mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Qual: Ignore false positive for suspicious param positions (#28693)
* Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored * Qual: Ignore suspicious param positions # Qual: Ignore suspicious param positions Add annotations to ignore false positives about suspicious parameter positions. The cases that require more analysis or may be actual bad parameters positions are not ignored
This commit is contained in:
parent
eb12fe6545
commit
63b2fff4a7
|
|
@ -129,6 +129,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) {
|
|||
}
|
||||
|
||||
//print '-name='.$name.'-color='.$color;
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$res = dolibarr_set_const($db, 'AGENDA_EXT_NAME'.$i, $name, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
|
@ -205,10 +206,10 @@ print "<br>\n";
|
|||
|
||||
|
||||
$selectedvalue = getDolGlobalInt('AGENDA_DISABLE_EXT');
|
||||
if ($selectedvalue==1) {
|
||||
$selectedvalue=0;
|
||||
if ($selectedvalue == 1) {
|
||||
$selectedvalue = 0;
|
||||
} else {
|
||||
$selectedvalue=1;
|
||||
$selectedvalue = 1;
|
||||
}
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
|
|
@ -224,7 +225,7 @@ print '<tr class="oddeven">';
|
|||
print "<td>".$langs->trans("ExtSitesEnableThisTool")."</td>";
|
||||
print '<td class="center">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled'=>array(0=>'.hideifnotset')), null, 1);
|
||||
print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled' => array(0 => '.hideifnotset')), null, 1);
|
||||
} else {
|
||||
if (!getDolGlobalString('AGENDA_DISABLE_EXT')) {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
|
|
@ -269,7 +270,7 @@ while ($i <= $MAXAGENDA) {
|
|||
$default = 'AGENDA_EXT_ACTIVEBYDEFAULT' . $key;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
// Nb
|
||||
// Nb @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print '<td width="180" class="nowrap">' . $langs->trans("AgendaExtNb", $key) . "</td>";
|
||||
// Name
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME' . $key . '" value="' . (GETPOST('AGENDA_EXT_NAME' . $key) ? GETPOST('AGENDA_EXT_NAME' . $key, 'alpha') : getDolGlobalString($name)) . '" size="28"></td>';
|
||||
|
|
@ -286,6 +287,7 @@ while ($i <= $MAXAGENDA) {
|
|||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key);
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
if (getDolGlobalString($default)) {
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ $rowid = GETPOST('rowid', 'alpha');
|
|||
$entity = GETPOSTINT('entity');
|
||||
$code = GETPOST('code', 'alpha');
|
||||
|
||||
$acts = array(); $actl = array();
|
||||
$acts = array();
|
||||
$actl = array();
|
||||
$acts[0] = "activate";
|
||||
$acts[1] = "disable";
|
||||
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"');
|
||||
|
|
@ -472,7 +473,7 @@ $tabrowid[27] = "id";
|
|||
$tabrowid[28] = "";
|
||||
$tabrowid[29] = "";
|
||||
$tabrowid[30] = "";
|
||||
$tabrowid[31]= "";
|
||||
$tabrowid[31] = "";
|
||||
$tabrowid[32] = "id";
|
||||
$tabrowid[33] = "rowid";
|
||||
$tabrowid[34] = "rowid";
|
||||
|
|
@ -539,58 +540,58 @@ $tabhelp = array();
|
|||
|
||||
// Table to store complete information (will replace all other table). Key is table name.
|
||||
$tabcomplete = array(
|
||||
'c_forme_juridique'=>array(
|
||||
'picto'=>'company',
|
||||
'help'=>array('code'=>$langs->trans("EnterAnyCode"))
|
||||
'c_forme_juridique' => array(
|
||||
'picto' => 'company',
|
||||
'help' => array('code' => $langs->trans("EnterAnyCode"))
|
||||
),
|
||||
'c_departements'=>array(
|
||||
'picto'=>'state',
|
||||
'help'=>array('code'=>$langs->trans("EnterAnyCode"))
|
||||
'c_departements' => array(
|
||||
'picto' => 'state',
|
||||
'help' => array('code' => $langs->trans("EnterAnyCode"))
|
||||
),
|
||||
'c_regions'=>array(
|
||||
'picto'=>'region',
|
||||
'help'=>array('code'=>$langs->trans("EnterAnyCode"))
|
||||
'c_regions' => array(
|
||||
'picto' => 'region',
|
||||
'help' => array('code' => $langs->trans("EnterAnyCode"))
|
||||
),
|
||||
'c_country'=>array('picto'=>'country', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_civility'=>array('picto'=>'contact', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_actioncomm'=>array('picto'=>'action', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'color'=>$langs->trans("ColorFormat"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
||||
'c_chargesociales'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_typent'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
||||
'c_currencies'=>array('picto'=>'multicurrency', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'unicode'=>$langs->trans("UnicodeCurrency"))),
|
||||
'c_tva'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'taux'=>$langs->trans("SellTaxRate"), 'recuperableonly'=>$langs->trans("RecuperableOnly"), 'localtax1_type'=>$langs->trans("LocalTaxDesc"), 'localtax2_type'=>$langs->trans("LocalTaxDesc"))),
|
||||
'c_type_contact'=>array('picto'=>'contact', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
||||
'c_payment_term'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'type_cdr'=>$langs->trans("TypeCdr", $langs->transnoentitiesnoconv("NbOfDays"), $langs->transnoentitiesnoconv("Offset"), $langs->transnoentitiesnoconv("NbOfDays"), $langs->transnoentitiesnoconv("Offset")))),
|
||||
'c_paiement'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_ecotaxe'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_paper_format'=>array('picto'=>'generic', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_prospectlevel'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_type_fees'=>array('picto'=>'trip', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_shipment_mode'=>array('picto'=>'shipment', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'tracking'=>$langs->trans("UrlTrackingDesc"))),
|
||||
'c_effectif'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_input_method'=>array('picto'=>'order', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_input_reason'=>array('picto'=>'order', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
||||
'c_availability'=>array('picto'=>'shipment', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_revenuestamp'=>array('picto'=>'bill', 'help'=>array('revenuestamp_type'=>$langs->trans('FixedOrPercent'))),
|
||||
'c_type_resource'=>array('picto'=>'resource', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_type_container'=>array('picto'=>'website', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_stcomm'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"))),
|
||||
'c_holiday_types'=>array('picto'=>'holiday', 'help'=>array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"))),
|
||||
'c_lead_status'=>array('picto'=>'project', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"))),
|
||||
'c_format_cards'=>array('picto'=>'generic', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"))),
|
||||
'c_hrm_public_holiday'=>array('picto'=>'holiday', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'dayrule'=>"Keep empty for a date defined with month and day (most common case).<br>Use a keyword like 'easter', 'eastermonday', ... for a date predefined by complex rules.", 'country'=>$langs->trans("CountryIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear"))),
|
||||
'c_hrm_department'=>array('picto'=>'hrm', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_hrm_function'=>array('picto'=>'hrm', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_exp_tax_cat'=>array('picto'=>'expensereport', 'help'=>array()),
|
||||
'c_exp_tax_range'=>array('picto'=>'expensereport', 'help'=>array('range_ik'=>$langs->trans('PrevRangeToThisRange'))),
|
||||
'c_units'=>array('picto'=>'product', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'unit_type' => $langs->trans('Measuringtype_durationDesc'), 'scale' => $langs->trans('MeasuringScaleDesc'))),
|
||||
'c_socialnetworks'=>array('picto'=>'share-alt', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'))),
|
||||
'c_prospectcontactlevel'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_stcommcontact'=>array('picto'=>'company', 'help'=>array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"))),
|
||||
'c_transport_mode'=>array('picto'=>'incoterm', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_product_nature'=>array('picto'=>'product', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_productbatch_qcstatus'=>array('picto'=>'lot', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_asset_disposal_type'=>array('picto'=>'asset', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_invoice_subtype'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))),
|
||||
'c_country' => array('picto' => 'country', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_civility' => array('picto' => 'contact', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_actioncomm' => array('picto' => 'action', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'color' => $langs->trans("ColorFormat"), 'position' => $langs->trans("PositionIntoComboList"))),
|
||||
'c_chargesociales' => array('picto' => 'bill', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_typent' => array('picto' => 'company', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'position' => $langs->trans("PositionIntoComboList"))),
|
||||
'c_currencies' => array('picto' => 'multicurrency', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'unicode' => $langs->trans("UnicodeCurrency"))),
|
||||
'c_tva' => array('picto' => 'bill', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'taux' => $langs->trans("SellTaxRate"), 'recuperableonly' => $langs->trans("RecuperableOnly"), 'localtax1_type' => $langs->trans("LocalTaxDesc"), 'localtax2_type' => $langs->trans("LocalTaxDesc"))),
|
||||
'c_type_contact' => array('picto' => 'contact', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'position' => $langs->trans("PositionIntoComboList"))),
|
||||
'c_payment_term' => array('picto' => 'bill', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'type_cdr' => $langs->trans("TypeCdr", $langs->transnoentitiesnoconv("NbOfDays"), $langs->transnoentitiesnoconv("Offset"), $langs->transnoentitiesnoconv("NbOfDays"), $langs->transnoentitiesnoconv("Offset")))),
|
||||
'c_paiement' => array('picto' => 'bill', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_ecotaxe' => array('picto' => 'bill', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_paper_format' => array('picto' => 'generic', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_prospectlevel' => array('picto' => 'company', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_type_fees' => array('picto' => 'trip', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_shipment_mode' => array('picto' => 'shipment', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'tracking' => $langs->trans("UrlTrackingDesc"))),
|
||||
'c_effectif' => array('picto' => 'company', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_input_method' => array('picto' => 'order', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_input_reason' => array('picto' => 'order', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'position' => $langs->trans("PositionIntoComboList"))),
|
||||
'c_availability' => array('picto' => 'shipment', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_revenuestamp' => array('picto' => 'bill', 'help' => array('revenuestamp_type' => $langs->trans('FixedOrPercent'))),
|
||||
'c_type_resource' => array('picto' => 'resource', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_type_container' => array('picto' => 'website', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_stcomm' => array('picto' => 'company', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'picto' => $langs->trans("PictoHelp"))),
|
||||
'c_holiday_types' => array('picto' => 'holiday', 'help' => array('affect' => $langs->trans("FollowedByACounter"), 'delay' => $langs->trans("MinimumNoticePeriod"), 'newbymonth' => $langs->trans("NbAddedAutomatically"))),
|
||||
'c_lead_status' => array('picto' => 'project', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'percent' => $langs->trans("OpportunityPercent"), 'position' => $langs->trans("PositionIntoComboList"))),
|
||||
'c_format_cards' => array('picto' => 'generic', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'name' => $langs->trans("LabelName"), 'paper_size' => $langs->trans("LabelPaperSize"))),
|
||||
'c_hrm_public_holiday' => array('picto' => 'holiday', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'dayrule' => "Keep empty for a date defined with month and day (most common case).<br>Use a keyword like 'easter', 'eastermonday', ... for a date predefined by complex rules.", 'country' => $langs->trans("CountryIfSpecificToOneCountry"), 'year' => $langs->trans("ZeroMeansEveryYear"))),
|
||||
'c_hrm_department' => array('picto' => 'hrm', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_hrm_function' => array('picto' => 'hrm', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_exp_tax_cat' => array('picto' => 'expensereport', 'help' => array()),
|
||||
'c_exp_tax_range' => array('picto' => 'expensereport', 'help' => array('range_ik' => $langs->trans('PrevRangeToThisRange'))),
|
||||
'c_units' => array('picto' => 'product', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'unit_type' => $langs->trans('Measuringtype_durationDesc'), 'scale' => $langs->trans('MeasuringScaleDesc'))),
|
||||
'c_socialnetworks' => array('picto' => 'share-alt', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'))),
|
||||
'c_prospectcontactlevel' => array('picto' => 'company', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_stcommcontact' => array('picto' => 'company', 'help' => array('code' => $langs->trans("EnterAnyCode"), 'picto' => $langs->trans("PictoHelp"))),
|
||||
'c_transport_mode' => array('picto' => 'incoterm', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_product_nature' => array('picto' => 'product', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_productbatch_qcstatus' => array('picto' => 'lot', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_asset_disposal_type' => array('picto' => 'asset', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
'c_invoice_subtype' => array('picto' => 'bill', 'help' => array('code' => $langs->trans("EnterAnyCode"))),
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -622,7 +623,7 @@ foreach ($tabcomplete as $key => $value) {
|
|||
$keytable = '';
|
||||
if ($id > 0) {
|
||||
$arrayofkeys = array_keys($tabcomplete);
|
||||
if (array_key_exists($id -1, $arrayofkeys)) {
|
||||
if (array_key_exists($id - 1, $arrayofkeys)) {
|
||||
$keytable = $arrayofkeys[$id - 1];
|
||||
}
|
||||
}
|
||||
|
|
@ -701,23 +702,23 @@ $localtax_typeList = array(
|
|||
|
||||
$object = new stdClass();
|
||||
$parameters = array(
|
||||
'id' =>$id,
|
||||
'rowid' =>$rowid,
|
||||
'code' =>$code,
|
||||
'confirm' =>$confirm,
|
||||
'entity' =>$entity,
|
||||
'taborder' =>$taborder,
|
||||
'tabname' =>$tabname,
|
||||
'tablib' =>$tablib,
|
||||
'tabsql' =>$tabsql,
|
||||
'tabsqlsort' =>$tabsqlsort,
|
||||
'tabfield' =>$tabfield,
|
||||
'tabfieldvalue' =>$tabfieldvalue,
|
||||
'tabfieldinsert'=>$tabfieldinsert,
|
||||
'tabrowid' =>$tabrowid,
|
||||
'tabcond' =>$tabcond,
|
||||
'tabhelp' =>$tabhelp,
|
||||
'tabcomplete' =>$tabcomplete
|
||||
'id' => $id,
|
||||
'rowid' => $rowid,
|
||||
'code' => $code,
|
||||
'confirm' => $confirm,
|
||||
'entity' => $entity,
|
||||
'taborder' => $taborder,
|
||||
'tabname' => $tabname,
|
||||
'tablib' => $tablib,
|
||||
'tabsql' => $tabsql,
|
||||
'tabsqlsort' => $tabsqlsort,
|
||||
'tabfield' => $tabfield,
|
||||
'tabfieldvalue' => $tabfieldvalue,
|
||||
'tabfieldinsert' => $tabfieldinsert,
|
||||
'tabrowid' => $tabrowid,
|
||||
'tabcond' => $tabcond,
|
||||
'tabhelp' => $tabhelp,
|
||||
'tabcomplete' => $tabcomplete
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
|
|
@ -771,11 +772,11 @@ if (empty($reshook)) {
|
|||
&& (
|
||||
!in_array($value, array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking', 'picto', 'deposit_percent')) // Fields that are not mandatory
|
||||
&& ($id != 10 || ($value != 'code' && $value != 'note')) // Field code and note is not mandatory for dictionary table 10
|
||||
)
|
||||
) {
|
||||
$ok = 0;
|
||||
$fieldnamekey = $value;
|
||||
// We take translate key of field
|
||||
)
|
||||
) {
|
||||
$ok = 0;
|
||||
$fieldnamekey = $value;
|
||||
// We take translate key of field
|
||||
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) {
|
||||
$fieldnamekey = 'Label';
|
||||
}
|
||||
|
|
@ -828,7 +829,7 @@ if (empty($reshook)) {
|
|||
$fieldnamekey = 'UseByDefault';
|
||||
}
|
||||
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||
}
|
||||
}
|
||||
// Other special checks
|
||||
|
|
@ -955,7 +956,7 @@ if (empty($reshook)) {
|
|||
if ($id == 10 && GETPOSTINT('country') > 0) {
|
||||
$search_country_id = GETPOSTINT('country');
|
||||
}
|
||||
$_POST = array('id'=>$id);
|
||||
$_POST = array('id' => $id);
|
||||
} else {
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
||||
|
|
@ -1669,7 +1670,7 @@ if ($id > 0) {
|
|||
}
|
||||
|
||||
$tmpaction = 'create';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
|
@ -2168,7 +2169,7 @@ if ($id > 0) {
|
|||
|
||||
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
|
||||
$tmpaction = 'edit';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
|
@ -2190,7 +2191,7 @@ if ($id > 0) {
|
|||
print '</td>';
|
||||
} else {
|
||||
$tmpaction = 'view';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$error = $hookmanager->error;
|
||||
|
|
@ -2281,7 +2282,7 @@ if ($id > 0) {
|
|||
$key = $langs->trans("PaymentType".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "PaymentType".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'type' && $tabname[$id] == 'c_paiement') {
|
||||
$payment_type_list = array(0=>$langs->trans('PaymentTypeCustomer'), 1=>$langs->trans('PaymentTypeSupplier'), 2=>$langs->trans('PaymentTypeBoth'));
|
||||
$payment_type_list = array(0 => $langs->trans('PaymentTypeCustomer'), 1 => $langs->trans('PaymentTypeSupplier'), 2 => $langs->trans('PaymentTypeBoth'));
|
||||
$valuetoshow = $payment_type_list[$valuetoshow];
|
||||
} elseif ($value == 'label' && $tabname[$id] == 'c_input_reason') {
|
||||
$key = $langs->trans("DemandReasonType".strtoupper($obj->code));
|
||||
|
|
@ -2378,7 +2379,7 @@ if ($id > 0) {
|
|||
} elseif ($value == 'icon') {
|
||||
$valuetoshow = $obj->{$value}." ".img_picto("", $obj->{$value});
|
||||
} elseif ($value == 'type_duration') {
|
||||
$TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes'));
|
||||
$TDurationTypes = array('y' => $langs->trans('Years'), 'm' => $langs->trans('Month'), 'w' => $langs->trans('Weeks'), 'd' => $langs->trans('Days'), 'h' => $langs->trans('Hours'), 'i' => $langs->trans('Minutes'));
|
||||
if (!empty($obj->{$value}) && array_key_exists($obj->{$value}, $TDurationTypes)) {
|
||||
$valuetoshow = $TDurationTypes[$obj->{$value}];
|
||||
}
|
||||
|
|
@ -2634,6 +2635,7 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
|||
} elseif (in_array($value, array('public', 'use_default'))) {
|
||||
// Fields 0/1 with a combo select Yes/No
|
||||
print '<td class="center">';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value} : ''), 1);
|
||||
print '</td>';
|
||||
} elseif ($value == 'private') {
|
||||
|
|
@ -2648,7 +2650,7 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
|||
print '</td>';
|
||||
} elseif ($value == 'type' && $tabname == 'c_paiement') {
|
||||
print '<td>';
|
||||
$select_list = array(0=>$langs->trans('PaymentTypeCustomer'), 1=>$langs->trans('PaymentTypeSupplier'), 2=>$langs->trans('PaymentTypeBoth'));
|
||||
$select_list = array(0 => $langs->trans('PaymentTypeCustomer'), 1 => $langs->trans('PaymentTypeSupplier'), 2 => $langs->trans('PaymentTypeBoth'));
|
||||
print $form->selectarray($value, $select_list, (!empty($obj->{$value}) ? $obj->{$value} : '2'));
|
||||
print '</td>';
|
||||
} elseif ($value == 'recuperableonly' || $value == 'type_cdr' || $value == 'deductible' || $value == 'category_type') {
|
||||
|
|
@ -2658,8 +2660,9 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
|||
print '<td>';
|
||||
}
|
||||
if ($value == 'type_cdr') {
|
||||
print $form->selectarray($value, array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (!empty($obj->{$value}) ? $obj->{$value} : ''));
|
||||
print $form->selectarray($value, array(0 => $langs->trans('None'), 1 => $langs->trans('AtEndOfMonth'), 2 => $langs->trans('CurrentNext')), (!empty($obj->{$value}) ? $obj->{$value} : ''));
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value} : ''), 1);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -2709,7 +2712,7 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
|||
} elseif ($value == 'type_vat') {
|
||||
// VAT type 0: all, 1: sell, 2: purchase
|
||||
print '<td class="center">';
|
||||
print $form->selectarray($value, $type_vatList, (!empty($obj->{$value}) ? $obj->{$value}:''));
|
||||
print $form->selectarray($value, $type_vatList, (!empty($obj->{$value}) ? $obj->{$value} : ''));
|
||||
print '</td>';
|
||||
} elseif ($value == 'localtax1_type' || $value == 'localtax2_type') {
|
||||
// Le type de taxe locale
|
||||
|
|
|
|||
|
|
@ -44,13 +44,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langsArray=array("errors", "admin", "mails", "languages");
|
||||
$langsArray = array("errors", "admin", "mails", "languages");
|
||||
|
||||
if (isModEnabled('member')) {
|
||||
$langsArray[]='members';
|
||||
$langsArray[] = 'members';
|
||||
}
|
||||
if (isModEnabled('eventorganization')) {
|
||||
$langsArray[]='eventorganization';
|
||||
$langsArray[] = 'eventorganization';
|
||||
}
|
||||
|
||||
$langs->loadLangs($langsArray);
|
||||
|
|
@ -163,16 +163,16 @@ if (!getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) {
|
|||
|
||||
$tabhelp = array();
|
||||
$tabhelp[25] = array(
|
||||
'label'=>$langs->trans('EnterAnyCode'),
|
||||
'type_template'=>$langs->trans("TemplateForElement"),
|
||||
'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"),
|
||||
'position'=>$langs->trans("PositionIntoComboList"),
|
||||
'topic'=>'<span class="small">'.$helpsubstit.'</span>',
|
||||
'email_from'=>$langs->trans('ForceEmailFrom'),
|
||||
'joinfiles'=>$langs->trans('AttachMainDocByDefault'),
|
||||
'defaultfortype'=>$langs->trans("DefaultForTypeDesc"),
|
||||
'content'=>'<span class="small">'.$helpsubstit.'</span>',
|
||||
'content_lines'=>'<span class="small">'.$helpsubstitforlines.'</span>'
|
||||
'label' => $langs->trans('EnterAnyCode'),
|
||||
'type_template' => $langs->trans("TemplateForElement"),
|
||||
'private' => $langs->trans("TemplateIsVisibleByOwnerOnly"),
|
||||
'position' => $langs->trans("PositionIntoComboList"),
|
||||
'topic' => '<span class="small">'.$helpsubstit.'</span>',
|
||||
'email_from' => $langs->trans('ForceEmailFrom'),
|
||||
'joinfiles' => $langs->trans('AttachMainDocByDefault'),
|
||||
'defaultfortype' => $langs->trans("DefaultForTypeDesc"),
|
||||
'content' => '<span class="small">'.$helpsubstit.'</span>',
|
||||
'content_lines' => '<span class="small">'.$helpsubstitforlines.'</span>'
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -241,7 +241,7 @@ if (isModEnabled('partnership') && $user->hasRight('partnership', 'read')) {
|
|||
$elementList['partnership_send'] = img_picto('', 'partnership', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToPartnership'));
|
||||
}
|
||||
|
||||
$parameters = array('elementList'=>$elementList);
|
||||
$parameters = array('elementList' => $elementList);
|
||||
$reshook = $hookmanager->executeHooks('emailElementlist', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook == 0) {
|
||||
foreach ($hookmanager->resArray as $item => $value) {
|
||||
|
|
@ -418,7 +418,7 @@ if (empty($reshook)) {
|
|||
$result = $db->query($sql);
|
||||
if ($result) { // Add is ok
|
||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||
$_POST = array('id'=>$id); // Clean $_POST array, we keep only id
|
||||
$_POST = array('id' => $id); // Clean $_POST array, we keep only id
|
||||
} else {
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
||||
|
|
@ -1040,7 +1040,7 @@ foreach ($fieldlist as $field => $value) {
|
|||
}
|
||||
$sortfieldtouse = ($sortable ? $fieldlist[$field] : '');
|
||||
if ($sortfieldtouse == 'type_template') {
|
||||
$sortfieldtouse.= 'type_template,lang,position,label';
|
||||
$sortfieldtouse .= 'type_template,lang,position,label';
|
||||
}
|
||||
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], $sortfieldtouse, ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, $css.' ');
|
||||
}
|
||||
|
|
@ -1065,7 +1065,7 @@ if ($num) {
|
|||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
|
||||
$tmpaction = 'edit';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('editEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
|
@ -1216,7 +1216,7 @@ if ($num) {
|
|||
}
|
||||
|
||||
$tmpaction = 'view';
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('viewEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$error = $hookmanager->error;
|
||||
|
|
@ -1461,8 +1461,10 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
|||
print '<td'.($classtd ? ' class="'.$classtd.'"' : '').'>';
|
||||
if ($value == 'private' && $context != 'preview') {
|
||||
if (empty($user->admin)) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->selectyesno($value, '1', 1);
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->selectyesno($value, (isset($obj->$value) ? $obj->$value : ''), 1);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -89,8 +89,8 @@ if (!count($listofvars) && !count($listofstatus)) {
|
|||
$arraytest = array();
|
||||
if (preg_match('/mysql/i', $db->type)) {
|
||||
$arraytest = array(
|
||||
'character_set_database'=>array('var'=>'dolibarr_main_db_character_set', 'valifempty'=>'utf8'),
|
||||
'collation_database'=>array('var'=>'dolibarr_main_db_collation', 'valifempty'=>'utf8_unicode_ci')
|
||||
'character_set_database' => array('var' => 'dolibarr_main_db_character_set', 'valifempty' => 'utf8'),
|
||||
'collation_database' => array('var' => 'dolibarr_main_db_collation', 'valifempty' => 'utf8_unicode_ci')
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -123,9 +123,11 @@ if (!count($listofvars) && !count($listofstatus)) {
|
|||
print $paramval;
|
||||
}
|
||||
if ($show == 1) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($paramval, $text);
|
||||
}
|
||||
if ($show == 2) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($paramval, $text, 1, 'warning');
|
||||
}
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -58,11 +58,11 @@ $object = new stdClass();
|
|||
|
||||
// Definition of fields for lists
|
||||
$arrayfields = array(
|
||||
'name'=>array('label'=>$langs->trans("Modules"), 'checked'=>1, 'position'=>10),
|
||||
'version'=>array('label'=>$langs->trans("Version"), 'checked'=>1, 'position'=>20),
|
||||
'id'=>array('label'=>$langs->trans("IdModule"), 'checked'=>1, 'position'=>30),
|
||||
'module_position'=>array('label'=>$langs->trans("Position"), 'checked'=>1, 'position'=>35),
|
||||
'permission'=>array('label'=>$langs->trans("IdPermissions"), 'checked'=>1, 'position'=>40)
|
||||
'name' => array('label' => $langs->trans("Modules"), 'checked' => 1, 'position' => 10),
|
||||
'version' => array('label' => $langs->trans("Version"), 'checked' => 1, 'position' => 20),
|
||||
'id' => array('label' => $langs->trans("IdModule"), 'checked' => 1, 'position' => 30),
|
||||
'module_position' => array('label' => $langs->trans("Position"), 'checked' => 1, 'position' => 35),
|
||||
'permission' => array('label' => $langs->trans("IdPermissions"), 'checked' => 1, 'position' => 40)
|
||||
);
|
||||
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
|
@ -143,6 +143,7 @@ foreach ($modules as $key => $module) {
|
|||
|
||||
if (!empty($module->picto)) {
|
||||
if (preg_match('/^\//', $module->picto)) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$newModule->picto = img_picto($alt, $module->picto, 'width="14px"', 1);
|
||||
} else {
|
||||
$newModule->picto = img_object($alt, $module->picto, 'width="14px"');
|
||||
|
|
@ -157,7 +158,7 @@ foreach ($modules as $key => $module) {
|
|||
if (empty($rights[0])) {
|
||||
continue;
|
||||
}
|
||||
$arrayofpermissions[$rights[0]] = array('label'=> 'user->hasRight(\''.$module->rights_class.'\', \''.$rights[4].'\''.(empty($rights[5]) ? '' : ', \''.$rights[5].'\'').')');
|
||||
$arrayofpermissions[$rights[0]] = array('label' => 'user->hasRight(\''.$module->rights_class.'\', \''.$rights[4].'\''.(empty($rights[5]) ? '' : ', \''.$rights[5].'\'').')');
|
||||
$permission[] = $rights[0];
|
||||
|
||||
array_push($rights_ids, $rights[0]);
|
||||
|
|
@ -296,7 +297,7 @@ if ($arrayfields['module_position']['checked']) {
|
|||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
|
|
@ -408,13 +409,13 @@ llxFooter();
|
|||
$db->close();
|
||||
|
||||
|
||||
/**
|
||||
* Compare two modules by their ID for a ascending order
|
||||
*
|
||||
* @param stdClass $a First module
|
||||
* @param stdClass $b Second module
|
||||
* @return int Compare result (-1, 0, 1)
|
||||
*/
|
||||
/**
|
||||
* Compare two modules by their ID for a ascending order
|
||||
*
|
||||
* @param stdClass $a First module
|
||||
* @param stdClass $b Second module
|
||||
* @return int Compare result (-1, 0, 1)
|
||||
*/
|
||||
function compareIdAsc(stdClass $a, stdClass $b)
|
||||
{
|
||||
if ((int) $a->id == (int) $b->id) {
|
||||
|
|
@ -424,13 +425,13 @@ function compareIdAsc(stdClass $a, stdClass $b)
|
|||
return ((int) $a->id < (int) $b->id) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two modules by their ID for a descending order
|
||||
*
|
||||
* @param stdClass $a First module
|
||||
* @param stdClass $b Second module
|
||||
* @return int Compare result (-1, 0, 1)
|
||||
*/
|
||||
/**
|
||||
* Compare two modules by their ID for a descending order
|
||||
*
|
||||
* @param stdClass $a First module
|
||||
* @param stdClass $b Second module
|
||||
* @return int Compare result (-1, 0, 1)
|
||||
*/
|
||||
function compareIdDesc(stdClass $a, stdClass $b)
|
||||
{
|
||||
if ((int) $a->id == (int) $b->id) {
|
||||
|
|
@ -440,13 +441,13 @@ function compareIdDesc(stdClass $a, stdClass $b)
|
|||
return ((int) $b->id < (int) $a->id) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two modules by their ID for a ascending order
|
||||
*
|
||||
* @param stdClass $a First module
|
||||
* @param stdClass $b Second module
|
||||
* @return int Compare result (-1, 0, 1)
|
||||
*/
|
||||
/**
|
||||
* Compare two modules by their ID for a ascending order
|
||||
*
|
||||
* @param stdClass $a First module
|
||||
* @param stdClass $b Second module
|
||||
* @return int Compare result (-1, 0, 1)
|
||||
*/
|
||||
function comparePermissionIdsAsc(stdClass $a, stdClass $b)
|
||||
{
|
||||
if (empty($a->permission) && empty($b->permission)) {
|
||||
|
|
@ -467,13 +468,13 @@ function comparePermissionIdsAsc(stdClass $a, stdClass $b)
|
|||
return $a->permission[0] < $b->permission[0] ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two modules by their permissions for a descending order
|
||||
*
|
||||
* @param stdClass $a First module
|
||||
* @param stdClass $b Second module
|
||||
* @return int Compare result (-1, 0, 1)
|
||||
*/
|
||||
/**
|
||||
* Compare two modules by their permissions for a descending order
|
||||
*
|
||||
* @param stdClass $a First module
|
||||
* @param stdClass $b Second module
|
||||
* @return int Compare result (-1, 0, 1)
|
||||
*/
|
||||
function comparePermissionIdsDesc(stdClass $a, stdClass $b)
|
||||
{
|
||||
if (empty($a->permission) && empty($b->permission)) {
|
||||
|
|
|
|||
|
|
@ -617,6 +617,7 @@ if ($mode == 'searchkey') {
|
|||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&token='.newToken().'&mode='.urlencode($mode).'">'.img_delete().'</a>';
|
||||
print ' ';
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key);
|
||||
print $form->textwithpicto('', $htmltext, 1, 'warning');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@ print "<br>\n";
|
|||
|
||||
$interfaces = new Interfaces($db);
|
||||
$triggers = $interfaces->getTriggersList();
|
||||
$param = ''; $align = '';
|
||||
$param = '';
|
||||
$align = '';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
|
|
@ -78,6 +79,7 @@ foreach ($triggers as $trigger) {
|
|||
$text = $trigger['info'];
|
||||
$text .= "<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath'];
|
||||
//$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto('', $text);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -276,6 +276,7 @@ if (!getDolGlobalString('AGENDA_DISABLE_EXT')) {
|
|||
'name' => dol_string_nohtmltag(getDolGlobalString($name)),
|
||||
'offsettz' => (int) getDolGlobalInt($offsettz, 0),
|
||||
'color' => dol_string_nohtmltag(getDolGlobalString($color)),
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
'default' => dol_string_nohtmltag(getDolGlobalString($default)),
|
||||
'buggedfile' => dol_string_nohtmltag(getDolGlobalString('buggedfile', ''))
|
||||
);
|
||||
|
|
@ -301,6 +302,7 @@ if (empty($user->conf->AGENDA_DISABLE_EXT)) {
|
|||
'src' => getDolUserString($source),
|
||||
'name' => dol_string_nohtmltag(getDolUserString($name)),
|
||||
'offsettz' => (int) (empty($user->conf->$offsettz) ? 0 : $user->conf->$offsettz),
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
'color' => dol_string_nohtmltag(getDolUserString($color)),
|
||||
'default' => dol_string_nohtmltag(getDolUserString($default)),
|
||||
'buggedfile' => dol_string_nohtmltag(isset($user->conf->buggedfile) ? $user->conf->buggedfile : '')
|
||||
|
|
@ -1562,6 +1564,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month
|
|||
$style .= ' cal_other_month_right';
|
||||
}
|
||||
echo ' <td class="'.$style.' nowrap tdtop" width="14%">';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
|
||||
echo " </td>\n";
|
||||
} elseif ($tmpday <= $max_day_in_month) {
|
||||
|
|
@ -1583,6 +1586,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month
|
|||
}
|
||||
//var_dump($todayarray['mday']."==".$tmpday." && ".$todayarray['mon']."==".$month." && ".$todayarray['year']."==".$year.' -> '.$style);
|
||||
echo ' <td class="'.$style.' nowrap tdtop" width="14%">';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam, 0, 60, 0, $bookcalcalendars);
|
||||
echo "</td>\n";
|
||||
} else {
|
||||
|
|
@ -1592,6 +1596,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month
|
|||
$style .= ' cal_other_month_right';
|
||||
}
|
||||
echo ' <td class="'.$style.' nowrap tdtop" width="14%">';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
|
||||
echo "</td>\n";
|
||||
}
|
||||
|
|
@ -1656,6 +1661,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month
|
|||
}
|
||||
|
||||
echo ' <td class="'.$style.'" width="14%" valign="top">';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
show_day_events($db, $tmpday, $tmpmonth, $tmpyear, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0, $bookcalcalendars);
|
||||
echo " </td>\n";
|
||||
}
|
||||
|
|
@ -1746,12 +1752,14 @@ if (empty($mode) || $mode == 'show_month') { // View by month
|
|||
|
||||
echo '</div></div>';
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 1, $bookcalcalendars);
|
||||
|
||||
print '</div>';
|
||||
} else {
|
||||
print '<div class="div-table-responsive-no-min borderbottom">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0, $bookcalcalendars);
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -448,6 +448,7 @@ if ($object->fetch($id) >= 0) {
|
|||
$nbemail = ($object->nbemail ? $object->nbemail : '0');
|
||||
if (getDolGlobalString('MAILING_LIMIT_SENDBYWEB') && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) {
|
||||
$text = $langs->trans('LimitSendingEmailing', getDolGlobalString('MAILING_LIMIT_SENDBYWEB'));
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($nbemail, $text, 1, 'warning');
|
||||
} else {
|
||||
print $nbemail;
|
||||
|
|
|
|||
|
|
@ -2093,7 +2093,7 @@ if (empty($reshook)) {
|
|||
|
||||
// Set if we used free entry or predefined product
|
||||
$predef = '';
|
||||
$product_desc =(GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
|
||||
$product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
|
||||
|
||||
$price_ht = '';
|
||||
$price_ht_devise = '';
|
||||
|
|
@ -2292,8 +2292,8 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
//If text set in desc is the same as product descpription (as now it's preloaded) we add it only one time
|
||||
if ($product_desc==$desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) {
|
||||
$product_desc='';
|
||||
if ($product_desc == $desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) {
|
||||
$product_desc = '';
|
||||
}
|
||||
|
||||
if (!empty($product_desc) && getDolGlobalString('MAIN_NO_CONCAT_DESCRIPTION')) {
|
||||
|
|
@ -2347,10 +2347,16 @@ if (empty($reshook)) {
|
|||
$type = $prod->type;
|
||||
$fk_unit = $prod->fk_unit;
|
||||
} else {
|
||||
if (!empty($price_ht)) $pu_ht = price2num($price_ht, 'MU');
|
||||
else $pu_ht = '';
|
||||
if (!empty($price_ttc)) $pu_ttc = price2num($price_ttc, 'MU');
|
||||
else $pu_ttc = '';
|
||||
if (!empty($price_ht)) {
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
} else {
|
||||
$pu_ht = '';
|
||||
}
|
||||
if (!empty($price_ttc)) {
|
||||
$pu_ttc = price2num($price_ttc, 'MU');
|
||||
} else {
|
||||
$pu_ttc = '';
|
||||
}
|
||||
$tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0);
|
||||
$tva_tx = str_replace('*', '', $tva_tx);
|
||||
if (empty($tva_tx)) {
|
||||
|
|
@ -2822,7 +2828,7 @@ if (empty($reshook)) {
|
|||
&& !$objectidnext
|
||||
&& $object->is_last_in_cycle()
|
||||
&& $usercanunvalidate
|
||||
) {
|
||||
) {
|
||||
$outingError = 0;
|
||||
$newCycle = $object->newCycle(); // we need to keep the "situation behavior" so we place it on a new situation cycle
|
||||
if ($newCycle > 1) {
|
||||
|
|
@ -2836,7 +2842,7 @@ if (empty($reshook)) {
|
|||
if ($next_invoice->type == Facture::TYPE_CREDIT_NOTE
|
||||
&& $next_invoice->situation_counter == $object->situation_counter
|
||||
&& $next_invoice->fk_facture_source == $object->id
|
||||
) {
|
||||
) {
|
||||
$linkedCreditNotesList[] = $next_invoice->id;
|
||||
}
|
||||
}
|
||||
|
|
@ -3942,7 +3948,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters = array('objectsrc' => !empty($objectsrc) ? $objectsrc : 0, 'colspan' => ' colspan="2"', 'cols' => '2', 'socid'=>$socid);
|
||||
$parameters = array('objectsrc' => !empty($objectsrc) ? $objectsrc : 0, 'colspan' => ' colspan="2"', 'cols' => '2', 'socid' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
|
|
@ -4276,7 +4282,7 @@ if ($action == 'create') {
|
|||
&& !$objectidnext
|
||||
&& $object->is_last_in_cycle()
|
||||
&& $usercanunvalidate
|
||||
) {
|
||||
) {
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $label, $text, 'confirm_situationout', $formquestion, "yes", 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -5444,6 +5450,7 @@ if ($action == 'create') {
|
|||
$text .= '<br><br><b>'.$langs->trans("Reason").'</b>:'.$object->close_note;
|
||||
}
|
||||
print '<span class="opacitymedium">';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($langs->trans("Abandoned"), $text, - 1);
|
||||
print '</span>';
|
||||
print '</td><td class="right"><span class="amount">'.price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaid, 'MT')).'</span></td><td> </td></tr>';
|
||||
|
|
@ -5479,7 +5486,7 @@ if ($action == 'create') {
|
|||
print '</td>';
|
||||
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">';
|
||||
//print (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code).' ';
|
||||
print price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td> </td></tr>';
|
||||
print price(price2num($object->multicurrency_tx * $resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td> </td></tr>';
|
||||
}
|
||||
|
||||
// Retained warranty : usually use on construction industry
|
||||
|
|
@ -5827,7 +5834,7 @@ if ($action == 'create') {
|
|||
// For credit note
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->status == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercancreate
|
||||
&& (getDolGlobalString('INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED') || $sumofpayment == 0) && $object->total_ht < 0
|
||||
) {
|
||||
) {
|
||||
print '<a class="butAction classfortooltip'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc" title="'.dol_escape_htmltag($langs->trans("ConfirmConvertToReduc2")).'">'.$langs->trans('ConvertToReduc').'</a>';
|
||||
}
|
||||
// For down payment invoice (deposit)
|
||||
|
|
@ -5890,7 +5897,7 @@ if ($action == 'create') {
|
|||
&& !$objectidnext
|
||||
&& $object->is_last_in_cycle()
|
||||
&& getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE')
|
||||
) {
|
||||
) {
|
||||
if ($usercanunvalidate) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&fac_avoir='.$object->id.'&invoiceAvoirWithLines=1&action=create&type=2'.($object->fk_project > 0 ? '&projectid='.$object->fk_project : '').'">'.$langs->trans("CreateCreditNote").'</a>';
|
||||
} else {
|
||||
|
|
@ -5920,7 +5927,7 @@ if ($action == 'create') {
|
|||
&& $object->situation_counter > 1
|
||||
&& $object->is_last_in_cycle()
|
||||
&& $usercanunvalidate
|
||||
) {
|
||||
) {
|
||||
if (($object->total_ttc - $totalcreditnotes) == 0) {
|
||||
print '<a id="butSituationOut" class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=situationout">'.$langs->trans("RemoveSituationFromCycle").'</a>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -613,6 +613,7 @@ if ($object->id > 0) {
|
|||
print '<tr><td>'.$langs->trans($title).'</td><td colspan="3">';
|
||||
|
||||
$bac = new CompanyBankAccount($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$bac->fetch(0, $object->thirdparty->id);
|
||||
|
||||
print $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ if ($resql) {
|
|||
setEventMessages($db->lasterror, null, 'errors');
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $num, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
|
||||
|
|
|
|||
|
|
@ -190,7 +190,9 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
|
|||
for ($i = $x1; $i <= $x2; $i += $Pointilles + $Pointilles) {
|
||||
for ($j = $i; $j <= ($i + $Pointilles); $j++) {
|
||||
if ($j <= ($x2 - 1)) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$pdf->Line($j, $y1, $j + 1, $y1); // on trace le pointill? du haut, point par point
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$pdf->Line($j, $y2, $j + 1, $y2); // on trace le pointill? du bas, point par point
|
||||
}
|
||||
}
|
||||
|
|
@ -198,7 +200,9 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
|
|||
for ($i = $y1; $i <= $y2; $i += $Pointilles + $Pointilles) {
|
||||
for ($j = $i; $j <= ($i + $Pointilles); $j++) {
|
||||
if ($j <= ($y2 - 1)) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$pdf->Line($x1, $j, $x1, $j + 1); // on trace le pointill? du haut, point par point
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$pdf->Line($x2, $j, $x2, $j + 1); // on trace le pointill? du bas, point par point
|
||||
}
|
||||
}
|
||||
|
|
@ -257,8 +261,8 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
|
|||
{
|
||||
if ($src != $dest) {
|
||||
$tab = array(
|
||||
'in'=>39.37008,
|
||||
'mm'=>1000
|
||||
'in' => 39.37008,
|
||||
'mm' => 1000
|
||||
);
|
||||
return $value * $tab[$dest] / $tab[$src];
|
||||
}
|
||||
|
|
@ -278,7 +282,7 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
|
|||
{
|
||||
// phpcs:enable
|
||||
// Array for link between height of characters and space between lines
|
||||
$_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);
|
||||
$_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))) {
|
||||
return $_Table_Hauteur_Chars[$pt];
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -796,12 +796,15 @@ class Form
|
|||
} elseif ($type == 'helpclickable') {
|
||||
$img = img_help(($tooltiptrigger != '' ? 2 : 1), $alt);
|
||||
} elseif ($type == 'superadmin') {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$img = img_picto($alt, 'redstar');
|
||||
} elseif ($type == 'admin') {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$img = img_picto($alt, 'star');
|
||||
} elseif ($type == 'warning') {
|
||||
$img = img_warning($alt);
|
||||
} elseif ($type != 'none') {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$img = img_picto($alt, $type); // $type can be an image path
|
||||
}
|
||||
|
||||
|
|
@ -2222,11 +2225,11 @@ class Form
|
|||
|
||||
$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
|
||||
$outarray2[$userstatic->id] = array(
|
||||
'id'=>$userstatic->id,
|
||||
'label'=>$labeltoshow,
|
||||
'labelhtml'=>$labeltoshowhtml,
|
||||
'color'=>'',
|
||||
'picto'=>''
|
||||
'id' => $userstatic->id,
|
||||
'label' => $labeltoshow,
|
||||
'labelhtml' => $labeltoshowhtml,
|
||||
'color' => '',
|
||||
'picto' => ''
|
||||
);
|
||||
|
||||
$i++;
|
||||
|
|
@ -3370,7 +3373,7 @@ class Form
|
|||
}
|
||||
}
|
||||
|
||||
$parameters = array('objp'=>$objp);
|
||||
$parameters = array('objp' => $objp);
|
||||
$reshook = $hookmanager->executeHooks('constructProductListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$opt .= $hookmanager->resPrint;
|
||||
|
|
@ -5375,11 +5378,11 @@ class Form
|
|||
}
|
||||
$more .= $this->selectDate($input['value'], $input['name'], $h, $m, 0, '', 1, $addnowlink);
|
||||
$more .= '</div></div>'."\n";
|
||||
$formquestion[] = array('name'=>$input['name'].'day');
|
||||
$formquestion[] = array('name'=>$input['name'].'month');
|
||||
$formquestion[] = array('name'=>$input['name'].'year');
|
||||
$formquestion[] = array('name'=>$input['name'].'hour');
|
||||
$formquestion[] = array('name'=>$input['name'].'min');
|
||||
$formquestion[] = array('name' => $input['name'].'day');
|
||||
$formquestion[] = array('name' => $input['name'].'month');
|
||||
$formquestion[] = array('name' => $input['name'].'year');
|
||||
$formquestion[] = array('name' => $input['name'].'hour');
|
||||
$formquestion[] = array('name' => $input['name'].'min');
|
||||
} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
|
||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
|
||||
if (!empty($input['label'])) {
|
||||
|
|
@ -7202,7 +7205,7 @@ class Form
|
|||
// Add a link to set data
|
||||
if ($conf->use_javascript_ajax && !empty($adddateof)) {
|
||||
if (!is_array($adddateof)) {
|
||||
$arrayofdateof = array(array('adddateof'=>$adddateof, 'labeladddateof'=>$labeladddateof));
|
||||
$arrayofdateof = array(array('adddateof' => $adddateof, 'labeladddateof' => $labeladddateof));
|
||||
} else {
|
||||
$arrayofdateof = $adddateof;
|
||||
}
|
||||
|
|
@ -8171,7 +8174,9 @@ class Form
|
|||
|
||||
$oldValueForShowOnCombobox = 0;
|
||||
foreach ($objecttmp->fields as $fieldK => $fielV) {
|
||||
if (!$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) continue;
|
||||
if (!$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$oldValueForShowOnCombobox) {
|
||||
$selected_input_value = '';
|
||||
|
|
@ -10723,8 +10728,8 @@ class Form
|
|||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$searchtags = removeGlobalParenthesis($searchtags);
|
||||
|
||||
$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
|
||||
$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> ';
|
||||
$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
|
||||
$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> ';
|
||||
$ret .= dol_escape_htmltag($searchtags);
|
||||
$ret .= '</span>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class Utils
|
|||
}
|
||||
}
|
||||
if (!$alreadyincluded) {
|
||||
$filesarray[] = array('fullname'=>$filelog, 'type'=>'file');
|
||||
$filesarray[] = array('fullname' => $filelog, 'type' => 'file');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -783,7 +783,7 @@ class Utils
|
|||
|
||||
dol_syslog("Utils::executeCLI result=".$result." output=".$output." error=".$error, LOG_DEBUG);
|
||||
|
||||
return array('result'=>$result, 'output'=>$output, 'error'=>$error);
|
||||
return array('result' => $result, 'output' => $output, 'error' => $error);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -909,25 +909,26 @@ class Utils
|
|||
|
||||
//var_dump($phpfileval['fullname']);
|
||||
$arrayreplacement = array(
|
||||
'mymodule'=>strtolower($module),
|
||||
'MyModule'=>$module,
|
||||
'MYMODULE'=>strtoupper($module),
|
||||
'My module'=>$module,
|
||||
'my module'=>$module,
|
||||
'Mon module'=>$module,
|
||||
'mon module'=>$module,
|
||||
'htdocs/modulebuilder/template'=>strtolower($module),
|
||||
'__MYCOMPANY_NAME__'=>$mysoc->name,
|
||||
'__KEYWORDS__'=>$module,
|
||||
'__USER_FULLNAME__'=>$user->getFullName($langs),
|
||||
'__USER_EMAIL__'=>$user->email,
|
||||
'__YYYY-MM-DD__'=>dol_print_date($now, 'dayrfc'),
|
||||
'---Put here your own copyright and developer email---'=>dol_print_date($now, 'dayrfc').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : ''),
|
||||
'__DATA_SPECIFICATION__'=>'Not yet available',
|
||||
'__README__'=>dolMd2Asciidoc($contentreadme),
|
||||
'__CHANGELOG__'=>dolMd2Asciidoc($contentchangelog),
|
||||
'mymodule' => strtolower($module),
|
||||
'MyModule' => $module,
|
||||
'MYMODULE' => strtoupper($module),
|
||||
'My module' => $module,
|
||||
'my module' => $module,
|
||||
'Mon module' => $module,
|
||||
'mon module' => $module,
|
||||
'htdocs/modulebuilder/template' => strtolower($module),
|
||||
'__MYCOMPANY_NAME__' => $mysoc->name,
|
||||
'__KEYWORDS__' => $module,
|
||||
'__USER_FULLNAME__' => $user->getFullName($langs),
|
||||
'__USER_EMAIL__' => $user->email,
|
||||
'__YYYY-MM-DD__' => dol_print_date($now, 'dayrfc'),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, 'dayrfc').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : ''),
|
||||
'__DATA_SPECIFICATION__' => 'Not yet available',
|
||||
'__README__' => dolMd2Asciidoc($contentreadme),
|
||||
'__CHANGELOG__' => dolMd2Asciidoc($contentchangelog),
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ if (isModEnabled('modulebuilder')) {
|
|||
//$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
|
||||
$text .= '<span class="fa fa-bug atoplogin"></span>';
|
||||
$text .= '</a>';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$toprightmenu .= $form->textwithtooltip('', $langs->trans("ModuleBuilder"), 2, 1, $text, 'login_block_elem', 2);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ function societe_prepare_head(Societe $object)
|
|||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
$nbEvent = 0;
|
||||
// Enable caching of thirdparty count actioncomm
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||
|
|
@ -537,7 +537,7 @@ function getCountry($searchkey, $withcode = '', $dbtouse = null, $outputlangs =
|
|||
// Check parameters
|
||||
if (empty($searchkey) && empty($searchlabel)) {
|
||||
if ($withcode === 'all') {
|
||||
return array('id'=>'', 'code'=>'', 'label'=>'');
|
||||
return array('id' => '', 'code' => '', 'label' => '');
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
|
@ -578,7 +578,7 @@ function getCountry($searchkey, $withcode = '', $dbtouse = null, $outputlangs =
|
|||
} elseif ($withcode == 3) {
|
||||
$result = $obj->rowid;
|
||||
} elseif ($withcode === 'all') {
|
||||
$result = array('id'=>$obj->rowid, 'code'=>$obj->code, 'label'=>$label);
|
||||
$result = array('id' => $obj->rowid, 'code' => $obj->code, 'label' => $label);
|
||||
} else {
|
||||
$result = $label;
|
||||
}
|
||||
|
|
@ -651,9 +651,9 @@ function getState($id, $withcode = '', $dbtouse = null, $withregion = 0, $output
|
|||
}
|
||||
} elseif ($withcode === 'all') {
|
||||
if ($withregion == 1) {
|
||||
return array('id'=>$obj->id, 'code'=>$obj->code, 'label'=>$label, 'region_code'=>$obj->region_code, 'region'=>$obj->region_name);
|
||||
return array('id' => $obj->id, 'code' => $obj->code, 'label' => $label, 'region_code' => $obj->region_code, 'region' => $obj->region_name);
|
||||
} else {
|
||||
return array('id'=>$obj->id, 'code'=>$obj->code, 'label'=>$label);
|
||||
return array('id' => $obj->id, 'code' => $obj->code, 'label' => $label);
|
||||
}
|
||||
} else {
|
||||
if ($withregion == 1) {
|
||||
|
|
@ -962,7 +962,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
|
|||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$parameters = array('sql'=>$sql, 'function'=>'show_projects');
|
||||
$parameters = array('sql' => $sql, 'function' => 'show_projects');
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
@ -1062,35 +1062,35 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||
$extrafields->fetch_name_optionals_label($contactstatic->table_element);
|
||||
|
||||
$contactstatic->fields = array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>"TechnicalID", 'enabled'=>(getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'visible'=>(getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'position'=>1),
|
||||
'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
|
||||
'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20),
|
||||
'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30),
|
||||
'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'visible'=>3, 'position'=>35),
|
||||
'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>4, 'index'=>1, 'position'=>40),
|
||||
'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>-1, 'notnull'=> 0, 'position'=>45),
|
||||
'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>50, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0, 1), 1=>$contactstatic->LibStatut(1, 1))),
|
||||
'rowid' => array('type' => 'integer', 'label' => "TechnicalID", 'enabled' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'visible' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'position' => 1),
|
||||
'name' => array('type' => 'varchar(128)', 'label' => 'Name', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 10, 'searchall' => 1),
|
||||
'poste' => array('type' => 'varchar(128)', 'label' => 'PostOrFunction', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 2, 'index' => 1, 'position' => 20),
|
||||
'address' => array('type' => 'varchar(128)', 'label' => 'Address', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 3, 'index' => 1, 'position' => 30),
|
||||
'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'visible' => 3, 'position' => 35),
|
||||
'role' => array('type' => 'checkbox', 'label' => 'Role', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 4, 'index' => 1, 'position' => 40),
|
||||
'birthday' => array('type' => 'date', 'label' => 'Birthday', 'enabled' => 1, 'visible' => -1, 'notnull' => 0, 'position' => 45),
|
||||
'statut' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => 0, 'index' => 1, 'position' => 50, 'arrayofkeyval' => array(0 => $contactstatic->LibStatut(0, 1), 1 => $contactstatic->LibStatut(1, 1))),
|
||||
);
|
||||
|
||||
// Definition of fields for list
|
||||
$arrayfields = array(
|
||||
't.rowid'=>array('label'=>"TechnicalID", 'checked'=>(getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'enabled'=>(getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'position'=>1),
|
||||
't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10),
|
||||
't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20),
|
||||
't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30),
|
||||
't.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'position'=>35),
|
||||
'sc.role'=>array('label'=>"ContactByDefaultFor", 'checked'=>1, 'position'=>40),
|
||||
't.birthday'=>array('label'=>"Birthday", 'checked'=>0, 'position'=>45),
|
||||
't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'),
|
||||
't.rowid' => array('label' => "TechnicalID", 'checked' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'enabled' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0), 'position' => 1),
|
||||
't.name' => array('label' => "Name", 'checked' => 1, 'position' => 10),
|
||||
't.poste' => array('label' => "PostOrFunction", 'checked' => 1, 'position' => 20),
|
||||
't.address' => array('label' => (empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked' => 1, 'position' => 30),
|
||||
't.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'position' => 35),
|
||||
'sc.role' => array('label' => "ContactByDefaultFor", 'checked' => 1, 'position' => 40),
|
||||
't.birthday' => array('label' => "Birthday", 'checked' => 0, 'position' => 45),
|
||||
't.statut' => array('label' => "Status", 'checked' => 1, 'position' => 50, 'class' => 'center'),
|
||||
);
|
||||
// Extra fields
|
||||
if (!empty($extrafields->attributes[$contactstatic->table_element]['label']) && is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$contactstatic->table_element]['label'] as $key => $val) {
|
||||
if (!empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) {
|
||||
$arrayfields["ef.".$key] = array(
|
||||
'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key],
|
||||
'checked'=>(((int) dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1, 1, '1') < 0) ? 0 : 1),
|
||||
'position'=>1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key],
|
||||
'label' => $extrafields->attributes[$contactstatic->table_element]['label'][$key],
|
||||
'checked' => (((int) dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1, 1, '1') < 0) ? 0 : 1),
|
||||
'position' => 1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key],
|
||||
'enabled' => (abs((int) dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1)) != 3 && (int) dol_eval($extrafields->attributes[$contactstatic->table_element]['perms'][$key], 1, 1, '1'))
|
||||
);
|
||||
}
|
||||
|
|
@ -1274,7 +1274,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||
if (!empty($arrayfields['t.'.$key]['checked']) || !empty($arrayfields['sc.'.$key]['checked'])) {
|
||||
print '<td class="liste_titre'.($align ? ' '.$align : '').'">';
|
||||
if (in_array($key, array('statut'))) {
|
||||
print $form->selectarray('search_status', array('-1'=>'', '0'=>$contactstatic->LibStatut(0, 1), '1'=>$contactstatic->LibStatut(1, 1)), $search_status, 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage');
|
||||
print $form->selectarray('search_status', array('-1' => '', '0' => $contactstatic->LibStatut(0, 1), '1' => $contactstatic->LibStatut(1, 1)), $search_status, 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage');
|
||||
} elseif (in_array($key, array('role'))) {
|
||||
print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles, 'minwidth200 maxwidth300');
|
||||
} elseif (in_array($key, array('birthday'))) {
|
||||
|
|
@ -1298,7 +1298,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
$parameters = array('arrayfields' => $arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $contactstatic); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
|
|
@ -1345,7 +1345,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||
$extrafieldsobjectkey = $contactstatic->table_element;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
|
|
@ -1406,7 +1406,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||
print '<td class="nowrap center">';
|
||||
|
||||
// Add to agenda
|
||||
if (isModEnabled('agenda')&& $user->hasRight('agenda', 'myactions', 'create')) {
|
||||
if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) {
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
||||
print img_object($langs->trans("Event"), "action");
|
||||
print '</a> ';
|
||||
|
|
@ -1484,7 +1484,8 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||
|
||||
if ($showuserlogin) {
|
||||
print '<td class="tdoverflowmax125">';
|
||||
$tmpuser= new User($db);
|
||||
$tmpuser = new User($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$resfetch = $tmpuser->fetch(0, '', '', 0, -1, '', $contactstatic->id);
|
||||
if ($resfetch > 0) {
|
||||
print $tmpuser->getNomUrl(1, '', 0, 0, 24, 1);
|
||||
|
|
@ -1501,7 +1502,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||
print '<td class="nowrap center">';
|
||||
|
||||
// Add to agenda
|
||||
if (isModEnabled('agenda')&& $user->hasRight('agenda', 'myactions', 'create')) {
|
||||
if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) {
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
||||
print img_object($langs->trans("Event"), "action");
|
||||
print '</a> ';
|
||||
|
|
@ -1686,7 +1687,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
|
|||
$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
|
||||
$reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if (!empty($hookmanager->resPrint)) {
|
||||
$sql.= $hookmanager->resPrint;
|
||||
$sql .= $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
|
|
@ -1708,7 +1709,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
|
|||
$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
|
||||
$reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if (!empty($hookmanager->resPrint)) {
|
||||
$sql.= $hookmanager->resPrint;
|
||||
$sql .= $hookmanager->resPrint;
|
||||
}
|
||||
if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
|
|
@ -1829,7 +1830,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
|
|||
$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module);
|
||||
$reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if (!empty($hookmanager->resPrint)) {
|
||||
$sql.= $hookmanager->resPrint;
|
||||
$sql .= $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
if (is_array($actioncode)) {
|
||||
|
|
@ -1893,48 +1894,48 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
|
|||
}
|
||||
|
||||
$histo[$numaction] = array(
|
||||
'type'=>$obj->type,
|
||||
'tododone'=>$tododone,
|
||||
'id'=>$obj->id,
|
||||
'datestart'=>$db->jdate($obj->dp),
|
||||
'dateend'=>$db->jdate($obj->dp2),
|
||||
'note'=>$obj->label,
|
||||
'percent'=>$obj->percent,
|
||||
'type' => $obj->type,
|
||||
'tododone' => $tododone,
|
||||
'id' => $obj->id,
|
||||
'datestart' => $db->jdate($obj->dp),
|
||||
'dateend' => $db->jdate($obj->dp2),
|
||||
'note' => $obj->label,
|
||||
'percent' => $obj->percent,
|
||||
|
||||
'userid'=>$obj->user_id,
|
||||
'login'=>$obj->user_login,
|
||||
'userfirstname'=>$obj->user_firstname,
|
||||
'userlastname'=>$obj->user_lastname,
|
||||
'userphoto'=>$obj->user_photo,
|
||||
'userid' => $obj->user_id,
|
||||
'login' => $obj->user_login,
|
||||
'userfirstname' => $obj->user_firstname,
|
||||
'userlastname' => $obj->user_lastname,
|
||||
'userphoto' => $obj->user_photo,
|
||||
|
||||
'contact_id'=>$obj->fk_contact,
|
||||
'contact_id' => $obj->fk_contact,
|
||||
'socpeopleassigned' => $contactaction->socpeopleassigned,
|
||||
'lastname' => empty($obj->lastname) ? '' : $obj->lastname,
|
||||
'firstname' => empty($obj->firstname) ? '' : $obj->firstname,
|
||||
'fk_element'=>$obj->fk_element,
|
||||
'elementtype'=>$obj->elementtype,
|
||||
'fk_element' => $obj->fk_element,
|
||||
'elementtype' => $obj->elementtype,
|
||||
// Type of event
|
||||
'acode'=>$obj->acode,
|
||||
'alabel'=>$obj->alabel,
|
||||
'libelle'=>$obj->alabel, // deprecated
|
||||
'apicto'=>$obj->apicto
|
||||
'acode' => $obj->acode,
|
||||
'alabel' => $obj->alabel,
|
||||
'libelle' => $obj->alabel, // deprecated
|
||||
'apicto' => $obj->apicto
|
||||
);
|
||||
} else {
|
||||
$histo[$numaction] = array(
|
||||
'type'=>$obj->type,
|
||||
'tododone'=>'done',
|
||||
'id'=>$obj->id,
|
||||
'datestart'=>$db->jdate($obj->dp),
|
||||
'dateend'=>$db->jdate($obj->dp2),
|
||||
'note'=>$obj->label,
|
||||
'percent'=>$obj->percent,
|
||||
'acode'=>$obj->acode,
|
||||
'type' => $obj->type,
|
||||
'tododone' => 'done',
|
||||
'id' => $obj->id,
|
||||
'datestart' => $db->jdate($obj->dp),
|
||||
'dateend' => $db->jdate($obj->dp2),
|
||||
'note' => $obj->label,
|
||||
'percent' => $obj->percent,
|
||||
'acode' => $obj->acode,
|
||||
|
||||
'userid'=>$obj->user_id,
|
||||
'login'=>$obj->user_login,
|
||||
'userfirstname'=>$obj->user_firstname,
|
||||
'userlastname'=>$obj->user_lastname,
|
||||
'userphoto'=>$obj->user_photo
|
||||
'userid' => $obj->user_id,
|
||||
'login' => $obj->user_login,
|
||||
'userfirstname' => $obj->user_firstname,
|
||||
'userlastname' => $obj->user_lastname,
|
||||
'userphoto' => $obj->user_photo
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1946,7 +1947,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
|
|||
}
|
||||
}
|
||||
|
||||
if (isModEnabled('agenda')|| (isModEnabled('mailing') && !empty($objcon->email))) {
|
||||
if (isModEnabled('agenda') || (isModEnabled('mailing') && !empty($objcon->email))) {
|
||||
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ function dolGetListOfObjectClasses($destdir)
|
|||
$objects[$fileobj['fullname']] = $objectnameloop;
|
||||
}
|
||||
}
|
||||
if (count($objects)>0) {
|
||||
if (count($objects) > 0) {
|
||||
return $objects;
|
||||
}
|
||||
|
||||
|
|
@ -559,12 +559,12 @@ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $
|
|||
}
|
||||
}
|
||||
} elseif ($action == -2 && !empty($objectname) && !empty($module)) {
|
||||
$key= null;
|
||||
$key = null;
|
||||
$right = null;
|
||||
$objectOfRights = array();
|
||||
//check if object already declared in rights file
|
||||
foreach ($permissions as $right) {
|
||||
$objectOfRights[]= $right[4];
|
||||
$objectOfRights[] = $right[4];
|
||||
}
|
||||
if (in_array(strtolower($objectname), $objectOfRights)) {
|
||||
$error++;
|
||||
|
|
@ -591,7 +591,7 @@ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $
|
|||
if (!$error) {
|
||||
// prepare permissions array
|
||||
$count_perms = count($permissions);
|
||||
for ($i = 0;$i<$count_perms;$i++) {
|
||||
for ($i = 0;$i < $count_perms;$i++) {
|
||||
$permissions[$i][0] = "\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1)";
|
||||
$permissions[$i][1] = "\$this->rights[\$r][1] = '".$permissions[$i][1]."'";
|
||||
$permissions[$i][4] = "\$this->rights[\$r][4] = '".$permissions[$i][4]."'";
|
||||
|
|
@ -611,7 +611,7 @@ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $
|
|||
|
||||
|
||||
// parcourir les objects
|
||||
$o=0;
|
||||
$o = 0;
|
||||
foreach ($permissions as &$object) {
|
||||
// récupérer la permission de l'objet
|
||||
$p = 1;
|
||||
|
|
@ -735,7 +735,7 @@ function writePropsInAsciiDoc($file, $objectname, $destfile)
|
|||
foreach ($attributesUnique as $attUnique) {
|
||||
$table .= "|".$attUnique;
|
||||
}
|
||||
$table .="\n";
|
||||
$table .= "\n";
|
||||
$valuesModif = array();
|
||||
foreach ($keys as $string) {
|
||||
$string = trim($string, "'");
|
||||
|
|
@ -783,9 +783,9 @@ function writePropsInAsciiDoc($file, $objectname, $destfile)
|
|||
$table .= "|===\n";
|
||||
$table .= "__ end table for object $objectname\n";
|
||||
|
||||
//write in file
|
||||
//write in file @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$writeInFile = dolReplaceInFile($destfile, array('== DATA SPECIFICATIONS' => $table));
|
||||
if ($writeInFile<0) {
|
||||
if ($writeInFile < 0) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
|
|
@ -897,7 +897,7 @@ function writePermsInAsciiDoc($file, $destfile)
|
|||
foreach ($permissions as $key => $element) {
|
||||
$element = str_replace(" '", '', $element);
|
||||
$element = trim($element, "'");
|
||||
$permsN[] = substr($element, strpos($element, "=")+1);
|
||||
$permsN[] = substr($element, strpos($element, "=") + 1);
|
||||
}
|
||||
array_pop($permsN);
|
||||
|
||||
|
|
@ -926,8 +926,9 @@ function writePermsInAsciiDoc($file, $destfile)
|
|||
}
|
||||
// end table
|
||||
$string .= "\n|===\n";
|
||||
$write = dolReplaceInFile($destfile, array('__DATA_PERMISSIONS__'=> $string));
|
||||
if ($write<0) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$write = dolReplaceInFile($destfile, array('__DATA_PERMISSIONS__' => $string));
|
||||
if ($write < 0) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
|
|
@ -985,7 +986,7 @@ function addObjectsToApiFile($file, $objects, $modulename)
|
|||
//add methods for each object
|
||||
$allContent = getFromFile($file, '/*begin methods CRUD*/', '/*end methods CRUD*/');
|
||||
foreach ($objects as $object) {
|
||||
$contentReplaced =str_replace(["myobject","MyObject"], [strtolower($object),$object], $allContent);
|
||||
$contentReplaced = str_replace(["myobject","MyObject"], [strtolower($object),$object], $allContent);
|
||||
dolReplaceInFile($file, array('/*end methods CRUD*/' => '/*CRUD FOR '.strtoupper($object).'*/'."\n".$contentReplaced."\n\t".'/*END CRUD FOR '.strtoupper($object).'*/'."\n\t".'/*end methods CRUD*/'));
|
||||
}
|
||||
dolReplaceInFile($file, array($allContent => '','MyModule' => ucfirst($modulename)));
|
||||
|
|
@ -1049,7 +1050,7 @@ function removeObjectFromApiFile($file, $objectname, $modulename)
|
|||
*/
|
||||
function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action)
|
||||
{
|
||||
$errors =0;
|
||||
$errors = 0;
|
||||
$counter = 0;
|
||||
if (!file_exists($file)) {
|
||||
return -1;
|
||||
|
|
@ -1062,7 +1063,7 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action)
|
|||
array_push($menus, $menuWantTo);
|
||||
} elseif ($action == 2 && !empty($key) && !empty($menuWantTo)) {
|
||||
// update right from permissions array
|
||||
$urlCounter=0;
|
||||
$urlCounter = 0;
|
||||
// check if the values already exists
|
||||
foreach ($menus as $index => $menu) {
|
||||
if ($index !== $key) {
|
||||
|
|
@ -1111,20 +1112,20 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action)
|
|||
//var_dump(dol_escape_php($menu['perms'], 1)); exit;
|
||||
|
||||
$str_menu .= $start."\n";
|
||||
$str_menu.= "\t\t\$this->menu[\$r++]=array(\n";
|
||||
$str_menu.= "\t\t\t 'fk_menu' => '".dol_escape_php($menu['fk_menu'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'type' => '".dol_escape_php($menu['type'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'titre' => '".dol_escape_php($menu['titre'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'mainmenu' => '".dol_escape_php($menu['mainmenu'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'leftmenu' => '".dol_escape_php($menu['leftmenu'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'url' => '".dol_escape_php($menu['url'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'langs' => '".dol_escape_php($menu['langs'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'position' => ".((int) $menu['position']).",\n";
|
||||
$str_menu.= "\t\t\t 'enabled' => '".dol_escape_php($menu['enabled'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'perms' => '".dol_escape_php($menu['perms'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'target' => '".dol_escape_php($menu['target'], 1)."',\n";
|
||||
$str_menu.= "\t\t\t 'user' => ".((int) $menu['user']).",\n";
|
||||
$str_menu.= "\t\t);\n";
|
||||
$str_menu .= "\t\t\$this->menu[\$r++]=array(\n";
|
||||
$str_menu .= "\t\t\t 'fk_menu' => '".dol_escape_php($menu['fk_menu'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'type' => '".dol_escape_php($menu['type'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'titre' => '".dol_escape_php($menu['titre'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'mainmenu' => '".dol_escape_php($menu['mainmenu'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'leftmenu' => '".dol_escape_php($menu['leftmenu'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'url' => '".dol_escape_php($menu['url'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'langs' => '".dol_escape_php($menu['langs'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'position' => ".((int) $menu['position']).",\n";
|
||||
$str_menu .= "\t\t\t 'enabled' => '".dol_escape_php($menu['enabled'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'perms' => '".dol_escape_php($menu['perms'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'target' => '".dol_escape_php($menu['target'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'user' => ".((int) $menu['user']).",\n";
|
||||
$str_menu .= "\t\t);\n";
|
||||
|
||||
if (is_null($next_val) || $val_actuel['leftmenu'] !== $next_val['leftmenu']) {
|
||||
$str_menu .= $end."\n";
|
||||
|
|
@ -1266,7 +1267,7 @@ function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = nul
|
|||
$dictionnaires['tabfieldinsert'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : '');
|
||||
$dictionnaires['tabrowid'][] = $primaryKey;
|
||||
$dictionnaires['tabcond'][] = isModEnabled('$modulename');
|
||||
$dictionnaires['tabhelp'][] = (array_key_exists('code', $columns) ? array('code'=>$langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip') : '');
|
||||
$dictionnaires['tabhelp'][] = (array_key_exists('code', $columns) ? array('code' => $langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip') : '');
|
||||
|
||||
// Build the dictionary string
|
||||
$writeInfile = updateDictionaryInFile($modulename, $file, $dictionnaires);
|
||||
|
|
|
|||
|
|
@ -519,6 +519,7 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri
|
|||
if ($containeraliasalt) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
|
||||
$tmpwebsitepage = new WebsitePage($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $tmpwebsitepage->fetch(0, $website->id, '', $containeraliasalt);
|
||||
if ($result > 0) {
|
||||
$containerref = $tmpwebsitepage->pageurl;
|
||||
|
|
@ -542,6 +543,7 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri
|
|||
if (!$containeraliasalt) { // If containeraliasalt set, we already did the test
|
||||
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
|
||||
$tmpwebsitepage = new WebsitePage($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $tmpwebsitepage->fetch(0, $website->id, $containerref);
|
||||
unset($tmpwebsitepage);
|
||||
}
|
||||
|
|
@ -1104,7 +1106,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
|
|||
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers.
|
||||
|
||||
$error = 0;
|
||||
$arrayresult = array('code'=>'', 'list'=>array());
|
||||
$arrayresult = array('code' => '', 'list' => array());
|
||||
|
||||
if (!is_object($weblangs)) {
|
||||
$weblangs = $langs;
|
||||
|
|
@ -1212,22 +1214,22 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
|
|||
|
||||
$filecontent = file_get_contents($filehtmlheader);
|
||||
if ((empty($max) || ($found < $max)) && preg_match('/'.preg_quote($searchstring, '/').'/', $filecontent)) {
|
||||
$arrayresult['list'][] = array('type'=>'website_htmlheadercontent');
|
||||
$arrayresult['list'][] = array('type' => 'website_htmlheadercontent');
|
||||
}
|
||||
|
||||
$filecontent = file_get_contents($filecss);
|
||||
if ((empty($max) || ($found < $max)) && preg_match('/'.preg_quote($searchstring, '/').'/', $filecontent)) {
|
||||
$arrayresult['list'][] = array('type'=>'website_csscontent');
|
||||
$arrayresult['list'][] = array('type' => 'website_csscontent');
|
||||
}
|
||||
|
||||
$filecontent = file_get_contents($filejs);
|
||||
if ((empty($max) || ($found < $max)) && preg_match('/'.preg_quote($searchstring, '/').'/', $filecontent)) {
|
||||
$arrayresult['list'][] = array('type'=>'website_jscontent');
|
||||
$arrayresult['list'][] = array('type' => 'website_jscontent');
|
||||
}
|
||||
|
||||
$filerobot = file_get_contents($filerobot);
|
||||
if ((empty($max) || ($found < $max)) && preg_match('/'.preg_quote($searchstring, '/').'/', $filecontent)) {
|
||||
$arrayresult['list'][] = array('type'=>'website_robotcontent');
|
||||
$arrayresult['list'][] = array('type' => 'website_robotcontent');
|
||||
}
|
||||
|
||||
$searchdone = 1;
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('pdfgeneration'));
|
||||
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
|
||||
global $action;
|
||||
$reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
|
@ -775,7 +775,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
|
||||
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
|
||||
}
|
||||
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
|
||||
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
|
||||
|
||||
if ($posYAfterImage > $posYAfterDescription) {
|
||||
$nexY = $posYAfterImage;
|
||||
|
|
@ -784,10 +784,10 @@ class pdf_crabe extends ModelePDFFactures
|
|||
// Add line
|
||||
if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) {
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80)));
|
||||
$pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
$pdf->SetLineStyle(array('dash' => 0));
|
||||
}
|
||||
|
||||
$nexY += 2; // Add space between lines
|
||||
|
|
@ -872,7 +872,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
|
||||
// Add pdfgeneration hook
|
||||
$hookmanager->initHooks(array('pdfgeneration'));
|
||||
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
|
||||
global $action;
|
||||
$reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
|
|
@ -882,7 +882,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
|
||||
dolChmod($file);
|
||||
|
||||
$this->result = array('fullpath'=>$file);
|
||||
$this->result = array('fullpath' => $file);
|
||||
|
||||
return 1; // No error
|
||||
} else {
|
||||
|
|
@ -1204,8 +1204,9 @@ class pdf_crabe extends ModelePDFFactures
|
|||
if ($object->mode_reglement_code == "PRE") {
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$bac->fetch(0, $object->thirdparty->id);
|
||||
$iban= $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
|
||||
$iban = $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
|
||||
$lib_mode_reg .= ' '.$outputlangs->trans("PaymentTypePREdetails", dol_trunc($iban, 6, 'right', 'UTF-8', 1));
|
||||
}
|
||||
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
|
||||
|
|
@ -2139,11 +2140,11 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$contactshipping = $object->fetch_Contact($idaddressshipping[0]);
|
||||
$companystatic = new Societe($this->db);
|
||||
$companystatic->fetch($object->contact->fk_soc);
|
||||
$carac_client_name_shipping=pdfBuildThirdpartyName($object->contact, $outputlangs);
|
||||
$carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs);
|
||||
$carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, $usecontact, 'target', $object);
|
||||
} else {
|
||||
$carac_client_name_shipping=pdfBuildThirdpartyName($object->thirdparty, $outputlangs);
|
||||
$carac_client_shipping=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object);
|
||||
$carac_client_name_shipping = pdfBuildThirdpartyName($object->thirdparty, $outputlangs);
|
||||
$carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object);
|
||||
}
|
||||
if (!empty($carac_client_shipping)) {
|
||||
$posy += $hautcadre;
|
||||
|
|
@ -2162,7 +2163,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$posy = $pdf->getY();
|
||||
|
||||
// Show shipping information
|
||||
$pdf->SetXY($posx+2, $posy);
|
||||
$pdf->SetXY($posx + 2, $posy);
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->MultiCell($widthrecbox - 2, 2, $carac_client_shipping, '', 'L');
|
||||
$top_shift += $hautcadre;
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('pdfgeneration'));
|
||||
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
|
||||
global $action;
|
||||
$reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
|
@ -848,9 +848,9 @@ class pdf_sponge extends ModelePDFFactures
|
|||
$parameters = array(
|
||||
'object' => $object,
|
||||
'i' => $i,
|
||||
'pdf' =>& $pdf,
|
||||
'curY' =>& $curY,
|
||||
'nexY' =>& $nexY,
|
||||
'pdf' => & $pdf,
|
||||
'curY' => & $curY,
|
||||
'nexY' => & $nexY,
|
||||
'outputlangs' => $outputlangs,
|
||||
'hidedetails' => $hidedetails
|
||||
);
|
||||
|
|
@ -900,7 +900,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||
// Retrieve type from database for backward compatibility with old records
|
||||
if ((!isset($localtax1_type) || $localtax1_type == '' || !isset($localtax2_type) || $localtax2_type == '') // if tax type not defined
|
||||
&& (!empty($localtax1_rate) || !empty($localtax2_rate))) { // and there is local tax
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc);
|
||||
$localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : '';
|
||||
$localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] : '';
|
||||
}
|
||||
|
|
@ -934,17 +934,17 @@ class pdf_sponge extends ModelePDFFactures
|
|||
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
|
||||
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
|
||||
}
|
||||
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
|
||||
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
|
||||
|
||||
$nexY = max($nexY, $posYAfterImage);
|
||||
|
||||
// Add line
|
||||
if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) {
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80)));
|
||||
$pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
$pdf->SetLineStyle(array('dash' => 0));
|
||||
}
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
|
|
@ -1024,7 +1024,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||
|
||||
// Add pdfgeneration hook
|
||||
$hookmanager->initHooks(array('pdfgeneration'));
|
||||
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
|
||||
global $action;
|
||||
$reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
|
|
@ -1034,7 +1034,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||
|
||||
dolChmod($file);
|
||||
|
||||
$this->result = array('fullpath'=>$file);
|
||||
$this->result = array('fullpath' => $file);
|
||||
|
||||
return 1; // No error
|
||||
} else {
|
||||
|
|
@ -1298,8 +1298,9 @@ class pdf_sponge extends ModelePDFFactures
|
|||
if ($object->mode_reglement_code == "PRE") {
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$bac->fetch(0, $object->thirdparty->id);
|
||||
$iban= $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
|
||||
$iban = $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
|
||||
$lib_mode_reg .= ' '.$outputlangs->trans("PaymentTypePREdetails", dol_trunc($iban, 6, 'right', 'UTF-8', 1));
|
||||
}
|
||||
|
||||
|
|
@ -2390,11 +2391,11 @@ class pdf_sponge extends ModelePDFFactures
|
|||
$contactshipping = $object->fetch_Contact($idaddressshipping[0]);
|
||||
$companystatic = new Societe($this->db);
|
||||
$companystatic->fetch($object->contact->fk_soc);
|
||||
$carac_client_name_shipping=pdfBuildThirdpartyName($object->contact, $outputlangs);
|
||||
$carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs);
|
||||
$carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, $usecontact, 'target', $object);
|
||||
} else {
|
||||
$carac_client_name_shipping=pdfBuildThirdpartyName($object->thirdparty, $outputlangs);
|
||||
$carac_client_shipping=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object);
|
||||
$carac_client_name_shipping = pdfBuildThirdpartyName($object->thirdparty, $outputlangs);
|
||||
$carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object);
|
||||
}
|
||||
if (!empty($carac_client_shipping)) {
|
||||
$posy += $hautcadre;
|
||||
|
|
@ -2413,7 +2414,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||
$posy = $pdf->getY();
|
||||
|
||||
// Show shipping information
|
||||
$pdf->SetXY($posx+2, $posy);
|
||||
$pdf->SetXY($posx + 2, $posy);
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->MultiCell($widthrecbox - 2, 2, $carac_client_shipping, '', 'L');
|
||||
$shipp_shift += $hautcadre;
|
||||
|
|
|
|||
|
|
@ -393,6 +393,7 @@ class ImportCsv extends ModeleImports
|
|||
|
||||
// Is it a required field ?
|
||||
if (preg_match('/\*/', $objimport->array_import_fields[0][$val]) && ((string) $newval == '')) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$this->errors[$error]['lib'] = $langs->trans('ErrorMissingMandatoryValue', $key);
|
||||
$this->errors[$error]['type'] = 'NOTNULL';
|
||||
$errorforthistable++;
|
||||
|
|
@ -405,7 +406,7 @@ class ImportCsv extends ModeleImports
|
|||
if ($objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeid'
|
||||
|| $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromref'
|
||||
|| $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel'
|
||||
) {
|
||||
) {
|
||||
// New val can be an id or ref. If it start with id: it is forced to id, if it start with ref: it is forced to ref. It not, we try to guess.
|
||||
$isidorref = 'id';
|
||||
if (!is_numeric($newval) && $newval != '' && !preg_match('/^id:/i', $newval)) {
|
||||
|
|
@ -854,7 +855,7 @@ class ImportCsv extends ModeleImports
|
|||
$fname = 'rowid';
|
||||
if (strpos($tablename, '_categorie_') !== false) {
|
||||
$is_table_category_link = true;
|
||||
$fname='*';
|
||||
$fname = '*';
|
||||
}
|
||||
|
||||
if (!empty($updatekeys)) {
|
||||
|
|
|
|||
|
|
@ -516,6 +516,7 @@ class ImportXlsx extends ModeleImports
|
|||
$newval = $classinstance->id;
|
||||
} elseif (! $error) {
|
||||
if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
|
||||
} elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) {
|
||||
$this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element']));
|
||||
|
|
@ -558,6 +559,7 @@ class ImportXlsx extends ModeleImports
|
|||
$newval = $classinstance->id;
|
||||
} else {
|
||||
if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
|
||||
} else {
|
||||
$this->errors[$error]['lib'] = 'ErrorFieldValueNotIn';
|
||||
|
|
@ -595,6 +597,7 @@ class ImportXlsx extends ModeleImports
|
|||
$newval = $scaleorid ? $scaleorid : 0;
|
||||
} else {
|
||||
if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
|
||||
} else {
|
||||
$this->errors[$error]['lib'] = 'ErrorFieldValueNotIn';
|
||||
|
|
@ -753,6 +756,7 @@ class ImportXlsx extends ModeleImports
|
|||
if (!empty($filter)) {
|
||||
$tableforerror .= ':' . $filter;
|
||||
}
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorFieldValueNotIn', $key, $newval, $field, $tableforerror);
|
||||
$this->errors[$error]['type'] = 'FOREIGNKEY';
|
||||
$errorforthistable++;
|
||||
|
|
@ -761,6 +765,7 @@ class ImportXlsx extends ModeleImports
|
|||
} elseif (!preg_match('/' . $objimport->array_import_regex[0][$val] . '/i', $newval)) {
|
||||
// If test is just a static regex
|
||||
//if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>";
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]);
|
||||
$this->errors[$error]['type'] = 'REGEX';
|
||||
$errorforthistable++;
|
||||
|
|
@ -771,6 +776,7 @@ class ImportXlsx extends ModeleImports
|
|||
// Check HTML injection
|
||||
$inj = testSqlAndScriptInject($newval, 0);
|
||||
if ($inj) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorHtmlInjectionForField', $key, dol_trunc($newval, 100));
|
||||
$this->errors[$error]['type'] = 'HTMLINJECTION';
|
||||
$errorforthistable++;
|
||||
|
|
@ -892,7 +898,7 @@ class ImportXlsx extends ModeleImports
|
|||
$fname = 'rowid';
|
||||
if (strpos($tablename, '_categorie_') !== false) {
|
||||
$is_table_category_link = true;
|
||||
$fname='*';
|
||||
$fname = '*';
|
||||
}
|
||||
|
||||
if (!empty($updatekeys)) {
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||
);
|
||||
complete_substitutions_array($substitutionarray, $langs, $object);
|
||||
// Call the ODTSubstitution hook
|
||||
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
|
||||
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
|
||||
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
// Line of free text
|
||||
|
|
@ -412,9 +412,10 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
$companybankaccount = new CompanyBankAccount($this->db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$companybankaccount->fetch(0, $object->thirdparty->id);
|
||||
$array_objet['company_default_bank_iban']=$companybankaccount->iban;
|
||||
$array_objet['company_default_bank_bic']=$companybankaccount->bic;
|
||||
$array_objet['company_default_bank_iban'] = $companybankaccount->iban;
|
||||
$array_objet['company_default_bank_bic'] = $companybankaccount->bic;
|
||||
|
||||
// retrieve contact information for use in object as contact_xxx tags
|
||||
$array_thirdparty_contact = array();
|
||||
|
|
@ -426,7 +427,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||
|
||||
// Call the ODTSubstitution hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
|
||||
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
foreach ($tmparray as $key => $value) {
|
||||
|
|
@ -464,7 +465,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray, 'line' => $line);
|
||||
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
foreach ($tmparray as $key => $val) {
|
||||
try {
|
||||
|
|
@ -496,7 +497,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||
}
|
||||
|
||||
// Call the beforeODTSave hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
|
||||
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
// Write new file
|
||||
|
|
@ -517,14 +518,14 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
|
||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
dolChmod($file);
|
||||
|
||||
$odfHandler = null; // Destroy object
|
||||
|
||||
$this->result = array('fullpath'=>$file);
|
||||
$this->result = array('fullpath' => $file);
|
||||
|
||||
return 1; // Success
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -293,6 +293,7 @@ if (empty($reshook)) {
|
|||
// Action validation
|
||||
if ($action == 'valid_promesse') {
|
||||
$object->fetch($id);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
if ($object->valid_promesse($id, $user->id) >= 0) {
|
||||
setEventMessages($langs->trans("DonationValidated", $object->ref), null);
|
||||
$action = '';
|
||||
|
|
|
|||
|
|
@ -317,6 +317,7 @@ class Donations extends DolibarrApi
|
|||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $this->don->valid_promesse($id, DolibarrApiAccess::$user->id, $notrigger);
|
||||
if ($result == 0) {
|
||||
throw new RestException(304, 'Error nothing done. May be object is already validated');
|
||||
|
|
|
|||
|
|
@ -725,6 +725,7 @@ class Don extends CommonObject
|
|||
*/
|
||||
public function setValid($user, $notrigger = 0)
|
||||
{
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
return $this->valid_promesse($this->id, $user->id, $notrigger);
|
||||
}
|
||||
|
||||
|
|
@ -957,7 +958,7 @@ class Don extends CommonObject
|
|||
$result .= $linkend;
|
||||
global $action;
|
||||
$hookmanager->initHooks(array($this->element . 'dao'));
|
||||
$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
|
||||
$parameters = array('id' => $this->id, 'getnomurl' => &$result);
|
||||
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
$result = $hookmanager->resPrint;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ $entitytoicon = array(
|
|||
'other' => 'generic',
|
||||
'account' => 'account',
|
||||
'product' => 'product',
|
||||
'virtualproduct'=>'product',
|
||||
'virtualproduct' => 'product',
|
||||
'subproduct' => 'product',
|
||||
'product_supplier_ref' => 'product',
|
||||
'stock' => 'stock',
|
||||
|
|
@ -67,11 +67,11 @@ $entitytoicon = array(
|
|||
'stockbatch' => 'stock',
|
||||
'category' => 'category',
|
||||
'shipment' => 'sending',
|
||||
'shipment_line'=> 'sending',
|
||||
'reception'=> 'sending',
|
||||
'reception_line'=> 'sending',
|
||||
'expensereport'=> 'trip',
|
||||
'expensereport_line'=> 'trip',
|
||||
'shipment_line' => 'sending',
|
||||
'reception' => 'sending',
|
||||
'reception_line' => 'sending',
|
||||
'expensereport' => 'trip',
|
||||
'expensereport_line' => 'trip',
|
||||
'holiday' => 'holiday',
|
||||
'contract_line' => 'contract',
|
||||
'translation' => 'generic',
|
||||
|
|
@ -114,16 +114,16 @@ $entitytolang = array(
|
|||
'other' => 'Other',
|
||||
'trip' => 'TripsAndExpenses',
|
||||
'shipment' => 'Shipments',
|
||||
'shipment_line'=> 'ShipmentLine',
|
||||
'shipment_line' => 'ShipmentLine',
|
||||
'project' => 'Projects',
|
||||
'projecttask' => 'Tasks',
|
||||
'task_time' => 'TaskTimeSpent',
|
||||
'action' => 'Event',
|
||||
'expensereport'=> 'ExpenseReport',
|
||||
'expensereport_line'=> 'ExpenseReportLine',
|
||||
'expensereport' => 'ExpenseReport',
|
||||
'expensereport_line' => 'ExpenseReportLine',
|
||||
'holiday' => 'TitreRequestCP',
|
||||
'contract' => 'Contract',
|
||||
'contract_line'=> 'ContractLine',
|
||||
'contract_line' => 'ContractLine',
|
||||
'translation' => 'Translation',
|
||||
'bom' => 'BOM',
|
||||
'bomline' => 'BOMLine',
|
||||
|
|
@ -1020,7 +1020,7 @@ if ($step == 4 && $datatoexport) {
|
|||
print '<tr class="oddeven">';
|
||||
print '<td><input name="export_name" value=""></td>';
|
||||
print '<td>';
|
||||
$arrayvisibility = array('private'=>$langs->trans("Private"), 'all'=>$langs->trans("Everybody"));
|
||||
$arrayvisibility = array('private' => $langs->trans("Private"), 'all' => $langs->trans("Everybody"));
|
||||
print $form->selectarray('visibility', $arrayvisibility, 'private');
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
|
|
@ -1203,6 +1203,7 @@ if ($step == 5 && $datatoexport) {
|
|||
$htmltabloflibs .= '<td>'.img_picto_common($key, $objmodelexport->getPictoForKey($key)).' ';
|
||||
$text = $objmodelexport->getDriverDescForKey($key);
|
||||
$label = $listeall[$key];
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$htmltabloflibs .= $form->textwithpicto($label, $text).'</td>';
|
||||
$htmltabloflibs .= '<td>'.$objmodelexport->getLibLabelForKey($key).'</td>';
|
||||
$htmltabloflibs .= '<td class="right">'.$objmodelexport->getLibVersionForKey($key).'</td>';
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ foreach ($liste as $key => $val) {
|
|||
print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key), $model->getPictoForKey($key)).'</td>';
|
||||
$text = $model->getDriverDescForKey($key);
|
||||
$label = $liste[$key];
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print '<td>'.$form->textwithpicto($label, $text).'</td>';
|
||||
print '<td>'.$model->getLibLabelForKey($key).'</td>';
|
||||
print '<td class="nowrap right">'.$model->getLibVersionForKey($key).'</td>';
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ $error = 0;
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array('socid'=>$socid);
|
||||
$parameters = array('socid' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -2403,7 +2403,7 @@ if ($action == 'create') {
|
|||
// Deposit - Down payment
|
||||
if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) {
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOSTINT('type') == 3 ? ' checked' : '') . '> ';
|
||||
$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOSTINT('type') == 3 ? ' checked' : '') . '> ';
|
||||
print '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() {
|
||||
|
|
@ -2604,7 +2604,7 @@ if ($action == 'create') {
|
|||
if (!getDolGlobalString('INVOICE_CREDIT_NOTE_STANDALONE')) {
|
||||
$tmp = '<input type="radio" name="type" id="radio_creditnote" value="0" disabled> ';
|
||||
} else {
|
||||
$tmp='<input type="radio" name="type" id="radio_creditnote" value="2"> ';
|
||||
$tmp = '<input type="radio" name="type" id="radio_creditnote" value="2"> ';
|
||||
}
|
||||
$text = $tmp.$langs->trans("InvoiceAvoir").' ';
|
||||
$text .= '<span class="opacitymedium">('.$langs->trans("YouMustCreateInvoiceFromSupplierThird").')</span> ';
|
||||
|
|
@ -3175,7 +3175,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
if (!$formconfirm) {
|
||||
$parameters = array('formConfirm' => $formconfirm, 'lineid'=>$lineid);
|
||||
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$formconfirm .= $hookmanager->resPrint;
|
||||
|
|
@ -3832,6 +3832,7 @@ if ($action == 'create') {
|
|||
$text .= '<br><br><b>'.$langs->trans("Reason").'</b>:'.$object->close_note;
|
||||
}
|
||||
print '<span class="opacitymedium">';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($langs->trans("Abandoned"), $text, - 1);
|
||||
print '</span>';
|
||||
print '</td><td class="right">'.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaid).'</td><td> </td></tr>';
|
||||
|
|
@ -3896,7 +3897,7 @@ if ($action == 'create') {
|
|||
print '<tr><td colspan="'.$nbcols.'" class="right">';
|
||||
print '<span class="opacitymedium">';
|
||||
print $langs->trans('RemainderToPayBackMulticurrency');
|
||||
if ($resteapayeraffiche> 0) {
|
||||
if ($resteapayeraffiche > 0) {
|
||||
print ' ('.$langs->trans('NegativeIfExcessRefunded').')';
|
||||
}
|
||||
print '</span>';
|
||||
|
|
@ -4081,7 +4082,7 @@ if ($action == 'create') {
|
|||
// For credit note
|
||||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $usercancreate
|
||||
&& (getDolGlobalString('SUPPLIER_INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED') || $object->getSommePaiement() == 0)
|
||||
) {
|
||||
) {
|
||||
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc" title="'.dol_escape_htmltag($langs->trans("ConfirmConvertToReducSupplier2")).'">'.$langs->trans('ConvertToReduc').'</a>';
|
||||
}
|
||||
// For deposit invoice
|
||||
|
|
|
|||
|
|
@ -501,6 +501,7 @@ if ($step == 2 && $datatoimport) {
|
|||
print '<tr class="oddeven">';
|
||||
print '<td width="16">'.img_picto_common($key, $objmodelimport->getPictoForKey($key)).'</td>';
|
||||
$text = $objmodelimport->getDriverDescForKey($key);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print '<td>'.$form->textwithpicto($objmodelimport->getDriverLabelForKey($key), $text).'</td>';
|
||||
print '<td style="text-align:center">';
|
||||
$filename = $langs->trans("ExampleOfImportFile").'_'.$datatoimport.'.'.$key;
|
||||
|
|
@ -593,6 +594,7 @@ if ($step == 3 && $datatoimport) {
|
|||
print '<tr><td class="titlefieldcreate">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<td class="nowraponall">';
|
||||
$text = $objmodelimport->getDriverDescForKey($format);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
|
||||
print '</td><td style="text-align:right" class="nowrap">';
|
||||
$filename = $langs->trans("ExampleOfImportFile").'_'.$datatoimport.'.'.$format;
|
||||
|
|
@ -991,6 +993,7 @@ if ($step == 4 && $datatoimport) {
|
|||
print '<tr><td class="titlefieldcreate">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<td>';
|
||||
$text = $objmodelimport->getDriverDescForKey($format);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -1087,6 +1090,7 @@ if ($step == 4 && $datatoimport) {
|
|||
|
||||
$lefti = 1;
|
||||
foreach ($fieldssource as $key => $val) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
show_elem($fieldssource, $key, $val); // key is field number in source file
|
||||
$listofkeys[$key] = 1;
|
||||
$fieldsplaced[$key] = 1;
|
||||
|
|
@ -1655,6 +1659,7 @@ if ($step == 5 && $datatoimport) {
|
|||
print '<tr><td class="titlefieldcreate">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<td>';
|
||||
$text = $objmodelimport->getDriverDescForKey($format);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -2140,6 +2145,7 @@ if ($step == 6 && $datatoimport) {
|
|||
print '<tr><td class="titlefieldcreate">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<td>';
|
||||
$text = $objmodelimport->getDriverDescForKey($format);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ foreach ($list as $key) {
|
|||
print '<tr class="oddeven">';
|
||||
print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key), $model->getPictoForKey($key)).'</td>';
|
||||
$text = $model->getDriverDescForKey($key);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print '<td>'.$form->textwithpicto($model->getDriverLabelForKey($key), $text).'</td>';
|
||||
print '<td>'.$model->getLibLabelForKey($key).'</td>';
|
||||
print '<td class="nowrap right">'.$model->getLibVersionForKey($key).'</td>';
|
||||
|
|
|
|||
|
|
@ -2253,6 +2253,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||
//$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
|
||||
$text .= '<span class="fa fa-bug atoplogin valignmiddle"></span>';
|
||||
$text .= '</a>';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$toprightmenu .= $form->textwithtooltip('', $langs->trans("ModuleBuilder"), 2, 1, $text, 'login_block_elem', 2);
|
||||
}
|
||||
|
||||
|
|
@ -2284,6 +2285,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||
//$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
|
||||
$text .= '<span class="fa fa-print atoplogin valignmiddle"></span>';
|
||||
$text .= '</a>';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$toprightmenu .= $form->textwithtooltip('', $langs->trans("PrintContentArea"), 2, 1, $text, 'login_block_elem', 2);
|
||||
}
|
||||
|
||||
|
|
@ -2330,6 +2332,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||
$text .= '<span class="fa fa-question-circle atoplogin valignmiddle'.($helppresent ? ' '.$helppresent : '').'"></span>';
|
||||
$text .= '<span class="fa fa-long-arrow-alt-up helppresentcircle'.($helppresent ? '' : ' unvisible').'"></span>';
|
||||
$text .= '</a>';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$toprightmenu .= $form->textwithtooltip('', $title, 2, 1, $text, 'login_block_elem', 2);
|
||||
}
|
||||
|
||||
|
|
@ -2342,6 +2345,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||
|
||||
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
$text = '<span class="aversion"><span class="hideonsmartphone small">'.DOL_VERSION.'</span></span>';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$toprightmenu .= $form->textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,6 +233,7 @@ if ($result) {
|
|||
$num = $db->num_rows($result);
|
||||
|
||||
print '<br>';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1);
|
||||
|
||||
if (getDolGlobalString('MARGIN_TYPE') == "1") {
|
||||
|
|
|
|||
|
|
@ -303,6 +303,7 @@ if ($result) {
|
|||
$num = $db->num_rows($result);
|
||||
|
||||
print '<br>';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1);
|
||||
|
||||
if (getDolGlobalString('MARGIN_TYPE') == "1") {
|
||||
|
|
|
|||
|
|
@ -253,6 +253,7 @@ if ($result) {
|
|||
$num = $db->num_rows($result);
|
||||
|
||||
print '<br>';
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1);
|
||||
|
||||
//var_dump($conf->global->MARGIN_TYPE);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ if (!$user->hasRight('margins', 'liretous')) {
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$parameters = array('id' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -199,6 +199,7 @@ if ($socid > 0) {
|
|||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "&socid=".$object->id, $sortfield, $sortorder, '', $num, $num, '');
|
||||
|
||||
$i = 0;
|
||||
|
|
|
|||
|
|
@ -358,6 +358,7 @@ if ($dirins && $action == 'initmodule' && $modulename) {
|
|||
$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
|
||||
//var_dump($result);
|
||||
if ($result < 0) {
|
||||
|
|
@ -469,7 +470,9 @@ if ($dirins && in_array($action, array('initapi', 'initphpunit', 'initpagecontac
|
|||
if (count($objects) > 1) {
|
||||
addObjectsToApiFile($destfile, $objects, $modulename);
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, array('/*begin methods CRUD*/' => '/*begin methods CRUD*/'."\n\t".'/*CRUD FOR '.strtoupper($objectname).'*/', '/*end methods CRUD*/' => '/*END CRUD FOR '.strtoupper($objectname).'*/'."\n\t".'/*end methods CRUD*/'));
|
||||
}
|
||||
|
||||
|
|
@ -477,6 +480,7 @@ if ($dirins && in_array($action, array('initapi', 'initphpunit', 'initpagecontac
|
|||
// Now we update the object file to set $$varnametoupdate to 1
|
||||
$srcfile = $dirins.'/'.strtolower($module).'/lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php';
|
||||
$arrayreplacement = array('/\$'.preg_quote($varnametoupdate, '/').' = 0;/' => '$'.$varnametoupdate.' = 1;');
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($srcfile, $arrayreplacement, '', 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -569,6 +573,7 @@ if ($dirins && $action == 'inithook' && !empty($module)) {
|
|||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
|
|
@ -603,6 +608,7 @@ if ($dirins && $action == 'inittrigger' && !empty($module)) {
|
|||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
|
|
@ -637,6 +643,7 @@ if ($dirins && $action == 'initwidget' && !empty($module)) {
|
|||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
|
|
@ -671,6 +678,7 @@ if ($dirins && $action == 'initemailing' && !empty($module)) {
|
|||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
|
|
@ -705,6 +713,7 @@ if ($dirins && $action == 'initcss' && !empty($module)) {
|
|||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : ''),
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
|
||||
// Update descriptor file to uncomment file
|
||||
|
|
@ -744,6 +753,7 @@ if ($dirins && $action == 'initjs' && !empty($module)) {
|
|||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
|
||||
// Update descriptor file to uncomment file
|
||||
|
|
@ -788,6 +798,7 @@ if ($dirins && $action == 'initcli' && !empty($module)) {
|
|||
'---Put here your own copyright and developer email---' => dol_print_date($now, 'dayrfc').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
|
|
@ -828,6 +839,7 @@ if ($dirins && $action == 'initdoc' && !empty($module)) {
|
|||
'---Put here your own copyright and developer email---' => dol_print_date($now, 'dayrfc').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, $arrayreplacement);
|
||||
|
||||
// add table of properties
|
||||
|
|
@ -866,6 +878,7 @@ if ($dirins && $action == 'initdoc' && !empty($module)) {
|
|||
}
|
||||
}
|
||||
$stringLog = implode("\n", $strreplace);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '','__CHANGELOG__' => $stringLog));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ if ($object->id > 0) {
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array('id'=>$id);
|
||||
$parameters = array('id' => $id);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -214,6 +214,7 @@ if ($id > 0 || $ref) {
|
|||
$param .= '&limit='.$limit;
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print_barre_liste($langs->trans("ActionsOnProduct"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 1);
|
||||
|
||||
// List of all actions
|
||||
|
|
|
|||
|
|
@ -585,29 +585,29 @@ class Product extends CommonObject
|
|||
* @var array fields of object product
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||
'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>5),
|
||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'position'=>15, 'csslist'=>'tdoverflowmax250'),
|
||||
'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>'isModEnabled("barcode")', 'position'=>20, 'visible'=>-1, 'showoncombobox'=>3),
|
||||
'fk_barcode_type' => array('type'=>'integer', 'label'=>'BarcodeType', 'enabled'=>'1', 'position'=>21, 'notnull'=>0, 'visible'=>-1,),
|
||||
'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61),
|
||||
'note' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62),
|
||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'),
|
||||
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 10, 'searchall' => 1, 'comment' => 'Reference of object'),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => 1, 'notnull' => 1, 'index' => 1, 'position' => 5),
|
||||
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 2, 'position' => 15, 'csslist' => 'tdoverflowmax250'),
|
||||
'barcode' => array('type' => 'varchar(255)', 'label' => 'Barcode', 'enabled' => 'isModEnabled("barcode")', 'position' => 20, 'visible' => -1, 'showoncombobox' => 3),
|
||||
'fk_barcode_type' => array('type' => 'integer', 'label' => 'BarcodeType', 'enabled' => '1', 'position' => 21, 'notnull' => 0, 'visible' => -1,),
|
||||
'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 61),
|
||||
'note' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 62),
|
||||
'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500),
|
||||
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 501),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||
'fk_user_author'=>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'llx_user.rowid'),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
|
||||
'fk_user_author' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 510, 'foreignkey' => 'llx_user.rowid'),
|
||||
'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 511),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'localtax1_tx' => array('type'=>'double(6,3)', 'label'=>'Localtax1tx', 'enabled'=>'1', 'position'=>150, 'notnull'=>0, 'visible'=>-1,),
|
||||
'localtax1_type' => array('type'=>'varchar(10)', 'label'=>'Localtax1type', 'enabled'=>'1', 'position'=>155, 'notnull'=>1, 'visible'=>-1,),
|
||||
'localtax2_tx' => array('type'=>'double(6,3)', 'label'=>'Localtax2tx', 'enabled'=>'1', 'position'=>160, 'notnull'=>0, 'visible'=>-1,),
|
||||
'localtax2_type' => array('type'=>'varchar(10)', 'label'=>'Localtax2type', 'enabled'=>'1', 'position'=>165, 'notnull'=>1, 'visible'=>-1,),
|
||||
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
|
||||
'localtax1_tx' => array('type' => 'double(6,3)', 'label' => 'Localtax1tx', 'enabled' => '1', 'position' => 150, 'notnull' => 0, 'visible' => -1,),
|
||||
'localtax1_type' => array('type' => 'varchar(10)', 'label' => 'Localtax1type', 'enabled' => '1', 'position' => 155, 'notnull' => 1, 'visible' => -1,),
|
||||
'localtax2_tx' => array('type' => 'double(6,3)', 'label' => 'Localtax2tx', 'enabled' => '1', 'position' => 160, 'notnull' => 0, 'visible' => -1,),
|
||||
'localtax2_type' => array('type' => 'varchar(10)', 'label' => 'Localtax2type', 'enabled' => '1', 'position' => 165, 'notnull' => 1, 'visible' => -1,),
|
||||
'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => -1, 'position' => 170),
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
|
||||
//'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
|
||||
//'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
|
||||
'mandatory_period' => array('type'=>'integer', 'label'=>'mandatoryperiod', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000),
|
||||
'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => 0, 'index' => 1, 'position' => 1000),
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -989,7 +989,7 @@ class Product extends CommonObject
|
|||
$result = -2;
|
||||
}
|
||||
|
||||
$arrayofnonnegativevalue = array('weight'=>'Weight', 'width'=>'Width', 'height'=>'Height', 'length'=>'Length', 'surface'=>'Surface', 'volume'=>'Volume');
|
||||
$arrayofnonnegativevalue = array('weight' => 'Weight', 'width' => 'Width', 'height' => 'Height', 'length' => 'Length', 'surface' => 'Surface', 'volume' => 'Volume');
|
||||
foreach ($arrayofnonnegativevalue as $key => $value) {
|
||||
if (property_exists($this, $key) && !empty($this->$key) && ($this->$key < 0)) {
|
||||
$langs->loadLangs(array("main", "other"));
|
||||
|
|
@ -1219,6 +1219,7 @@ class Product extends CommonObject
|
|||
} else {
|
||||
// we also add lot record if not exist
|
||||
$ObjLot = new Productlot($this->db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
if ($ObjLot->fetch(0, $this->id, $valueforundefinedlot) == 0) {
|
||||
$ObjLot->fk_product = $this->id;
|
||||
$ObjLot->entity = $this->entity;
|
||||
|
|
@ -1361,8 +1362,8 @@ class Product extends CommonObject
|
|||
if (!$this->hasbatch() && $this->oldcopy->hasbatch()) {
|
||||
// Selection of all product stock movements that contains batchs
|
||||
$sql = 'SELECT pb.qty, pb.fk_entrepot, pb.batch FROM '.MAIN_DB_PREFIX.'product_batch as pb';
|
||||
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product_stock as ps ON (ps.rowid = batch.fk_product_stock)';
|
||||
$sql.= ' WHERE ps.fk_product = '.(int) $this->id;
|
||||
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'product_stock as ps ON (ps.rowid = batch.fk_product_stock)';
|
||||
$sql .= ' WHERE ps.fk_product = '.(int) $this->id;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
|
|
@ -2023,7 +2024,7 @@ class Product extends CommonObject
|
|||
|
||||
// Call hook if any
|
||||
if (is_object($hookmanager)) {
|
||||
$parameters = array('thirdparty_seller'=>$thirdparty_seller, 'thirdparty_buyer' => $thirdparty_buyer, 'pqp' => $pqp);
|
||||
$parameters = array('thirdparty_seller' => $thirdparty_seller, 'thirdparty_buyer' => $thirdparty_buyer, 'pqp' => $pqp);
|
||||
// Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('getSellPrice', $parameters, $this, $action);
|
||||
if ($reshook > 0) {
|
||||
|
|
@ -2123,7 +2124,7 @@ class Product extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
return array('pu_ht'=>$pu_ht, 'pu_ttc'=>$pu_ttc, 'price_min'=>$price_min, 'price_base_type'=>$price_base_type, 'tva_tx'=>$tva_tx, 'tva_npr'=>$tva_npr);
|
||||
return array('pu_ht' => $pu_ht, 'pu_ttc' => $pu_ttc, 'price_min' => $price_min, 'price_base_type' => $price_base_type, 'tva_tx' => $tva_tx, 'tva_npr' => $tva_npr);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
@ -2564,7 +2565,7 @@ class Product extends CommonObject
|
|||
if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
|
||||
if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
|
||||
$checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
|
||||
if ($this->db->num_rows($checkPMPPerEntity)>0) {
|
||||
if ($this->db->num_rows($checkPMPPerEntity) > 0) {
|
||||
$separatedEntityPMP = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -3574,7 +3575,7 @@ class Product extends CommonObject
|
|||
$sql .= "AND EXISTS (SELECT p.rowid FROM ".$this->db->prefix()."product AS p WHERE p.rowid = ".((int) $this->id)." AND p.fk_product_type IN (0))";
|
||||
}
|
||||
if (!empty($warehouseid)) {
|
||||
$sql.= " AND m.fk_warehouse = ".((int) $warehouseid);
|
||||
$sql .= " AND m.fk_warehouse = ".((int) $warehouseid);
|
||||
}
|
||||
$sql .= " GROUP BY role";
|
||||
|
||||
|
|
@ -4590,16 +4591,16 @@ class Product extends CommonObject
|
|||
|
||||
// Updated ranks so that none are missing
|
||||
$sqlrank = "SELECT rowid, rang FROM ".$this->db->prefix()."product_association";
|
||||
$sqlrank.= " WHERE fk_product_pere = ".((int) $fk_parent);
|
||||
$sqlrank.= " ORDER BY rang";
|
||||
$sqlrank .= " WHERE fk_product_pere = ".((int) $fk_parent);
|
||||
$sqlrank .= " ORDER BY rang";
|
||||
$resqlrank = $this->db->query($sqlrank);
|
||||
if ($resqlrank) {
|
||||
$cpt = 0;
|
||||
while ($objrank = $this->db->fetch_object($resqlrank)) {
|
||||
$cpt++;
|
||||
$sql = "UPDATE ".$this->db->prefix()."product_association";
|
||||
$sql.= " SET rang = ".((int) $cpt);
|
||||
$sql.= " WHERE rowid = ".((int) $objrank->rowid);
|
||||
$sql .= " SET rang = ".((int) $cpt);
|
||||
$sql .= " WHERE rowid = ".((int) $objrank->rowid);
|
||||
if (! $this->db->query($sql)) {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
|
|
@ -4992,20 +4993,20 @@ class Product extends CommonObject
|
|||
}
|
||||
|
||||
$this->res[] = array(
|
||||
'id'=>$id, // Id product
|
||||
'id_parent'=>$id_parent,
|
||||
'ref'=>$tmpproduct->ref, // Ref product
|
||||
'nb'=>$nb, // Nb of units that compose parent product
|
||||
'nb_total'=>$nb * $multiply, // Nb of units for all nb of product
|
||||
'stock'=>$tmpproduct->stock_reel, // Stock
|
||||
'stock_alert'=>$tmpproduct->seuil_stock_alerte, // Stock alert
|
||||
'label'=>$label,
|
||||
'fullpath'=>$compl_path.$label, // Label
|
||||
'type'=>$type, // Nb of units that compose parent product
|
||||
'desiredstock'=>$tmpproduct->desiredstock,
|
||||
'level'=>$level,
|
||||
'incdec'=>$incdec,
|
||||
'entity'=>$tmpproduct->entity
|
||||
'id' => $id, // Id product
|
||||
'id_parent' => $id_parent,
|
||||
'ref' => $tmpproduct->ref, // Ref product
|
||||
'nb' => $nb, // Nb of units that compose parent product
|
||||
'nb_total' => $nb * $multiply, // Nb of units for all nb of product
|
||||
'stock' => $tmpproduct->stock_reel, // Stock
|
||||
'stock_alert' => $tmpproduct->seuil_stock_alerte, // Stock alert
|
||||
'label' => $label,
|
||||
'fullpath' => $compl_path.$label, // Label
|
||||
'type' => $type, // Nb of units that compose parent product
|
||||
'desiredstock' => $tmpproduct->desiredstock,
|
||||
'level' => $level,
|
||||
'incdec' => $incdec,
|
||||
'entity' => $tmpproduct->entity
|
||||
);
|
||||
|
||||
// Recursive call if there child has children of its own
|
||||
|
|
@ -5188,12 +5189,12 @@ class Product extends CommonObject
|
|||
$sql .= " WHERE p.rowid = pa.fk_product_fils";
|
||||
$sql .= " AND pa.fk_product_pere = ".((int) $id);
|
||||
$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
|
||||
$sql.= " ORDER BY pa.rang";
|
||||
$sql .= " ORDER BY pa.rang";
|
||||
|
||||
dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
|
||||
|
||||
if ($level == 1) {
|
||||
$alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately
|
||||
$alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately
|
||||
}
|
||||
// Protection against infinite loop
|
||||
if ($level > 30) {
|
||||
|
|
@ -5212,14 +5213,14 @@ class Product extends CommonObject
|
|||
}
|
||||
$alreadyfound[$rec['rowid']] = 1;
|
||||
$prods[$rec['rowid']] = array(
|
||||
0=>$rec['rowid'],
|
||||
1=>$rec['qty'],
|
||||
2=>$rec['fk_product_type'],
|
||||
3=>$this->db->escape($rec['label']),
|
||||
4=>$rec['incdec'],
|
||||
5=>$rec['ref'],
|
||||
6=>$rec['fk_association'],
|
||||
7=>$rec['rang']
|
||||
0 => $rec['rowid'],
|
||||
1 => $rec['qty'],
|
||||
2 => $rec['fk_product_type'],
|
||||
3 => $this->db->escape($rec['label']),
|
||||
4 => $rec['incdec'],
|
||||
5 => $rec['ref'],
|
||||
6 => $rec['fk_association'],
|
||||
7 => $rec['rang']
|
||||
);
|
||||
//$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']);
|
||||
//$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']);
|
||||
|
|
@ -5288,34 +5289,34 @@ class Product extends CommonObject
|
|||
if ($this->type == Product::TYPE_PRODUCT) {
|
||||
$datas['picto'] = img_picto('', 'product').' <u class="paddingrightonly">'.$langs->trans("Product").'</u>';
|
||||
} elseif ($this->type == Product::TYPE_SERVICE) {
|
||||
$datas['picto']= img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>';
|
||||
$datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>';
|
||||
}
|
||||
if (isset($this->status) && isset($this->status_buy)) {
|
||||
$datas['status']= ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1);
|
||||
$datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1);
|
||||
}
|
||||
|
||||
if (!empty($this->ref)) {
|
||||
$datas['ref']= '<br><b>'.$langs->trans('ProductRef').':</b> '.$this->ref;
|
||||
$datas['ref'] = '<br><b>'.$langs->trans('ProductRef').':</b> '.$this->ref;
|
||||
}
|
||||
if (!empty($this->label)) {
|
||||
$datas['label']= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label;
|
||||
$datas['label'] = '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label;
|
||||
}
|
||||
if (!empty($this->description)) {
|
||||
$datas['description']= '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineOfText($this->description, 5);
|
||||
$datas['description'] = '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineOfText($this->description, 5);
|
||||
}
|
||||
if ($this->type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
$langs->load("productbatch");
|
||||
$datas['batchstatus']= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2);
|
||||
$datas['batchstatus'] = "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2);
|
||||
}
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
$datas['barcode']= '<br><b>'.$langs->trans('BarCode').':</b> '.$this->barcode;
|
||||
$datas['barcode'] = '<br><b>'.$langs->trans('BarCode').':</b> '.$this->barcode;
|
||||
}
|
||||
|
||||
if ($this->type == Product::TYPE_PRODUCT) {
|
||||
if ($this->weight) {
|
||||
$datas['weight']= "<br><b>".$langs->trans("Weight").'</b>: '.$this->weight.' '.measuringUnitString(0, "weight", $this->weight_units);
|
||||
$datas['weight'] = "<br><b>".$langs->trans("Weight").'</b>: '.$this->weight.' '.measuringUnitString(0, "weight", $this->weight_units);
|
||||
}
|
||||
$labelsize = "";
|
||||
if ($this->length) {
|
||||
|
|
@ -5328,7 +5329,7 @@ class Product extends CommonObject
|
|||
$labelsize .= ($labelsize ? " - " : "")."<b>".$langs->trans("Height").'</b>: '.$this->height.' '.measuringUnitString(0, 'size', $this->height_units);
|
||||
}
|
||||
if ($labelsize) {
|
||||
$datas['size']= "<br>".$labelsize;
|
||||
$datas['size'] = "<br>".$labelsize;
|
||||
}
|
||||
|
||||
$labelsurfacevolume = "";
|
||||
|
|
@ -5346,9 +5347,9 @@ class Product extends CommonObject
|
|||
// Duration
|
||||
$datas['duration'] = '<br><b>'.$langs->trans("Duration").':</b> '.$this->duration_value;
|
||||
if ($this->duration_value > 1) {
|
||||
$dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years"));
|
||||
$dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
|
||||
} elseif ($this->duration_value > 0) {
|
||||
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year"));
|
||||
$dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year"));
|
||||
}
|
||||
$datas['duration'] .= (!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? " ".$langs->trans($dur[$this->duration_unit]) : '');
|
||||
}
|
||||
|
|
@ -5483,7 +5484,7 @@ class Product extends CommonObject
|
|||
|
||||
global $action;
|
||||
$hookmanager->initHooks(array('productdao'));
|
||||
$parameters = array('id'=>$this->id, 'getnomurl' => &$result, 'label' => &$label);
|
||||
$parameters = array('id' => $this->id, 'getnomurl' => &$result, 'label' => &$label);
|
||||
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
$result = $hookmanager->resPrint;
|
||||
|
|
@ -5965,7 +5966,7 @@ class Product extends CommonObject
|
|||
$this->stock_theorique += ($stock_commande_fournisseur - $stock_reception_fournisseur);
|
||||
}
|
||||
|
||||
$parameters = array('id'=>$this->id, 'includedraftpoforvirtual' => $includedraftpoforvirtual);
|
||||
$parameters = array('id' => $this->id, 'includedraftpoforvirtual' => $includedraftpoforvirtual);
|
||||
// Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('loadvirtualstock', $parameters, $this, $action);
|
||||
if ($reshook > 0) {
|
||||
|
|
@ -6017,7 +6018,7 @@ class Product extends CommonObject
|
|||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$result[] = array('batch'=>$batch, 'eatby'=>$this->db->jdate($obj->eatby), 'sellby'=>$this->db->jdate($obj->sellby), 'qty'=>$obj->qty);
|
||||
$result[] = array('batch' => $batch, 'eatby' => $this->db->jdate($obj->eatby), 'sellby' => $this->db->jdate($obj->sellby), 'qty' => $obj->qty);
|
||||
$i++;
|
||||
}
|
||||
return $result;
|
||||
|
|
@ -6626,7 +6627,7 @@ class Product extends CommonObject
|
|||
global $langs;
|
||||
|
||||
if (empty($this->duration_value)) {
|
||||
$this->errors[]='ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice';
|
||||
$this->errors[] = 'ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice';
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Save quantity found during inventory (when we click on Save button on inventory page)
|
||||
if ($action =='updateinventorylines' && $permissiontoadd) {
|
||||
if ($action == 'updateinventorylines' && $permissiontoadd) {
|
||||
$sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,';
|
||||
$sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id';
|
||||
|
|
@ -356,7 +356,7 @@ if (empty($reshook)) {
|
|||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/
|
||||
|
||||
if (GETPOST('addline', 'alpha')) {
|
||||
$qty= (GETPOST('qtytoadd') != '' ? price2num(GETPOST('qtytoadd', 'MS')) : null);
|
||||
$qty = (GETPOST('qtytoadd') != '' ? price2num(GETPOST('qtytoadd', 'MS')) : null);
|
||||
if ($fk_warehouse <= 0) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
|
|
@ -373,12 +373,12 @@ if (empty($reshook)) {
|
|||
$tmpproduct = new Product($db);
|
||||
$result = $tmpproduct->fetch($fk_product);
|
||||
|
||||
if (empty($error) && $tmpproduct->status_batch>0 && empty($batch)) {
|
||||
if (empty($error) && $tmpproduct->status_batch > 0 && empty($batch)) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorProductNeedBatchNumber", $tmpproduct->ref), null, 'errors');
|
||||
}
|
||||
if (empty($error) && $tmpproduct->status_batch==2 && !empty($batch) && $qty>1) {
|
||||
if (empty($error) && $tmpproduct->status_batch == 2 && !empty($batch) && $qty > 1) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("TooManyQtyForSerialNumber", $tmpproduct->ref, $batch), null, 'errors');
|
||||
|
|
@ -1050,6 +1050,7 @@ if ($resql) {
|
|||
if (isModEnabled('productbatch')) {
|
||||
print '<td id="id_'.$obj->rowid.'_batch" data-batch="'.dol_escape_htmltag($obj->batch).'">';
|
||||
$batch_static = new Productlot($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$res = $batch_static->fetch(0, $product_static->id, $obj->batch);
|
||||
if ($res) {
|
||||
print $batch_static->getNomUrl(1);
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ if ($cancel) {
|
|||
$action = '';
|
||||
}
|
||||
|
||||
$parameters = array('id'=>$id, 'ref'=>$ref);
|
||||
$parameters = array('id' => $id, 'ref' => $ref);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -369,7 +369,7 @@ if (empty($reshook)) {
|
|||
'default_vat_code' => $vatratecode,
|
||||
'vat_tx' => $tva_tx, // default_vat_code should be used in priority in a future
|
||||
'npr' => $npr, // default_vat_code should be used in priority in a future
|
||||
'localtaxes_array' => array('0'=>$localtax1_type, '1'=>$localtax1, '2'=>$localtax2_type, '3'=>$localtax2) // default_vat_code should be used in priority in a future
|
||||
'localtaxes_array' => array('0' => $localtax1_type, '1' => $localtax1, '2' => $localtax2_type, '3' => $localtax2) // default_vat_code should be used in priority in a future
|
||||
);
|
||||
|
||||
//If autogeneration is enabled, then we only set the first level
|
||||
|
|
@ -452,7 +452,7 @@ if (empty($reshook)) {
|
|||
'default_vat_code' => $vatratecode,
|
||||
'vat_tx' => $tva_tx, // default_vat_code should be used in priority in a future
|
||||
'npr' => $npr, // default_vat_code should be used in priority in a future
|
||||
'localtaxes_array' => array('0'=>$localtax1_type, '1'=>$localtax1, '2'=>$localtax2_type, '3'=>$localtax2) // default_vat_code should be used in priority in a future
|
||||
'localtaxes_array' => array('0' => $localtax1_type, '1' => $localtax1, '2' => $localtax2_type, '3' => $localtax2) // default_vat_code should be used in priority in a future
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1705,8 +1705,10 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau
|
|||
$backbutton = '<a class="justalink" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">'.$langs->trans("Back").'</a>';
|
||||
|
||||
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print_barre_liste($langs->trans("DefaultPriceLog"), 0, $_SERVER["PHP_SELF"], '', '', '', $backbutton, 0, $num, 'title_accountancy.png');
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print_barre_liste($langs->trans("PriceByCustomerLog"), 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, $num, 'title_accountancy.png');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@ if ($action == 'addlimitstockwarehouse' && $user->hasRight('produit', 'creer'))
|
|||
|
||||
if ($maj_ok) {
|
||||
$pse = new ProductStockEntrepot($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
if ($pse->fetch(0, $id, GETPOSTINT('fk_entrepot')) > 0) {
|
||||
// Update
|
||||
$pse->seuil_stock_alerte = $seuil_stock_alerte;
|
||||
|
|
|
|||
|
|
@ -1721,6 +1721,7 @@ if ($source == 'donation') {
|
|||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
|
||||
$don = new Don($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $don->fetch($ref);
|
||||
if ($result <= 0) {
|
||||
$mesg = $don->error;
|
||||
|
|
|
|||
|
|
@ -229,6 +229,7 @@ if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->access
|
|||
if (!$error) {
|
||||
// get partnership
|
||||
$logged_partnership = new WebPortalPartnership($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $logged_partnership->fetch(0, '', $logged_member->id, $websiteaccount->thirdparty->id);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -105,11 +105,13 @@ if (empty($pageid)) {
|
|||
$objectpage = new WebsitePage($db);
|
||||
|
||||
if ($pageref) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $objectpage->fetch(0, $object->id, $pageref);
|
||||
if ($result > 0) {
|
||||
$pageid = $objectpage->id;
|
||||
} elseif ($result == 0) {
|
||||
// Page not found from ref=pageurl, we try using alternative alias
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $objectpage->fetch(0, $object->id, null, $pageref);
|
||||
if ($result > 0) {
|
||||
$pageid = $objectpage->id;
|
||||
|
|
|
|||
|
|
@ -855,6 +855,7 @@ class Salary extends CommonObject
|
|||
if ($this->paye == 0) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$bac->fetch(0, $mysoc->id);
|
||||
|
||||
$sql = "SELECT count(rowid) as nb";
|
||||
|
|
|
|||
|
|
@ -1220,6 +1220,7 @@ class Thirdparties extends DolibarrApi
|
|||
}
|
||||
$account = new CompanyBankAccount($this->db);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$account->fetch($bankaccount_id, $id, -1, '');
|
||||
|
||||
if ($account->socid != $id) {
|
||||
|
|
|
|||
|
|
@ -3340,6 +3340,7 @@ class Societe extends CommonObject
|
|||
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$bac->fetch(0, $this->id);
|
||||
|
||||
if ($bac->id > 0) { // If a bank account has been found for company $this->id
|
||||
|
|
@ -4977,6 +4978,7 @@ class Societe extends CommonObject
|
|||
if (!isset($this->bank_account)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $bac->fetch(0, $this->id);
|
||||
if ($result > 0) {
|
||||
$this->bank_account = $bac;
|
||||
|
|
|
|||
|
|
@ -215,23 +215,23 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
|||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
's.nom'=>"ThirdPartyName",
|
||||
's.name_alias'=>"AliasNameShort",
|
||||
's.code_client'=>"CustomerCode",
|
||||
's.code_fournisseur'=>"SupplierCode",
|
||||
's.code_compta'=>"CustomerAccountancyCodeShort",
|
||||
's.code_compta_fournisseur'=>"SupplierAccountancyCodeShort",
|
||||
's.zip'=>"Zip",
|
||||
's.town'=>"Town",
|
||||
's.email'=>"EMail",
|
||||
's.url'=>"URL",
|
||||
's.tva_intra'=>"VATIntra",
|
||||
's.siren'=>"ProfId1",
|
||||
's.siret'=>"ProfId2",
|
||||
's.ape'=>"ProfId3",
|
||||
's.phone'=>"Phone",
|
||||
's.phone_mobile'=>"PhoneMobile",
|
||||
's.fax'=>"Fax",
|
||||
's.nom' => "ThirdPartyName",
|
||||
's.name_alias' => "AliasNameShort",
|
||||
's.code_client' => "CustomerCode",
|
||||
's.code_fournisseur' => "SupplierCode",
|
||||
's.code_compta' => "CustomerAccountancyCodeShort",
|
||||
's.code_compta_fournisseur' => "SupplierAccountancyCodeShort",
|
||||
's.zip' => "Zip",
|
||||
's.town' => "Town",
|
||||
's.email' => "EMail",
|
||||
's.url' => "URL",
|
||||
's.tva_intra' => "VATIntra",
|
||||
's.siren' => "ProfId1",
|
||||
's.siret' => "ProfId2",
|
||||
's.ape' => "ProfId3",
|
||||
's.phone' => "Phone",
|
||||
's.phone_mobile' => "PhoneMobile",
|
||||
's.fax' => "Fax",
|
||||
);
|
||||
if (($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') {
|
||||
$fieldstosearchall['s.idprof4'] = 'ProfId4';
|
||||
|
|
@ -269,49 +269,49 @@ $checkedprofid6 = 0;
|
|||
$checkprospectlevel = (in_array($contextpage, array('prospectlist')) ? 1 : 0);
|
||||
$checkstcomm = (in_array($contextpage, array('prospectlist')) ? 1 : 0);
|
||||
$arrayfields = array(
|
||||
's.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>-1, 'enabled'=>1),
|
||||
's.nom'=>array('label'=>"ThirdPartyName", 'position'=>2, 'checked'=>1),
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>3, 'checked'=>1),
|
||||
's.barcode'=>array('label'=>"Gencod", 'position'=>5, 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))),
|
||||
's.code_client'=>array('label'=>"CustomerCodeShort", 'position'=>10, 'checked'=>$checkedcustomercode),
|
||||
's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'position'=>11, 'checked'=>$checkedsuppliercode, 'enabled'=>(isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
|
||||
's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'position'=>13, 'checked'=>$checkedcustomeraccountcode),
|
||||
's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'position'=>14, 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
|
||||
's.address'=>array('label'=>"Address", 'position'=>19, 'checked'=>0),
|
||||
's.zip'=>array('label'=>"Zip", 'position'=>20, 'checked'=>1),
|
||||
's.town'=>array('label'=>"Town", 'position'=>21, 'checked'=>0),
|
||||
'state.nom'=>array('label'=>"State", 'position'=>22, 'checked'=>0),
|
||||
'region.nom'=>array('label'=>"Region", 'position'=>23, 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'position'=>24, 'checked'=>0),
|
||||
's.email'=>array('label'=>"Email", 'position'=>25, 'checked'=>0),
|
||||
's.url'=>array('label'=>"Url", 'position'=>26, 'checked'=>0),
|
||||
's.phone'=>array('label'=>"Phone", 'position'=>27, 'checked'=>1),
|
||||
's.fax'=>array('label'=>"Fax", 'position'=>28, 'checked'=>0),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'position'=>29, 'checked'=>$checkedtypetiers),
|
||||
'staff.code'=>array('label'=>"Workforce", 'position'=>31, 'checked'=>0),
|
||||
's.phone_mobile'=>array('label'=>"PhoneMobile", 'position'=>32, 'checked'=>0),
|
||||
's.siren'=>array('label'=>"ProfId1Short", 'position'=>40, 'checked'=>$checkedprofid1),
|
||||
's.siret'=>array('label'=>"ProfId2Short", 'position'=>41, 'checked'=>$checkedprofid2),
|
||||
's.ape'=>array('label'=>"ProfId3Short", 'position'=>42, 'checked'=>$checkedprofid3),
|
||||
's.idprof4'=>array('label'=>"ProfId4Short", 'position'=>43, 'checked'=>$checkedprofid4),
|
||||
's.idprof5'=>array('label'=>"ProfId5Short", 'position'=>44, 'checked'=>$checkedprofid5),
|
||||
's.idprof6'=>array('label'=>"ProfId6Short", 'position'=>45, 'checked'=>$checkedprofid6),
|
||||
's.tva_intra'=>array('label'=>"VATIntraShort", 'position'=>50, 'checked'=>0),
|
||||
'customerorsupplier'=>array('label'=>'NatureOfThirdParty', 'position'=>61, 'checked'=>1),
|
||||
's.fk_prospectlevel'=>array('label'=>"ProspectLevel", 'position'=>62, 'checked'=>$checkprospectlevel),
|
||||
's.fk_stcomm'=>array('label'=>"StatusProsp", 'position'=>63, 'checked'=>$checkstcomm),
|
||||
's2.nom'=>array('label'=>'ParentCompany', 'position'=>64, 'checked'=>0),
|
||||
's.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||
's.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||
's.status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
's.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100),
|
||||
's.rowid' => array('label' => "TechnicalID", 'position' => 1, 'checked' => -1, 'enabled' => 1),
|
||||
's.nom' => array('label' => "ThirdPartyName", 'position' => 2, 'checked' => 1),
|
||||
's.name_alias' => array('label' => "AliasNameShort", 'position' => 3, 'checked' => 1),
|
||||
's.barcode' => array('label' => "Gencod", 'position' => 5, 'checked' => 1, 'enabled' => (isModEnabled('barcode'))),
|
||||
's.code_client' => array('label' => "CustomerCodeShort", 'position' => 10, 'checked' => $checkedcustomercode),
|
||||
's.code_fournisseur' => array('label' => "SupplierCodeShort", 'position' => 11, 'checked' => $checkedsuppliercode, 'enabled' => (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
|
||||
's.code_compta' => array('label' => "CustomerAccountancyCodeShort", 'position' => 13, 'checked' => $checkedcustomeraccountcode),
|
||||
's.code_compta_fournisseur' => array('label' => "SupplierAccountancyCodeShort", 'position' => 14, 'checked' => $checkedsupplieraccountcode, 'enabled' => (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
|
||||
's.address' => array('label' => "Address", 'position' => 19, 'checked' => 0),
|
||||
's.zip' => array('label' => "Zip", 'position' => 20, 'checked' => 1),
|
||||
's.town' => array('label' => "Town", 'position' => 21, 'checked' => 0),
|
||||
'state.nom' => array('label' => "State", 'position' => 22, 'checked' => 0),
|
||||
'region.nom' => array('label' => "Region", 'position' => 23, 'checked' => 0),
|
||||
'country.code_iso' => array('label' => "Country", 'position' => 24, 'checked' => 0),
|
||||
's.email' => array('label' => "Email", 'position' => 25, 'checked' => 0),
|
||||
's.url' => array('label' => "Url", 'position' => 26, 'checked' => 0),
|
||||
's.phone' => array('label' => "Phone", 'position' => 27, 'checked' => 1),
|
||||
's.fax' => array('label' => "Fax", 'position' => 28, 'checked' => 0),
|
||||
'typent.code' => array('label' => "ThirdPartyType", 'position' => 29, 'checked' => $checkedtypetiers),
|
||||
'staff.code' => array('label' => "Workforce", 'position' => 31, 'checked' => 0),
|
||||
's.phone_mobile' => array('label' => "PhoneMobile", 'position' => 32, 'checked' => 0),
|
||||
's.siren' => array('label' => "ProfId1Short", 'position' => 40, 'checked' => $checkedprofid1),
|
||||
's.siret' => array('label' => "ProfId2Short", 'position' => 41, 'checked' => $checkedprofid2),
|
||||
's.ape' => array('label' => "ProfId3Short", 'position' => 42, 'checked' => $checkedprofid3),
|
||||
's.idprof4' => array('label' => "ProfId4Short", 'position' => 43, 'checked' => $checkedprofid4),
|
||||
's.idprof5' => array('label' => "ProfId5Short", 'position' => 44, 'checked' => $checkedprofid5),
|
||||
's.idprof6' => array('label' => "ProfId6Short", 'position' => 45, 'checked' => $checkedprofid6),
|
||||
's.tva_intra' => array('label' => "VATIntraShort", 'position' => 50, 'checked' => 0),
|
||||
'customerorsupplier' => array('label' => 'NatureOfThirdParty', 'position' => 61, 'checked' => 1),
|
||||
's.fk_prospectlevel' => array('label' => "ProspectLevel", 'position' => 62, 'checked' => $checkprospectlevel),
|
||||
's.fk_stcomm' => array('label' => "StatusProsp", 'position' => 63, 'checked' => $checkstcomm),
|
||||
's2.nom' => array('label' => 'ParentCompany', 'position' => 64, 'checked' => 0),
|
||||
's.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500),
|
||||
's.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500),
|
||||
's.status' => array('label' => "Status", 'checked' => 1, 'position' => 1000),
|
||||
's.import_key' => array('label' => "ImportId", 'checked' => 0, 'position' => 1100),
|
||||
);
|
||||
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
|
||||
$arrayfields['s.price_level'] = array('label'=>"PriceLevel", 'position'=>30, 'checked'=>0);
|
||||
$arrayfields['s.price_level'] = array('label' => "PriceLevel", 'position' => 30, 'checked' => 0);
|
||||
}
|
||||
|
||||
// Add non object fields to fields for list
|
||||
$arrayfields['sales.representative'] = array('label'=>$langs->trans("SalesRepresentatives"), 'checked'=>1, 'position'=>12);
|
||||
$arrayfields['sales.representative'] = array('label' => $langs->trans("SalesRepresentatives"), 'checked' => 1, 'position' => 12);
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
|
@ -1087,7 +1087,7 @@ if (GETPOST('delsoc')) {
|
|||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
);
|
||||
//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
||||
|
|
@ -1139,8 +1139,8 @@ if ($contextpage != 'poslist') {
|
|||
$url .= '&socid='.$socid;
|
||||
}
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url, '', $user->hasRight('societe', 'creer'));
|
||||
} elseif ($user->hasRight('societe', 'creer')) {
|
||||
$url = DOL_URL_ROOT.'/societe/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
|
||||
|
|
@ -1182,6 +1182,7 @@ foreach (array(1, 2, 3, 4, 5, 6) as $key) {
|
|||
if (preg_match('/\((.*)\)/i', $label, $reg)) {
|
||||
$label = $reg[1];
|
||||
}
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$textprofid[$key] = $langs->trans("ProfIdShortDesc", $key, $mysoc->country_code, $label);
|
||||
}
|
||||
}
|
||||
|
|
@ -1238,7 +1239,7 @@ if ($user->hasRight("societe", "client", "voir") || $socid) {
|
|||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
$parameters = array('type'=>$type);
|
||||
$parameters = array('type' => $type);
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print '</div>';
|
||||
|
|
@ -1478,7 +1479,7 @@ if (!empty($arrayfields['s2.nom']['checked'])) {
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
$parameters = array('arrayfields' => $arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Creation date
|
||||
|
|
@ -1506,7 +1507,7 @@ if (!empty($arrayfields['s.tms']['checked'])) {
|
|||
// Status
|
||||
if (!empty($arrayfields['s.status']['checked'])) {
|
||||
print '<td class="liste_titre center minwidth75imp parentonrightofpage">';
|
||||
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage', 1);
|
||||
print $form->selectarray('search_status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage', 1);
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['s.import_key']['checked'])) {
|
||||
|
|
@ -1674,7 +1675,7 @@ if (!empty($arrayfields['s2.nom']['checked'])) {
|
|||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (!empty($arrayfields['s.datec']['checked'])) {
|
||||
|
|
@ -1933,7 +1934,7 @@ while ($i < $imaxinloop) {
|
|||
if (!isset($typenArray) || !is_array($typenArray) || count($typenArray) == 0) {
|
||||
$typenArray = $formcompany->typent_array(1);
|
||||
}
|
||||
$labeltypeofcompany= empty($typenArray[$obj->typent_code]) ? '' : $typenArray[$obj->typent_code];
|
||||
$labeltypeofcompany = empty($typenArray[$obj->typent_code]) ? '' : $typenArray[$obj->typent_code];
|
||||
|
||||
print '<td class="center tdoverflowmax125" title="'.dol_escape_htmltag($labeltypeofcompany).'">';
|
||||
print dol_escape_htmltag($labeltypeofcompany);
|
||||
|
|
@ -2088,7 +2089,7 @@ while ($i < $imaxinloop) {
|
|||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Date creation
|
||||
|
|
@ -2162,7 +2163,7 @@ if ($num == 0) {
|
|||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ if ($cancel) {
|
|||
}
|
||||
|
||||
$morehtmlright = '';
|
||||
$parameters = array('id'=>$socid);
|
||||
$parameters = array('id' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -518,8 +518,8 @@ if (empty($reshook)) {
|
|||
if ($action == 'builddocrib') {
|
||||
$action = 'builddoc';
|
||||
$moreparams = array(
|
||||
'use_companybankid'=>GETPOST('companybankid'),
|
||||
'force_dir_output'=>$conf->societe->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->id)
|
||||
'use_companybankid' => GETPOST('companybankid'),
|
||||
'force_dir_output' => $conf->societe->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->id)
|
||||
);
|
||||
$_POST['lang_id'] = GETPOSTINT('lang_idrib'.GETPOSTINT('companybankid'));
|
||||
$_POST['model'] = GETPOSTINT('modelrib'.GETPOSTINT('companybankid'));
|
||||
|
|
@ -890,7 +890,9 @@ if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('fo
|
|||
|
||||
// Load Bank account
|
||||
if (!$id) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$companybankaccount->fetch(0, $object->id);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$companypaymentmode->fetch(0, null, $object->id, 'card');
|
||||
} else {
|
||||
$companybankaccount->fetch($id);
|
||||
|
|
@ -1195,7 +1197,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
print '<td>'.$langs->trans('Note').'</td>';
|
||||
print '<td>'.$langs->trans('DateModification').'</td>';
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>array(), 'param'=>'', 'sortfield'=>'', 'sortorder'=>'', 'linetype'=>'stripetitle');
|
||||
$parameters = array('arrayfields' => array(), 'param' => '', 'sortfield' => '', 'sortorder' => '', 'linetype' => 'stripetitle');
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
|
|
@ -1302,7 +1304,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
print dol_print_date($companypaymentmodetemp->tms, 'dayhour');
|
||||
print '</td>';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>array(), 'obj'=>$obj, 'linetype'=>'stripecard');
|
||||
$parameters = array('arrayfields' => array(), 'obj' => $obj, 'linetype' => 'stripecard');
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
|
|
@ -1453,7 +1455,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
print '</td>';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>array(), 'stripesource'=>$src, 'linetype'=>'stripecardremoteonly');
|
||||
$parameters = array('arrayfields' => array(), 'stripesource' => $src, 'linetype' => 'stripecardremoteonly');
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
@ -1560,7 +1562,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
}
|
||||
print_liste_field_titre('', '', '', '', '', '', '', '', 'center ');
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>array(), 'linetype'=>'stripebantitle');
|
||||
$parameters = array('arrayfields' => array(), 'linetype' => 'stripebantitle');
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch ');
|
||||
|
|
@ -1716,7 +1718,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
print '</td>';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>array(), 'stripe_card_ref'=>$rib->stripe_card_ref, 'stripe_account'=>$rib->stripe_account, 'linetype'=>'stripeban');
|
||||
$parameters = array('arrayfields' => array(), 'stripe_card_ref' => $rib->stripe_card_ref, 'stripe_account' => $rib->stripe_account, 'linetype' => 'stripeban');
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
@ -1850,7 +1852,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
print '</td>';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>array(), 'stripe_card_ref'=>$rib->stripe_card_ref, 'stripe_account'=>$rib->stripe_account, 'linetype'=>'stripebanremoteonly');
|
||||
$parameters = array('arrayfields' => array(), 'stripe_card_ref' => $rib->stripe_card_ref, 'stripe_account' => $rib->stripe_account, 'linetype' => 'stripebanremoteonly');
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
@ -1881,7 +1883,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
}
|
||||
|
||||
//Hook to display your print listing (list of CB card from Stancer Plugin for example)
|
||||
$parameters = array('arrayfields'=>array(), 'param'=>'', 'sortfield'=>'', 'sortorder'=>'', 'linetype'=>'');
|
||||
$parameters = array('arrayfields' => array(), 'param' => '', 'sortfield' => '', 'sortorder' => '', 'linetype' => '');
|
||||
$reshook = $hookmanager->executeHooks('printNewTable', $parameters, $object);
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
|
@ -1903,10 +1905,12 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
if (getDolGlobalString('BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD')) {
|
||||
$companybankaccounttemp = new CompanyBankAccount($db);
|
||||
$companypaymentmodetemp = new CompanyPaymentMode($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $companypaymentmodetemp->fetch(0, null, $object->id, 'ban');
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||
$ecmfile = new EcmFiles($db);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$result = $ecmfile->fetch(0, '', '', '', '', $companybankaccounttemp->table_element, $companypaymentmodetemp->id);
|
||||
if ($result > 0) {
|
||||
$companybankaccounttemp->last_main_doc = $ecmfile->filepath.'/'.$ecmfile->filename;
|
||||
|
|
|
|||
|
|
@ -170,8 +170,8 @@ $term = empty($_SESSION["takeposterminal"]) ? 1 : $_SESSION["takeposterminal"];
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
@ -546,7 +546,7 @@ if (empty($reshook)) {
|
|||
$batch = GETPOST('batch', 'alpha');
|
||||
|
||||
if (!empty($batch)) {
|
||||
$action="setbatch";
|
||||
$action = "setbatch";
|
||||
} else {
|
||||
// Set nb of suggested with nb of batch into the warehouse of the terminal
|
||||
$nbofsuggested = 0;
|
||||
|
|
@ -566,7 +566,7 @@ if (empty($reshook)) {
|
|||
echo "}";
|
||||
echo "</script>";
|
||||
|
||||
if ($nbofsuggested>0) {
|
||||
if ($nbofsuggested > 0) {
|
||||
echo "<center>".$langs->trans("SearchIntoBatch").": <b> $nbofsuggested </b></center><br><table>";
|
||||
foreach ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch as $dbatch) { // $dbatch is instance of Productbatch
|
||||
$batchStock = + $dbatch->qty; // To get a numeric
|
||||
|
|
@ -628,7 +628,7 @@ if (empty($reshook)) {
|
|||
if (getDolGlobalString('TAKEPOS_GROUP_SAME_PRODUCT')) {
|
||||
foreach ($invoice->lines as $line) {
|
||||
if ($line->product_ref == $prod->ref) {
|
||||
if ($line->special_code==4) {
|
||||
if ($line->special_code == 4) {
|
||||
continue;
|
||||
} // If this line is sended to printer create new line
|
||||
// check if qty in stock
|
||||
|
|
@ -678,7 +678,7 @@ if (empty($reshook)) {
|
|||
|
||||
// complete line by hook
|
||||
$parameters = array('prod' => $prod, 'line' => $line);
|
||||
$reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
@ -733,7 +733,7 @@ if (empty($reshook)) {
|
|||
|
||||
if ($action == "addnote" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
|
||||
$desc = GETPOST('addnote', 'alpha');
|
||||
if ($idline==0) {
|
||||
if ($idline == 0) {
|
||||
$invoice->update_note($desc, '_public');
|
||||
} else {
|
||||
foreach ($invoice->lines as $line) {
|
||||
|
|
@ -791,6 +791,7 @@ if (empty($reshook)) {
|
|||
// We delete the lines
|
||||
$resdeletelines = 1;
|
||||
foreach ($invoice->lines as $line) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$tmpres = $invoice->deleteLine($line->id);
|
||||
if ($tmpres < 0) {
|
||||
$resdeletelines = 0;
|
||||
|
|
@ -928,7 +929,7 @@ if (empty($reshook)) {
|
|||
$invoice->fetch($placeid);
|
||||
}
|
||||
|
||||
if ($action=="setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
|
||||
if ($action == "setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
|
||||
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch=".$db->escape($batch).", fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded);
|
||||
$db->query($sql);
|
||||
|
|
@ -1139,7 +1140,7 @@ if ((getDolGlobalString('TAKEPOS_PHONE_BASIC_LAYOUT') == 1 && $conf->browser->la
|
|||
<script type="text/javascript">
|
||||
var selectedline=0;
|
||||
var selectedtext="";
|
||||
<?php if ($action=="valid") {
|
||||
<?php if ($action == "valid") {
|
||||
echo "var place=0;";
|
||||
}?> // Set to default place after close sale
|
||||
var placeid=<?php echo($placeid > 0 ? $placeid : 0); ?>;
|
||||
|
|
@ -1551,8 +1552,8 @@ if (!$usediv) {
|
|||
}
|
||||
|
||||
// Complete header by hook
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
@ -1713,8 +1714,8 @@ if ($placeid > 0) {
|
|||
$htmlsupplements[$line->fk_parent_line] .= '</td>';
|
||||
|
||||
// complete line by hook
|
||||
$parameters=array('line' => $line);
|
||||
$reshook=$hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array('line' => $line);
|
||||
$reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
@ -1809,8 +1810,8 @@ if ($placeid > 0) {
|
|||
$htmlforlines .= '</td>';
|
||||
|
||||
// complete line by hook
|
||||
$parameters=array('line' => $line);
|
||||
$reshook=$hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array('line' => $line);
|
||||
$reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ $hookmanager->initHooks(array('usercard', 'useragenda', 'globalcard'));
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$parameters = array('id' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -249,7 +249,7 @@ while ($i <= $MAXAGENDA) {
|
|||
$color = 'AGENDA_EXT_COLOR_'.$id.'_'.$key;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
// Nb
|
||||
// Nb @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print '<td class="maxwidth50onsmartphone">'.$langs->trans("AgendaExtNb", $key)."</td>";
|
||||
// Name
|
||||
$name_value = (GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) ? GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) : (empty($object->conf->$name) ? '' : $object->conf->$name));
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
$account = new UserBankAccount($db);
|
||||
if (!$bankid) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
$account->fetch(0, '', $id);
|
||||
} else {
|
||||
$account->fetch($bankid);
|
||||
|
|
@ -603,7 +604,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
|||
// Latest payments of salaries
|
||||
if (isModEnabled('salaries') &&
|
||||
(($user->hasRight('salaries', 'read') && (in_array($object->id, $childids) || $object->id == $user->id)) || ($user->hasRight('salaries', 'readall')))
|
||||
) {
|
||||
) {
|
||||
$payment_salary = new PaymentSalary($db);
|
||||
$salary = new Salary($db);
|
||||
|
||||
|
|
@ -725,7 +726,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
|||
// Latest expense report
|
||||
if (isModEnabled('expensereport') &&
|
||||
($user->hasRight('expensereport', 'readall') || ($user->hasRight('expensereport', 'lire') && $object->id == $user->id))
|
||||
) {
|
||||
) {
|
||||
$exp = new ExpenseReport($db);
|
||||
|
||||
$sql = "SELECT e.rowid, e.ref, e.fk_statut as status, e.date_debut, e.total_ttc";
|
||||
|
|
|
|||
|
|
@ -1021,7 +1021,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||
// Gender
|
||||
print '<tr><td>'.$langs->trans("Gender").'</td>';
|
||||
print '<td>';
|
||||
$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother"));
|
||||
$arraygender = array('man' => $langs->trans("Genderman"), 'woman' => $langs->trans("Genderwoman"), 'other' => $langs->trans("Genderother"));
|
||||
print $form->selectarray('gender', $arraygender, GETPOST('gender'), 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -2314,7 +2314,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||
// Gender
|
||||
print '<tr><td>'.$langs->trans("Gender").'</td>';
|
||||
print '<td>';
|
||||
$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother"));
|
||||
$arraygender = array('man' => $langs->trans("Genderman"), 'woman' => $langs->trans("Genderwoman"), 'other' => $langs->trans("Genderother"));
|
||||
if ($caneditfield) {
|
||||
print $form->selectarray('gender', $arraygender, GETPOSTISSET('gender') ? GETPOST('gender') : $object->gender, 1);
|
||||
} else {
|
||||
|
|
@ -2399,6 +2399,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||
if ($object->socid) {
|
||||
$type = $langs->trans("External");
|
||||
}
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print $form->textwithpicto($type, $langs->trans("InternalExternalDesc"));
|
||||
if ($object->ldap_sid) {
|
||||
print ' ('.$langs->trans("DomainUser").')';
|
||||
|
|
|
|||
|
|
@ -273,6 +273,7 @@ if ($result > 0) {
|
|||
|
||||
// List of active notifications
|
||||
//print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', '');
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, 'email', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
// Line with titles
|
||||
|
|
@ -311,7 +312,7 @@ if ($result > 0) {
|
|||
print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$type = array('email'=>$langs->trans("EMail"));
|
||||
$type = array('email' => $langs->trans("EMail"));
|
||||
print $form->selectarray("typeid", $type);
|
||||
print '</td>';
|
||||
print '<td class="nowraponall">';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user