Merge pull request #9387 from frederic34/camelCaps2
start changing phpcs:ignore
This commit is contained in:
commit
963d5eeddf
@ -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" />
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class autoTranslator
|
||||
// Translate
|
||||
//ini_set('default_charset','UTF-8');
|
||||
ini_set('default_charset',$this->_outputpagecode);
|
||||
$this->parse_refLangTranslationFiles();
|
||||
$this->parseRefLangTranslationFiles();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,8 +72,7 @@ class autoTranslator
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function parse_refLangTranslationFiles()
|
||||
private function parseRefLangTranslationFiles()
|
||||
{
|
||||
|
||||
$files = $this->getTranslationFilesArray($this->_refLang);
|
||||
|
||||
@ -535,15 +535,16 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Account deactivated
|
||||
*
|
||||
* @param int $id Id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function account_desactivate($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$result = $this->checkUsage();
|
||||
|
||||
if ($result > 0) {
|
||||
@ -569,15 +570,16 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Account activated
|
||||
*
|
||||
* @param int $id Id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function account_activate($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||
@ -608,6 +610,7 @@ class AccountingAccount extends CommonObject
|
||||
return $this->LibStatut($this->status,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -615,9 +618,9 @@ class AccountingAccount extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->loadLangs(array("users"));
|
||||
|
||||
@ -627,27 +630,27 @@ class AccountingAccount extends CommonObject
|
||||
if ($statut == 1) return $langs->trans('Enabled');
|
||||
if ($statut == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
if ($statut == 1) return $langs->trans('Enabled');
|
||||
if ($statut == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||
|
||||
@ -271,6 +271,7 @@ class AccountingJournal extends CommonObject
|
||||
return $this->LibType($this->nature,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return type of an accounting journal
|
||||
*
|
||||
@ -278,9 +279,9 @@ class AccountingJournal extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court
|
||||
* @return string Label of type
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibType($nature,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
@ -1548,15 +1548,16 @@ class BookKeeping extends CommonObject
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Export bookkeping
|
||||
*
|
||||
* @param string $model Model
|
||||
* @return int Result
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function export_bookkeping($model = 'ebp')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||
@ -1701,11 +1702,12 @@ class BookKeeping extends CommonObject
|
||||
*/
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of accounts with label by chart of accounts
|
||||
*
|
||||
* @param string $selectid Preselected chart of accounts
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param string $selectid Preselected chart of accounts
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param array $event Event options
|
||||
* @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1)
|
||||
@ -1713,9 +1715,9 @@ class BookKeeping extends CommonObject
|
||||
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
@ -1772,15 +1774,16 @@ class BookKeeping extends CommonObject
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Description of a root accounting account
|
||||
*
|
||||
* @param string $account Accounting account
|
||||
* @return string Root account
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_compte_racine($account = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
@ -1813,15 +1816,16 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Description of accounting account
|
||||
*
|
||||
* @param string $account Accounting account
|
||||
* @return string Account desc
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_compte_desc($account = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
@ -75,16 +75,17 @@ abstract class ActionsAdherentCardCommon
|
||||
//}
|
||||
}
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set content of ->tpl array, to use into template
|
||||
*
|
||||
* @param string $action Type of action
|
||||
* @param int $id Id
|
||||
* @return string HTML output
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function assign_values(&$action, $id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $user, $canvas;
|
||||
global $form, $formcompany, $objsoc;
|
||||
|
||||
@ -233,14 +234,15 @@ abstract class ActionsAdherentCardCommon
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Assign POST values into object
|
||||
*
|
||||
* @return string HTML output
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function assign_post()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $mysoc;
|
||||
|
||||
$this->object->old_name = $_POST["old_name"];
|
||||
|
||||
@ -67,6 +67,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Assign custom values for canvas
|
||||
*
|
||||
@ -74,9 +75,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
||||
* @param int $id Id
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function assign_values(&$action, $id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $limit, $offset, $sortfield, $sortorder;
|
||||
global $conf, $db, $langs, $user;
|
||||
global $form;
|
||||
@ -121,6 +122,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Fetch datas list and save into ->list_datas
|
||||
*
|
||||
@ -130,9 +132,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
||||
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
//$this->getFieldList();
|
||||
|
||||
@ -138,6 +138,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function sending an email has the adherent with the text supplied in parameter.
|
||||
*
|
||||
@ -153,9 +154,9 @@ class Adherent extends CommonObject
|
||||
* @param string $errors_to erros to
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
// Detect if message is HTML
|
||||
@ -644,6 +645,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update denormalized last subscription date.
|
||||
* This function is called when we delete a subscription for example.
|
||||
@ -651,9 +653,9 @@ class Adherent extends CommonObject
|
||||
* @param User $user User making change
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_end_date($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
// Search for last subscription id and end date
|
||||
@ -999,15 +1001,16 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Method to load member from its login
|
||||
*
|
||||
* @param string $login login of member
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_login($login)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
|
||||
@ -1029,6 +1032,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Method to load member from its name
|
||||
*
|
||||
@ -1036,9 +1040,9 @@ class Adherent extends CommonObject
|
||||
* @param string $lastname Lastname
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_name($firstname,$lastname)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
|
||||
@ -1201,6 +1205,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Fonction qui recupere pour un adherent les parametres
|
||||
* first_subscription_date
|
||||
@ -1210,9 +1215,9 @@ class Adherent extends CommonObject
|
||||
*
|
||||
* @return int <0 si KO, >0 si OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_subscriptions()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
@ -1756,14 +1761,15 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to add member into external tools mailing-list, spip, etc.
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_to_abo()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
||||
@ -1814,14 +1820,15 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to delete a member from external tools like mailing-list, spip, etc.
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function del_to_abo()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
||||
@ -1994,6 +2001,7 @@ class Adherent extends CommonObject
|
||||
return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -2003,9 +2011,9 @@ class Adherent extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load("members");
|
||||
if ($mode == 0)
|
||||
@ -2019,7 +2027,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
if ($statut == 0) return $langs->trans("MemberStatusResiliated");
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
|
||||
if ($statut >= 1)
|
||||
@ -2030,7 +2038,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
if ($statut == 0) return $langs->trans("MemberStatusResiliatedShort");
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort");
|
||||
if ($statut >= 1)
|
||||
@ -2041,7 +2049,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort");
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||
if ($statut >= 1)
|
||||
@ -2052,7 +2060,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
|
||||
if ($statut >= 1)
|
||||
@ -2063,7 +2071,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated");
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||
if ($statut >= 1)
|
||||
@ -2074,7 +2082,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
|
||||
}
|
||||
if ($mode == 6)
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||
if ($statut >= 1)
|
||||
@ -2088,14 +2096,15 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$this->nb=array();
|
||||
@ -2123,15 +2132,16 @@ class Adherent extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param User $user Objet user
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_board($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
@ -2266,6 +2276,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||
*
|
||||
@ -2275,9 +2286,9 @@ class Adherent extends CommonObject
|
||||
* 2=Return key only (uid=qqq)
|
||||
* @return string DN
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _load_ldap_dn($info,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$dn='';
|
||||
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS."=".$info[$conf->global->LDAP_KEY_MEMBERS].",".$conf->global->LDAP_MEMBER_DN;
|
||||
@ -2287,14 +2298,15 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Initialise tableau info (tableau des attributs LDAP)
|
||||
*
|
||||
* @return array Tableau info des attributs
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _load_ldap_info()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$info=array();
|
||||
|
||||
@ -300,14 +300,15 @@ class AdherentType extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of members' type
|
||||
*
|
||||
* @return array List of types of members
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_array()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$adherenttypes = array();
|
||||
@ -432,6 +433,7 @@ class AdherentType extends CommonObject
|
||||
return '';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||
*
|
||||
@ -441,9 +443,9 @@ class AdherentType extends CommonObject
|
||||
* 2=Return key only (uid=qqq)
|
||||
* @return string DN
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _load_ldap_dn($info,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$dn='';
|
||||
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS_TYPES."=".$info[$conf->global->LDAP_KEY_MEMBERS_TYPES].",".$conf->global->LDAP_MEMBER_TYPE_DN;
|
||||
@ -453,14 +455,15 @@ class AdherentType extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions
|
||||
*
|
||||
* @return array Tableau info des attributs
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _load_ldap_info()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$info=array();
|
||||
|
||||
@ -366,15 +366,16 @@ class Subscription extends CommonObject
|
||||
return '';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load("members");
|
||||
return '';
|
||||
|
||||
@ -163,15 +163,16 @@ class Dolistore
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return tree of Dolistore categories. $this->categories must have been loaded before.
|
||||
*
|
||||
* @param int $parent Id of parent category
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_categories($parent = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (!isset($this->categories)) die('not possible');
|
||||
if ($parent != 0) {
|
||||
$html = '<ul>';
|
||||
@ -211,14 +212,15 @@ class Dolistore
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of product formated for output
|
||||
*
|
||||
* @return string HTML output
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_products()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
$html = "";
|
||||
$parity = "pair";
|
||||
@ -293,38 +295,41 @@ class Dolistore
|
||||
return $html;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* get previous link
|
||||
*
|
||||
* @param string $text symbol previous
|
||||
* @return string html previous link
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_previous_link($text = '<<')
|
||||
{
|
||||
// phpcs:enable
|
||||
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* get next link
|
||||
*
|
||||
* @param string $text symbol next
|
||||
* @return string html next link
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_next_link($text = '>>')
|
||||
{
|
||||
// phpcs:enable
|
||||
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* get previous url
|
||||
*
|
||||
* @return string previous url
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_previous_url()
|
||||
function get_previous_url()
|
||||
{
|
||||
// phpcs:enable
|
||||
$param_array = array();
|
||||
if ($this->start < $this->per_page) {
|
||||
$sub = 0;
|
||||
@ -340,14 +345,15 @@ class Dolistore
|
||||
return $this->url."&".$param;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* get next url
|
||||
*
|
||||
* @return string next url
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_next_url()
|
||||
{
|
||||
// phpcs:enable
|
||||
$param_array = array();
|
||||
if (count($this->products) < $this->per_page) {
|
||||
$add = 0;
|
||||
@ -363,6 +369,7 @@ class Dolistore
|
||||
return $this->url."&".$param;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* version compare
|
||||
*
|
||||
@ -370,9 +377,9 @@ class Dolistore
|
||||
* @param string $v2 version 2
|
||||
* @return int result of compare
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function version_compare($v1, $v2)
|
||||
{
|
||||
// phpcs:enable
|
||||
$v1 = explode('.', $v1);
|
||||
$v2 = explode('.', $v2);
|
||||
$ret = 0;
|
||||
|
||||
@ -271,15 +271,16 @@ class DolibarrApi
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to forge a SQL criteria
|
||||
*
|
||||
* @param array $matches Array of found string by regex search
|
||||
* @return string Forged criteria. Example: "t.field like 'abc%'"
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function _forge_criteria_callback($matches)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db;
|
||||
|
||||
//dol_syslog("Convert matches ".$matches[1]);
|
||||
|
||||
@ -59,15 +59,16 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
*/
|
||||
public static $user = '';
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
|
||||
/**
|
||||
* Check access
|
||||
*
|
||||
* @return bool
|
||||
* @throws RestException
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
|
||||
public function __isAllowed()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $db;
|
||||
|
||||
$login = '';
|
||||
@ -165,15 +166,16 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
|
||||
/**
|
||||
* @return string string to be used with WWW-Authenticate header
|
||||
* @example Basic
|
||||
* @example Digest
|
||||
* @example OAuth
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
|
||||
public function __getWWWAuthenticateString()
|
||||
{
|
||||
// phpcs:enable
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
@ -356,6 +356,7 @@ class Asset extends CommonObject
|
||||
return $this->LibStatut($this->status,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return the status
|
||||
*
|
||||
@ -363,43 +364,37 @@ class Asset extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function LibStatut($status,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
$prefix='';
|
||||
if ($status == 1) return $langs->trans('Enabled');
|
||||
if ($status == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 1)
|
||||
if ($mode == 0 || $mode == 1)
|
||||
{
|
||||
if ($status == 1) return $langs->trans('Enabled');
|
||||
if ($status == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||
}
|
||||
if ($mode == 6)
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||
|
||||
@ -291,14 +291,15 @@ class AssetType extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of asset's type
|
||||
*
|
||||
* @return array List of types of members
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_array()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$assettypes = array();
|
||||
|
||||
@ -647,6 +647,7 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Link an object to the category
|
||||
*
|
||||
@ -654,9 +655,9 @@ class Categorie extends CommonObject
|
||||
* @param string $type Type of category ('product', ...)
|
||||
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_type($obj, $type)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$langs,$conf;
|
||||
|
||||
$error=0;
|
||||
@ -749,6 +750,7 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Delete object from category
|
||||
*
|
||||
@ -757,9 +759,9 @@ class Categorie extends CommonObject
|
||||
*
|
||||
* @return int 1 if OK, -1 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function del_type($obj,$type)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$langs,$conf;
|
||||
|
||||
$error=0;
|
||||
@ -973,14 +975,15 @@ class Categorie extends CommonObject
|
||||
return $categories;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return childs of a category
|
||||
*
|
||||
* @return array|int <0 KO, array ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_filles()
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql.= " WHERE fk_parent = ".$this->id;
|
||||
|
||||
@ -1003,14 +1006,15 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load this->motherof that is array(id_son=>id_parent, ...)
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function load_motherof()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$this->motherof=array();
|
||||
@ -1038,6 +1042,7 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Rebuilding the category tree as an array
|
||||
* Return an array of table('id','id_mere',...) trie selon arbre et avec:
|
||||
@ -1053,9 +1058,9 @@ class Categorie extends CommonObject
|
||||
*
|
||||
* @return array Array of categories. this->cats and this->motherof are set.
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_full_arbo($type, $markafterid=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
|
||||
@ -1130,6 +1135,7 @@ class Categorie extends CommonObject
|
||||
return $this->cats;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* For category id_categ and its childs available in this->cats, define property fullpath and fulllabel
|
||||
*
|
||||
@ -1137,9 +1143,9 @@ class Categorie extends CommonObject
|
||||
* @param int $protection Deep counter to avoid infinite loop
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function build_path_from_id_categ($id_categ,$protection=1000)
|
||||
{
|
||||
// phpcs:enable
|
||||
dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
|
||||
|
||||
if (! empty($this->cats[$id_categ]['fullpath']))
|
||||
@ -1173,14 +1179,15 @@ class Categorie extends CommonObject
|
||||
return;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Display content of $this->cats
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function debug_cats()
|
||||
{
|
||||
// phpcs:enable
|
||||
// Display $this->cats
|
||||
foreach($this->cats as $key => $val)
|
||||
{
|
||||
@ -1195,6 +1202,7 @@ class Categorie extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns all categories
|
||||
*
|
||||
@ -1202,9 +1210,9 @@ class Categorie extends CommonObject
|
||||
* @param boolean $parent Just parent categories if true
|
||||
* @return array Table of Object Category
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_all_categories($type=null, $parent=false)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
|
||||
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
||||
@ -1233,14 +1241,15 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Check if no category with same label already exists for this cat's parent or root and for this cat's type
|
||||
*
|
||||
* @return integer 1 if already exist, 0 otherwise, -1 if error
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function already_exists()
|
||||
{
|
||||
// phpcs:enable
|
||||
$type=$this->type;
|
||||
|
||||
if (! is_numeric($type)) $type=$this->MAP_ID[$type];
|
||||
@ -1283,18 +1292,20 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns the top level categories (which are not girls)
|
||||
*
|
||||
* @param int $type Type of category (0, 1, ...)
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_main_categories($type=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->get_all_categories($type, true);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns the path of the category, with the names of the categories
|
||||
* separated by $sep (" >> " by default)
|
||||
@ -1304,9 +1315,9 @@ class Categorie extends CommonObject
|
||||
* @param int $nocolor 0
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function print_all_ways($sep = " >> ", $url='', $nocolor=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$ways = array();
|
||||
|
||||
$allways = $this->get_all_ways(); // Load array of categories
|
||||
@ -1353,14 +1364,15 @@ class Categorie extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns an array containing the list of parent categories
|
||||
*
|
||||
* @return int|array <0 KO, array OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_meres()
|
||||
{
|
||||
// phpcs:enable
|
||||
$parents = array();
|
||||
|
||||
$sql = "SELECT fk_parent FROM ".MAIN_DB_PREFIX."categorie";
|
||||
@ -1388,15 +1400,16 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns in a table all possible paths to get to the category
|
||||
* starting with the major categories represented by Tables of categories
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_all_ways()
|
||||
{
|
||||
// phpcs:enable
|
||||
$ways = array();
|
||||
|
||||
$parents=$this->get_meres();
|
||||
@ -1603,6 +1616,7 @@ class Categorie extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Deplace fichier uploade sous le nom $files dans le repertoire sdir
|
||||
*
|
||||
@ -1610,9 +1624,9 @@ class Categorie extends CommonObject
|
||||
* @param string $file Nom du fichier uploade
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_photo($sdir, $file)
|
||||
{
|
||||
// phpcs:enable
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$dir = $sdir .'/'. get_exdir($this->id,2,0,0,$this,'category') . $this->id ."/";
|
||||
@ -1653,6 +1667,7 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return tableau de toutes les photos de la categorie
|
||||
*
|
||||
@ -1660,9 +1675,9 @@ class Categorie extends CommonObject
|
||||
* @param int $nbmax Nombre maximum de photos (0=pas de max)
|
||||
* @return array Tableau de photos
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_photos($dir,$nbmax=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
||||
|
||||
$nbphoto=0;
|
||||
@ -1709,15 +1724,16 @@ class Categorie extends CommonObject
|
||||
return $tabobj;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Efface la photo de la categorie et sa vignette
|
||||
*
|
||||
* @param string $file Path to file
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_photo($file)
|
||||
{
|
||||
// phpcs:enable
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
|
||||
@ -1738,15 +1754,16 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load size of image file
|
||||
*
|
||||
* @param string $file Path to file
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_image_size($file)
|
||||
{
|
||||
// phpcs:enable
|
||||
$infoImg = getimagesize($file); // Recuperation des infos de l'image
|
||||
$this->imgWidth = $infoImg[0]; // Largeur de l'image
|
||||
$this->imgHeight = $infoImg[1]; // Hauteur de l'image
|
||||
|
||||
@ -35,9 +35,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
class ActionComm extends CommonObject
|
||||
{
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
public $element='action';
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
public $element='action';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
@ -47,9 +47,9 @@ class ActionComm extends CommonObject
|
||||
public $table_rowid = 'id';
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto='action';
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto = 'action';
|
||||
|
||||
/**
|
||||
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
@ -698,14 +698,15 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Initialize this->userassigned array with list of id of user assigned to event
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_userassigned()
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
|
||||
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
|
||||
@ -1021,6 +1022,7 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
@ -1028,10 +1030,10 @@ class ActionComm extends CommonObject
|
||||
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_board($user, $load_state_board=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
if(empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp";
|
||||
else {
|
||||
@ -1146,6 +1148,7 @@ class ActionComm extends CommonObject
|
||||
return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of action status
|
||||
*
|
||||
@ -1155,9 +1158,9 @@ class ActionComm extends CommonObject
|
||||
* @param int $datestart Date start of event
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($percent,$mode,$hidenastatus=0,$datestart='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
@ -1355,6 +1358,7 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Export events from database into a cal file.
|
||||
*
|
||||
@ -1365,9 +1369,9 @@ class ActionComm extends CommonObject
|
||||
* @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...)
|
||||
* @return int <0 if error, nb of events in new file if ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function build_exportfile($format,$type,$cachedelay,$filename,$filters)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$dolibarr_main_url_root,$mysoc;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php";
|
||||
|
||||
@ -173,6 +173,7 @@ class ActionCommReminder extends CommonObject
|
||||
return $this->LibStatut($this->status,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return the status
|
||||
*
|
||||
@ -180,9 +181,9 @@ class ActionCommReminder extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function LibStatut($status,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0 || $mode == 1)
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage different types of events
|
||||
* Class to manage different types of events
|
||||
*/
|
||||
class CActionComm
|
||||
{
|
||||
@ -56,9 +56,9 @@ class CActionComm
|
||||
public $color;
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto;
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto;
|
||||
|
||||
public $type_actions=array();
|
||||
|
||||
@ -118,6 +118,7 @@ class CActionComm
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of event types: array(id=>label) or array(code=>label)
|
||||
*
|
||||
@ -129,9 +130,9 @@ class CActionComm
|
||||
* @param int $shortlabel 1=Get short label instead of long label
|
||||
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='', $shortlabel=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
$langs->load("commercial");
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/xcal.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to read/parse ICal calendars
|
||||
* Class to read/parse ICal calendars
|
||||
*/
|
||||
class ICal
|
||||
{
|
||||
@ -39,22 +39,23 @@ class ICal
|
||||
var $last_key; //Help variable save last key (multiline string)
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Read text file, icalender text file
|
||||
*
|
||||
* @param string $file File
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function read_file($file)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->file = $file;
|
||||
$file_text='';
|
||||
|
||||
@ -67,25 +68,27 @@ class ICal
|
||||
return $file_text; // return all text
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns the number of calendar events
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_event_count()
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->event_count;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns the number of to do
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_todo_count()
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->todo_count;
|
||||
}
|
||||
|
||||
@ -197,6 +200,7 @@ class ICal
|
||||
return $this->cal;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add to $this->ical array one value and key.
|
||||
*
|
||||
@ -205,9 +209,9 @@ class ICal
|
||||
* @param string $value Value
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_to_array($type, $key, $value)
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
//print 'type='.$type.' key='.$key.' value='.$value.'<br>'."\n";
|
||||
|
||||
@ -258,16 +262,17 @@ class ICal
|
||||
$this->last_key = $key;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value");
|
||||
*
|
||||
* @param string $text Text
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function retun_key_value($text)
|
||||
{
|
||||
/*
|
||||
// phpcs:enable
|
||||
/*
|
||||
preg_match("/([^:]+)[:]([\w\W]+)/", $text, $matches);
|
||||
|
||||
if (empty($matches))
|
||||
@ -279,19 +284,20 @@ class ICal
|
||||
$matches = array_splice($matches, 1, 2);
|
||||
return $matches;
|
||||
}*/
|
||||
return explode(':',$text,2);
|
||||
return explode(':',$text,2);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Parse RRULE return array
|
||||
*
|
||||
* @param string $value string
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function ical_rrule($value)
|
||||
{
|
||||
$result=array();
|
||||
// phpcs:enable
|
||||
$result = array();
|
||||
$rrule = explode(';',$value);
|
||||
foreach ($rrule as $line)
|
||||
{
|
||||
@ -300,15 +306,17 @@ class ICal
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS)
|
||||
*
|
||||
* @param string $ical_date String date
|
||||
* @return int
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function ical_date_to_unix($ical_date)
|
||||
{
|
||||
// phpcs:enable
|
||||
$ical_date = str_replace('T', '', $ical_date);
|
||||
$ical_date = str_replace('Z', '', $ical_date);
|
||||
|
||||
@ -322,6 +330,7 @@ class ICal
|
||||
return $ntime; // ntime is a GTM time
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return unix date from iCal date format
|
||||
*
|
||||
@ -329,10 +338,10 @@ class ICal
|
||||
* @param string $value Value
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function ical_dt_date($key, $value)
|
||||
{
|
||||
$return_value=array();
|
||||
// phpcs:enable
|
||||
$return_value = array();
|
||||
$value = $this->ical_date_to_unix($value);
|
||||
|
||||
// Analyse TZID
|
||||
@ -352,14 +361,15 @@ class ICal
|
||||
return array($key,$return_value);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return sorted eventlist as array or false if calenar is empty
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_sort_event_list()
|
||||
{
|
||||
// phpcs:enable
|
||||
$temp = $this->get_event_list();
|
||||
if (!empty($temp))
|
||||
{
|
||||
@ -372,6 +382,7 @@ class ICal
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Compare two unix timestamp
|
||||
*
|
||||
@ -379,64 +390,69 @@ class ICal
|
||||
* @param array $b Operand b
|
||||
* @return integer
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function ical_dtstart_compare($a, $b)
|
||||
{
|
||||
// phpcs:enable
|
||||
return strnatcasecmp($a['DTSTART']['unixtime'], $b['DTSTART']['unixtime']);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return eventlist array (not sort eventlist array)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_event_list()
|
||||
{
|
||||
// phpcs:enable
|
||||
return (! empty($this->cal['VEVENT'])?$this->cal['VEVENT']:'');
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return eventlist array (not sort eventlist array)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_freebusy_list()
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->cal['VFREEBUSY'];
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return to do array (not sort to do array)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_todo_list()
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->cal['VTODO'];
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return base calendar data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_calender_data()
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->cal['VCALENDAR'];
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return array with all data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_all_data()
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->cal;
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,15 +254,16 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_by_mailing($id=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
@ -320,6 +321,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
@ -327,9 +329,9 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
* @param string $type_element Type target
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_by_element($id=0, $type_element='mailing')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
@ -546,15 +548,16 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load object in memory from database
|
||||
*
|
||||
* @param array $arrayquery All element to Query
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function query_thirdparty($arrayquery)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
$sql = "SELECT";
|
||||
@ -700,6 +703,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load object in memory from database
|
||||
*
|
||||
@ -707,9 +711,9 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
* @param int $withThirdpartyFilter add contact with tridparty filter
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function query_contact($arrayquery, $withThirdpartyFilter = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
$sql = "SELECT";
|
||||
|
||||
@ -76,10 +76,10 @@ class Mailing extends CommonObject
|
||||
public $statuts=array();
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDb $db Database handler
|
||||
* @param DoliDb $db Database handler
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
@ -442,14 +442,15 @@ class Mailing extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Delete targets emailing
|
||||
*
|
||||
* @return int 1 if OK, 0 if error
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_targets()
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql.= " WHERE fk_mailing = ".$this->id;
|
||||
|
||||
@ -467,15 +468,16 @@ class Mailing extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Change status of each recipient
|
||||
*
|
||||
* @param User $user Objet user qui valide
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function reset_targets_status($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql.= " SET statut = 0";
|
||||
$sql.= " WHERE fk_mailing = ".$this->id;
|
||||
@ -539,6 +541,7 @@ class Mailing extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -546,42 +549,38 @@ class Mailing extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load('mails');
|
||||
|
||||
if ($mode == 0)
|
||||
if ($mode == 0 || $mode == 1)
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
||||
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3');
|
||||
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
||||
if ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||
@ -609,39 +608,39 @@ class Mailing extends CommonObject
|
||||
{
|
||||
return $langs->trans('MailingStatusError');
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
return $langs->trans('MailingStatusSent');
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
|
||||
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
|
||||
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
|
||||
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
|
||||
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
|
||||
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
|
||||
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
|
||||
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
|
||||
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
|
||||
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
|
||||
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
|
||||
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
|
||||
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
|
||||
}
|
||||
if ($mode == 6)
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
|
||||
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
|
||||
|
||||
@ -243,9 +243,10 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add line into array products
|
||||
* $this->thirdparty should be loaded
|
||||
* Add line into array products
|
||||
* $this->thirdparty should be loaded
|
||||
*
|
||||
* @param int $idproduct Product Id to add
|
||||
* @param int $qty Quantity
|
||||
@ -255,9 +256,9 @@ class Propal extends CommonObject
|
||||
* TODO Replace calls to this function by generation objet Ligne
|
||||
* inserted into table $this->products
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_product($idproduct, $qty, $remise_percent=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $mysoc;
|
||||
|
||||
if (! $qty) $qty = 1;
|
||||
@ -304,15 +305,16 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adding line of fixed discount in the proposal in DB
|
||||
*
|
||||
* @param int $idremise Id of fixed discount
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_discount($idremise)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
@ -1183,6 +1185,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Insert into DB a proposal object completely defined by its data members (ex, results from copy).
|
||||
*
|
||||
@ -1190,9 +1193,9 @@ class Propal extends CommonObject
|
||||
* @return int Id of the new object if ok, <0 if ko
|
||||
* @see create
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function create_from($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
// i love this function because $this->products is not used in create function...
|
||||
$this->products=$this->lines;
|
||||
|
||||
@ -1575,15 +1578,16 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load array lines
|
||||
*
|
||||
* @param int $only_product Return only physical products
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_lines($only_product=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->lines=array();
|
||||
|
||||
$sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,';
|
||||
@ -1814,6 +1818,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define proposal date
|
||||
*
|
||||
@ -1822,9 +1827,9 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_date($user, $date, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($date))
|
||||
{
|
||||
$this->error='ErrorBadParameter';
|
||||
@ -1882,6 +1887,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define end validity date
|
||||
*
|
||||
@ -1890,9 +1896,9 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_echeance($user, $date_fin_validite, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! empty($user->rights->propal->creer))
|
||||
{
|
||||
$error=0;
|
||||
@ -1943,6 +1949,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set delivery date
|
||||
*
|
||||
@ -1951,9 +1958,9 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_date_livraison($user, $date_livraison, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! empty($user->rights->propal->creer))
|
||||
{
|
||||
$error=0;
|
||||
@ -2004,6 +2011,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set delivery
|
||||
*
|
||||
@ -2012,9 +2020,9 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_availability($user, $id, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT)
|
||||
{
|
||||
$error=0;
|
||||
@ -2074,6 +2082,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set source of demand
|
||||
*
|
||||
@ -2082,9 +2091,9 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_demand_reason($user, $id, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT)
|
||||
{
|
||||
$error=0;
|
||||
@ -2146,6 +2155,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set customer reference number
|
||||
*
|
||||
@ -2154,9 +2164,9 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_ref_client($user, $ref_client, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! empty($user->rights->propal->creer))
|
||||
{
|
||||
$error=0;
|
||||
@ -2210,6 +2220,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set an overall discount on the proposal
|
||||
*
|
||||
@ -2218,9 +2229,9 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_remise_percent($user, $remise, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$remise=trim($remise)?trim($remise):0;
|
||||
|
||||
if (! empty($user->rights->propal->creer))
|
||||
@ -2276,6 +2287,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set an absolute overall discount on the proposal
|
||||
*
|
||||
@ -2284,9 +2296,9 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_remise_absolue($user, $remise, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$remise=trim($remise)?trim($remise):0;
|
||||
|
||||
if (! empty($user->rights->propal->creer))
|
||||
@ -2561,6 +2573,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set draft status
|
||||
*
|
||||
@ -2568,9 +2581,9 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_draft($user, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
@ -2619,6 +2632,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of proposal (eventually filtered on user) into an array
|
||||
*
|
||||
@ -2632,9 +2646,9 @@ class Propal extends CommonObject
|
||||
* @param string $sortorder Sort order
|
||||
* @return int -1 if KO, array with result if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_array($shortlist=0, $draft=0, $notcurrentuser=0, $socid=0, $limit=0, $offset=0, $sortfield='p.datep', $sortorder='DESC')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$ga = array();
|
||||
@ -2706,15 +2720,16 @@ class Propal extends CommonObject
|
||||
return $this->InvoiceArrayList($this->id);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns an array with id and ref of related invoices
|
||||
*
|
||||
* @param int $id Id propal
|
||||
* @return array Array of invoices id
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function InvoiceArrayList($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$ga = array();
|
||||
$linkedInvoices = array();
|
||||
|
||||
@ -2985,6 +3000,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Change source demand
|
||||
*
|
||||
@ -2993,9 +3009,9 @@ class Propal extends CommonObject
|
||||
* @return int >0 si ok, <0 si ko
|
||||
* @deprecated use set_demand_reason
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function demand_reason($demand_reason_id, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
if ($this->statut >= self::STATUS_DRAFT)
|
||||
@ -3126,6 +3142,7 @@ class Propal extends CommonObject
|
||||
return $this->LibStatut($this->statut, $mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of a status (draft, validated, ...)
|
||||
*
|
||||
@ -3133,9 +3150,9 @@ class Propal extends CommonObject
|
||||
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
// Init/load array of translation of status
|
||||
@ -3169,9 +3186,10 @@ class Propal extends CommonObject
|
||||
if ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut];
|
||||
if ($mode == 5) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
|
||||
if ($mode == 6) return '<span class="hideonsmartphone">'.$this->labelstatut[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
@ -3179,9 +3197,9 @@ class Propal extends CommonObject
|
||||
* @param int $mode "opened" for proposal to close, "signed" for proposal to invoice
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_board($user,$mode)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
$clause = " WHERE";
|
||||
@ -3347,14 +3365,15 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
*
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$this->nb=array();
|
||||
@ -4234,15 +4253,16 @@ class PropaleLigne extends CommonObjectLine
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update DB line fields total_xxx
|
||||
* Used by migration
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_total()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
// Mise a jour ligne en base
|
||||
|
||||
@ -450,6 +450,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set draft status
|
||||
*
|
||||
@ -457,9 +458,9 @@ class Commande extends CommonOrder
|
||||
* @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_draft($user, $idwarehouse=-1)
|
||||
{
|
||||
//phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$error=0;
|
||||
@ -532,6 +533,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Tag the order as validated (opened)
|
||||
* Function used when order is reopend after being closed.
|
||||
@ -539,9 +541,9 @@ class Commande extends CommonOrder
|
||||
* @param User $user Object user that change status
|
||||
* @return int <0 if KO, 0 if nothing is done, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_reopen($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
$error=0;
|
||||
|
||||
if ($this->statut != self::STATUS_CANCELED && $this->statut != self::STATUS_CLOSED)
|
||||
@ -1497,6 +1499,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add line into array
|
||||
* $this->client must be loaded
|
||||
@ -1511,9 +1514,9 @@ class Commande extends CommonOrder
|
||||
* TODO Remplacer les appels a cette fonction par generation objet Ligne
|
||||
* insere dans tableau $this->products
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $mysoc;
|
||||
|
||||
if (! $qty) $qty = 1;
|
||||
@ -1736,15 +1739,16 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adding line of fixed discount in the order in DB
|
||||
*
|
||||
* @param int $idremise Id de la remise fixe
|
||||
* @return int >0 si ok, <0 si ko
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_discount($idremise)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
@ -1814,15 +1818,16 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load array lines
|
||||
*
|
||||
* @param int $only_product Return only physical products
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_lines($only_product=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->lines=array();
|
||||
|
||||
$sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.product_type, l.fk_commande, l.label as custom_label, l.description, l.price, l.qty, l.vat_src_code, l.tva_tx,';
|
||||
@ -2040,6 +2045,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns a array with expeditions lines number
|
||||
*
|
||||
@ -2047,9 +2053,9 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* TODO deprecate, move to Shipping class
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function nb_expedition()
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'SELECT count(*)';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'element_element as el';
|
||||
@ -2066,6 +2072,7 @@ class Commande extends CommonOrder
|
||||
else dol_print_error($this->db);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a array with the pending stock by product
|
||||
*
|
||||
@ -2074,9 +2081,9 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* TODO FONCTION NON FINIE A FINIR
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function stock_array($filtre_statut=self::STATUS_CANCELED)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->stocks = array();
|
||||
|
||||
// Tableau des id de produit de la commande
|
||||
@ -2183,6 +2190,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Applique une remise relative
|
||||
*
|
||||
@ -2191,9 +2199,9 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_remise($user, $remise, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$remise=trim($remise)?trim($remise):0;
|
||||
|
||||
if ($user->rights->commande->creer)
|
||||
@ -2250,6 +2258,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Applique une remise absolue
|
||||
*
|
||||
@ -2258,9 +2267,9 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_remise_absolue($user, $remise, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$remise=trim($remise)?trim($remise):0;
|
||||
|
||||
if ($user->rights->commande->creer)
|
||||
@ -2317,6 +2326,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set the order date
|
||||
*
|
||||
@ -2325,9 +2335,9 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_date($user, $date, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
$error=0;
|
||||
@ -2382,6 +2392,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set the planned delivery date
|
||||
*
|
||||
@ -2390,9 +2401,9 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_date_livraison($user, $date_livraison, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
$error=0;
|
||||
@ -2447,6 +2458,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of orders (eventuelly filtered on a user) into an array
|
||||
*
|
||||
@ -2460,9 +2472,9 @@ class Commande extends CommonOrder
|
||||
* @param string $sortorder Sort order
|
||||
* @return int -1 if KO, array with result if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='c.date_commande', $sortorder='DESC')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$ga = array();
|
||||
@ -2591,6 +2603,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update order demand_reason
|
||||
*
|
||||
@ -2598,9 +2611,9 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int >0 if ok, <0 if ko
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function demand_reason($demand_reason_id, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
dol_syslog('Commande::demand_reason('.$demand_reason_id.')');
|
||||
@ -2662,6 +2675,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set customer ref
|
||||
*
|
||||
@ -2670,9 +2684,9 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_ref_client($user, $ref_client, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
$error=0;
|
||||
@ -3275,15 +3289,16 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_board($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
$clause = " WHERE";
|
||||
@ -3361,6 +3376,7 @@ class Commande extends CommonOrder
|
||||
return $this->LibStatut($this->statut, $this->billed, $mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of status
|
||||
*
|
||||
@ -3370,9 +3386,9 @@ class Commande extends CommonOrder
|
||||
* @param int $donotshowbilled Do not show billed status after order status
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$billed,$mode,$donotshowbilled=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
$billedtext = '';
|
||||
@ -3681,14 +3697,15 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
*
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$this->nb=array();
|
||||
@ -4317,15 +4334,16 @@ class OrderLine extends CommonOrderLine
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update DB line fields total_xxx
|
||||
* Used by migration
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_total()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
// Clean parameters
|
||||
|
||||
@ -297,6 +297,7 @@ class Account extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add a link between bank line record and its source
|
||||
*
|
||||
@ -307,9 +308,9 @@ class Account extends CommonObject
|
||||
* @param string $type Type of link ('payment', 'company', 'member', ...)
|
||||
* @return int <0 if KO, id line if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_url_line($line_id, $url_id, $url, $label, $type)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (";
|
||||
$sql.= "fk_bank";
|
||||
$sql.= ", url_id";
|
||||
@ -337,6 +338,7 @@ class Account extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* TODO Move this into AccountLine
|
||||
* Return array with links from llx_bank_url
|
||||
@ -346,9 +348,9 @@ class Account extends CommonObject
|
||||
* @param string $type To search using type
|
||||
* @return array|int Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_url($fk_bank='', $url_id='', $type='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$lines = array();
|
||||
|
||||
// Check parameters
|
||||
@ -787,15 +789,16 @@ class Account extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update BBAN (RIB) account fields
|
||||
*
|
||||
* @param User $user Object user making update
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_bban(User $user = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
// Clean parameters
|
||||
@ -1074,6 +1077,7 @@ class Account extends CommonObject
|
||||
return $this->LibStatut($this->clos,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of given object status
|
||||
*
|
||||
@ -1081,9 +1085,9 @@ class Account extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load('banks');
|
||||
|
||||
@ -1112,14 +1116,15 @@ class Account extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi si un compte peut etre supprimer ou non (sans mouvements)
|
||||
*
|
||||
* @return boolean vrai si peut etre supprime, faux sinon
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function can_be_deleted()
|
||||
{
|
||||
// phpcs:enable
|
||||
$can_be_deleted=false;
|
||||
|
||||
$sql = "SELECT COUNT(rowid) as nb";
|
||||
@ -1180,6 +1185,7 @@ class Account extends CommonObject
|
||||
return $solde;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
@ -1187,9 +1193,9 @@ class Account extends CommonObject
|
||||
* @param int $filteraccountid To get info for a particular account id
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_board(User $user, $filteraccountid = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
@ -1236,14 +1242,15 @@ class Account extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
* @param int $filteraccountid To get info for a particular account id
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_state_board($filteraccountid = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
@ -1652,7 +1659,7 @@ class AccountLine extends CommonObject
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
/**
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
@ -1677,10 +1684,10 @@ class AccountLine extends CommonObject
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @var string Ref
|
||||
*/
|
||||
public $ref;
|
||||
/**
|
||||
* @var string Ref
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
public $datec;
|
||||
public $dateo;
|
||||
@ -1691,12 +1698,12 @@ class AccountLine extends CommonObject
|
||||
public $datev;
|
||||
public $amount;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @var string bank transaction lines label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $note;
|
||||
public $note;
|
||||
public $fk_user_author;
|
||||
public $fk_user_rappro;
|
||||
public $fk_type;
|
||||
@ -1709,7 +1716,7 @@ class AccountLine extends CommonObject
|
||||
public $fk_account; // Id of bank account
|
||||
public $bank_account_label; // Label of bank account
|
||||
|
||||
public $emetteur;
|
||||
public $emetteur;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -1894,15 +1901,16 @@ class AccountLine extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Delete bank line records
|
||||
*
|
||||
* @param User $user User object that delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_urls(User $user = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
$nbko=0;
|
||||
|
||||
if ($this->rappro)
|
||||
@ -1965,6 +1973,7 @@ class AccountLine extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update conciliation field
|
||||
*
|
||||
@ -1972,9 +1981,9 @@ class AccountLine extends CommonObject
|
||||
* @param int $cat Category id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_conciliation(User $user, $cat)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$this->db->begin();
|
||||
@ -2028,6 +2037,7 @@ class AccountLine extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Increase/decrease value date of a rowid
|
||||
*
|
||||
@ -2035,9 +2045,9 @@ class AccountLine extends CommonObject
|
||||
* @param int $sign 1 or -1
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function datev_change($rowid,$sign=1)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "SELECT datev FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -2067,31 +2077,34 @@ class AccountLine extends CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Increase value date of a rowid
|
||||
*
|
||||
* @param int $id Id of line to change
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function datev_next($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->datev_change($id,1);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Decrease value date of a rowid
|
||||
*
|
||||
* @param int $id Id of line to change
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function datev_previous($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->datev_change($id,-1);
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Increase/decrease operation date of a rowid
|
||||
*
|
||||
@ -2099,9 +2112,9 @@ class AccountLine extends CommonObject
|
||||
* @param int $sign 1 or -1
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function dateo_change($rowid,$sign=1)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -2131,27 +2144,29 @@ class AccountLine extends CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Increase operation date of a rowid
|
||||
*
|
||||
* @param int $id Id of line to change
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function dateo_next($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->dateo_change($id,1);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Decrease operation date of a rowid
|
||||
*
|
||||
* @param int $id Id of line to change
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function dateo_previous($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->dateo_change($id,-1);
|
||||
}
|
||||
|
||||
@ -2258,6 +2273,7 @@ class AccountLine extends CommonObject
|
||||
return $this->LibStatut($this->status,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -2265,9 +2281,9 @@ class AccountLine extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
//$langs->load('companies');
|
||||
/*
|
||||
|
||||
@ -91,7 +91,7 @@ class PaymentVarious extends CommonObject
|
||||
* Update database
|
||||
*
|
||||
* @param User $user User that modify
|
||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=null, $notrigger=0)
|
||||
@ -458,15 +458,16 @@ class PaymentVarious extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update link between payment various and line generate into llx_bank
|
||||
*
|
||||
* @param int $id_bank Id bank account
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_various SET fk_bank = '.$id_bank;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
$result = $this->db->query($sql);
|
||||
@ -493,6 +494,7 @@ class PaymentVarious extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -500,38 +502,38 @@ class PaymentVarious extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Libelle
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
return $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
|
||||
@ -313,6 +313,7 @@ class Deplacement extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -320,38 +321,38 @@ class Deplacement extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Libelle
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
return $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
|
||||
@ -451,14 +451,15 @@ class FactureRec extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Recupere les lignes de factures predefinies dans this->lines
|
||||
*
|
||||
* @return int 1 if OK, < 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_lines()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->lines=array();
|
||||
|
||||
// Retreive all extrafield for line
|
||||
@ -1193,6 +1194,7 @@ class FactureRec extends CommonInvoice
|
||||
return $this->LibStatut($this->frequency?1:0, $this->suspended, $mode, $alreadypaid, empty($this->type)?0:$this->type);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of a status
|
||||
*
|
||||
@ -1203,9 +1205,9 @@ class FactureRec extends CommonInvoice
|
||||
* @param int $type Type invoice
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($recur, $status, $mode=0, $alreadypaid=-1, $type=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load('bills');
|
||||
|
||||
@ -1224,7 +1226,7 @@ class FactureRec extends CommonInvoice
|
||||
else return $langs->trans("Draft");
|
||||
}
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
$prefix='Short';
|
||||
if ($recur)
|
||||
@ -1238,7 +1240,7 @@ class FactureRec extends CommonInvoice
|
||||
else return $langs->trans("Draft");
|
||||
}
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($recur)
|
||||
{
|
||||
@ -1251,7 +1253,7 @@ class FactureRec extends CommonInvoice
|
||||
else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
|
||||
}
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($recur)
|
||||
{
|
||||
@ -1265,7 +1267,7 @@ class FactureRec extends CommonInvoice
|
||||
else return img_picto($langs->trans('Draft'),'statut0');
|
||||
}
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
$prefix='';
|
||||
if ($recur)
|
||||
@ -1279,7 +1281,7 @@ class FactureRec extends CommonInvoice
|
||||
else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
|
||||
}
|
||||
}
|
||||
if ($mode == 5 || $mode == 6)
|
||||
elseif ($mode == 5 || $mode == 6)
|
||||
{
|
||||
$prefix='';
|
||||
if ($mode == 5) $prefix='Short';
|
||||
|
||||
@ -1424,14 +1424,15 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load all detailed lines into this->lines
|
||||
*
|
||||
* @return int 1 if OK, < 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_lines()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->lines=array();
|
||||
|
||||
$sql = 'SELECT l.rowid, l.fk_facture, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,';
|
||||
@ -1684,15 +1685,16 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount)
|
||||
*
|
||||
* @param int $idremise Id of absolute discount
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_discount($idremise)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
@ -1785,6 +1787,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set customer ref
|
||||
*
|
||||
@ -1792,9 +1795,9 @@ class Facture extends CommonInvoice
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_ref_client($ref_client, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$error=0;
|
||||
@ -2019,6 +2022,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1
|
||||
* ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0
|
||||
@ -2028,9 +2032,9 @@ class Facture extends CommonInvoice
|
||||
* @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_paid($user, $close_code='', $close_note='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$error=0;
|
||||
|
||||
if ($this->paye != 1)
|
||||
@ -2078,6 +2082,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Tag la facture comme non payee completement + appel trigger BILL_UNPAYED
|
||||
* Fonction utilisee quand un paiement prelevement est refuse,
|
||||
@ -2086,9 +2091,9 @@ class Facture extends CommonInvoice
|
||||
* @param User $user Object user that change status
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_unpaid($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
@ -2126,6 +2131,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL
|
||||
* Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because
|
||||
@ -2136,9 +2142,9 @@ class Facture extends CommonInvoice
|
||||
* @param string $close_note Comment
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_canceled($user, $close_code='', $close_note='')
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG);
|
||||
|
||||
@ -2490,6 +2496,7 @@ class Facture extends CommonInvoice
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set draft status
|
||||
*
|
||||
@ -2497,9 +2504,9 @@ class Facture extends CommonInvoice
|
||||
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_draft($user,$idwarehouse=-1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$error=0;
|
||||
@ -3056,6 +3063,7 @@ class Facture extends CommonInvoice
|
||||
else return $situation_percent < $obj->situation_percent;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update invoice line with percentage
|
||||
*
|
||||
@ -3063,9 +3071,9 @@ class Facture extends CommonInvoice
|
||||
* @param int $percent Percentage
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_percent($line, $percent)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $mysoc,$user;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php';
|
||||
@ -3153,6 +3161,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set percent discount
|
||||
*
|
||||
@ -3161,9 +3170,9 @@ class Facture extends CommonInvoice
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_remise($user, $remise, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Clean parameters
|
||||
if (empty($remise)) $remise=0;
|
||||
|
||||
@ -3218,6 +3227,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set absolute discount
|
||||
*
|
||||
@ -3226,9 +3236,9 @@ class Facture extends CommonInvoice
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_remise_absolue($user, $remise, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($remise)) $remise=0;
|
||||
|
||||
if ($user->rights->facture->creer)
|
||||
@ -3419,6 +3429,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of invoices (eventually filtered on a user) into an array
|
||||
*
|
||||
@ -3432,9 +3443,9 @@ class Facture extends CommonInvoice
|
||||
* @param string $sortorder Sort order
|
||||
* @return int -1 if KO, array with result if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user;
|
||||
|
||||
$ga = array();
|
||||
@ -3494,6 +3505,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of invoices qualified to be replaced by another invoice.
|
||||
* Invoices matching the following rules are returned:
|
||||
@ -3502,9 +3514,9 @@ class Facture extends CommonInvoice
|
||||
* @param int $socid Id thirdparty
|
||||
* @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function list_replacable_invoices($socid=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$return = array();
|
||||
@ -3543,6 +3555,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of invoices qualified to be corrected by a credit note.
|
||||
* Invoices matching the following rules are returned:
|
||||
@ -3551,9 +3564,9 @@ class Facture extends CommonInvoice
|
||||
* @param int $socid Id thirdparty
|
||||
* @return array Array of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function list_qualified_avoir_invoices($socid=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$return = array();
|
||||
@ -3617,6 +3630,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a withdrawal request for a standing order.
|
||||
* Use the remain to pay excluding all existing open direct debit requests.
|
||||
@ -3625,9 +3639,9 @@ class Facture extends CommonInvoice
|
||||
* @param float $amount Amount we request direct debit for
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function demande_prelevement($fuser, $amount=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -3728,6 +3742,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Supprime une demande de prelevement
|
||||
*
|
||||
@ -3735,9 +3750,9 @@ class Facture extends CommonInvoice
|
||||
* @param int $did id de la demande a supprimer
|
||||
* @return int <0 if OK, >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function demande_prelevement_delete($fuser, $did)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande';
|
||||
$sql .= ' WHERE rowid = '.$did;
|
||||
$sql .= ' AND traite = 0';
|
||||
@ -3754,15 +3769,16 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_board($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
$clause = " WHERE";
|
||||
@ -4000,14 +4016,15 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
||||
$this->nb=array();
|
||||
@ -4114,25 +4131,27 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Checks if the invoice is the first of a cycle
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function is_first()
|
||||
{
|
||||
// phpcs:enable
|
||||
return ($this->situation_counter == 1);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns an array containing the previous situations as Facture objects
|
||||
*
|
||||
* @return mixed -1 if error, array of previous situations
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_prev_sits()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture';
|
||||
@ -4205,15 +4224,16 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Checks if the invoice is the last in its cycle
|
||||
*
|
||||
* @return bool Last of the cycle status
|
||||
*
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function is_last_in_cycle()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
if (!empty($this->situation_cycle_ref)) {
|
||||
@ -4843,15 +4863,16 @@ class FactureLigne extends CommonInvoiceLine
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update DB line fields total_xxx
|
||||
* Used by migration
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_total()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
dol_syslog(get_class($this)."::update_total", LOG_DEBUG);
|
||||
|
||||
@ -4884,6 +4905,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns situation_percent of the previous line.
|
||||
* Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line.
|
||||
@ -4891,9 +4913,9 @@ class FactureLigne extends CommonInvoiceLine
|
||||
* @param int $invoiceid Invoice id
|
||||
* @return int >= 0
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_prev_progress($invoiceid)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") {
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@ -347,15 +347,16 @@ class Localtax extends CommonObject
|
||||
return $solde;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Total de la localtax des factures emises par la societe.
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return int ???
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function localtax_sum_collectee($year = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "SELECT sum(f.localtax) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
|
||||
if ($year)
|
||||
@ -386,15 +387,16 @@ class Localtax extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* localtax payed
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return int ???
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function localtax_sum_payee($year = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
$sql = "SELECT sum(f.total_localtax) as total_localtax";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
@ -427,6 +429,7 @@ class Localtax extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* localtax payed
|
||||
* Total de la localtax payed
|
||||
@ -434,9 +437,9 @@ class Localtax extends CommonObject
|
||||
* @param int $year Year
|
||||
* @return int ???
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function localtax_sum_reglee($year = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
$sql = "SELECT sum(f.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."localtax as f";
|
||||
@ -582,15 +585,16 @@ class Localtax extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update the link betwen localtax payment and the line into llx_bank
|
||||
*
|
||||
* @param int $id Id bank account
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_fk_bank($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'localtax SET fk_bank = '.$id;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
$result = $this->db->query($sql);
|
||||
@ -642,6 +646,7 @@ class Localtax extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -649,9 +654,9 @@ class Localtax extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($status, $mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||
|
||||
return '';
|
||||
|
||||
@ -495,15 +495,16 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param User $user Objet user
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_board($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
@ -549,14 +550,15 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
*
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
@ -864,14 +866,15 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge les proprietes ref_previous et ref_next
|
||||
*
|
||||
* @return int <0 if KO, 0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_previous_next_id()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$this->errno = 0;
|
||||
@ -906,6 +909,7 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set the creation date
|
||||
*
|
||||
@ -913,9 +917,9 @@ class RemiseCheque extends CommonObject
|
||||
* @param int $date Date creation
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_date($user, $date)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->rights->banque->cheque)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||
@ -941,6 +945,7 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set the ref of bordereau
|
||||
*
|
||||
@ -948,9 +953,9 @@ class RemiseCheque extends CommonObject
|
||||
* @param int $ref ref of bordereau
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_number($user, $ref)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->rights->banque->cheque)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||
@ -1064,6 +1069,7 @@ class RemiseCheque extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of a status
|
||||
*
|
||||
@ -1071,9 +1077,9 @@ class RemiseCheque extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($status,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||
$langs->load('compta');
|
||||
if ($mode == 0)
|
||||
@ -1081,32 +1087,32 @@ class RemiseCheque extends CommonObject
|
||||
if ($status == 0) return $langs->trans('ToValidate');
|
||||
if ($status == 1) return $langs->trans('Validated');
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
if ($status == 0) return $langs->trans('ToValidate');
|
||||
if ($status == 1) return $langs->trans('Validated');
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0').' '.$langs->trans('ToValidate');
|
||||
if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0');
|
||||
if ($status == 1) return img_picto($langs->trans('Validated'),'statut4');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0').' '.$langs->trans('ToValidate');
|
||||
if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0');
|
||||
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
||||
}
|
||||
if ($mode == 6)
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0');
|
||||
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
||||
|
||||
@ -708,15 +708,16 @@ class Paiement extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Mise a jour du lien entre le paiement et la ligne generee dans llx_bank
|
||||
*
|
||||
* @param int $id_bank Id compte bancaire
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' set fk_bank = '.$id_bank;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
|
||||
@ -734,15 +735,16 @@ class Paiement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Updates the payment date
|
||||
*
|
||||
* @param int $date New date
|
||||
* @return int <0 if KO, 0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_date($date)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (!empty($date) && $this->statut!=1)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
||||
@ -766,15 +768,16 @@ class Paiement extends CommonObject
|
||||
return -1; //no date given or already validated
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Updates the payment number
|
||||
*
|
||||
* @param string $num New num
|
||||
* @return int <0 if KO, 0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_num($num)
|
||||
{
|
||||
// phpcs:enable
|
||||
if(!empty($num) && $this->statut!=1)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
||||
@ -1129,6 +1132,7 @@ class Paiement extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -1136,9 +1140,9 @@ class Paiement extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($status,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||
|
||||
$langs->load('compta');
|
||||
@ -1180,15 +1184,16 @@ class Paiement extends CommonObject
|
||||
return '';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load the third party of object, from id into this->thirdparty
|
||||
*
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
|
||||
if (empty($force_thirdparty_id))
|
||||
|
||||
@ -49,10 +49,10 @@ class BonPrelevement extends CommonObject
|
||||
*/
|
||||
public $table_element='prelevement_bons';
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto = 'payment';
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto = 'payment';
|
||||
|
||||
public $date_echeance;
|
||||
public $raison_sociale;
|
||||
@ -112,6 +112,7 @@ class BonPrelevement extends CommonObject
|
||||
$this->fetched = 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add invoice to withdrawal
|
||||
*
|
||||
@ -125,9 +126,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $number_key number key of account number
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key)
|
||||
{
|
||||
// phpcs:enable
|
||||
$result = 0;
|
||||
$line_id = 0;
|
||||
|
||||
@ -331,14 +332,15 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set credite and set status of linked invoices. Still used ??
|
||||
*
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_credite()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$conf;
|
||||
|
||||
$error = 0;
|
||||
@ -409,6 +411,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set direct debit order to "credited" status.
|
||||
*
|
||||
@ -416,9 +419,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param int $date date of action
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_infocredit($user, $date)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$error = 0;
|
||||
@ -556,6 +559,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set withdrawal to transmited status
|
||||
*
|
||||
@ -564,9 +568,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $method method of transmision to bank
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_infotrans($user, $date, $method)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$error = 0;
|
||||
@ -681,14 +685,15 @@ class BonPrelevement extends CommonObject
|
||||
return $arr;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns amount of withdrawal
|
||||
*
|
||||
* @return double Total amount
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SommeAPrelever()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT sum(pfd.amount) as nb";
|
||||
@ -719,6 +724,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get number of invoices to withdrawal
|
||||
* TODO delete params banque and agence when not necesary
|
||||
@ -727,9 +733,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param int $agence dolibarr mysoc agence
|
||||
* @return int <O if KO, number of invoices if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function NbFactureAPrelever($banque=0,$agence=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT count(f.rowid) as nb";
|
||||
@ -761,6 +767,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a withdraw
|
||||
* TODO delete params banque and agence when not necesary
|
||||
@ -772,9 +779,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $executiondate Date to execute the transfer
|
||||
* @return int <0 if KO, nbre of invoice withdrawed if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function Create($banque=0, $agence=0, $mode='real', $format='ALL',$executiondate='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
dol_syslog(__METHOD__."::Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG);
|
||||
@ -1197,15 +1204,16 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Delete a notification def by id
|
||||
*
|
||||
* @param int $rowid id of notification
|
||||
* @return int 0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DeleteNotificationById($rowid)
|
||||
{
|
||||
// phpcs:enable
|
||||
$result = 0;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
||||
@ -1221,6 +1229,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Delete a notification
|
||||
*
|
||||
@ -1228,9 +1237,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $action notification action
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DeleteNotification($user, $action)
|
||||
{
|
||||
// phpcs:enable
|
||||
$result = 0;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
||||
@ -1246,6 +1255,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add a notification
|
||||
*
|
||||
@ -1254,9 +1264,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $action notification action
|
||||
* @return int 0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function AddNotification($db, $user, $action)
|
||||
{
|
||||
// phpcs:enable
|
||||
$result = 0;
|
||||
|
||||
if ($this->DeleteNotification($user, $action) == 0)
|
||||
@ -1472,6 +1482,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Write recipient of request (customer)
|
||||
*
|
||||
@ -1486,9 +1497,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $rib_dom rib domiciliation
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $facnumber, $facid, $rib_dom='')
|
||||
{
|
||||
// phpcs:enable
|
||||
fputs($this->file, "06");
|
||||
fputs($this->file, "08"); // Prelevement ordinaire
|
||||
|
||||
@ -1559,6 +1570,7 @@ class BonPrelevement extends CommonObject
|
||||
return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Write recipient of request (customer)
|
||||
*
|
||||
@ -1580,9 +1592,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $row_drum rib.rowid used to generate rum
|
||||
* @return string Return string with SEPA part DrctDbtTxInf
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
|
||||
{
|
||||
// phpcs:enable
|
||||
$CrLf = "\n";
|
||||
$Rowing = sprintf("%06d", $row_idfac);
|
||||
|
||||
@ -1637,14 +1649,15 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Write sender of request (me)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function EnregEmetteur()
|
||||
{
|
||||
// phpcs:enable
|
||||
fputs($this->file, "03");
|
||||
fputs($this->file, "08"); // Prelevement ordinaire
|
||||
|
||||
@ -1703,6 +1716,7 @@ class BonPrelevement extends CommonObject
|
||||
fputs($this->file, "\n");
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Write sender of request (me).
|
||||
* Note: The tag PmtInf is opened here but closed into caller
|
||||
@ -1715,9 +1729,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $format FRST or RCUR or ALL
|
||||
* @return string String with SEPA Sender
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n', $format='FRST')
|
||||
{
|
||||
// phpcs:enable
|
||||
// SEPA INITIALISATION
|
||||
global $conf;
|
||||
|
||||
@ -1825,15 +1839,16 @@ class BonPrelevement extends CommonObject
|
||||
return $XML_SEPA_INFO;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Write end
|
||||
*
|
||||
* @param int $total total amount
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function EnregTotal($total)
|
||||
{
|
||||
// phpcs:enable
|
||||
fputs($this->file, "08");
|
||||
fputs($this->file, "08"); // Prelevement ordinaire
|
||||
|
||||
@ -1898,6 +1913,7 @@ class BonPrelevement extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return status label for a status
|
||||
*
|
||||
@ -1905,9 +1921,9 @@ class BonPrelevement extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($this->labelstatut))
|
||||
{
|
||||
global $langs;
|
||||
@ -1917,39 +1933,35 @@ class BonPrelevement extends CommonObject
|
||||
$this->labelstatut[2]=$langs->trans("StatusCredited");
|
||||
}
|
||||
|
||||
if ($mode == 0)
|
||||
if ($mode == 0 || $mode == 1)
|
||||
{
|
||||
return $this->labelstatut[$statut];
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
return $this->labelstatut[$statut];
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
|
||||
if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut];
|
||||
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1');
|
||||
if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3');
|
||||
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
|
||||
if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut];
|
||||
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
|
||||
if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3');
|
||||
if ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
|
||||
}
|
||||
if ($mode == 6)
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
|
||||
if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3');
|
||||
|
||||
@ -35,7 +35,7 @@ class LignePrelevement
|
||||
* @var int ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
@ -128,6 +128,7 @@ class LignePrelevement
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return status label for a status
|
||||
*
|
||||
@ -135,28 +136,28 @@ class LignePrelevement
|
||||
* @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); // Waiting
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); // Credited
|
||||
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); // Refused
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8');
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||
if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||
|
||||
@ -34,7 +34,7 @@ class RejetPrelevement
|
||||
* @var int ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
@ -199,15 +199,16 @@ class RejetPrelevement
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Send email to all users that has asked the withdraw request
|
||||
*
|
||||
* @param Facture $fac Invoice object
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _send_email($fac)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$userid = 0;
|
||||
|
||||
@ -494,15 +494,16 @@ class PaymentSalary extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update link between payment salary and line generate into llx_bank
|
||||
*
|
||||
* @param int $id_bank Id bank account
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
$result = $this->db->query($sql);
|
||||
@ -592,6 +593,7 @@ class PaymentSalary extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -599,9 +601,9 @@ class PaymentSalary extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($status,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||
|
||||
$langs->load('compta');
|
||||
|
||||
@ -461,6 +461,7 @@ class Cchargesociales
|
||||
return $this->LibStatut($this->status,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un status donne
|
||||
*
|
||||
@ -468,9 +469,9 @@ class Cchargesociales
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($status,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
|
||||
@ -45,9 +45,9 @@ class ChargeSociales extends CommonObject
|
||||
public $table_element='chargesociales';
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto = 'bill';
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto = 'bill';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
@ -370,15 +370,16 @@ class ChargeSociales extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Tag social contribution as payed completely
|
||||
*
|
||||
* @param User $user Object user making change
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_paid($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
|
||||
$sql.= " paye = 1";
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
@ -386,15 +387,17 @@ class ChargeSociales extends CommonObject
|
||||
if ($return) return 1;
|
||||
else return -1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Remove tag payed on social contribution
|
||||
*
|
||||
* @param User $user Object user making change
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_unpaid($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
|
||||
$sql.= " paye = 0";
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
@ -415,6 +418,7 @@ class ChargeSociales extends CommonObject
|
||||
return $this->LibStatut($this->paye,$mode,$alreadypaid);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -423,55 +427,50 @@ class ChargeSociales extends CommonObject
|
||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0,$alreadypaid=-1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load('customers');
|
||||
$langs->load('bills');
|
||||
|
||||
if ($mode == 0)
|
||||
if ($mode == 0 || $mode == 1)
|
||||
{
|
||||
if ($statut == 0) return $langs->trans("Unpaid");
|
||||
if ($statut == 1) return $langs->trans("Paid");
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($statut == 0) return $langs->trans("Unpaid");
|
||||
if ($statut == 1) return $langs->trans("Paid");
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
|
||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||
}
|
||||
if ($mode == 6)
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||
}
|
||||
|
||||
return "Error, mode/status not found";
|
||||
else return "Error, mode/status not found";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -605,15 +605,16 @@ class PaymentSocialContribution extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee
|
||||
*
|
||||
* @param int $id_bank Id if bank
|
||||
* @return int >0 if OK, <=0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
|
||||
@ -641,6 +642,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -648,9 +650,9 @@ class PaymentSocialContribution extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($status,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||
|
||||
$langs->load('compta');
|
||||
|
||||
@ -366,15 +366,16 @@ class Tva extends CommonObject
|
||||
return $solde;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Total of the VAT from invoices emitted by the thirdparty.
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return double Amount
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function tva_sum_collectee($year = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
$sql = "SELECT sum(f.tva) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
|
||||
@ -406,15 +407,16 @@ class Tva extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* VAT payed
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return double Amount
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function tva_sum_payee($year = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
$sql = "SELECT sum(f.total_tva) as total_tva";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
@ -447,15 +449,16 @@ class Tva extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Total of the VAT payed
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return double Amount
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function tva_sum_reglee($year = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
$sql = "SELECT sum(f.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."tva as f";
|
||||
@ -639,15 +642,16 @@ class Tva extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update link between payment tva and line generate into llx_bank
|
||||
*
|
||||
* @param int $id_bank Id bank account
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.$id_bank;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
$result = $this->db->query($sql);
|
||||
@ -803,6 +807,7 @@ class Tva extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -810,9 +815,9 @@ class Tva extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($status,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||
|
||||
return '';
|
||||
|
||||
@ -31,7 +31,7 @@ abstract class ActionsContactCardCommon
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
var $dirmodule;
|
||||
var $targetmodule;
|
||||
var $canvas;
|
||||
@ -41,12 +41,12 @@ abstract class ActionsContactCardCommon
|
||||
var $tpl = array();
|
||||
//! Object container
|
||||
var $object;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @var string[] Error codes (or messages)
|
||||
@ -76,16 +76,17 @@ abstract class ActionsContactCardCommon
|
||||
//}
|
||||
}
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set content of ->tpl array, to use into template
|
||||
*
|
||||
* @param string $action Type of action
|
||||
* @param int $id Id
|
||||
* @return string HTML output
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function assign_values(&$action, $id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $user, $canvas;
|
||||
global $form, $formcompany, $objsoc;
|
||||
|
||||
@ -266,14 +267,15 @@ abstract class ActionsContactCardCommon
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Assign POST values into object
|
||||
*
|
||||
* @return string HTML output
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function assign_post()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $mysoc;
|
||||
|
||||
$this->object->old_name = $_POST["old_name"];
|
||||
|
||||
@ -29,8 +29,8 @@ include_once DOL_DOCUMENT_ROOT.'/contact/canvas/actions_contactcard_common.class
|
||||
*/
|
||||
class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Handler acces base de donnees
|
||||
* @param string $dirmodule Name of directory of module
|
||||
@ -66,6 +66,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Assign custom values for canvas
|
||||
*
|
||||
@ -73,9 +74,9 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
* @param int $id Id
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function assign_values(&$action, $id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $limit, $offset, $sortfield, $sortorder;
|
||||
global $conf, $db, $langs, $user;
|
||||
global $form;
|
||||
@ -120,6 +121,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Fetch datas list and save into ->list_datas
|
||||
*
|
||||
@ -129,9 +131,9 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
//$this->getFieldList();
|
||||
|
||||
@ -135,9 +135,6 @@ class Contact extends CommonObject
|
||||
public $oldcopy; // To contains a clone of this when we need to save old properties of object
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -149,14 +146,15 @@ class Contact extends CommonObject
|
||||
$this->statut = 1; // By default, status is enabled
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators into this->nb for board
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$this->nb=array();
|
||||
@ -479,6 +477,7 @@ class Contact extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||
*
|
||||
@ -488,9 +487,9 @@ class Contact extends CommonObject
|
||||
* 2=Return key only (uid=qqq)
|
||||
* @return string DN
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _load_ldap_dn($info,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$dn='';
|
||||
if ($mode==0) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS].",".$conf->global->LDAP_CONTACT_DN;
|
||||
@ -500,14 +499,15 @@ class Contact extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Initialise tableau info (tableau des attributs LDAP)
|
||||
*
|
||||
* @return array Tableau info des attributs
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _load_ldap_info()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$info = array();
|
||||
@ -574,6 +574,7 @@ class Contact extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update field alert birthday
|
||||
*
|
||||
@ -582,9 +583,9 @@ class Contact extends CommonObject
|
||||
* @param int $notrigger 0=no, 1=yes
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_perso($id, $user=null, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$error=0;
|
||||
$result=false;
|
||||
|
||||
@ -856,6 +857,7 @@ class Contact extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load number of elements the contact is used as a link for
|
||||
* ref_facturation
|
||||
@ -865,9 +867,9 @@ class Contact extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_ref_elements()
|
||||
{
|
||||
// phpcs:enable
|
||||
// Compte les elements pour lesquels il est contact
|
||||
$sql ="SELECT tc.element, count(ec.rowid) as nb";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||
@ -1198,6 +1200,7 @@ class Contact extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -1205,9 +1208,9 @@ class Contact extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
@ -1244,15 +1247,16 @@ class Contact extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return translated label of Public or Private
|
||||
*
|
||||
* @param int $statut Type (0 = public, 1 = private)
|
||||
* @return string Label translated
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibPubPriv($statut)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
if ($statut=='1') return $langs->trans('ContactPrivate');
|
||||
else return $langs->trans('ContactPublic');
|
||||
|
||||
@ -249,6 +249,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Activate a contract line
|
||||
*
|
||||
@ -259,9 +260,9 @@ class Contrat extends CommonObject
|
||||
* @param string $comment A comment typed by user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function active_line($user, $line_id, $date, $date_end='', $comment='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$result = $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -272,6 +273,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Close a contract line
|
||||
*
|
||||
@ -281,9 +283,9 @@ class Contrat extends CommonObject
|
||||
* @param string $comment A comment typed by user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function close_line($user, $line_id, $date_end, $comment='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$result=$this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -715,15 +717,16 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load lines array into this->lines.
|
||||
* This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed
|
||||
*
|
||||
* @return ContratLigne[] Return array of contract lines
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_lines()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->nbofserviceswait=0;
|
||||
$this->nbofservicesopened=0;
|
||||
$this->nbofservicesexpired=0;
|
||||
@ -1793,6 +1796,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update statut of contract according to services
|
||||
*
|
||||
@ -1800,9 +1804,9 @@ class Contrat extends CommonObject
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @deprecated This function will never be used. Status of a contract is status of its lines.
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_statut($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
|
||||
|
||||
// If draft, we keep it (should not happen)
|
||||
@ -1832,6 +1836,7 @@ class Contrat extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi label of a given contrat status
|
||||
*
|
||||
@ -1839,9 +1844,9 @@ class Contrat extends CommonObject
|
||||
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load("contracts");
|
||||
if ($mode == 0)
|
||||
@ -2015,15 +2020,16 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of line rowid
|
||||
*
|
||||
* @param int $statut Status of lines to get
|
||||
* @return array Array of line's rowid
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function array_detail($statut=-1)
|
||||
{
|
||||
// phpcs:enable
|
||||
$tab=array();
|
||||
|
||||
$sql = "SELECT cd.rowid";
|
||||
@ -2091,6 +2097,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
@ -2098,9 +2105,9 @@ class Contrat extends CommonObject
|
||||
* @param string $mode "inactive" pour services a activer, "expired" pour services expires
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_board($user,$mode)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
$this->from = " FROM ".MAIN_DB_PREFIX."contrat as c";
|
||||
@ -2170,14 +2177,15 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
*
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
||||
$this->nb=array();
|
||||
@ -2602,6 +2610,7 @@ class ContratLigne extends CommonObjectLine
|
||||
return $this->LibStatut($this->statut,$mode,((! empty($this->date_fin_validite))?($this->date_fin_validite < dol_now()?1:0):-1));
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of a contract line status
|
||||
*
|
||||
@ -2611,9 +2620,9 @@ class ContratLigne extends CommonObjectLine
|
||||
* @param string $moreatt More attribute
|
||||
* @return string Libelle
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function LibStatut($statut,$mode,$expired=-1,$moreatt='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load("contracts");
|
||||
if ($mode == 0)
|
||||
@ -3025,15 +3034,16 @@ class ContratLigne extends CommonObjectLine
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Mise a jour en base des champs total_xxx de ligne
|
||||
* Used by migration process
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_total()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
// Mise a jour ligne en base
|
||||
@ -3142,6 +3152,7 @@ class ContratLigne extends CommonObjectLine
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Activate a contract line
|
||||
*
|
||||
@ -3151,9 +3162,9 @@ class ContratLigne extends CommonObjectLine
|
||||
* @param string $comment A comment typed by user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function active_line($user, $date, $date_end = '', $comment = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
$error = 0;
|
||||
@ -3200,6 +3211,7 @@ class ContratLigne extends CommonObjectLine
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Close a contract line
|
||||
*
|
||||
@ -3209,9 +3221,9 @@ class ContratLigne extends CommonObjectLine
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function close_line($user, $date_end, $comment = '', $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
// Update object
|
||||
|
||||
@ -827,15 +827,16 @@ class CMailFile
|
||||
return '=?'.$conf->file->character_set_client.'?B?'.base64_encode($stringtoencode).'?=';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Read a file on disk and return encoded content for emails (mode = 'mail')
|
||||
*
|
||||
* @param string $sourcefile Path to file to encode
|
||||
* @return int <0 if KO, encoded string if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _encode_file($sourcefile)
|
||||
{
|
||||
// phpcs:enable
|
||||
$newsourcefile=dol_osencode($sourcefile);
|
||||
|
||||
if (is_readable($newsourcefile))
|
||||
@ -853,6 +854,7 @@ class CMailFile
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Write content of a SMTP request into a dump file (mode = all)
|
||||
* Used for debugging.
|
||||
@ -860,9 +862,9 @@ class CMailFile
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function dump_mail()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$dolibarr_main_data_root;
|
||||
|
||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
||||
@ -947,14 +949,15 @@ class CMailFile
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create SMTP headers (mode = 'mail')
|
||||
*
|
||||
* @return string headers
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_smtpheaders()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$out = "";
|
||||
|
||||
@ -1010,6 +1013,7 @@ class CMailFile
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create header MIME (mode = 'mail')
|
||||
*
|
||||
@ -1017,9 +1021,9 @@ class CMailFile
|
||||
* @param array $mimefilename_list Array of mime types
|
||||
* @return string mime headers
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_mimeheaders($filename_list, $mimefilename_list)
|
||||
{
|
||||
// phpcs:enable
|
||||
$mimedone=0;
|
||||
$out = "";
|
||||
|
||||
@ -1040,15 +1044,16 @@ class CMailFile
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return email content (mode = 'mail')
|
||||
*
|
||||
* @param string $msgtext Message string
|
||||
* @return string String content
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_body($msgtext)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$out='';
|
||||
@ -1141,6 +1146,7 @@ class CMailFile
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Attach file to email (mode = 'mail')
|
||||
*
|
||||
@ -1149,9 +1155,9 @@ class CMailFile
|
||||
* @param array $mimefilename_list Tableau
|
||||
* @return string Chaine fichiers encodes
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_files($filename_list,$mimetype_list,$mimefilename_list)
|
||||
{
|
||||
// phpcs:enable
|
||||
$out = '';
|
||||
|
||||
$filename_list_size=count($filename_list);
|
||||
@ -1189,15 +1195,16 @@ class CMailFile
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Attach an image to email (mode = 'mail')
|
||||
*
|
||||
* @param array $images_list Tableau
|
||||
* @return string Chaine images encodees
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_images($images_list)
|
||||
{
|
||||
// phpcs:enable
|
||||
$out = '';
|
||||
|
||||
if ($images_list)
|
||||
@ -1221,6 +1228,7 @@ class CMailFile
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Try to create a socket connection
|
||||
*
|
||||
@ -1228,9 +1236,9 @@ class CMailFile
|
||||
* @param int $port Example: 25, 465
|
||||
* @return int Socket id if ok, 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function check_server_port($host,$port)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$_retVal=0;
|
||||
@ -1285,6 +1293,7 @@ class CMailFile
|
||||
return $_retVal;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* This function has been modified as provided by SirSir to allow multiline responses when
|
||||
* using SMTP Extensions.
|
||||
@ -1293,9 +1302,9 @@ class CMailFile
|
||||
* @param string $response Response string
|
||||
* @return boolean true if success
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function server_parse($socket, $response)
|
||||
{
|
||||
// phpcs:enable
|
||||
$_retVal = true; // Indicates if Object was created or not
|
||||
$server_response = '';
|
||||
|
||||
|
||||
@ -192,15 +192,16 @@ class CSMSFile
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Write content of a SendSms request into a dump file (mode = all)
|
||||
* Used for debugging.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function dump_sms()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$dolibarr_main_data_root;
|
||||
|
||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
||||
@ -222,6 +223,7 @@ class CSMSFile
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Write content of a SendSms result into a dump file (mode = all)
|
||||
* Used for debugging.
|
||||
@ -229,9 +231,9 @@ class CSMSFile
|
||||
* @param int $result Result of sms sending
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function dump_sms_result($result)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$dolibarr_main_data_root;
|
||||
|
||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
||||
|
||||
@ -41,7 +41,7 @@ class AntiVir
|
||||
public $errors = array();
|
||||
|
||||
var $output;
|
||||
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
@ -57,6 +57,7 @@ class AntiVir
|
||||
$this->db=$db;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Scan a file with antivirus.
|
||||
* This function runs the command defined in setup. This antivirus command must return 0 if OK.
|
||||
@ -65,9 +66,9 @@ class AntiVir
|
||||
* @param string $file File to scan
|
||||
* @return int <0 if KO (-98 if error, -99 if virus), 0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function dol_avscan_file($file)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$return = 0;
|
||||
|
||||
@ -32,7 +32,7 @@ class Canvas
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -133,6 +133,7 @@ class Canvas
|
||||
//print ' => template_dir='.$this->template_dir.'<br>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Shared method for canvas to assign values for templates
|
||||
*
|
||||
@ -141,9 +142,9 @@ class Canvas
|
||||
* @param string $ref Object ref (if id not provided)
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function assign_values(&$action='view', $id=0, $ref='')
|
||||
{
|
||||
// phpcs:enable
|
||||
if (method_exists($this->control,'assign_values')) $this->control->assign_values($action, $id, $ref);
|
||||
}
|
||||
|
||||
@ -161,6 +162,7 @@ class Canvas
|
||||
else return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Display a canvas page. This will include the template for output.
|
||||
* Variables used by templates may have been defined or loaded before into the assign_values function.
|
||||
@ -168,9 +170,9 @@ class Canvas
|
||||
* @param string $action Action code
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function display_canvas($action)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db, $conf, $langs, $user, $canvas;
|
||||
global $form, $formfile;
|
||||
|
||||
|
||||
@ -48,6 +48,7 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple subtitution key => subtitution value
|
||||
*
|
||||
@ -55,9 +56,9 @@ abstract class CommonDocGenerator
|
||||
* @param Translate $outputlangs Language object for output
|
||||
* @return array Array of substitution key->code
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_user($user,$outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$logotouse=$conf->user->dir_output.'/'.get_exdir($user->id, 2, 0, 1, $user, 'user').'/'.$user->photo;
|
||||
@ -85,6 +86,7 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple subtitution key => subtitution value
|
||||
*
|
||||
@ -92,9 +94,9 @@ abstract class CommonDocGenerator
|
||||
* @param Translate $outputlangs Language object for output
|
||||
* @return array Array of substitution key->code
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_mysoc($mysoc,$outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
if (empty($mysoc->forme_juridique) && ! empty($mysoc->forme_juridique_code))
|
||||
@ -144,6 +146,7 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple subtitution key => subtitution value
|
||||
*
|
||||
@ -151,9 +154,9 @@ abstract class CommonDocGenerator
|
||||
* @param Translate $outputlangs Language object for output
|
||||
* @return array Array of substitution key->code
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_thirdparty($object,$outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
if (empty($object->country) && ! empty($object->country_code))
|
||||
@ -224,6 +227,7 @@ abstract class CommonDocGenerator
|
||||
return $array_thirdparty;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple subtitution key => subtitution value
|
||||
*
|
||||
@ -232,9 +236,9 @@ abstract class CommonDocGenerator
|
||||
* @param array_key $array_key Name of the key for return array
|
||||
* @return array of substitution key->code
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
if(empty($object->country) && ! empty($object->country_code))
|
||||
@ -297,15 +301,16 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple subtitution key => subtitution value
|
||||
*
|
||||
* @param Translate $outputlangs Language object for output
|
||||
* @return array Array of substitution key->code
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_other($outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$now=dol_now('gmt'); // gmt
|
||||
@ -334,6 +339,7 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple substitution key => substitution value
|
||||
*
|
||||
@ -342,9 +348,9 @@ abstract class CommonDocGenerator
|
||||
* @param string $array_key Name of the key for return array
|
||||
* @return array Array of substitution
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_object($object,$outputlangs,$array_key='object')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$sumpayed=$sumdeposit=$sumcreditnote='';
|
||||
@ -481,6 +487,7 @@ abstract class CommonDocGenerator
|
||||
return $resarray;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple substitution key => substitution value
|
||||
*
|
||||
@ -488,9 +495,9 @@ abstract class CommonDocGenerator
|
||||
* @param Translate $outputlangs Lang object to use for output
|
||||
* @return array Return a substitution array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_lines($line,$outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$resarray= array(
|
||||
@ -559,6 +566,7 @@ abstract class CommonDocGenerator
|
||||
return $resarray;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple substitution key => substitution value
|
||||
*
|
||||
@ -567,9 +575,9 @@ abstract class CommonDocGenerator
|
||||
* @param array_key $array_key Name of the key for return array
|
||||
* @return array Array of substitution
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_shipment($object,$outputlangs,$array_key='object')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
dol_include_once('/core/lib/product.lib.php');
|
||||
$object->list_delivery_methods($object->shipping_method_id);
|
||||
@ -621,6 +629,7 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple substitution key => substitution value
|
||||
*
|
||||
@ -628,10 +637,10 @@ abstract class CommonDocGenerator
|
||||
* @param Translate $outputlangs Lang object to use for output
|
||||
* @return array Substitution array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_shipment_lines($line, $outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
dol_include_once('/core/lib/product.lib.php');
|
||||
|
||||
$resarray = array(
|
||||
@ -668,6 +677,7 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define array with couple subtitution key => subtitution value
|
||||
*
|
||||
@ -676,17 +686,17 @@ abstract class CommonDocGenerator
|
||||
* @param boolean $recursive Want to fetch child array or child object
|
||||
* @return array Array of substitution key->code
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true)
|
||||
{
|
||||
// phpcs:enable
|
||||
$array_other = array();
|
||||
if(!empty($object)) {
|
||||
if (!empty($object)) {
|
||||
foreach($object as $key => $value) {
|
||||
if(!empty($value)) {
|
||||
if(!is_array($value) && !is_object($value)) {
|
||||
if (!empty($value)) {
|
||||
if (!is_array($value) && !is_object($value)) {
|
||||
$array_other['object_'.$key] = $value;
|
||||
}
|
||||
if(is_array($value) && $recursive){
|
||||
if (is_array($value) && $recursive) {
|
||||
$array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false);
|
||||
}
|
||||
}
|
||||
@ -696,6 +706,7 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Fill array with couple extrafield key => extrafield value
|
||||
*
|
||||
@ -706,9 +717,9 @@ abstract class CommonDocGenerator
|
||||
* @param Translate $outputlangs Lang object to use for output
|
||||
* @return array Substitution array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fill_substitutionarray_with_extrafields($object,$array_to_fill,$extrafields,$array_key,$outputlangs)
|
||||
function fill_substitutionarray_with_extrafields($object,$array_to_fill,$extrafields,$array_key,$outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
|
||||
@ -325,6 +325,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return if an invoice can be deleted
|
||||
* Rule is:
|
||||
@ -337,9 +338,9 @@ abstract class CommonInvoice extends CommonObject
|
||||
*
|
||||
* @return int <=0 if no, >0 if yes
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function is_erasable()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
// We check if invoice is a temporary number (PROVxxxx)
|
||||
@ -450,6 +451,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
return $this->LibStatut($this->paye, $this->statut, $mode, $alreadypaid, $this->type);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of a status
|
||||
*
|
||||
@ -460,9 +462,9 @@ abstract class CommonInvoice extends CommonObject
|
||||
* @param int $type Type invoice
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($paye, $status, $mode=0, $alreadypaid=-1, $type=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load('bills');
|
||||
|
||||
@ -485,7 +487,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
else return $langs->trans('Bill'.$prefix.'StatusPaid');
|
||||
}
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
$prefix='Short';
|
||||
if (! $paye)
|
||||
@ -503,7 +505,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
else return $langs->trans('Bill'.$prefix.'StatusPaid');
|
||||
}
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
$prefix='Short';
|
||||
if (! $paye)
|
||||
@ -521,7 +523,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('Bill'.$prefix.'StatusPaid');
|
||||
}
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
$prefix='Short';
|
||||
if (! $paye)
|
||||
@ -539,7 +541,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
else return img_picto($langs->trans('BillStatusPaid'),'statut6');
|
||||
}
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
$prefix='';
|
||||
if (! $paye)
|
||||
@ -557,7 +559,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('BillStatusPaid');
|
||||
}
|
||||
}
|
||||
if ($mode == 5 || $mode == 6)
|
||||
elseif ($mode == 5 || $mode == 6)
|
||||
{
|
||||
$prefix='';
|
||||
if ($mode == 5) $prefix='Short';
|
||||
@ -582,6 +584,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi une date limite de reglement de facture en fonction des
|
||||
* conditions de reglements de la facture et date de facturation
|
||||
@ -589,9 +592,9 @@ abstract class CommonInvoice extends CommonObject
|
||||
* @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition.
|
||||
* @return date Date limite de reglement si ok, <0 si ko
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function calculate_date_lim_reglement($cond_reglement=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code;
|
||||
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_id;
|
||||
|
||||
|
||||
@ -714,6 +714,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add a link between element $this->element and a contact
|
||||
*
|
||||
@ -723,9 +724,9 @@ abstract class CommonObject
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$langs;
|
||||
|
||||
|
||||
@ -837,6 +838,7 @@ abstract class CommonObject
|
||||
} else return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Copy contact from one element to current
|
||||
*
|
||||
@ -844,9 +846,9 @@ abstract class CommonObject
|
||||
* @param string $source Nature of contact ('internal' or 'external')
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function copy_linked_contact($objFrom, $source='internal')
|
||||
{
|
||||
// phpcs:enable
|
||||
$contacts = $objFrom->liste_contact(-1, $source);
|
||||
foreach($contacts as $contact)
|
||||
{
|
||||
@ -859,6 +861,7 @@ abstract class CommonObject
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update a link to contact line
|
||||
*
|
||||
@ -868,9 +871,9 @@ abstract class CommonObject
|
||||
* @param int $fk_socpeople Id of soc_people to update (not modified if 0)
|
||||
* @return int <0 if KO, >= 0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Insert into database
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
|
||||
$sql.= " statut = ".$statut;
|
||||
@ -889,6 +892,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Delete a link to contact line
|
||||
*
|
||||
@ -896,9 +900,9 @@ abstract class CommonObject
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_contact($rowid, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
|
||||
@ -927,6 +931,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Delete all links between an object $this and all its contacts
|
||||
*
|
||||
@ -934,9 +939,9 @@ abstract class CommonObject
|
||||
* @param string $code Type of contact (code or id)
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_linked_contact($source='',$code='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$temp = array();
|
||||
$typeContact = $this->liste_type_contact($source,'',0,0,$code);
|
||||
|
||||
@ -963,6 +968,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get array of all contacts for an object
|
||||
*
|
||||
@ -972,9 +978,9 @@ abstract class CommonObject
|
||||
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
|
||||
* @return array Array of contacts
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_contact($statut=-1,$source='external',$list=0,$code='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$tab=array();
|
||||
@ -1071,6 +1077,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return array with list of possible values for type of contacts
|
||||
*
|
||||
@ -1081,9 +1088,9 @@ abstract class CommonObject
|
||||
* @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE')
|
||||
* @return array Array list of type of contacts (id->label if option=0, code->label if option=1)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_type_contact($source='internal', $order='position', $option=0, $activeonly=0, $code='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if (empty($order)) $order='position';
|
||||
@ -1185,15 +1192,16 @@ abstract class CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load object contact with id=$this->contactid into $this->contact
|
||||
*
|
||||
* @param int $contactid Id du contact. Use this->contactid if empty.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_contact($contactid=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($contactid)) $contactid=$this->contactid;
|
||||
|
||||
if (empty($contactid)) return 0;
|
||||
@ -1205,15 +1213,16 @@ abstract class CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty
|
||||
*
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id))
|
||||
@ -1267,6 +1276,7 @@ abstract class CommonObject
|
||||
return $this->fetch($result->rowid);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load data for barcode into properties ->barcode_type*
|
||||
* Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
|
||||
@ -1274,9 +1284,9 @@ abstract class CommonObject
|
||||
*
|
||||
* @return int <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_barcode()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
dol_syslog(get_class($this).'::fetch_barcode this->element='.$this->element.' this->barcode_type='.$this->barcode_type);
|
||||
@ -1317,14 +1327,15 @@ abstract class CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load the project with id $this->fk_project into this->project
|
||||
*
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_projet()
|
||||
{
|
||||
// phpcs:enable
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
if (empty($this->fk_project) && ! empty($this->fk_projet)) $this->fk_project = $this->fk_projet; // For backward compatibility
|
||||
@ -1338,14 +1349,15 @@ abstract class CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load the product with id $this->fk_product into this->product
|
||||
*
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_product()
|
||||
{
|
||||
// phpcs:enable
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
if (empty($this->fk_product)) return 0;
|
||||
@ -1357,29 +1369,31 @@ abstract class CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load the user with id $userid into this->user
|
||||
*
|
||||
* @param int $userid Id du contact
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_user($userid)
|
||||
{
|
||||
// phpcs:enable
|
||||
$user = new User($this->db);
|
||||
$result=$user->fetch($userid);
|
||||
$this->user = $user;
|
||||
return $result;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Read linked origin object
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_origin()
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($this->origin == 'shipping') $this->origin = 'expedition';
|
||||
if ($this->origin == 'delivery') $this->origin = 'livraison';
|
||||
|
||||
@ -1539,6 +1553,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load properties id_previous and id_next by comparing $fieldid with $this->ref
|
||||
*
|
||||
@ -1547,9 +1562,9 @@ abstract class CommonObject
|
||||
* @param int $nodbprefix Do not include DB prefix to forge table name
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_previous_next_ref($filter, $fieldid, $nodbprefix=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
||||
if (! $this->table_element)
|
||||
@ -2174,6 +2189,7 @@ abstract class CommonObject
|
||||
|
||||
// TODO: Move line related operations to CommonObjectLine?
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Save a new position (field rang) for details lines.
|
||||
* You can choose to set position for lines with already a position or lines without any position defined.
|
||||
@ -2183,9 +2199,9 @@ abstract class CommonObject
|
||||
* @param boolean $fk_parent_line Table with fk_parent_line field or not
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! $this->table_element_line)
|
||||
{
|
||||
dol_syslog(get_class($this)."::line_order was called on objet with property table_element_line not defined",LOG_ERR);
|
||||
@ -2294,6 +2310,7 @@ abstract class CommonObject
|
||||
return $rows;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update a line to have a lower rank
|
||||
*
|
||||
@ -2301,9 +2318,9 @@ abstract class CommonObject
|
||||
* @param boolean $fk_parent_line Table with fk_parent_line field or not
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function line_up($rowid, $fk_parent_line=true)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->line_order(false, 'ASC', $fk_parent_line);
|
||||
|
||||
// Get rang of line
|
||||
@ -2313,6 +2330,7 @@ abstract class CommonObject
|
||||
$this->updateLineUp($rowid, $rang);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update a line to have a higher rank
|
||||
*
|
||||
@ -2320,9 +2338,9 @@ abstract class CommonObject
|
||||
* @param boolean $fk_parent_line Table with fk_parent_line field or not
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function line_down($rowid, $fk_parent_line=true)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->line_order(false, 'ASC', $fk_parent_line);
|
||||
|
||||
// Get rang of line
|
||||
@ -2357,15 +2375,16 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update position of line with ajax (rang)
|
||||
*
|
||||
* @param array $rows Array of rows
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function line_ajaxorder($rows)
|
||||
{
|
||||
// phpcs:enable
|
||||
$num = count($rows);
|
||||
for ($i = 0 ; $i < $num ; $i++)
|
||||
{
|
||||
@ -2473,15 +2492,16 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get max value used for position of line (rang)
|
||||
*
|
||||
* @param int $fk_parent_line Parent line id
|
||||
* @return int Max value of rang in table of lines
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function line_max($fk_parent_line=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Search the last rang with fk_parent_line
|
||||
if ($fk_parent_line)
|
||||
{
|
||||
@ -2520,15 +2540,16 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update external ref of element
|
||||
*
|
||||
* @param string $ref_ext Update field ref_ext
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_ref_ext($ref_ext)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! $this->table_element)
|
||||
{
|
||||
dol_syslog(get_class($this)."::update_ref_ext was called on objet with property table_element not defined", LOG_ERR);
|
||||
@ -2552,6 +2573,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update note of element
|
||||
*
|
||||
@ -2559,9 +2581,9 @@ abstract class CommonObject
|
||||
* @param string $suffix '', '_public' or '_private'
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_note($note, $suffix='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
if (! $this->table_element)
|
||||
@ -2604,6 +2626,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update public note (kept for backward compatibility)
|
||||
*
|
||||
@ -2612,12 +2635,13 @@ abstract class CommonObject
|
||||
* @deprecated
|
||||
* @see update_note()
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_note_public($note)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->update_note($note,'_public');
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines).
|
||||
* Must be called at end of methods addline or updateline.
|
||||
@ -2628,9 +2652,9 @@ abstract class CommonObject
|
||||
* @param Societe $seller If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$seller=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $hookmanager, $action;
|
||||
|
||||
// Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield)
|
||||
@ -2857,6 +2881,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add objects linked in llx_element_element.
|
||||
*
|
||||
@ -2865,9 +2890,9 @@ abstract class CommonObject
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @see fetchObjectLinked, updateObjectLinked, deleteObjectLinked
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_object_linked($origin=null, $origin_id=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
$origin = (! empty($origin) ? $origin : $this->origin);
|
||||
$origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id);
|
||||
|
||||
@ -3618,15 +3643,16 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return incoterms informations
|
||||
* TODO Use a cache for label get
|
||||
*
|
||||
* @return string incoterms info
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function display_incoterms()
|
||||
{
|
||||
// phpcs:enable
|
||||
$out = '';
|
||||
$this->libelle_incoterms = '';
|
||||
if (!empty($this->fk_incoterms))
|
||||
@ -4226,6 +4252,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add resources to the current object : add entry into llx_element_resources
|
||||
* Need $this->element & $this->id
|
||||
@ -4236,9 +4263,9 @@ abstract class CommonObject
|
||||
* @param int $mandatory Mandatory or not
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_element_resource($resource_id, $resource_type, $busy=0, $mandatory=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_resources (";
|
||||
@ -4271,6 +4298,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Delete a link to resource line
|
||||
*
|
||||
@ -4279,9 +4307,9 @@ abstract class CommonObject
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_resource($rowid, $element, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$this->db->begin();
|
||||
@ -4654,6 +4682,7 @@ abstract class CommonObject
|
||||
/* For triggers */
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Call trigger based on this instance.
|
||||
* Some context information may also be provided into array property this->context.
|
||||
@ -4664,9 +4693,9 @@ abstract class CommonObject
|
||||
* @param User $user Object user
|
||||
* @return int Result of run_triggers
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function call_trigger($trigger_name, $user)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
@ -4691,6 +4720,7 @@ abstract class CommonObject
|
||||
/* Functions for extrafields */
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to get extra fields of an object into $this->array_options
|
||||
* This method is in most cases called by method fetch of objects but you can call it separately.
|
||||
@ -4699,9 +4729,9 @@ abstract class CommonObject
|
||||
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
|
||||
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_optionals($rowid=null, $optionsArray=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($rowid)) $rowid=$this->id;
|
||||
|
||||
// To avoid SQL errors. Probably not the better solution though
|
||||
@ -6463,6 +6493,7 @@ abstract class CommonObject
|
||||
return $buyPrice;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show photos of an object (nbmax maximum), into several columns
|
||||
*
|
||||
@ -6480,9 +6511,9 @@ abstract class CommonObject
|
||||
* @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead)
|
||||
* @return string Html code to show photo. Number of photos shown is saved in this->nbphoto
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user,$langs;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
||||
|
||||
@ -94,6 +94,7 @@ abstract class CommonStickerGenerator
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to build PDF on disk, then output on HTTP strem.
|
||||
*
|
||||
@ -103,8 +104,8 @@ abstract class CommonStickerGenerator
|
||||
* @param string $outputdir Output directory for pdf file
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
abstract function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir='');
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0)
|
||||
@ -116,6 +117,7 @@ abstract class CommonStickerGenerator
|
||||
*/
|
||||
abstract function addSticker(&$pdf,$outputlangs,$param);
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Methode qui permet de modifier la taille des caracteres
|
||||
* Cela modiera aussi l'espace entre chaque ligne
|
||||
@ -124,9 +126,9 @@ abstract class CommonStickerGenerator
|
||||
* @param int $pt point
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function Set_Char_Size(&$pdf,$pt)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($pt > 3) {
|
||||
$this->_Char_Size = $pt;
|
||||
$this->_Line_Height = $this->_Get_Height_Chars($pt);
|
||||
@ -134,6 +136,7 @@ abstract class CommonStickerGenerator
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* protected Print dot line
|
||||
*
|
||||
@ -146,9 +149,9 @@ abstract class CommonStickerGenerator
|
||||
* @param int $nbPointilles Nb pointilles
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _Pointille(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$nbPointilles=15)
|
||||
{
|
||||
// phpcs:enable
|
||||
$pdf->SetLineWidth($epaisseur);
|
||||
$length=abs($x1-$x2);
|
||||
$hauteur=abs($y1-$y2);
|
||||
@ -176,6 +179,7 @@ abstract class CommonStickerGenerator
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* protected Function realisant une croix aux 4 coins des cartes
|
||||
*
|
||||
@ -188,9 +192,9 @@ abstract class CommonStickerGenerator
|
||||
* @param int $taille Size
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _Croix(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=4)
|
||||
{
|
||||
// phpcs:enable
|
||||
$pdf->SetDrawColor(192,192,192);
|
||||
|
||||
$pdf->SetLineWidth($epaisseur);
|
||||
@ -211,6 +215,7 @@ abstract class CommonStickerGenerator
|
||||
$pdf->SetDrawColor(0,0,0);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* protected Convert units (in to mm, mm to in)
|
||||
* $src and $dest must be 'in' or 'mm'
|
||||
@ -220,9 +225,9 @@ abstract class CommonStickerGenerator
|
||||
* @param string $dest to
|
||||
* @return float value value after conversion
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _Convert_Metric($value, $src, $dest)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($src != $dest) {
|
||||
$tab['in'] = 39.37008;
|
||||
$tab['mm'] = 1000;
|
||||
@ -232,15 +237,16 @@ abstract class CommonStickerGenerator
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* protected Give the height for a char size given.
|
||||
*
|
||||
* @param int $pt Point
|
||||
* @return int Height chars
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _Get_Height_Chars($pt)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes
|
||||
$_Table_Hauteur_Chars = array(6=>2, 7=>2.5, 8=>3, 9=>3.5, 10=>4, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10);
|
||||
if (in_array($pt, array_keys($_Table_Hauteur_Chars))) {
|
||||
@ -250,6 +256,7 @@ abstract class CommonStickerGenerator
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* protected Set format
|
||||
*
|
||||
@ -257,9 +264,9 @@ abstract class CommonStickerGenerator
|
||||
* @param string $format Format
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _Set_Format(&$pdf, $format)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->_Metric = $format['metric'];
|
||||
$this->_Avery_Name = $format['name'];
|
||||
$this->_Avery_Code = $format['code'];
|
||||
|
||||
@ -361,6 +361,7 @@ class DiscountAbsolute
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Link the discount to a particular invoice line or a particular invoice.
|
||||
* When discount is a global discount used as an invoice line, we link using rowidline.
|
||||
@ -370,9 +371,9 @@ class DiscountAbsolute
|
||||
* @param int $rowidinvoice Invoice id (To use discount as a credit note to reduc payment of invoice)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function link_to_invoice($rowidline,$rowidinvoice)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Check parameters
|
||||
if (! $rowidline && ! $rowidinvoice)
|
||||
{
|
||||
@ -416,15 +417,16 @@ class DiscountAbsolute
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Link the discount to a particular invoice line or a particular invoice.
|
||||
* Do not call this if discount is linked to a reconcialiated invoice
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function unlink_invoice()
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except";
|
||||
if(! empty($this->discount_type)) {
|
||||
$sql.=" SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL";
|
||||
|
||||
@ -137,6 +137,7 @@ class DolEditor
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output edit area inside the HTML stream.
|
||||
* Output depends on this->tool (fckeditor, ckeditor, textarea, ...)
|
||||
@ -148,9 +149,9 @@ class DolEditor
|
||||
* @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...)
|
||||
* @return void|string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$fullpage=false;
|
||||
|
||||
@ -69,7 +69,7 @@ class DolGraph
|
||||
var $showpercent=0;
|
||||
var $combine=0; // 0.05 if you want to combine records < 5% into "other"
|
||||
var $graph; // Objet Graph (Artichow, Phplot...)
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -128,120 +128,130 @@ class DolGraph
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set Y precision
|
||||
*
|
||||
* @param float $which_prec Precision
|
||||
* @return boolean
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetPrecisionY($which_prec)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->PrecisionY = $which_prec;
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
|
||||
*
|
||||
* @param float $xi Xi
|
||||
* @return boolean True
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetHorizTickIncrement($xi)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->horizTickIncrement = $xi;
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
|
||||
*
|
||||
* @param float $xt Xt
|
||||
* @return boolean True
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetNumXTicks($xt)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->SetNumXTicks = $xt;
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set label interval to reduce number of labels
|
||||
*
|
||||
* @param float $x Label interval
|
||||
* @return boolean True
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetLabelInterval($x)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->labelInterval = $x;
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Hide X grid
|
||||
*
|
||||
* @param boolean $bool XGrid or not
|
||||
* @return boolean true
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetHideXGrid($bool)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->hideXGrid = $bool;
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Hide Y grid
|
||||
*
|
||||
* @param boolean $bool YGrid or not
|
||||
* @return boolean true
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetHideYGrid($bool)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->hideYGrid = $bool;
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set y label
|
||||
*
|
||||
* @param string $label Y label
|
||||
* @return boolean|null True
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetYLabel($label)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->YLabel = $label;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set width
|
||||
*
|
||||
* @param int $w Width
|
||||
* @return boolean|null True
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetWidth($w)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->width = $w;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set title
|
||||
*
|
||||
* @param string $title Title
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetTitle($title)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set data
|
||||
*
|
||||
@ -249,161 +259,174 @@ class DolGraph
|
||||
* @return void
|
||||
* @see draw_jflot for syntax of data array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetData($data)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set data
|
||||
*
|
||||
* @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...)
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetDataColor($datacolor)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->datacolor = $datacolor;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars')
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetType($type)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set legend
|
||||
*
|
||||
* @param array $legend Legend. Example: array('seriename1','seriname2',...)
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetLegend($legend)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->Legend = $legend;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set min width
|
||||
*
|
||||
* @param int $legendwidthmin Min width
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetLegendWidthMin($legendwidthmin)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->LegendWidthMin = $legendwidthmin;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set max value
|
||||
*
|
||||
* @param int $max Max value
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetMaxValue($max)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->MaxValue = $max;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get max value
|
||||
*
|
||||
* @return int Max value
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetMaxValue()
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->MaxValue;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set min value
|
||||
*
|
||||
* @param int $min Min value
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetMinValue($min)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->MinValue = $min;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get min value
|
||||
*
|
||||
* @return int Max value
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetMinValue()
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->MinValue;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set height
|
||||
*
|
||||
* @param int $h Height
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetHeight($h)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->height = $h;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set shading
|
||||
*
|
||||
* @param string $s Shading
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetShading($s)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->SetShading = $s;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set shading
|
||||
*
|
||||
* @param string $s Shading
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetCssPrefix($s)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->cssprefix = $s;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Reset bg color
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function ResetBgColor()
|
||||
{
|
||||
// phpcs:enable
|
||||
unset($this->bgcolor);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Reset bgcolorgrid
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function ResetBgColorGrid()
|
||||
{
|
||||
// phpcs:enable
|
||||
unset($this->bgcolorgrid);
|
||||
}
|
||||
|
||||
@ -452,15 +475,16 @@ class DolGraph
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define background color of complete image
|
||||
*
|
||||
* @param array $bg_color array(R,G,B) ou 'onglet' ou 'default'
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetBgColor($bg_color = array(255,255,255))
|
||||
{
|
||||
// phpcs:enable
|
||||
global $theme_bgcolor,$theme_bgcoloronglet;
|
||||
|
||||
if (! is_array($bg_color))
|
||||
@ -481,15 +505,16 @@ class DolGraph
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Define background color of grid
|
||||
*
|
||||
* @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default'
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetBgColorGrid($bg_colorgrid = array(255,255,255))
|
||||
{
|
||||
// phpcs:enable
|
||||
global $theme_bgcolor,$theme_bgcoloronglet;
|
||||
|
||||
if (! is_array($bg_colorgrid))
|
||||
@ -510,25 +535,27 @@ class DolGraph
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Reset data color
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function ResetDataColor()
|
||||
{
|
||||
// phpcs:enable
|
||||
unset($this->datacolor);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get max value
|
||||
*
|
||||
* @return int Max value
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetMaxValueInData()
|
||||
{
|
||||
// phpcs:enable
|
||||
$k = 0;
|
||||
$vals = array();
|
||||
|
||||
@ -547,14 +574,15 @@ class DolGraph
|
||||
return $vals[0];
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return min value of all data
|
||||
*
|
||||
* @return int Min value of all data
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetMinValueInData()
|
||||
{
|
||||
// phpcs:enable
|
||||
$k = 0;
|
||||
$vals = array();
|
||||
|
||||
@ -573,14 +601,15 @@ class DolGraph
|
||||
return $vals[0];
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return max value of all data
|
||||
*
|
||||
* @return int Max value of all data
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetCeilMaxValue()
|
||||
{
|
||||
// phpcs:enable
|
||||
$max = $this->GetMaxValueInData();
|
||||
if ($max != 0) $max++;
|
||||
$size=dol_strlen(abs(ceil($max)));
|
||||
@ -597,14 +626,15 @@ class DolGraph
|
||||
return $res;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return min value of all data
|
||||
*
|
||||
* @return double Max value of all data
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetFloorMinValue()
|
||||
{
|
||||
// phpcs:enable
|
||||
$min = $this->GetMinValueInData();
|
||||
if ($min == '') $min=0;
|
||||
if ($min != 0) $min--;
|
||||
@ -652,6 +682,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Build a graph onto disk using Artichow library and return img string to it
|
||||
*
|
||||
@ -659,9 +690,9 @@ class DolGraph
|
||||
* @param string $fileurl Url path to show image if saved onto disk
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function draw_artichow($file,$fileurl)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $artichow_defaultfont;
|
||||
|
||||
dol_syslog(get_class($this)."::draw_artichow this->type=".join(',',$this->type));
|
||||
@ -832,6 +863,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Build a graph using JFlot library. Input when calling this method should be:
|
||||
* $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB));
|
||||
@ -848,9 +880,9 @@ class DolGraph
|
||||
* @param string $fileurl Url path to show image if saved onto disk. Never used here.
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function draw_jflot($file,$fileurl)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $artichow_defaultfont;
|
||||
|
||||
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type)." this->MaxValue=".$this->MaxValue);
|
||||
|
||||
@ -105,25 +105,25 @@ class dolReceiptPrinter extends Escpos
|
||||
const CONNECTOR_NETWORK_PRINT = 3;
|
||||
const CONNECTOR_WINDOWS_PRINT = 4;
|
||||
//const CONNECTOR_JAVA = 5;
|
||||
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
var $tags;
|
||||
var $printer;
|
||||
var $template;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
/**
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
|
||||
|
||||
@ -352,6 +352,7 @@ class dolReceiptPrinter extends Escpos
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to Add a printer in db
|
||||
*
|
||||
@ -361,9 +362,9 @@ class dolReceiptPrinter extends Escpos
|
||||
* @param string $parameter Printer parameter
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function AddPrinter($name, $type, $profile, $parameter)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt';
|
||||
@ -377,6 +378,7 @@ class dolReceiptPrinter extends Escpos
|
||||
return $error;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to Update a printer in db
|
||||
*
|
||||
@ -387,9 +389,9 @@ class dolReceiptPrinter extends Escpos
|
||||
* @param int $printerid Printer id
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function UpdatePrinter($name, $type, $profile, $parameter, $printerid)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt';
|
||||
@ -406,15 +408,16 @@ class dolReceiptPrinter extends Escpos
|
||||
return $error;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to Delete a printer from db
|
||||
*
|
||||
* @param int $printerid Printer id
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DeletePrinter($printerid)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt';
|
||||
@ -427,6 +430,7 @@ class dolReceiptPrinter extends Escpos
|
||||
return $error;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to Update a printer template in db
|
||||
*
|
||||
@ -435,9 +439,9 @@ class dolReceiptPrinter extends Escpos
|
||||
* @param int $templateid Template id
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function UpdateTemplate($name, $template, $templateid)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template';
|
||||
@ -453,15 +457,16 @@ class dolReceiptPrinter extends Escpos
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to Send Test page to Printer
|
||||
*
|
||||
* @param int $printerid Printer id
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SendTestToPrinter($printerid)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png');
|
||||
@ -488,6 +493,7 @@ class dolReceiptPrinter extends Escpos
|
||||
return $error;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to Print Receipt Ticket
|
||||
*
|
||||
@ -496,9 +502,9 @@ class dolReceiptPrinter extends Escpos
|
||||
* @param int $printerid Printer id
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SendToPrinter($object, $templateid, $printerid)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$ret = $this->loadTemplate($templateid);
|
||||
@ -652,15 +658,16 @@ class dolReceiptPrinter extends Escpos
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function Init Printer
|
||||
*
|
||||
* @param int $printerid Printer id
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function InitPrinter($printerid)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$error=0;
|
||||
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';
|
||||
|
||||
@ -319,6 +319,7 @@ class EmailSenderProfile extends CommonObject
|
||||
return $this->LibStatut($this->status,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return the status
|
||||
*
|
||||
@ -326,43 +327,36 @@ class EmailSenderProfile extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function LibStatut($status,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
$prefix='';
|
||||
if ($status == 1) return $langs->trans('Enabled');
|
||||
if ($status == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 1)
|
||||
if ($mode == 0 || $mode == 1)
|
||||
{
|
||||
if ($status == 1) return $langs->trans('Enabled');
|
||||
if ($status == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||
}
|
||||
if ($mode == 6)
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||
|
||||
@ -95,7 +95,7 @@ class ExtraFields
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
|
||||
var $errno;
|
||||
|
||||
|
||||
@ -293,6 +293,7 @@ class ExtraFields
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Add description of a new optional attribute
|
||||
*
|
||||
@ -316,9 +317,9 @@ class ExtraFields
|
||||
* @param string $enabled Condition to have the field enabled or not
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list='-1', $help='', $default='', $computed='',$entity='', $langfile='', $enabled='1')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user;
|
||||
|
||||
if ($elementtype == 'thirdparty') $elementtype='societe';
|
||||
@ -463,6 +464,7 @@ class ExtraFields
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Delete description of an optional attribute
|
||||
*
|
||||
@ -470,9 +472,9 @@ class ExtraFields
|
||||
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
|
||||
* @return int < 0 if KO, 0 if nothing is done, 1 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function delete_label($attrname, $elementtype='member')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
if ($elementtype == 'thirdparty') $elementtype='societe';
|
||||
@ -612,6 +614,7 @@ class ExtraFields
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Modify description of personalized attribute
|
||||
*
|
||||
@ -636,9 +639,9 @@ class ExtraFields
|
||||
* @param int $totalizable Is extrafield totalizable on list
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1', $totalizable=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled.", ".$totalizable);
|
||||
|
||||
@ -759,6 +762,7 @@ class ExtraFields
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ...
|
||||
*
|
||||
@ -766,9 +770,9 @@ class ExtraFields
|
||||
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED. Deprecated. Should not be required.
|
||||
* @return array Array of attributes keys+label for all extra fields.
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_name_optionals_label($elementtype,$forceload=false)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
if (empty($elementtype)) return array();
|
||||
|
||||
@ -261,6 +261,7 @@ class Fiscalyear extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Give a label from a status
|
||||
*
|
||||
@ -268,38 +269,38 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
return $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8');
|
||||
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]);
|
||||
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -653,6 +653,7 @@ class Form
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return combo list of activated countries, into language of user
|
||||
*
|
||||
@ -666,9 +667,9 @@ class Form
|
||||
* @param int $disablefavorites Disable favorites
|
||||
* @return string HTML string with select
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$langs->load("dict");
|
||||
@ -750,6 +751,7 @@ class Form
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return select list of incoterms
|
||||
*
|
||||
@ -762,9 +764,9 @@ class Form
|
||||
* @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @return string HTML string with select and input
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_incoterms($selected='', $location_incoterms='', $page='', $htmlname='incoterm_id', $htmloption='', $forcecombo=1, $events=array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$langs->load("dict");
|
||||
@ -843,6 +845,7 @@ class Form
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of types of lines (product or service)
|
||||
* Example: 0=product, 1=service, 9=other (for external module)
|
||||
@ -854,9 +857,9 @@ class Form
|
||||
* @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service')
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db,$langs,$user,$conf;
|
||||
|
||||
// If product & services are enabled or both disabled.
|
||||
@ -899,14 +902,15 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load into cache cache_types_fees, array of types of fees
|
||||
*
|
||||
* @return int Nb of lines loaded, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_cache_types_fees()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$num = count($this->cache_types_fees);
|
||||
@ -947,6 +951,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of types of notes
|
||||
*
|
||||
@ -955,9 +960,9 @@ class Form
|
||||
* @param int $showempty Add an empty field
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_type_fees($selected='',$htmlname='type',$showempty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $langs;
|
||||
|
||||
dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
|
||||
@ -986,6 +991,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return HTML code to select a company.
|
||||
*
|
||||
@ -998,12 +1004,13 @@ class Form
|
||||
* @return string Return select box for thirdparty.
|
||||
* @deprecated 3.8 Use select_company instead. For exemple $form->select_thirdparty(GETPOST('socid'),'socid','',0) => $form->select_company(GETPOST('socid'),'socid','',1,0,0,array(),0)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_thirdparty($selected='', $htmlname='socid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0, $limit);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output html form to select a third party
|
||||
*
|
||||
@ -1023,9 +1030,9 @@ class Form
|
||||
* @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter)
|
||||
* @return string HTML string with select box for thirdparty.
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array(), $multiple=false)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user,$langs;
|
||||
|
||||
$out='';
|
||||
@ -1067,6 +1074,7 @@ class Form
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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.
|
||||
@ -1086,9 +1094,9 @@ class Form
|
||||
* @param bool $multiple add [] in the name of element and add 'multiple' attribut
|
||||
* @return string HTML string with
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='', $multiple=false)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user,$langs;
|
||||
|
||||
$out='';
|
||||
@ -1249,6 +1257,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return HTML combo list of absolute discounts
|
||||
*
|
||||
@ -1259,9 +1268,9 @@ class Form
|
||||
* @param int $maxvalue Max value for lines that can be selected
|
||||
* @return int Return number of qualifed lines in list
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_remises($selected, $htmlname, $filter, $socid, $maxvalue=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
// On recherche les remises
|
||||
@ -1325,6 +1334,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of all contacts (for a third party or all)
|
||||
*
|
||||
@ -1345,9 +1355,9 @@ class Form
|
||||
* @return int <0 if KO, Nb of contact in list if OK
|
||||
* @deprected You can use selectcontacts directly (warning order of param was changed)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $events=array(), $options_only=false, $moreparam='', $htmlid='')
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid);
|
||||
return $this->num;
|
||||
}
|
||||
@ -1485,6 +1495,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return select list of users
|
||||
*
|
||||
@ -1500,12 +1511,13 @@ class Form
|
||||
* @deprecated Use select_dolusers instead
|
||||
* @see select_dolusers()
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity='0')
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return select list of users
|
||||
*
|
||||
@ -1529,9 +1541,9 @@ class Form
|
||||
* @return string HTML select string
|
||||
* @see select_dolgroups
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0, $multiple=false)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user,$langs;
|
||||
|
||||
// If no preselected user defined, we take current user
|
||||
@ -1714,6 +1726,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return select list of users. Selected users are stored into session.
|
||||
* List of users are provided into $_SESSION['assignedtouser'].
|
||||
@ -1736,9 +1749,9 @@ class Form
|
||||
* @return string HTML select string
|
||||
* @see select_dolgroups
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$userstatic=new User($this->db);
|
||||
@ -1803,6 +1816,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
|
||||
*
|
||||
@ -1828,9 +1842,9 @@ class Form
|
||||
* @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='', $selected_combinations = array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
$price_level = (! empty($price_level) ? $price_level : 0);
|
||||
@ -1946,6 +1960,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of products for a customer
|
||||
*
|
||||
@ -1969,9 +1984,9 @@ class Form
|
||||
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only
|
||||
* @return array Array of keys for json
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0,$morecss='',$hidepriceinlabel=0, $warehouseStatus='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf,$user,$db;
|
||||
|
||||
$out='';
|
||||
@ -2433,6 +2448,7 @@ class Form
|
||||
$optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>$outprice_ht, 'price_ttc'=>$outprice_ttc, 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)
|
||||
*
|
||||
@ -2446,9 +2462,9 @@ class Form
|
||||
* @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_produits_fournisseurs($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $ajaxoptions=array(), $hidelabel=0, $alsoproductwithnosupplierprice=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
global $price_level, $status, $finished;
|
||||
|
||||
@ -2475,6 +2491,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of suppliers products
|
||||
*
|
||||
@ -2490,9 +2507,9 @@ class Form
|
||||
* @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices
|
||||
* @return array Array of keys for json
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0,$limit=100,$alsoproductwithnosupplierprice=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf,$db;
|
||||
|
||||
$out='';
|
||||
@ -2705,6 +2722,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of suppliers prices for a product
|
||||
*
|
||||
@ -2713,9 +2731,9 @@ class Form
|
||||
* @param int $selected_supplier Pre-selected supplier if more than 1 result
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_product_fourn_price($productid, $htmlname='productfournpriceid', $selected_supplier='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
$langs->load('stocks');
|
||||
@ -2817,6 +2835,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of delivery address
|
||||
*
|
||||
@ -2826,10 +2845,10 @@ class Form
|
||||
* @param int $showempty Add an empty field
|
||||
* @return integer|null
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_address($selected, $socid, $htmlname='address_id',$showempty=0)
|
||||
{
|
||||
// On recherche les utilisateurs
|
||||
// phpcs:enable
|
||||
// looking for users
|
||||
$sql = "SELECT a.rowid, a.label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX ."societe_address as a";
|
||||
$sql .= " WHERE a.fk_soc = ".$socid;
|
||||
@ -2870,14 +2889,15 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load into cache list of payment terms
|
||||
*
|
||||
* @return int Nb of lines loaded, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_cache_conditions_paiements()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$num = count($this->cache_conditions_paiements);
|
||||
@ -2918,14 +2938,15 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge dans cache la liste des délais de livraison possibles
|
||||
*
|
||||
* @return int Nb of lines loaded, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_cache_availability()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$num = count($this->cache_availability);
|
||||
@ -3085,14 +3106,15 @@ class Form
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge dans cache la liste des types de paiements possibles
|
||||
*
|
||||
* @return int Nb of lines loaded, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_cache_types_paiements()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$num=count($this->cache_types_paiements);
|
||||
@ -3138,6 +3160,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return 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.
|
||||
@ -3151,9 +3174,9 @@ class Form
|
||||
* @param string $morecss Add more CSS on select tag
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_conditions_paiements($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $user, $conf;
|
||||
|
||||
dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
|
||||
@ -3183,6 +3206,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of payment methods
|
||||
*
|
||||
@ -3197,9 +3221,9 @@ class Form
|
||||
* @param string $morecss Add more CSS on select tag
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$user;
|
||||
|
||||
dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
|
||||
@ -3459,6 +3483,7 @@ class Form
|
||||
return $return;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a HTML select list of bank accounts
|
||||
*
|
||||
@ -3471,9 +3496,9 @@ class Form
|
||||
* @param int $showcurrency Show currency in label
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0,$moreattrib='',$showcurrency=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
$langs->load("admin");
|
||||
@ -3563,6 +3588,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of categories having choosed type
|
||||
*
|
||||
@ -3575,9 +3601,9 @@ class Form
|
||||
* @return string
|
||||
* @see select_categories
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0, $outputmode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
$langs->load("categories");
|
||||
|
||||
@ -3649,6 +3675,7 @@ class Form
|
||||
return $output;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a confirmation HTML form or AJAX popup
|
||||
*
|
||||
@ -3665,9 +3692,9 @@ class Form
|
||||
* @deprecated
|
||||
* @see formconfirm()
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500)
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
|
||||
}
|
||||
|
||||
@ -3961,6 +3988,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a form to select a project
|
||||
*
|
||||
@ -3974,9 +4002,9 @@ class Form
|
||||
* @param int $nooutput No print is done. String is returned.
|
||||
* @return string Return html content
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0, $nooutput=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||
@ -4020,6 +4048,7 @@ class Form
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a form to select payment conditions
|
||||
*
|
||||
@ -4029,9 +4058,9 @@ class Form
|
||||
* @param int $addempty Add empty entry
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
if ($htmlname != "none")
|
||||
{
|
||||
@ -4054,6 +4083,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a form to select a delivery delay
|
||||
*
|
||||
@ -4063,9 +4093,9 @@ class Form
|
||||
* @param int $addempty Ajoute entree vide
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_availability($page, $selected='', $htmlname='availability', $addempty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
if ($htmlname != "none")
|
||||
{
|
||||
@ -4129,6 +4159,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a form + html select a date
|
||||
*
|
||||
@ -4141,9 +4172,9 @@ class Form
|
||||
* @return string
|
||||
* @see select_date
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$ret='';
|
||||
@ -4171,6 +4202,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a select form to choose a user
|
||||
*
|
||||
@ -4181,9 +4213,9 @@ class Form
|
||||
* @param array $include List of users id to include
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_users($page, $selected='', $htmlname='userid', $exclude='', $include='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($htmlname != "none")
|
||||
@ -4210,6 +4242,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show form with payment mode
|
||||
*
|
||||
@ -4220,9 +4253,9 @@ class Form
|
||||
* @param int $active Active or not, -1 = all
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
if ($htmlname != "none")
|
||||
{
|
||||
@ -4245,6 +4278,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show form with multicurrency code
|
||||
*
|
||||
@ -4253,9 +4287,9 @@ class Form
|
||||
* @param string $htmlname Name of select html field
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_multicurrency_code($page, $selected='', $htmlname='multicurrency_code')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
if ($htmlname != "none")
|
||||
{
|
||||
@ -4273,6 +4307,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show form with multicurrency rate
|
||||
*
|
||||
@ -4282,9 +4317,9 @@ class Form
|
||||
* @param string $currency Currency code to explain the rate
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $mysoc, $conf;
|
||||
|
||||
if ($htmlname != "none")
|
||||
@ -4315,6 +4350,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a select box with available absolute discounts
|
||||
*
|
||||
@ -4330,9 +4366,9 @@ class Form
|
||||
* @param int $discount_type 0 => customer discount, 1 => supplier discount
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0, $discount_type=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
if ($htmlname != "none")
|
||||
{
|
||||
@ -4411,6 +4447,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show forms to select a contact
|
||||
*
|
||||
@ -4420,9 +4457,9 @@ class Form
|
||||
* @param string $htmlname Name of HTML select. If 'none', we just show contact link.
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_contacts($page, $societe, $selected='', $htmlname='contactid')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
if ($htmlname != "none")
|
||||
@ -4456,6 +4493,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output html select to select thirdparty
|
||||
*
|
||||
@ -4469,9 +4507,9 @@ class Form
|
||||
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_thirdparty($page, $selected='', $htmlname='socid', $filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($htmlname != "none")
|
||||
@ -4499,6 +4537,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne la liste des devises, dans la langue de l'utilisateur
|
||||
*
|
||||
@ -4506,9 +4545,9 @@ class Form
|
||||
* @param string $htmlname name of HTML select list
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_currency($selected='',$htmlname='currency_id')
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->selectCurrency($selected,$htmlname);
|
||||
}
|
||||
|
||||
@ -4611,15 +4650,16 @@ class Form
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load into the cache vat rates of a country
|
||||
*
|
||||
* @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'")
|
||||
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_cache_vatrates($country_code)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$num = count($this->cache_vatrates);
|
||||
@ -4677,6 +4717,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output an HTML select vat rate.
|
||||
* The name of this function should be selectVat. We keep bad name for compatibility purpose.
|
||||
@ -4698,9 +4739,9 @@ class Form
|
||||
* @param int $mode 0=Use vat rate as key in combo list, 1=Add VAT code after vat rate into key, -1=Use id of vat line as key
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
$langs->load('errors');
|
||||
@ -4865,6 +4906,7 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes.
|
||||
* Fields are preselected with :
|
||||
@ -4888,9 +4930,9 @@ class Form
|
||||
* @return string|null Nothing or string if nooutput is 1
|
||||
* @see form_date, select_month, select_year, select_dayofweek
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$retstring='';
|
||||
@ -5241,6 +5283,7 @@ class Form
|
||||
return;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to show a form to select a duration on a page
|
||||
*
|
||||
@ -5254,9 +5297,9 @@ class Form
|
||||
* @param int $nooutput Do not output html string but return it
|
||||
* @return string|null
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$retstring='';
|
||||
@ -6440,6 +6483,7 @@ class Form
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of export templates
|
||||
*
|
||||
@ -6449,10 +6493,9 @@ class Form
|
||||
* @param int $useempty Affiche valeur vide dans liste
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$sql = "SELECT rowid, label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
@ -6821,6 +6864,7 @@ class Form
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return select list of groups
|
||||
*
|
||||
@ -6836,9 +6880,9 @@ class Form
|
||||
* @return string
|
||||
* @see select_dolusers
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity='0', $multiple=false)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user,$langs;
|
||||
|
||||
// Permettre l'exclusion de groupes
|
||||
|
||||
@ -39,7 +39,7 @@ class FormAccounting extends Form
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -55,6 +55,7 @@ class FormAccounting extends Form
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of journals with label by nature
|
||||
*
|
||||
@ -69,9 +70,9 @@ class FormAccounting extends Form
|
||||
* @param int $disabledajaxcombo Disable ajax combo box.
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_journal($selectid, $htmlname = 'journal', $nature=0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='', $disabledajaxcombo=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$out = '';
|
||||
@ -137,6 +138,7 @@ class FormAccounting extends Form
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of accounting category.
|
||||
* Use mysoc->country_id or mysoc->country_code so they must be defined.
|
||||
@ -149,9 +151,9 @@ class FormAccounting extends Form
|
||||
* @param int $allcountries All countries
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_accounting_category($selected='',$htmlname='account_category', $useempty=0, $maxlen=0, $help=1, $allcountries=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db,$langs,$user,$mysoc;
|
||||
|
||||
if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries))
|
||||
@ -218,6 +220,7 @@ class FormAccounting extends Form
|
||||
print $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return select filter with date of transaction
|
||||
*
|
||||
@ -225,9 +228,9 @@ class FormAccounting extends Form
|
||||
* @param string $selectedkey Value
|
||||
* @return string HTML edit field
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
$options = array();
|
||||
|
||||
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
|
||||
@ -250,6 +253,7 @@ class FormAccounting extends Form
|
||||
return Form::selectarray($htmlname, $options, $selectedkey);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of accounts with label by chart of accounts
|
||||
*
|
||||
@ -263,9 +267,9 @@ class FormAccounting extends Form
|
||||
* @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache.
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
@ -342,6 +346,7 @@ class FormAccounting extends Form
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of auxilary thirdparty accounts
|
||||
*
|
||||
@ -351,9 +356,9 @@ class FormAccounting extends Form
|
||||
* @param string $morecss More css
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200')
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
$aux_account = array();
|
||||
|
||||
@ -403,6 +408,7 @@ class FormAccounting extends Form
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return HTML combo list of years existing into book keepping
|
||||
*
|
||||
@ -412,9 +418,9 @@ class FormAccounting extends Form
|
||||
* @param string $output_format (html/opton (for option html only)/array (to return options arrays
|
||||
* @return string/array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$out_array = array();
|
||||
|
||||
@ -33,7 +33,7 @@ class FormActions
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -52,6 +52,7 @@ class FormActions
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show list of action status
|
||||
*
|
||||
@ -64,9 +65,9 @@ class FormActions
|
||||
* @param string $morecss More css on select field
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_select_status_action($formname, $selected, $canedit=1, $htmlname='complete', $showempty=0, $onlyselect=0, $morecss='maxwidth100')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
$listofstatus = array(
|
||||
@ -314,6 +315,7 @@ class FormActions
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output html select list of type of event
|
||||
*
|
||||
@ -326,9 +328,9 @@ class FormActions
|
||||
* @param int $nooutput 1=No output
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$user,$form,$conf;
|
||||
|
||||
if (! is_object($form)) $form=new Form($db);
|
||||
|
||||
@ -29,15 +29,8 @@
|
||||
*/
|
||||
class FormAdmin
|
||||
{
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
|
||||
/**
|
||||
@ -51,6 +44,7 @@ class FormAdmin
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return html select list with available languages (key='en_US', value='United States' for example)
|
||||
*
|
||||
@ -66,9 +60,9 @@ class FormAdmin
|
||||
* @param int $forcecombo Force to use combo box (so no ajax beautify effect)
|
||||
* @return string Return HTML select string with list of languages
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT,12);
|
||||
@ -127,6 +121,7 @@ class FormAdmin
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of available menus (eldy_backoffice, ...)
|
||||
*
|
||||
@ -136,9 +131,9 @@ class FormAdmin
|
||||
* @param string $moreattrib More attributes on html select tag
|
||||
* @return integer|null
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
// Clean parameters
|
||||
@ -217,6 +212,7 @@ class FormAdmin
|
||||
print '</select>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return combo list of available menu families
|
||||
*
|
||||
@ -225,9 +221,9 @@ class FormAdmin
|
||||
* @param string[] $dirmenuarray Directories to scan
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_menu_families($selected, $htmlname, $dirmenuarray)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
//$expdevmenu=array('smartphone_backoffice.php','smartphone_frontoffice.php'); // Menu to disable if $conf->global->MAIN_FEATURES_LEVEL is not set
|
||||
@ -289,6 +285,7 @@ class FormAdmin
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a HTML select list of timezones
|
||||
*
|
||||
@ -296,9 +293,9 @@ class FormAdmin
|
||||
* @param string $htmlname Nom de la zone select
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_timezone($selected,$htmlname)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
|
||||
@ -342,6 +339,7 @@ class FormAdmin
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return html select list with available languages (key='en_US', value='United States' for example)
|
||||
*
|
||||
@ -351,9 +349,9 @@ class FormAdmin
|
||||
* @param int $showempty Add empty value
|
||||
* @return string Return HTML output
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_paper_format($selected='',$htmlname='paperformat_id',$filter=0,$showempty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$langs->load("dict");
|
||||
|
||||
@ -41,9 +41,9 @@ class FormBarCode
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
@ -104,18 +104,19 @@ class FormBarCode
|
||||
return $select_encoder;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Print form to select type of barcode
|
||||
*
|
||||
* @param int $selected Id code pre-selected
|
||||
* @param string $htmlname Name of HTML select field
|
||||
* @param int $useempty Affiche valeur vide dans liste
|
||||
* @return void
|
||||
* @param int $selected Id code pre-selected
|
||||
* @param string $htmlname Name of HTML select field
|
||||
* @param int $useempty Affiche valeur vide dans liste
|
||||
* @return void
|
||||
* @deprecated
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_barcode_type($selected='', $htmlname='barcodetype_id', $useempty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->selectBarcodeType($selected, $htmlname, $useempty);
|
||||
}
|
||||
|
||||
@ -173,6 +174,7 @@ class FormBarCode
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show form to select type of barcode
|
||||
*
|
||||
@ -182,9 +184,9 @@ class FormBarCode
|
||||
* @return void
|
||||
* @deprecated
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_barcode_type($page, $selected='', $htmlname='barcodetype_id')
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->formBarcodeType($page, $selected, $htmlname);
|
||||
}
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ class FormCompany
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -54,6 +54,7 @@ class FormCompany
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of labels (translated) of third parties type
|
||||
*
|
||||
@ -61,9 +62,9 @@ class FormCompany
|
||||
* @param string $filter Add a SQL filter to select
|
||||
* @return array Array of types
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function typent_array($mode=0, $filter='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$mysoc;
|
||||
|
||||
$effs = array();
|
||||
@ -96,6 +97,7 @@ class FormCompany
|
||||
return $effs;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie la liste des types d'effectifs possibles (pas de traduction car nombre)
|
||||
*
|
||||
@ -103,9 +105,9 @@ class FormCompany
|
||||
* @param string $filter Add a SQL filter to select
|
||||
* @return array Array of types d'effectifs
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function effectif_array($mode=0, $filter='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$effs = array();
|
||||
|
||||
$sql = "SELECT id, code, libelle";
|
||||
@ -135,6 +137,7 @@ class FormCompany
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Affiche formulaire de selection des modes de reglement
|
||||
*
|
||||
@ -144,9 +147,9 @@ class FormCompany
|
||||
* @param int $empty Add empty value in list
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $langs;
|
||||
|
||||
print '<form method="post" action="'.$page.'">';
|
||||
@ -185,6 +188,7 @@ class FormCompany
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne.
|
||||
* Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays.
|
||||
@ -197,12 +201,13 @@ class FormCompany
|
||||
* @param string $htmlname Id of department
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_departement($selected='',$country_codeid=0, $htmlname='state_id')
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->select_state($selected,$country_codeid, $htmlname);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne.
|
||||
* Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays.
|
||||
@ -216,9 +221,9 @@ class FormCompany
|
||||
* @return string String with HTML select
|
||||
* @see select_country
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_state($selected='',$country_codeid=0, $htmlname='state_id')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$user;
|
||||
|
||||
dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid,LOG_DEBUG);
|
||||
@ -318,6 +323,7 @@ class FormCompany
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne la liste deroulante des regions actives dont le pays est actif
|
||||
* La cle de la liste est le code (il peut y avoir plusieurs entree pour
|
||||
@ -328,9 +334,9 @@ class FormCompany
|
||||
* @param string $htmlname Name of HTML select field
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_region($selected='',$htmlname='region_id')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
$langs->load("dict");
|
||||
|
||||
@ -385,6 +391,7 @@ class FormCompany
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return combo list with people title
|
||||
*
|
||||
@ -393,9 +400,9 @@ class FormCompany
|
||||
* @param string $morecss Add more css on SELECT element
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$user;
|
||||
$langs->load("dict");
|
||||
|
||||
@ -442,6 +449,7 @@ class FormCompany
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne.
|
||||
* Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays.
|
||||
@ -453,12 +461,13 @@ class FormCompany
|
||||
* @deprecated Use print xxx->select_juridicalstatus instead
|
||||
* @see select_juridicalstatus()
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_forme_juridique($selected='', $country_codeid=0, $filter='')
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->select_juridicalstatus($selected, $country_codeid, $filter);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne.
|
||||
* Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays
|
||||
@ -469,9 +478,9 @@ class FormCompany
|
||||
* @param string $htmlname HTML name of select
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$user;
|
||||
$langs->load("dict");
|
||||
|
||||
@ -754,6 +763,7 @@ class FormCompany
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a select list with zip codes and their town
|
||||
*
|
||||
@ -766,9 +776,9 @@ class FormCompany
|
||||
* @param string $morecss More css
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$out='';
|
||||
@ -786,6 +796,7 @@ class FormCompany
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return HTML string to use as input of professional id into a HTML page (siren, siret, etc...)
|
||||
*
|
||||
@ -796,9 +807,9 @@ class FormCompany
|
||||
* @param string $morecss More css
|
||||
* @return string HTML string with prof id
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_input_id_prof($idprof,$htmlname,$preselected,$country_code,$morecss='maxwidth100onsmartphone quatrevingtpercent')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$formlength=0;
|
||||
@ -837,6 +848,7 @@ class FormCompany
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a HTML select with localtax values for thirdparties
|
||||
*
|
||||
@ -845,13 +857,13 @@ class FormCompany
|
||||
* @param string $htmlname HTML select name
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_localtax($local, $selected, $htmlname)
|
||||
{
|
||||
$tax=get_localtax_by_third($local);
|
||||
// phpcs:enable
|
||||
$tax=get_localtax_by_third($local);
|
||||
|
||||
$num = $this->db->num_rows($tax);
|
||||
$i = 0;
|
||||
$num = $this->db->num_rows($tax);
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
$valors=explode(":", $tax);
|
||||
|
||||
@ -49,6 +49,7 @@ class FormContract
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a combo list with contracts qualified for a third party
|
||||
*
|
||||
@ -59,9 +60,9 @@ class FormContract
|
||||
* @param int $showempty Show empty line
|
||||
* @return int Nbr of project if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_contract($socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db,$user,$conf,$langs;
|
||||
|
||||
$hideunselectables = false;
|
||||
|
||||
@ -32,7 +32,7 @@ class FormCron extends Form
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -50,6 +50,7 @@ class FormCron extends Form
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Display On Off selector
|
||||
*
|
||||
@ -58,9 +59,9 @@ class FormCron extends Form
|
||||
* @param integer $readonly Select is read only or not
|
||||
* @return string HTML select field
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_typejob($htmlname,$selected=0,$readonly=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$langs->load('cron@cron');
|
||||
|
||||
@ -58,6 +58,7 @@ class FormFile
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show form to upload a new file.
|
||||
*
|
||||
@ -77,9 +78,9 @@ class FormFile
|
||||
* @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='', $sectiondir='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs, $hookmanager;
|
||||
$hookmanager->initHooks(array('formfile'));
|
||||
|
||||
@ -231,6 +232,7 @@ class FormFile
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show the box with list of available documents for object
|
||||
*
|
||||
@ -253,9 +255,9 @@ class FormFile
|
||||
* @return int <0 if KO, number of shown files if OK
|
||||
* @deprecated Use print xxx->showdocuments() instead.
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->numoffiles=0;
|
||||
print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang);
|
||||
return $this->numoffiles;
|
||||
@ -981,6 +983,7 @@ class FormFile
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show list of documents in $filearray (may be they are all in same directory but may not)
|
||||
* This also sync database if $upload_dir is defined.
|
||||
@ -1010,9 +1013,9 @@ class FormFile
|
||||
* @return int <0 if KO, nb of files shown if OK
|
||||
* @see list_of_autoecmfiles
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $conf, $langs, $hookmanager;
|
||||
global $sortfield, $sortorder, $maxheightmini;
|
||||
global $dolibarr_main_url_root;
|
||||
@ -1379,6 +1382,7 @@ class FormFile
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show list of documents in a directory
|
||||
*
|
||||
@ -1397,9 +1401,9 @@ class FormFile
|
||||
* @return int <0 if KO, nb of files shown if OK
|
||||
* @see list_of_documents
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $conf, $langs, $form;
|
||||
global $sortfield, $sortorder;
|
||||
global $search_doc_ref;
|
||||
|
||||
@ -31,7 +31,7 @@ class FormIntervention
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -49,6 +49,7 @@ class FormIntervention
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show a combo list with contracts qualified for a third party
|
||||
*
|
||||
@ -59,9 +60,9 @@ class FormIntervention
|
||||
* @param int $showempty Show empty line
|
||||
* @return int Nbre of project if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_interventions($socid=-1, $selected='', $htmlname='interventionid', $maxlength=16, $showempty=1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db,$user,$conf,$langs;
|
||||
|
||||
$out='';
|
||||
|
||||
@ -136,14 +136,15 @@ class FormMail extends Form
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Clear list of attached files in send mail form (also stored in session)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function clear_attached_files()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
@ -158,6 +159,7 @@ class FormMail extends Form
|
||||
unset($_SESSION["listofmimes".$keytoavoidconflict]);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add a file into the list of attached files (stored in SECTION array)
|
||||
*
|
||||
@ -166,9 +168,9 @@ class FormMail extends Form
|
||||
* @param string $type Mime type (can be dol_mimetype($file))
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_attached_files($path, $file='', $type='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$listofpaths=array();
|
||||
$listofnames=array();
|
||||
$listofmimes=array();
|
||||
@ -191,15 +193,16 @@ class FormMail extends Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Remove a file from the list of attached files (stored in SECTION array)
|
||||
*
|
||||
* @param string $keytodelete Key in file array (0, 1, 2, ...)
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function remove_attached_files($keytodelete)
|
||||
{
|
||||
// phpcs:enable
|
||||
$listofpaths=array();
|
||||
$listofnames=array();
|
||||
$listofmimes=array();
|
||||
@ -220,14 +223,15 @@ class FormMail extends Form
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of attached files (stored in SECTION array)
|
||||
*
|
||||
* @return array array('paths'=> ,'names'=>, 'mimes'=> )
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_attached_files()
|
||||
{
|
||||
// phpcs:enable
|
||||
$listofpaths=array();
|
||||
$listofnames=array();
|
||||
$listofmimes=array();
|
||||
@ -239,6 +243,7 @@ class FormMail extends Form
|
||||
return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show the form to input an email
|
||||
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
|
||||
@ -248,12 +253,13 @@ class FormMail extends Form
|
||||
* @param string $removefileaction Name of action when removing file attachments
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function show_form($addfileaction='addfile',$removefileaction='removefile')
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->get_form($addfileaction,$removefileaction);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get the form to input an email
|
||||
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
|
||||
@ -264,9 +270,9 @@ class FormMail extends Form
|
||||
* @param string $removefileaction Name of action when removing file attachments
|
||||
* @return string Form to show
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_form($addfileaction='addfile', $removefileaction='removefile')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $user, $hookmanager, $form;
|
||||
|
||||
if (! is_object($form)) $form=new Form($this->db);
|
||||
|
||||
@ -58,6 +58,7 @@ class FormOther
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return HTML select list of export models
|
||||
*
|
||||
@ -68,13 +69,13 @@ class FormOther
|
||||
* @param int $fk_user Utilisateur créant le modèle
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_export_model($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "SELECT rowid, label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
if(!empty($fk_user))$sql.=" AND fk_user=".$fk_user;
|
||||
if (!empty($fk_user)) $sql.=" AND fk_user=".$fk_user;
|
||||
$sql.= " ORDER BY rowid";
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
@ -110,6 +111,7 @@ class FormOther
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of export models
|
||||
*
|
||||
@ -119,9 +121,9 @@ class FormOther
|
||||
* @param int $useempty Affiche valeur vide dans liste
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_import_model($selected='', $htmlname='importmodelid', $type='', $useempty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "SELECT rowid, label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."import_model";
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
@ -160,6 +162,7 @@ class FormOther
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of ecotaxes with label
|
||||
*
|
||||
@ -167,9 +170,9 @@ class FormOther
|
||||
* @param string $htmlname Name of combo list
|
||||
* @return integer
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_ecotaxes($selected='', $htmlname='ecotaxe_id')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT e.rowid, e.code, e.label, e.price, e.organization,";
|
||||
@ -217,6 +220,7 @@ class FormOther
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of revenue stamp for country
|
||||
*
|
||||
@ -225,9 +229,9 @@ class FormOther
|
||||
* @param string $country_code Country Code
|
||||
* @return string HTML select list
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_revenue_stamp($selected='', $htmlname='revenuestamp', $country_code='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$out='';
|
||||
@ -275,6 +279,7 @@ class FormOther
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a HTML select list to select a percent
|
||||
*
|
||||
@ -287,9 +292,9 @@ class FormOther
|
||||
* @param int $showempty Add also an empty line
|
||||
* @return string HTML select string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100,$showempty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$return = '<select class="flat" name="'.$htmlname.'" '.($disabled?'disabled':'').'>';
|
||||
if ($showempty) $return.='<option value="-1"'.(($selected == -1 || $selected == '')?' selected':'').'> </option>';
|
||||
|
||||
@ -312,6 +317,7 @@ class FormOther
|
||||
return $return;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return select list for categories (to use in form search selectors)
|
||||
*
|
||||
@ -324,9 +330,9 @@ class FormOther
|
||||
* @return string Html combo list code
|
||||
* @see select_all_categories
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_categories($type, $selected=0, $htmlname='search_categ', $nocateg=0, $showempty=1, $morecss='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
@ -373,6 +379,7 @@ class FormOther
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return select list for categories (to use in form search selectors)
|
||||
*
|
||||
@ -384,9 +391,9 @@ class FormOther
|
||||
* @param string $morecss More CSS
|
||||
* @return string Html combo list code
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0,$showempty=1,$morecss='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
$langs->load('users');
|
||||
|
||||
@ -628,6 +635,7 @@ class FormOther
|
||||
else print $textifnotdefined;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output a HTML code to select a color
|
||||
*
|
||||
@ -640,9 +648,9 @@ class FormOther
|
||||
* @deprecated Use instead selectColor
|
||||
* @see selectColor()
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='')
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors);
|
||||
}
|
||||
|
||||
@ -746,6 +754,7 @@ class FormOther
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Creation d'un icone de couleur
|
||||
*
|
||||
@ -756,9 +765,9 @@ class FormOther
|
||||
* @param int $y Hauteur de l'image en pixels
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function CreateColorIcon($color,$module,$name,$x='12',$y='12')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$file = $conf->$module->dir_temp.'/'.$name.'.png';
|
||||
@ -786,6 +795,7 @@ class FormOther
|
||||
ImageDestroy($image);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return HTML combo list of week
|
||||
*
|
||||
@ -794,18 +804,20 @@ class FormOther
|
||||
* @param int $useempty Affiche valeur vide dans liste
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_dayofweek($selected='',$htmlname='weekid',$useempty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$week = array( 0=>$langs->trans("Day0"),
|
||||
1=>$langs->trans("Day1"),
|
||||
2=>$langs->trans("Day2"),
|
||||
3=>$langs->trans("Day3"),
|
||||
4=>$langs->trans("Day4"),
|
||||
5=>$langs->trans("Day5"),
|
||||
6=>$langs->trans("Day6"));
|
||||
$week = array(
|
||||
0=>$langs->trans("Day0"),
|
||||
1=>$langs->trans("Day1"),
|
||||
2=>$langs->trans("Day2"),
|
||||
3=>$langs->trans("Day3"),
|
||||
4=>$langs->trans("Day4"),
|
||||
5=>$langs->trans("Day5"),
|
||||
6=>$langs->trans("Day6")
|
||||
);
|
||||
|
||||
$select_week = '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($useempty)
|
||||
@ -829,6 +841,7 @@ class FormOther
|
||||
return $select_week;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return HTML combo list of month
|
||||
*
|
||||
@ -839,9 +852,9 @@ class FormOther
|
||||
* @param string $morecss More Css
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_month($selected='', $htmlname='monthid', $useempty=0, $longlabel=0, $morecss='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
@ -871,6 +884,7 @@ class FormOther
|
||||
return $select_month;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return HTML combo list of years
|
||||
*
|
||||
@ -885,9 +899,9 @@ class FormOther
|
||||
* @param string $morecss More CSS
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto')
|
||||
{
|
||||
// phpcs:enable
|
||||
print $this->selectyear($selected,$htmlname,$useempty,$min_year,$max_year,$offset,$invert,$option,$morecss);
|
||||
}
|
||||
|
||||
@ -944,6 +958,7 @@ class FormOther
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show form to select address
|
||||
*
|
||||
@ -955,9 +970,9 @@ class FormOther
|
||||
* @param int $originid Id de l'origine
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
global $form;
|
||||
|
||||
@ -1206,6 +1221,7 @@ class FormOther
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a HTML select list of a dictionary
|
||||
*
|
||||
@ -1218,9 +1234,9 @@ class FormOther
|
||||
* @param string $moreattrib More attributes on HTML select tag
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0,$moreattrib='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
@ -33,7 +33,7 @@ class FormProjets
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -51,6 +51,7 @@ class FormProjets
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output a combo list with projects qualified for a third party / user
|
||||
*
|
||||
@ -71,9 +72,9 @@ class FormProjets
|
||||
* @param int $htmlid Html id to use instead of htmlname
|
||||
* @return string Return html content
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0, $morecss='', $htmlid='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf,$form;
|
||||
|
||||
$out='';
|
||||
@ -119,6 +120,7 @@ class FormProjets
|
||||
else return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns an array with projects qualified for a third party
|
||||
*
|
||||
@ -139,9 +141,9 @@ class FormProjets
|
||||
* @param string $morecss More CSS
|
||||
* @return int Nb of project if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '', $nooutput=0, $forceaddid=0, $htmlid='', $morecss='maxwidth500')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$conf,$langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
@ -470,6 +472,7 @@ class FormProjets
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Build a HTML select list of element of same thirdparty to suggest to link them to project
|
||||
*
|
||||
@ -480,9 +483,9 @@ class FormProjets
|
||||
* @param string $projectkey Equivalent key to fk_projet for actual table_element
|
||||
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet")
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
|
||||
|
||||
@ -88,6 +88,7 @@ class FormSms
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show the form to input an sms.
|
||||
*
|
||||
@ -95,9 +96,9 @@ class FormSms
|
||||
* @param int $showform Show form tags and submit button (recommanded is to use with value 0)
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function show_form($morecss='titlefield', $showform=1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $user, $form;
|
||||
|
||||
if (! is_object($form)) $form=new Form($this->db);
|
||||
|
||||
@ -31,7 +31,7 @@ class FormSocialContrib
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -48,9 +48,10 @@ class FormSocialContrib
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of social contributions.
|
||||
* Use mysoc->country_id or mysoc->country_code so they must be defined.
|
||||
* Return list of social contributions.
|
||||
* Use mysoc->country_id or mysoc->country_code so they must be defined.
|
||||
*
|
||||
* @param string $selected Preselected type
|
||||
* @param string $htmlname Name of field in form
|
||||
@ -60,9 +61,9 @@ class FormSocialContrib
|
||||
* @param string $morecss Add more CSS on select
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1, $morecss='minwidth300')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$db,$langs,$user,$mysoc;
|
||||
|
||||
if (empty($mysoc->country_id) && empty($mysoc->country_code))
|
||||
|
||||
@ -35,9 +35,9 @@ class Interfaces
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
var $dir; // Directory with all core and external triggers files
|
||||
|
||||
|
||||
/**
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
@ -53,6 +53,7 @@ class Interfaces
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function called when a Dolibarr business event occurs
|
||||
* This function call all qualified triggers.
|
||||
@ -64,9 +65,9 @@ class Interfaces
|
||||
* @param Conf $conf Objet conf
|
||||
* @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise.
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function run_triggers($action,$object,$user,$langs,$conf)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Check parameters
|
||||
if (! is_object($object) || ! is_object($conf)) // Error
|
||||
{
|
||||
|
||||
@ -38,7 +38,7 @@ class Ldap
|
||||
* @var string[] Array of error strings
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
|
||||
/**
|
||||
* Tableau des serveurs (IP addresses ou nom d'hotes)
|
||||
*/
|
||||
@ -149,6 +149,7 @@ class Ldap
|
||||
|
||||
// Connection handling methods -------------------------------------------
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Connect and bind
|
||||
* Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword
|
||||
@ -156,9 +157,9 @@ class Ldap
|
||||
*
|
||||
* @return int <0 if KO, 1 if bind anonymous, 2 if bind auth
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function connect_bind()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
$connected=0;
|
||||
@ -655,6 +656,7 @@ class Ldap
|
||||
return -1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Build a LDAP message
|
||||
*
|
||||
@ -662,9 +664,9 @@ class Ldap
|
||||
* @param array $info Attributes array
|
||||
* @return string Content of file
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function dump_content($dn, $info)
|
||||
{
|
||||
// phpcs:enable
|
||||
$content='';
|
||||
|
||||
// Create file content
|
||||
@ -1436,15 +1438,16 @@ class Ldap
|
||||
return($retval);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Convertit le temps ActiveDirectory en Unix timestamp
|
||||
*
|
||||
* @param string $value AD time to convert
|
||||
* @return integer Unix timestamp
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function convert_time($value)
|
||||
{
|
||||
// phpcs:enable
|
||||
$dateLargeInt=$value; // nano secondes depuis 1601 !!!!
|
||||
$secsAfterADEpoch = $dateLargeInt / (10000000); // secondes depuis le 1 jan 1601
|
||||
$ADToUnixConvertor=((1970-1601) * 365.242190) * 86400; // UNIX start date - AD start date * jours * secondes
|
||||
|
||||
@ -96,14 +96,15 @@ class Menu
|
||||
$this->liste=array_merge($array_start,$array_new,$array_end);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Remove a menu entry from this->liste
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function remove_last()
|
||||
{
|
||||
// phpcs:enable
|
||||
if (count($this->liste) > 1) {
|
||||
array_pop($this->liste);
|
||||
}
|
||||
|
||||
@ -45,63 +45,68 @@ class SimpleOpenID
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* SetOpenIDServer
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetOpenIDServer($a)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->URLs['openid_server'] = $a;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* SetOpenIDServer
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetTrustRoot($a)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->URLs['trust_root'] = $a;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* SetOpenIDServer
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetCancelURL($a)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->URLs['cancel'] = $a;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* SetApprovedURL
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetApprovedURL($a)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->URLs['approved'] = $a;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* SetRequiredFields
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetRequiredFields($a)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (is_array($a)) {
|
||||
$this->fields['required'] = $a;
|
||||
} else {
|
||||
@ -109,15 +114,16 @@ class SimpleOpenID
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* SetOptionalFields
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetOptionalFields($a)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (is_array($a)) {
|
||||
$this->fields['optional'] = $a;
|
||||
} else {
|
||||
@ -125,15 +131,16 @@ class SimpleOpenID
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* SetIdentity
|
||||
*
|
||||
* @param string $a Server
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetIdentity($a)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Set Identity URL
|
||||
if ((stripos($a, 'http://') === false)
|
||||
&& (stripos($a, 'https://') === false)) {
|
||||
@ -155,30 +162,33 @@ class SimpleOpenID
|
||||
$this->openid_url_identity = $a;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* GetIdentity
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetIdentity()
|
||||
{
|
||||
// phpcs:enable
|
||||
// Get Identity
|
||||
return $this->openid_url_identity;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* SetOpenIDServer
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetError()
|
||||
{
|
||||
// phpcs:enable
|
||||
$e = $this->error;
|
||||
return array('code'=>$e[0],'description'=>$e[1]);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* ErrorStore
|
||||
*
|
||||
@ -186,9 +196,9 @@ class SimpleOpenID
|
||||
* @param string $desc Description
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function ErrorStore($code, $desc = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
$errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.';
|
||||
if ($desc == null){
|
||||
$desc = $errs[$code];
|
||||
@ -196,14 +206,15 @@ class SimpleOpenID
|
||||
$this->error = array($code,$desc);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* IsError
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function IsError()
|
||||
{
|
||||
// phpcs:enable
|
||||
if (count($this->error) > 0)
|
||||
{
|
||||
return true;
|
||||
@ -234,15 +245,16 @@ class SimpleOpenID
|
||||
return $r;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* OpenID_Standarize
|
||||
*
|
||||
* @param string $openid_identity Server
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function OpenID_Standarize($openid_identity = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($openid_identity === null)
|
||||
$openid_identity = $this->openid_url_identity;
|
||||
|
||||
@ -280,6 +292,7 @@ class SimpleOpenID
|
||||
return $query;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* FSOCK_Request
|
||||
*
|
||||
@ -288,9 +301,9 @@ class SimpleOpenID
|
||||
* @param string $params Params
|
||||
* @return boolean|unknown
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function FSOCK_Request($url, $method="GET", $params = "")
|
||||
{
|
||||
// phpcs:enable
|
||||
$fp = fsockopen("ssl://www.myopenid.com", 443, $errno, $errstr, 3); // Connection timeout is 3 seconds
|
||||
if (!$fp) {
|
||||
$this->ErrorStore('OPENID_SOCKETERROR', $errstr);
|
||||
@ -313,6 +326,7 @@ class SimpleOpenID
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* CURL_Request
|
||||
*
|
||||
@ -321,9 +335,9 @@ class SimpleOpenID
|
||||
* @param string $params Params
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function CURL_Request($url, $method="GET", $params = "")
|
||||
{
|
||||
// phpcs:enable
|
||||
// Remember, SSL MUST BE SUPPORTED
|
||||
if (is_array($params)) $params = $this->array2url($params);
|
||||
|
||||
@ -345,15 +359,16 @@ class SimpleOpenID
|
||||
return $response;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* HTML2OpenIDServer
|
||||
*
|
||||
* @param string $content Content
|
||||
* @return array Array of servers
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function HTML2OpenIDServer($content)
|
||||
{
|
||||
// phpcs:enable
|
||||
$get = array();
|
||||
|
||||
// Get details of their OpenID server and (optional) delegate
|
||||
@ -372,15 +387,16 @@ class SimpleOpenID
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get openid server
|
||||
*
|
||||
* @param string $url Url to found endpoint
|
||||
* @return string Endpoint
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetOpenIDServer($url='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
@ -401,14 +417,15 @@ class SimpleOpenID
|
||||
return $servers[0];
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* GetRedirectURL
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetRedirectURL()
|
||||
{
|
||||
// phpcs:enable
|
||||
$params = array();
|
||||
$params['openid.return_to'] = urlencode($this->URLs['approved']);
|
||||
$params['openid.mode'] = 'checkid_setup';
|
||||
@ -426,14 +443,15 @@ class SimpleOpenID
|
||||
return $this->URLs['openid_server'] . "?". $this->array2url($params);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Redirect
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function Redirect()
|
||||
{
|
||||
// phpcs:enable
|
||||
$redirect_to = $this->GetRedirectURL();
|
||||
if (headers_sent())
|
||||
{ // Use JavaScript to redirect if content has been previously sent (not recommended, but safe)
|
||||
@ -447,14 +465,15 @@ class SimpleOpenID
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* ValidateWithServer
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function ValidateWithServer()
|
||||
{
|
||||
// phpcs:enable
|
||||
$params = array(
|
||||
'openid.assoc_handle' => urlencode($_GET['openid_assoc_handle']),
|
||||
'openid.signed' => urlencode($_GET['openid_signed']),
|
||||
|
||||
@ -30,7 +30,7 @@ class RssParser
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -461,6 +461,7 @@ class RssParser
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Triggered when opened tag is found
|
||||
*
|
||||
@ -469,9 +470,9 @@ class RssParser
|
||||
* @param array $attrs Attributes of tags
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function feed_start_element($p, $element, &$attrs)
|
||||
{
|
||||
// phpcs:enable
|
||||
$el = $element = strtolower($element);
|
||||
$attrs = array_change_key_case($attrs, CASE_LOWER);
|
||||
|
||||
@ -582,6 +583,7 @@ class RssParser
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Triggered when CDATA is found
|
||||
*
|
||||
@ -589,9 +591,9 @@ class RssParser
|
||||
* @param string $text Tag
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function feed_cdata($p, $text)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($this->_format == 'atom' and $this->incontent)
|
||||
{
|
||||
$this->append_content($text);
|
||||
@ -603,6 +605,7 @@ class RssParser
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Triggered when closed tag is found
|
||||
*
|
||||
@ -610,9 +613,9 @@ class RssParser
|
||||
* @param string $el Tag
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function feed_end_element($p, $el)
|
||||
{
|
||||
// phpcs:enable
|
||||
$el = strtolower($el);
|
||||
|
||||
if ($el == 'item' or $el == 'entry')
|
||||
@ -673,15 +676,16 @@ class RssParser
|
||||
$str1 .= $str2;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Enter description here ...
|
||||
*
|
||||
* @param string $text Text
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function append_content($text)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ( $this->initem ) {
|
||||
$this->concat($this->current_item[ $this->incontent ], $text);
|
||||
}
|
||||
@ -759,7 +763,7 @@ function xml2php($xml)
|
||||
}
|
||||
|
||||
//Let see if the new child is not in the array
|
||||
if($tab==false && in_array($key,array_keys($array)))
|
||||
if ($tab==false && in_array($key,array_keys($array)))
|
||||
{
|
||||
//If this element is already in the array we will create an indexed array
|
||||
$tmp = $array[$key];
|
||||
@ -783,7 +787,7 @@ function xml2php($xml)
|
||||
}
|
||||
|
||||
|
||||
if($fils==0)
|
||||
if ($fils==0)
|
||||
{
|
||||
return (string) $xml;
|
||||
}
|
||||
|
||||
@ -344,14 +344,15 @@ class SMTPs
|
||||
$_aryToList = $this->getTO();
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Attempt a connection to mail server
|
||||
*
|
||||
* @return mixed $_retVal Boolean indicating success or failure on connection
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _server_connect()
|
||||
{
|
||||
// phpcs:enable
|
||||
// Default return value
|
||||
$_retVal = true;
|
||||
|
||||
@ -407,14 +408,15 @@ class SMTPs
|
||||
return $_retVal;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Attempt mail server authentication for a secure connection
|
||||
*
|
||||
* @return boolean|null $_retVal Boolean indicating success or failure of authentication
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _server_authenticate()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
// Send the RFC2554 specified EHLO.
|
||||
@ -1038,6 +1040,7 @@ class SMTPs
|
||||
$this->_msgRecipients = $aryHost;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns an array of the various parts of an email address
|
||||
* This assumes a well formed address:
|
||||
@ -1054,9 +1057,9 @@ class SMTPs
|
||||
* @param string $_strAddr Email address
|
||||
* @return array An array of the various parts of an email address
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _strip_email($_strAddr)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Keep the orginal
|
||||
$_aryEmail['org'] = $_strAddr;
|
||||
|
||||
@ -1090,6 +1093,7 @@ class SMTPs
|
||||
return $_aryEmail;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns an array of bares addresses for use with 'RCPT TO:'
|
||||
* This is a "build as you go" method. Each time this method is called
|
||||
@ -1097,9 +1101,9 @@ class SMTPs
|
||||
*
|
||||
* @return array Returns an array of bares addresses
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_RCPT_list()
|
||||
{
|
||||
// phpcs:enable
|
||||
/**
|
||||
* An array of bares addresses for use with 'RCPT TO:'
|
||||
*/
|
||||
@ -1121,15 +1125,16 @@ class SMTPs
|
||||
return $_RCPT_list;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns an array of addresses for a specific type; TO, CC or BCC
|
||||
*
|
||||
* @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc')
|
||||
* @return string|false Array of emaill address
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_email_list($_which = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
// We need to know which address segment to pull
|
||||
if ( $_which )
|
||||
{
|
||||
@ -1750,6 +1755,7 @@ class SMTPs
|
||||
else if ($type == 'alternative') return $this->_smtpsAlternativeBoundary;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* This function has been modified as provided by SirSir to allow multiline responses when
|
||||
* using SMTP Extensions
|
||||
@ -1758,9 +1764,9 @@ class SMTPs
|
||||
* @param string $response Response. Example: "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3"
|
||||
* @return boolean True or false
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function server_parse($socket, $response)
|
||||
{
|
||||
// phpcs:enable
|
||||
/**
|
||||
* Returns constructed SELECT Object string or boolean upon failure
|
||||
* Default value is set at true
|
||||
@ -1792,6 +1798,7 @@ class SMTPs
|
||||
return $_retVal;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Send str
|
||||
*
|
||||
@ -1800,9 +1807,9 @@ class SMTPs
|
||||
* @param string $CRLF CRLF
|
||||
* @return boolean|null True or false
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" )
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log
|
||||
fputs($this->socket, $_strSend . $CRLF);
|
||||
if ($this->_debug) $this->log.=' ('.$_returnCode.')' . $CRLF;
|
||||
|
||||
@ -756,6 +756,7 @@ class Translate
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of all available languages
|
||||
*
|
||||
@ -764,9 +765,9 @@ class Translate
|
||||
* @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code
|
||||
* @return array List of languages
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_available_languages($langdir=DOL_DOCUMENT_ROOT,$maxlength=0,$usecode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
// We scan directory langs to detect available languages
|
||||
@ -796,6 +797,7 @@ class Translate
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return if a filename $filename exists for current language (or alternate language)
|
||||
*
|
||||
@ -803,9 +805,9 @@ class Translate
|
||||
* @param integer $searchalt Search also alernate language file
|
||||
* @return boolean true if exists and readable
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function file_exists($filename,$searchalt=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Test si fichier dans repertoire de la langue
|
||||
foreach($this->dir as $searchdir)
|
||||
{
|
||||
@ -1020,15 +1022,16 @@ class Translate
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return an array with content of all loaded translation keys (found into this->tab_translate) so
|
||||
* we get a substitution array we can use for substitutions (for mail or ODT generation for example)
|
||||
*
|
||||
* @return array Array of translation keys lang_key => string_translation_loaded
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_translations_for_substitutions()
|
||||
{
|
||||
// phpcs:enable
|
||||
$substitutionarray = array();
|
||||
|
||||
foreach($this->tab_translate as $code => $label) {
|
||||
|
||||
@ -35,14 +35,15 @@ interface Database
|
||||
*/
|
||||
function ifsql($test, $resok, $resko);
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param resource $resultset Resultset of request
|
||||
* @return array Array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_row($resultset);
|
||||
function fetch_row($resultset);
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field.
|
||||
@ -67,6 +68,7 @@ interface Database
|
||||
*/
|
||||
function begin();
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new database
|
||||
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
|
||||
@ -78,8 +80,8 @@ interface Database
|
||||
* @param string $owner Username of database owner
|
||||
* @return resource resource defined if OK, null if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateDb($database, $charset = '', $collation = '', $owner = '');
|
||||
function DDLCreateDb($database, $charset = '', $collation = '', $owner = '');
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Return version of database server into an array
|
||||
@ -97,6 +99,7 @@ interface Database
|
||||
*/
|
||||
static function convertSQLFromMysql($line, $type = 'ddl');
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
||||
*
|
||||
@ -104,8 +107,8 @@ interface Database
|
||||
* @return int Nombre de lignes
|
||||
* @see num_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function affected_rows($resultset);
|
||||
function affected_rows($resultset);
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Return description of last error
|
||||
@ -114,6 +117,7 @@ interface Database
|
||||
*/
|
||||
function error();
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List tables into a database
|
||||
*
|
||||
@ -121,8 +125,8 @@ interface Database
|
||||
* @param string $table Nmae of table filter ('xxx%')
|
||||
* @return array List of tables in an array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLListTables($database, $table = '');
|
||||
function DDLListTables($database, $table = '');
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Return last request executed with query()
|
||||
@ -148,14 +152,15 @@ interface Database
|
||||
*/
|
||||
function decrypt($value);
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param resource $resultset Resultset of request
|
||||
* @return array Array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_array($resultset);
|
||||
function fetch_array($resultset);
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Return last error label
|
||||
@ -172,6 +177,7 @@ interface Database
|
||||
*/
|
||||
function escape($stringtoencode);
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get last ID after an insert INSERT
|
||||
*
|
||||
@ -179,8 +185,8 @@ interface Database
|
||||
* @param string $fieldid Field name
|
||||
* @return int Id of row
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function last_insert_id($tab, $fieldid = 'rowid');
|
||||
function last_insert_id($tab, $fieldid = 'rowid');
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Return full path of restore program
|
||||
@ -253,6 +259,7 @@ interface Database
|
||||
*/
|
||||
function getDefaultCollationDatabase();
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return number of lines for result of a SELECT
|
||||
*
|
||||
@ -260,8 +267,8 @@ interface Database
|
||||
* @return int Nb of lines
|
||||
* @see affected_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function num_rows($resultset);
|
||||
function num_rows($resultset);
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Return full path of dump program
|
||||
@ -284,6 +291,7 @@ interface Database
|
||||
*/
|
||||
function errno();
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a table into database
|
||||
*
|
||||
@ -296,17 +304,18 @@ interface Database
|
||||
* @param array $keys Tableau des champs cles noms => valeur
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null);
|
||||
function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null);
|
||||
// phpcs:enable
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a table into database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropTable($table);
|
||||
function DDLDropTable($table);
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Return list of available charset that can be used to store data in database
|
||||
@ -315,6 +324,7 @@ interface Database
|
||||
*/
|
||||
function getListOfCharacterSet();
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new field into table
|
||||
*
|
||||
@ -324,9 +334,10 @@ interface Database
|
||||
* @param string $field_position Optionnel ex.: "after champtruc"
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLAddField($table, $field_name, $field_desc, $field_position = "");
|
||||
function DDLAddField($table, $field_name, $field_desc, $field_position = "");
|
||||
// phpcs:enable
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a field from table
|
||||
*
|
||||
@ -334,9 +345,10 @@ interface Database
|
||||
* @param string $field_name Name of field to drop
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropField($table, $field_name);
|
||||
function DDLDropField($table, $field_name);
|
||||
// phpcs:enable
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update format of a field into a table
|
||||
*
|
||||
@ -345,8 +357,8 @@ interface Database
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLUpdateField($table, $field_name, $field_desc);
|
||||
function DDLUpdateField($table, $field_name, $field_desc);
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Return list of available collation that can be used for database
|
||||
@ -355,6 +367,7 @@ interface Database
|
||||
*/
|
||||
function getListOfCollation();
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a pointer of line with description of a table or field
|
||||
*
|
||||
@ -362,8 +375,8 @@ interface Database
|
||||
* @param string $field Optionnel : Name of field if we want description of field
|
||||
* @return resource Resource
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDescTable($table, $field = "");
|
||||
function DDLDescTable($table, $field = "");
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Return version of database server
|
||||
@ -379,6 +392,7 @@ interface Database
|
||||
*/
|
||||
function getDefaultCharacterSetDatabase();
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a user and privileges to connect to database (even if database does not exists yet)
|
||||
*
|
||||
@ -388,13 +402,13 @@ interface Database
|
||||
* @param string $dolibarr_main_db_name Database name where user must be granted
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateUser(
|
||||
$dolibarr_main_db_host,
|
||||
$dolibarr_main_db_user,
|
||||
$dolibarr_main_db_pass,
|
||||
$dolibarr_main_db_name
|
||||
);
|
||||
);
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true)
|
||||
@ -425,14 +439,15 @@ interface Database
|
||||
*/
|
||||
function commit($log = '');
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List information of columns into a table.
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return array Array with inforation on table
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLInfoTable($table);
|
||||
function DDLInfoTable($table);
|
||||
// phpcs:enable
|
||||
|
||||
/**
|
||||
* Free last resultset used.
|
||||
@ -457,29 +472,32 @@ interface Database
|
||||
*/
|
||||
function lastqueryerror();
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return connexion ID
|
||||
*
|
||||
* @return string Id connexion
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLGetConnectId();
|
||||
function DDLGetConnectId();
|
||||
// phpcs:enable
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
|
||||
*
|
||||
* @param resource $resultset Curseur de la requete voulue
|
||||
* @return Object Object result line or false if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_object($resultset);
|
||||
function fetch_object($resultset);
|
||||
// phpcs:enable
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Select a database
|
||||
*
|
||||
* @param string $database Name of database
|
||||
* @return boolean true if OK, false if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_db($database);
|
||||
function select_db($database);
|
||||
// phpcs:enable
|
||||
}
|
||||
|
||||
@ -139,15 +139,16 @@ class DoliDBMssql extends DoliDB
|
||||
return $line;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Select a database
|
||||
*
|
||||
* @param string $database Name of database
|
||||
* @return boolean true if OK, false if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_db($database)
|
||||
{
|
||||
// phpcs:enable
|
||||
return @mssql_select_db($database, $this->db);
|
||||
}
|
||||
|
||||
@ -460,49 +461,53 @@ class DoliDBMssql extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
|
||||
*
|
||||
* @param resource $resultset Curseur de la requete voulue
|
||||
* @return object|false Object result line or false if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_object($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return mssql_fetch_object($resultset);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param resource $resultset Resultset of request
|
||||
* @return array|false Array or false if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_array($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return mssql_fetch_array($resultset);
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param resource $resultset Resultset of request
|
||||
* @return array|false Array or false if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_row($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return @mssql_fetch_row($resultset);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return number of lines for result of a SELECT
|
||||
*
|
||||
@ -510,14 +515,15 @@ class DoliDBMssql extends DoliDB
|
||||
* @return int Nb of lines
|
||||
* @see affected_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function num_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return mssql_num_rows($resultset);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
||||
*
|
||||
@ -525,9 +531,9 @@ class DoliDBMssql extends DoliDB
|
||||
* @return int Nombre de lignes
|
||||
* @see num_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function affected_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
// mssql necessite un link de base pour cette fonction contrairement
|
||||
@ -645,6 +651,7 @@ class DoliDBMssql extends DoliDB
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get last ID after an insert INSERT
|
||||
*
|
||||
@ -652,9 +659,9 @@ class DoliDBMssql extends DoliDB
|
||||
* @param string $fieldid Field name
|
||||
* @return int Id of row or -1 on error
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function last_insert_id($tab,$fieldid='rowid')
|
||||
{
|
||||
// phpcs:enable
|
||||
$res = $this->query("SELECT @@IDENTITY as id");
|
||||
if ($res && $data = $this->fetch_array($res))
|
||||
{
|
||||
@ -709,14 +716,15 @@ class DoliDBMssql extends DoliDB
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return connexion ID
|
||||
*
|
||||
* @return string Id connexion
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLGetConnectId()
|
||||
{
|
||||
// phpcs:enable
|
||||
$resql=$this->query('SELECT CONNECTION_ID()');
|
||||
if ($resql)
|
||||
{
|
||||
@ -726,6 +734,7 @@ class DoliDBMssql extends DoliDB
|
||||
else return '?';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new database
|
||||
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
|
||||
@ -737,9 +746,9 @@ class DoliDBMssql extends DoliDB
|
||||
* @param string $owner Username of database owner
|
||||
* @return false|resource|true resource defined if OK, false if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateDb($database,$charset='',$collation='',$owner='')
|
||||
{
|
||||
// phpcs:enable
|
||||
/*if (empty($charset)) $charset=$this->forcecharset;
|
||||
if (empty($collation)) $collation=$this->forcecollate;
|
||||
*/
|
||||
@ -763,6 +772,7 @@ class DoliDBMssql extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List tables into a database
|
||||
*
|
||||
@ -770,22 +780,23 @@ class DoliDBMssql extends DoliDB
|
||||
* @param string $table Nmae of table filter ('xxx%')
|
||||
* @return array List of tables in an array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLListTables($database,$table='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->_results = mssql_list_tables($database, $this->db);
|
||||
return $this->_results;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List information of columns into a table.
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return array Tableau des informations des champs de la table
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLInfoTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
// FIXME: Dummy method
|
||||
// TODO: Implement
|
||||
@ -795,6 +806,7 @@ class DoliDBMssql extends DoliDB
|
||||
return $infotables;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a table into database
|
||||
*
|
||||
@ -807,9 +819,9 @@ class DoliDBMssql extends DoliDB
|
||||
* @param array $keys Tableau des champs cles noms => valeur
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
// FIXME: $fulltext_keys parameter is unused
|
||||
|
||||
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
|
||||
@ -875,15 +887,16 @@ class DoliDBMssql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a table into database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "DROP TABLE ".$table;
|
||||
|
||||
if (! $this->query($sql))
|
||||
@ -892,6 +905,7 @@ class DoliDBMssql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a pointer of line with description of a table or field
|
||||
*
|
||||
@ -899,9 +913,9 @@ class DoliDBMssql extends DoliDB
|
||||
* @param string $field Optionnel : Name of field if we want description of field
|
||||
* @return false|resource|true Resource
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDescTable($table,$field="")
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql="DESC ".$table." ".$field;
|
||||
|
||||
dol_syslog($sql);
|
||||
@ -909,6 +923,7 @@ class DoliDBMssql extends DoliDB
|
||||
return $this->_results;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new field into table
|
||||
*
|
||||
@ -918,9 +933,9 @@ class DoliDBMssql extends DoliDB
|
||||
* @param string $field_position Optionnel ex.: "after champtruc"
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLAddField($table,$field_name,$field_desc,$field_position="")
|
||||
{
|
||||
// phpcs:enable
|
||||
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
|
||||
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
|
||||
@ -946,6 +961,7 @@ class DoliDBMssql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update format of a field into a table
|
||||
*
|
||||
@ -954,9 +970,9 @@ class DoliDBMssql extends DoliDB
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLUpdateField($table,$field_name,$field_desc)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table;
|
||||
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
||||
if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
|
||||
@ -970,6 +986,7 @@ class DoliDBMssql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a field from table
|
||||
*
|
||||
@ -977,9 +994,9 @@ class DoliDBMssql extends DoliDB
|
||||
* @param string $field_name Name of field to drop
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropField($table,$field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
|
||||
dol_syslog($sql,LOG_DEBUG);
|
||||
if (! $this->query($sql))
|
||||
@ -990,6 +1007,7 @@ class DoliDBMssql extends DoliDB
|
||||
else return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a user and privileges to connect to database (even if database does not exists yet)
|
||||
*
|
||||
@ -999,10 +1017,10 @@ class DoliDBMssql extends DoliDB
|
||||
* @param string $dolibarr_main_db_name Database name where user must be granted
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
|
||||
{
|
||||
$sql = "CREATE LOGIN ".$this->EscapeFieldName($dolibarr_main_db_user)." WITH PASSWORD='$dolibarr_main_db_pass'";
|
||||
// phpcs:enable
|
||||
$sql = "CREATE LOGIN ".$this->EscapeFieldName($dolibarr_main_db_user)." WITH PASSWORD='$dolibarr_main_db_pass'";
|
||||
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
||||
$resql=$this->query($sql);
|
||||
if (! $resql)
|
||||
@ -1150,19 +1168,21 @@ class DoliDBMssql extends DoliDB
|
||||
return array();
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Escape a field name according to escape's syntax
|
||||
*
|
||||
* @param string $fieldname Field's name to escape
|
||||
* @return string field's name escaped
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function EscapeFieldName($fieldname)
|
||||
{
|
||||
// phpcs:enable
|
||||
return "[".$fieldname."]";
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get information on field
|
||||
*
|
||||
@ -1170,9 +1190,9 @@ class DoliDBMssql extends DoliDB
|
||||
* @param mixed $fields String for one field or array of string for multiple field
|
||||
* @return false|object
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function GetFieldInformation($table,$fields)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME";
|
||||
if (is_array($fields))
|
||||
{
|
||||
|
||||
@ -167,17 +167,18 @@ class DoliDBMysqli extends DoliDB
|
||||
return $line;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Select a database
|
||||
* Select a database
|
||||
*
|
||||
* @param string $database Name of database
|
||||
* @return boolean true if OK, false if KO
|
||||
* @param string $database Name of database
|
||||
* @return boolean true if OK, false if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_db($database)
|
||||
{
|
||||
// phpcs:enable
|
||||
dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG);
|
||||
return $this->db->select_db($database);
|
||||
return $this->db->select_db($database);
|
||||
}
|
||||
|
||||
|
||||
@ -286,44 +287,47 @@ class DoliDBMysqli extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
|
||||
*
|
||||
* @param mysqli_result $resultset Curseur de la requete voulue
|
||||
* @return object|null Object result line or null if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_object($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
if (! is_object($resultset)) { $resultset=$this->_results; }
|
||||
return $resultset->fetch_object();
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param mysqli_result $resultset Resultset of request
|
||||
* @return array|null Array or null if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_array($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_object($resultset)) { $resultset=$this->_results; }
|
||||
return $resultset->fetch_array();
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param mysqli_result $resultset Resultset of request
|
||||
* @return array|null|0 Array or null if KO or end of cursor or 0 if resultset is bool
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_row($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_bool($resultset))
|
||||
{
|
||||
@ -337,6 +341,7 @@ class DoliDBMysqli extends DoliDB
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return number of lines for result of a SELECT
|
||||
*
|
||||
@ -344,14 +349,15 @@ class DoliDBMysqli extends DoliDB
|
||||
* @return int Nb of lines
|
||||
* @see affected_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function num_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_object($resultset)) { $resultset=$this->_results; }
|
||||
return $resultset->num_rows;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
||||
*
|
||||
@ -359,9 +365,9 @@ class DoliDBMysqli extends DoliDB
|
||||
* @return int Nombre de lignes
|
||||
* @see num_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function affected_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_object($resultset)) { $resultset=$this->_results; }
|
||||
// mysql necessite un link de base pour cette fonction contrairement
|
||||
@ -462,6 +468,7 @@ class DoliDBMysqli extends DoliDB
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get last ID after an insert INSERT
|
||||
*
|
||||
@ -469,9 +476,9 @@ class DoliDBMysqli extends DoliDB
|
||||
* @param string $fieldid Field name
|
||||
* @return int|string Id of row
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function last_insert_id($tab,$fieldid='rowid')
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->db->insert_id;
|
||||
}
|
||||
|
||||
@ -545,14 +552,15 @@ class DoliDBMysqli extends DoliDB
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return connexion ID
|
||||
*
|
||||
* @return string Id connexion
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLGetConnectId()
|
||||
{
|
||||
// phpcs:enable
|
||||
$resql=$this->query('SELECT CONNECTION_ID()');
|
||||
if ($resql)
|
||||
{
|
||||
@ -562,8 +570,9 @@ class DoliDBMysqli extends DoliDB
|
||||
else return '?';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new database
|
||||
* Create a new database
|
||||
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
|
||||
* We force to create database with charset this->forcecharset and collate this->forcecollate
|
||||
*
|
||||
@ -573,9 +582,9 @@ class DoliDBMysqli extends DoliDB
|
||||
* @param string $owner Username of database owner
|
||||
* @return bool|mysqli_result resource defined if OK, null if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateDb($database,$charset='',$collation='',$owner='')
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($charset)) $charset=$this->forcecharset;
|
||||
if (empty($collation)) $collation=$this->forcecollate;
|
||||
|
||||
@ -595,6 +604,7 @@ class DoliDBMysqli extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List tables into a database
|
||||
*
|
||||
@ -602,9 +612,9 @@ class DoliDBMysqli extends DoliDB
|
||||
* @param string $table Nmae of table filter ('xxx%')
|
||||
* @return array List of tables in an array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLListTables($database, $table='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$listtables=array();
|
||||
|
||||
$like = '';
|
||||
@ -622,15 +632,16 @@ class DoliDBMysqli extends DoliDB
|
||||
return $listtables;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List information of columns into a table.
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return array Tableau des informations des champs de la table
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLInfoTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$infotables=array();
|
||||
|
||||
$sql="SHOW FULL COLUMNS FROM ".$table.";";
|
||||
@ -647,6 +658,7 @@ class DoliDBMysqli extends DoliDB
|
||||
return $infotables;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a table into database
|
||||
*
|
||||
@ -659,9 +671,9 @@ class DoliDBMysqli extends DoliDB
|
||||
* @param array $keys Tableau des champs cles noms => valeur
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
// FIXME: $fulltext_keys parameter is unused
|
||||
|
||||
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
|
||||
@ -730,16 +742,17 @@ class DoliDBMysqli extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a table into database
|
||||
* Drop a table into database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropTable($table)
|
||||
{
|
||||
$sql = "DROP TABLE ".$table;
|
||||
// phpcs:enable
|
||||
$sql = "DROP TABLE ".$table;
|
||||
|
||||
if (! $this->query($sql))
|
||||
return -1;
|
||||
@ -747,6 +760,7 @@ class DoliDBMysqli extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a pointer of line with description of a table or field
|
||||
*
|
||||
@ -754,9 +768,9 @@ class DoliDBMysqli extends DoliDB
|
||||
* @param string $field Optionnel : Name of field if we want description of field
|
||||
* @return bool|mysqli_result Resultset x (x->Field, x->Type, ...)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDescTable($table,$field="")
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql="DESC ".$table." ".$field;
|
||||
|
||||
dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG);
|
||||
@ -764,6 +778,7 @@ class DoliDBMysqli extends DoliDB
|
||||
return $this->_results;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new field into table
|
||||
*
|
||||
@ -773,9 +788,9 @@ class DoliDBMysqli extends DoliDB
|
||||
* @param string $field_position Optionnel ex.: "after champtruc"
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLAddField($table,$field_name,$field_desc,$field_position="")
|
||||
{
|
||||
// phpcs:enable
|
||||
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
|
||||
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
|
||||
@ -815,6 +830,7 @@ class DoliDBMysqli extends DoliDB
|
||||
return -1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update format of a field into a table
|
||||
*
|
||||
@ -823,9 +839,9 @@ class DoliDBMysqli extends DoliDB
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLUpdateField($table,$field_name,$field_desc)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table;
|
||||
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
||||
if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
|
||||
@ -861,6 +877,7 @@ class DoliDBMysqli extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a field from table
|
||||
*
|
||||
@ -868,19 +885,20 @@ class DoliDBMysqli extends DoliDB
|
||||
* @param string $field_name Name of field to drop
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropField($table,$field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
|
||||
dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG);
|
||||
if ($this->query($sql)) {
|
||||
return 1;
|
||||
}
|
||||
$this->error=$this->lasterror();
|
||||
return -1;
|
||||
$this->error=$this->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a user and privileges to connect to database (even if database does not exists yet)
|
||||
*
|
||||
@ -890,9 +908,9 @@ class DoliDBMysqli extends DoliDB
|
||||
* @param string $dolibarr_main_db_name Database name where user must be granted
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."'";
|
||||
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
||||
$resql=$this->query($sql);
|
||||
|
||||
@ -359,20 +359,24 @@ class DoliDBPgsql extends DoliDB
|
||||
return $line;
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a database
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Select a database
|
||||
* Ici postgresql n'a aucune fonction equivalente de mysql_select_db
|
||||
* On compare juste manuellement si la database choisie est bien celle activee par la connexion
|
||||
*
|
||||
* @param string $database Name of database
|
||||
* @return bool true if OK, false if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_db($database)
|
||||
{
|
||||
if ($database == $this->database_name) return true;
|
||||
else return false;
|
||||
}
|
||||
// phpcs:enable
|
||||
if ($database == $this->database_name) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connexion to server
|
||||
@ -541,63 +545,68 @@ class DoliDBPgsql extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
|
||||
*
|
||||
* @param resource $resultset Curseur de la requete voulue
|
||||
* @return false|object Object result line or false if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_object($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return pg_fetch_object($resultset);
|
||||
}
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param resource $resultset Resultset of request
|
||||
* @return false|array Array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_array($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return pg_fetch_array($resultset);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param resource $resultset Resultset of request
|
||||
* @return false|array Array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_row($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return pg_fetch_row($resultset);
|
||||
}
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return number of lines for result of a SELECT
|
||||
*
|
||||
* @param resourse $resultset Resulset of requests
|
||||
* @return int Nb of lines, -1 on error
|
||||
* @see affected_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
*/
|
||||
function num_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return pg_num_rows($resultset);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
||||
*
|
||||
@ -605,9 +614,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @return int Nb of lines
|
||||
* @see num_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function affected_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
// pgsql necessite un resultset pour cette fonction contrairement
|
||||
@ -760,6 +769,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return pg_last_error($this->db);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get last ID after an insert INSERT
|
||||
*
|
||||
@ -767,9 +777,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $fieldid Field name
|
||||
* @return string Id of row
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function last_insert_id($tab,$fieldid='rowid')
|
||||
{
|
||||
// phpcs:enable
|
||||
//$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab);
|
||||
$result = pg_query($this->db,"SELECT currval('".$tab."_".$fieldid."_seq')");
|
||||
if (! $result)
|
||||
@ -826,19 +836,21 @@ class DoliDBPgsql extends DoliDB
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return connexion ID
|
||||
*
|
||||
* @return string Id connexion
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLGetConnectId()
|
||||
{
|
||||
// phpcs:enable
|
||||
return '?';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new database
|
||||
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
|
||||
@ -850,9 +862,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $owner Username of database owner
|
||||
* @return false|resource resource defined if OK, null if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateDb($database,$charset='',$collation='',$owner='')
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($charset)) $charset=$this->forcecharset;
|
||||
if (empty($collation)) $collation=$this->forcecollate;
|
||||
|
||||
@ -865,6 +877,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List tables into a database
|
||||
*
|
||||
@ -872,9 +885,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $table Name of table filter ('xxx%')
|
||||
* @return array List of tables in an array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLListTables($database, $table='')
|
||||
{
|
||||
{
|
||||
// phpcs:enable
|
||||
$listtables=array();
|
||||
|
||||
$like = '';
|
||||
@ -890,6 +903,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return $listtables;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List information of columns into a table.
|
||||
*
|
||||
@ -897,9 +911,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @return array Tableau des informations des champs de la table
|
||||
*
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLInfoTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$infotables=array();
|
||||
|
||||
$sql="SELECT ";
|
||||
@ -931,6 +945,7 @@ class DoliDBPgsql extends DoliDB
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a table into database
|
||||
*
|
||||
@ -943,9 +958,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param array $keys Tableau des champs cles noms => valeur
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
// FIXME: $fulltext_keys parameter is unused
|
||||
|
||||
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
|
||||
@ -1011,15 +1026,16 @@ class DoliDBPgsql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a table into database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "DROP TABLE ".$table;
|
||||
|
||||
if (! $this->query($sql))
|
||||
@ -1028,6 +1044,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a user to connect to database
|
||||
*
|
||||
@ -1037,9 +1054,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $dolibarr_main_db_name Database name where user must be granted
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Note: using ' on user does not works with pgsql
|
||||
$sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'";
|
||||
|
||||
@ -1053,6 +1070,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a pointer of line with description of a table or field
|
||||
*
|
||||
@ -1060,9 +1078,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $field Optionnel : Name of field if we want description of field
|
||||
* @return false|resource Resultset x (x->attname)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDescTable($table,$field="")
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql ="SELECT attname FROM pg_attribute, pg_type WHERE typname = '".$table."' AND attrelid = typrelid";
|
||||
$sql.=" AND attname NOT IN ('cmin', 'cmax', 'ctid', 'oid', 'tableoid', 'xmin', 'xmax')";
|
||||
if ($field) $sql.= " AND attname = '".$field."'";
|
||||
@ -1072,6 +1090,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return $this->_results;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new field into table
|
||||
*
|
||||
@ -1081,37 +1100,38 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $field_position Optionnel ex.: "after champtruc"
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLAddField($table,$field_name,$field_desc,$field_position="")
|
||||
{
|
||||
// phpcs:enable
|
||||
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
|
||||
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
|
||||
$sql .= $field_desc['type'];
|
||||
if(preg_match("/^[^\s]/i",$field_desc['value']))
|
||||
if (preg_match("/^[^\s]/i",$field_desc['value']))
|
||||
if (! in_array($field_desc['type'],array('int','date','datetime')))
|
||||
{
|
||||
$sql.= "(".$field_desc['value'].")";
|
||||
}
|
||||
if (preg_match("/^[^\s]/i",$field_desc['attribute']))
|
||||
$sql .= " ".$field_desc['attribute'];
|
||||
$sql .= " ".$field_desc['attribute'];
|
||||
if (preg_match("/^[^\s]/i",$field_desc['null']))
|
||||
$sql .= " ".$field_desc['null'];
|
||||
$sql .= " ".$field_desc['null'];
|
||||
if (preg_match("/^[^\s]/i",$field_desc['default']))
|
||||
if (preg_match("/null/i",$field_desc['default']))
|
||||
$sql .= " default ".$field_desc['default'];
|
||||
else
|
||||
$sql .= " default '".$field_desc['default']."'";
|
||||
if (preg_match("/null/i",$field_desc['default']))
|
||||
$sql .= " default ".$field_desc['default'];
|
||||
else
|
||||
$sql .= " default '".$field_desc['default']."'";
|
||||
if (preg_match("/^[^\s]/i",$field_desc['extra']))
|
||||
$sql .= " ".$field_desc['extra'];
|
||||
$sql .= " ".$field_desc['extra'];
|
||||
$sql .= " ".$field_position;
|
||||
|
||||
dol_syslog($sql,LOG_DEBUG);
|
||||
if(! $this -> query($sql))
|
||||
if (! $this -> query($sql))
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update format of a field into a table
|
||||
*
|
||||
@ -1120,9 +1140,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLUpdateField($table,$field_name,$field_desc)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table;
|
||||
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
||||
if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
|
||||
@ -1156,6 +1176,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a field from table
|
||||
*
|
||||
@ -1163,9 +1184,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $field_name Name of field to drop
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropField($table,$field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name;
|
||||
dol_syslog($sql,LOG_DEBUG);
|
||||
if (! $this->query($sql))
|
||||
|
||||
@ -296,17 +296,18 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return $line;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Select a database
|
||||
*
|
||||
* @param string $database Name of database
|
||||
* @return boolean true if OK, false if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_db($database)
|
||||
{
|
||||
// phpcs:enable
|
||||
dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG);
|
||||
// sqlite_select_db() does not exist
|
||||
// sqlite_select_db() does not exist
|
||||
//return sqlite_select_db($this->db,$database);
|
||||
return true;
|
||||
}
|
||||
@ -491,15 +492,16 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
|
||||
*
|
||||
* @param SQLite3Result $resultset Curseur de la requete voulue
|
||||
* @return false|object Object result line or false if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_object($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
if (! is_object($resultset)) { $resultset=$this->_results; }
|
||||
//return $resultset->fetch(PDO::FETCH_OBJ);
|
||||
@ -511,15 +513,16 @@ class DoliDBSqlite3 extends DoliDB
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param SQLite3Result $resultset Resultset of request
|
||||
* @return false|array Array or false if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_array($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_object($resultset)) { $resultset=$this->_results; }
|
||||
//return $resultset->fetch(PDO::FETCH_ASSOC);
|
||||
@ -527,15 +530,16 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param SQLite3Result $resultset Resultset of request
|
||||
* @return false|array Array or false if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_row($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_bool($resultset))
|
||||
{
|
||||
@ -549,6 +553,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return number of lines for result of a SELECT
|
||||
*
|
||||
@ -556,10 +561,10 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @return int Nb of lines
|
||||
* @see affected_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function num_rows($resultset)
|
||||
{
|
||||
// FIXME: SQLite3Result does not have a queryString member
|
||||
// phpcs:enable
|
||||
// FIXME: SQLite3Result does not have a queryString member
|
||||
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_object($resultset)) { $resultset=$this->_results; }
|
||||
@ -569,6 +574,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return number of lines for result of a SELECT
|
||||
*
|
||||
@ -576,10 +582,10 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @return int Nb of lines
|
||||
* @see affected_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function affected_rows($resultset)
|
||||
{
|
||||
// FIXME: SQLite3Result does not have a queryString member
|
||||
// phpcs:enable
|
||||
// FIXME: SQLite3Result does not have a queryString member
|
||||
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_object($resultset)) { $resultset=$this->_results; }
|
||||
@ -698,6 +704,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get last ID after an insert INSERT
|
||||
*
|
||||
@ -705,9 +712,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $fieldid Field name
|
||||
* @return int Id of row
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function last_insert_id($tab,$fieldid='rowid')
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->db->lastInsertRowId();
|
||||
}
|
||||
|
||||
@ -780,18 +787,20 @@ class DoliDBSqlite3 extends DoliDB
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return connexion ID
|
||||
*
|
||||
* @return string Id connexion
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLGetConnectId()
|
||||
{
|
||||
// phpcs:enable
|
||||
return '?';
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new database
|
||||
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
|
||||
@ -803,9 +812,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $owner Username of database owner
|
||||
* @return SQLite3Result resource defined if OK, null if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateDb($database,$charset='',$collation='',$owner='')
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($charset)) $charset=$this->forcecharset;
|
||||
if (empty($collation)) $collation=$this->forcecollate;
|
||||
|
||||
@ -825,6 +834,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List tables into a database
|
||||
*
|
||||
@ -832,9 +842,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $table Name of table filter ('xxx%')
|
||||
* @return array List of tables in an array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLListTables($database, $table='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$listtables=array();
|
||||
|
||||
$like = '';
|
||||
@ -852,16 +862,17 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return $listtables;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List information of columns into a table.
|
||||
* List information of columns into a table.
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return array Tableau des informations des champs de la table
|
||||
* TODO modify for sqlite
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLInfoTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$infotables=array();
|
||||
|
||||
$sql="SHOW FULL COLUMNS FROM ".$table.";";
|
||||
@ -878,6 +889,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return $infotables;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a table into database
|
||||
*
|
||||
@ -890,10 +902,10 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param array $keys Tableau des champs cles noms => valeur
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null)
|
||||
{
|
||||
// FIXME: $fulltext_keys parameter is unused
|
||||
// phpcs:enable
|
||||
// FIXME: $fulltext_keys parameter is unused
|
||||
|
||||
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
|
||||
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||
@ -957,15 +969,16 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a table into database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "DROP TABLE ".$table;
|
||||
|
||||
if (! $this->query($sql))
|
||||
@ -974,6 +987,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a pointer of line with description of a table or field
|
||||
*
|
||||
@ -981,9 +995,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $field Optionnel : Name of field if we want description of field
|
||||
* @return SQLite3Result Resource
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDescTable($table,$field="")
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql="DESC ".$table." ".$field;
|
||||
|
||||
dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG);
|
||||
@ -991,6 +1005,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return $this->_results;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new field into table
|
||||
*
|
||||
@ -1000,9 +1015,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $field_position Optionnel ex.: "after champtruc"
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLAddField($table,$field_name,$field_desc,$field_position="")
|
||||
{
|
||||
// phpcs:enable
|
||||
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
|
||||
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
|
||||
@ -1035,6 +1050,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update format of a field into a table
|
||||
*
|
||||
@ -1043,9 +1059,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLUpdateField($table,$field_name,$field_desc)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table;
|
||||
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
||||
if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
|
||||
@ -1058,6 +1074,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a field from table
|
||||
*
|
||||
@ -1065,9 +1082,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $field_name Name of field to drop
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropField($table,$field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
|
||||
dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG);
|
||||
if (! $this->query($sql))
|
||||
@ -1079,8 +1096,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a user and privileges to connect to database (even if database does not exists yet)
|
||||
* Create a user and privileges to connect to database (even if database does not exists yet)
|
||||
*
|
||||
* @param string $dolibarr_main_db_host Ip serveur
|
||||
* @param string $dolibarr_main_db_user Nom user a creer
|
||||
@ -1088,9 +1106,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $dolibarr_main_db_name Database name where user must be granted
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "INSERT INTO user ";
|
||||
$sql.= "(Host,User,password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)";
|
||||
$sql.= " VALUES ('".$this->escape($dolibarr_main_db_host)."','".$this->escape($dolibarr_main_db_user)."',password('".addslashes($dolibarr_main_db_pass)."')";
|
||||
@ -1312,6 +1330,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* calc_daynr
|
||||
*
|
||||
@ -1320,9 +1339,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param int $day Day
|
||||
* @return int Formatted date
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private static function calc_daynr($year, $month, $day)
|
||||
{
|
||||
// phpcs:enable
|
||||
$y = $year;
|
||||
if ($y == 0 && $month == 0) return 0;
|
||||
$num = (365* $y + 31 * ($month - 1) + $day);
|
||||
@ -1335,6 +1354,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
return $num + floor($y / 4) - $temp;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* calc_weekday
|
||||
*
|
||||
@ -1342,25 +1362,27 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param bool $sunday_first_day_of_week ???
|
||||
* @return int
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private static function calc_weekday($daynr, $sunday_first_day_of_week)
|
||||
{
|
||||
$ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7);
|
||||
return $ret;
|
||||
// phpcs:enable
|
||||
$ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* calc_days_in_year
|
||||
*
|
||||
* @param string $year Year
|
||||
* @return int Nb of days in year
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private static function calc_days_in_year($year)
|
||||
{
|
||||
return (($year & 3) == 0 && ($year%100 || ($year%400 == 0 && $year)) ? 366 : 365);
|
||||
// phpcs:enable
|
||||
return (($year & 3) == 0 && ($year%100 || ($year%400 == 0 && $year)) ? 366 : 365);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* calc_week
|
||||
*
|
||||
@ -1371,9 +1393,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $calc_year ???
|
||||
* @return string ???
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year)
|
||||
{
|
||||
// phpcs:enable
|
||||
$daynr=self::calc_daynr($year,$month,$day);
|
||||
$first_daynr=self::calc_daynr($year,1,1);
|
||||
$monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0;
|
||||
|
||||
@ -999,6 +999,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create tables and keys required by module.
|
||||
* Files module.sql and module.key.sql with create table and create keys
|
||||
@ -1008,9 +1009,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
* @param string $reldir Relative directory where to scan files
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _load_tables($reldir)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$error=0;
|
||||
@ -1118,6 +1119,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adds boxes
|
||||
*
|
||||
@ -1125,9 +1127,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_boxes($option='')
|
||||
{
|
||||
// phpcs:enable
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php';
|
||||
|
||||
global $conf;
|
||||
@ -1218,14 +1220,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Removes boxes
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_boxes()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -1294,14 +1297,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
return $err;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adds cronjobs
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_cronjobs()
|
||||
{
|
||||
// phpcs:enable
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php';
|
||||
|
||||
global $conf;
|
||||
@ -1408,14 +1412,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Removes boxes
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_cronjobs()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -1438,14 +1443,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
return $err;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Removes tabs
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_tabs()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -1464,14 +1470,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
return $err;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adds tabs
|
||||
*
|
||||
* @return int Error count (0 if ok)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_tabs()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -1532,14 +1539,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
return $err;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adds constants
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_const()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -1602,14 +1610,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
return $err;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Removes constants tagged 'deleteonunactive'
|
||||
*
|
||||
* @return int <0 if KO, 0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_const()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -1638,6 +1647,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
return $err;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adds access rights
|
||||
*
|
||||
@ -1646,9 +1656,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_permissions($reinitadminperms=0, $force_entity=null, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user;
|
||||
|
||||
$err=0;
|
||||
@ -1794,14 +1804,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Removes access rights
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_permissions()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -1820,14 +1831,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adds menu entries
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_menus()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
if (! is_array($this->menu) || empty($this->menu)) return 0;
|
||||
@ -1930,14 +1942,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Removes menu entries
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_menus()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -1960,14 +1973,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
return $err;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Creates directories
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function create_dirs()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
$err=0;
|
||||
@ -2019,6 +2033,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adds directories definitions
|
||||
*
|
||||
@ -2027,9 +2042,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_dirs($name,$dir)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -2064,14 +2079,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Removes directories
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_dirs()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
@ -2090,14 +2106,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
return $err;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Adds generic parts
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function insert_module_parts()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$error=0;
|
||||
@ -2169,14 +2186,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
return $error;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Removes generic parts
|
||||
*
|
||||
* @return int Error count (0 if OK)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function delete_module_parts()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$err=0;
|
||||
|
||||
@ -33,16 +33,17 @@ abstract class ModeleAction extends CommonDocGenerator
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
* @param integer $maxfilenamelength Max length of value to show
|
||||
* @return array List of templates
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function liste_modeles($db,$maxfilenamelength=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$type='action';
|
||||
@ -54,6 +55,8 @@ abstract class ModeleAction extends CommonDocGenerator
|
||||
return $liste;
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create an product document on disk using template defined into PRODUCT_ADDON_PDF
|
||||
*
|
||||
@ -66,9 +69,9 @@ abstract class ModeleAction extends CommonDocGenerator
|
||||
* @param int $hideref Hide ref
|
||||
* @return int 0 if KO, 1 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function action_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$user;
|
||||
$langs->load("action");
|
||||
|
||||
|
||||
@ -93,6 +93,7 @@ class CommActionRapport
|
||||
$this->subject=$langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Write the object to document file to disk
|
||||
*
|
||||
@ -101,9 +102,9 @@ class CommActionRapport
|
||||
* @param Translate $outputlangs Lang object for output language
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_file($socid = 0, $catid = 0, $outputlangs='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$conf,$langs,$hookmanager;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
|
||||
@ -83,6 +83,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Fonction generant le projet sur le disque
|
||||
*
|
||||
@ -90,9 +91,9 @@ class pdf_ban extends ModeleBankAccountDoc
|
||||
* @param Translate $outputlangs Lang output object
|
||||
* @return int 1 if OK, <=0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_file($object,$outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $hookmanager, $langs, $user;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
|
||||
@ -83,8 +83,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonction generant le projet sur le disque
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Fonction generant le projet sur le disque
|
||||
*
|
||||
* @param Project $object Object project a generer
|
||||
* @param Translate $outputlangs Lang output object
|
||||
@ -95,9 +96,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param null|array $moreparams More parameters
|
||||
* @return int 1 if OK, <=0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $hookmanager, $langs, $user, $mysoc;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
@ -427,6 +428,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
@ -436,10 +438,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
global $conf, $mysoc;
|
||||
// phpcs:enable
|
||||
global $conf, $mysoc;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@ -463,6 +465,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show area for the customer to sign
|
||||
*
|
||||
@ -472,9 +475,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _signature_area(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
$tab_top = $posy + 4;
|
||||
$tab_hl = 4;
|
||||
|
||||
@ -37,6 +37,7 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator
|
||||
public $error='';
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of active generation modules
|
||||
*
|
||||
@ -44,9 +45,9 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator
|
||||
* @param integer $maxfilenamelength Max length of value to show
|
||||
* @return array List of templates
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function liste_modeles($db, $maxfilenamelength=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$type = 'bankaccount';
|
||||
|
||||
@ -223,6 +223,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return if a code is used (by other element)
|
||||
*
|
||||
@ -231,9 +232,9 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
* @param Product $product Objet product
|
||||
* @return int 0 if available, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function verif_dispo($db, $code, $product)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "SELECT barcode FROM ".MAIN_DB_PREFIX."product";
|
||||
$sql.= " WHERE barcode = '".$code."'";
|
||||
if ($product->id > 0) $sql.= " AND rowid <> ".$product->id;
|
||||
@ -256,6 +257,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return if a barcode value match syntax
|
||||
*
|
||||
@ -263,9 +265,9 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
* @param string $typefortest Type of barcode (ISBN, EAN, ...)
|
||||
* @return int 0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function verif_syntax($codefortest, $typefortest)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$result = 0;
|
||||
|
||||
@ -74,6 +74,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
$this->tab_height = 200; //$this->line_height * $this->line_per_page;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Fonction to generate document on disk
|
||||
*
|
||||
@ -83,9 +84,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
* @param Translate $outputlangs Lang output object
|
||||
* @return int 1=ok, 0=ko
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_file($object, $_dir, $number, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$conf,$langs,$hookmanager;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
@ -198,6 +199,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Generate Header
|
||||
*
|
||||
@ -207,9 +209,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
* @param Translate $outputlangs Object language for output
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function Header(&$pdf, $page, $pages, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@ -305,6 +307,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output array
|
||||
*
|
||||
@ -314,9 +317,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
* @param Translate $outputlangs Object lang
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function Body(&$pdf, $pagenb, $pages, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
// x=10 - Num
|
||||
// x=30 - Banque
|
||||
// x=100 - Emetteur
|
||||
|
||||
@ -138,6 +138,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return next free value
|
||||
*
|
||||
@ -145,9 +146,9 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
|
||||
* @param string $objforref Object for number to search
|
||||
* @return string Next free value
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function chequereceipt_get_num($objsoc,$objforref)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->getNextValue($objsoc,$objforref);
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,6 +124,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return next free value
|
||||
*
|
||||
@ -131,9 +132,9 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
|
||||
* @param string $objforref Object for number to search
|
||||
* @return string Next free value
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function chequereceipt_get_num($objsoc,$objforref)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->getNextValue($objsoc,$objforref);
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,6 +127,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of active generation modules
|
||||
*
|
||||
@ -134,9 +135,9 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
|
||||
* @param integer $maxfilenamelength Max length of value to show
|
||||
* @return array List of templates
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function liste_modeles($db,$maxfilenamelength=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$type='chequereceipt';
|
||||
|
||||
@ -177,6 +177,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
return $texte;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to build a document on disk using the generic odt module.
|
||||
*
|
||||
@ -188,9 +189,9 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
* @param int $hideref Do not show ref
|
||||
* @return int 1 if OK, <=0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$langs,$conf,$mysoc,$hookmanager;
|
||||
|
||||
if (empty($srctemplatepath))
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
@ -202,7 +202,8 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$this->atleastonediscount=0;
|
||||
}
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param Object $object Object to generate
|
||||
@ -213,9 +214,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
* @param int $hideref Do not show ref
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblignes;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
@ -644,6 +645,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show payments table
|
||||
*
|
||||
@ -653,12 +655,13 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
@ -668,9 +671,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@ -846,6 +849,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show total to pay
|
||||
*
|
||||
@ -856,9 +860,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$mysoc;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@ -131,13 +131,14 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
$yymm = strftime("%y%m",$date);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
else $num = sprintf("%04s", $max+1);
|
||||
|
||||
dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return next free value
|
||||
*
|
||||
@ -145,9 +146,9 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
* @param string $objforref Object for number to search
|
||||
* @return string Next free value
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function commande_get_num($objsoc,$objforref)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->getNextValue($objsoc,$objforref);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user