mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Qual: Fix phan notices (mostly in box files)
# Qual: Fix phan notices (mostly in box files) Fix several phan notices reported in box files and a few extra cases.
This commit is contained in:
parent
b41ef2192c
commit
d48a2e907f
|
|
@ -10,14 +10,14 @@
|
|||
return [
|
||||
// # Issue statistics:
|
||||
// PhanUndeclaredProperty : 560+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 370+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 350+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 300+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 230+ occurrences
|
||||
// PhanPluginUnknownArrayMethodReturnType : 180+ occurrences
|
||||
// PhanTypeMismatchProperty : 140+ occurrences
|
||||
// PhanPluginUnknownPropertyType : 130+ occurrences
|
||||
// PhanPluginUnknownArrayMethodParamType : 120+ occurrences
|
||||
// PhanPossiblyUndeclaredVariable : 110+ occurrences
|
||||
// PhanPluginUnknownPropertyType : 120+ occurrences
|
||||
// PhanPossiblyUndeclaredVariable : 80+ occurrences
|
||||
// PhanPluginUndeclaredVariableIsset : 60+ occurrences
|
||||
// PhanRedefineFunction : 45+ occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 45+ occurrences
|
||||
|
|
@ -30,27 +30,26 @@ return [
|
|||
// PhanTypeComparisonFromArray : 10+ occurrences
|
||||
// PhanTypeMismatchDimFetchNullable : 10+ occurrences
|
||||
// PhanUndeclaredMethod : 10+ occurrences
|
||||
// PhanEmptyForeach : 9 occurrences
|
||||
// PhanEmptyForeach : 8 occurrences
|
||||
// PhanTypeArraySuspiciousNull : 8 occurrences
|
||||
// PhanPluginBothLiteralsBinaryOp : 7 occurrences
|
||||
// PhanPluginDuplicateExpressionBinaryOp : 7 occurrences
|
||||
// PhanPluginSuspiciousParamPosition : 7 occurrences
|
||||
// PhanTypeArraySuspiciousNull : 7 occurrences
|
||||
// PhanPossiblyNullTypeMismatchProperty : 5 occurrences
|
||||
// PhanParamTooMany : 4 occurrences
|
||||
// PhanPluginDuplicateArrayKey : 4 occurrences
|
||||
// PhanEmptyFQSENInClasslike : 3 occurrences
|
||||
// PhanInvalidFQSENInClasslike : 3 occurrences
|
||||
// PhanTypeMismatchReturn : 3 occurrences
|
||||
// PhanPluginUnknownArrayPropertyType : 2 occurrences
|
||||
// PhanTypeExpectedObjectPropAccessButGotNull : 2 occurrences
|
||||
// PhanTypeMismatchDimAssignment : 2 occurrences
|
||||
// PhanTypeSuspiciousStringExpression : 2 occurrences
|
||||
// PhanAccessMethodProtected : 1 occurrence
|
||||
// PhanPluginUnknownArrayPropertyType : 1 occurrence
|
||||
// PhanTypeConversionFromArray : 1 occurrence
|
||||
|
||||
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
|
||||
'file_suppressions' => [
|
||||
'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanPluginUnknownArrayPropertyType'],
|
||||
'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/adherents/type.php' => ['PhanTypeMismatchProperty'],
|
||||
|
|
@ -129,7 +128,6 @@ return [
|
|||
'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'],
|
||||
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/contact/perso.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/contrat/agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/contrat/card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
|
||||
|
|
@ -138,26 +136,6 @@ return [
|
|||
'htdocs/core/actions_printing.inc.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/boxes/box_actions.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_actions_future.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_external_rss.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/boxes/box_graph_invoices_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_graph_invoices_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/boxes/box_graph_nb_tickets_type.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/boxes/box_graph_new_vs_close_ticket.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/boxes/box_graph_orders_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_graph_orders_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_graph_product_distribution.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_graph_propales_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_graph_ticket_by_severity.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/boxes/box_last_modified_ticket.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/boxes/box_last_ticket.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/boxes/box_project.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_project_opportunities.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/boxes/box_services_contracts.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/core/boxes/box_task.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/boxes/box_validated_projects.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'],
|
||||
'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -353,7 +331,6 @@ return [
|
|||
'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/ftp/admin/ftpclient.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/holiday/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/holiday/card_group.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/holiday/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/holiday/view_log.php' => ['PhanTypeMismatchDimFetch'],
|
||||
|
|
@ -388,7 +365,7 @@ return [
|
|||
'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/loan/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/loan/card.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/loan/document.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/loan/note.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -407,7 +384,7 @@ return [
|
|||
'htdocs/opcachepreload.php' => ['PhanEmptyForeach'],
|
||||
'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/opensurvey/list.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/opensurvey/list.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
'htdocs/opensurvey/results.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/opensurvey/wizard/choix_date.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/opensurvey/wizard/create_survey.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
|
|
@ -418,7 +395,7 @@ return [
|
|||
'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/printing/index.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/product/ajax/products.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/product/ajax/products.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/product/card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -567,14 +544,12 @@ return [
|
|||
'htdocs/theme/eldy/btn.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/eldy/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/eldy/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/eldy/info-box.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/eldy/main_menu_fa_icons.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/eldy/progress.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/md/badges.inc.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/theme/md/btn.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/md/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/md/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/md/info-box.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/md/progress.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/actions_ticket.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
|
|||
|
|
@ -359,10 +359,10 @@ class OrderLine extends CommonOrderLine
|
|||
$this->localtax2_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax1_type)) {
|
||||
$this->localtax1_type = 0;
|
||||
$this->localtax1_type = '0';
|
||||
}
|
||||
if (empty($this->localtax2_type)) {
|
||||
$this->localtax2_type = 0;
|
||||
$this->localtax2_type = '0';
|
||||
}
|
||||
if (empty($this->total_localtax1)) {
|
||||
$this->total_localtax1 = 0;
|
||||
|
|
@ -522,10 +522,10 @@ class OrderLine extends CommonOrderLine
|
|||
$this->localtax2_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax1_type)) {
|
||||
$this->localtax1_type = 0;
|
||||
$this->localtax1_type = '0';
|
||||
}
|
||||
if (empty($this->localtax2_type)) {
|
||||
$this->localtax2_type = 0;
|
||||
$this->localtax2_type = '0';
|
||||
}
|
||||
if (empty($this->qty)) {
|
||||
$this->qty = 0;
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ class box_actions extends ModeleBoxes
|
|||
if (getDolGlobalString('SHOW_DIALOG_HOMEPAGE')) {
|
||||
$actioncejour = false;
|
||||
$contents = $this->info_box_contents;
|
||||
$nblines = 0;
|
||||
if (is_countable($contents) && count($contents) > 0) {
|
||||
$nblines = count($contents);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ class box_actions_future extends ModeleBoxes
|
|||
if (getDolGlobalString('SHOW_DIALOG_HOMEPAGE')) {
|
||||
$actioncejour = false;
|
||||
$contents = $this->info_box_contents;
|
||||
$nblines = 0;
|
||||
if (is_countable($contents) && count($contents) > 0) {
|
||||
$nblines = count($contents);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ class box_external_rss extends ModeleBoxes
|
|||
public $boxlabel = "BoxLastRssInfos";
|
||||
public $depends = array("externalrss");
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $paramdef; // Params of box definition (not user params)
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -133,6 +133,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||
|
||||
$stats = new FactureStats($this->db, $socid, $mode, 0);
|
||||
$stats->where = "f.fk_statut > 0";
|
||||
$px1 = null;
|
||||
$px2 = null;
|
||||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb) {
|
||||
|
|
@ -247,14 +249,14 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<div class="fichecenter">';
|
||||
$stringtoshow .= '<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) {
|
||||
if ($shownb && $px1 !== null) {
|
||||
$stringtoshow .= $px1->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
$stringtoshow .= '</div>';
|
||||
$stringtoshow .= '<div class="fichehalfright">';
|
||||
}
|
||||
if ($showtot) {
|
||||
if ($showtot && $px2 !== null) {
|
||||
$stringtoshow .= $px2->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,11 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
$prefix = '';
|
||||
$mesg = '';
|
||||
$socid = 0;
|
||||
$px1 = null;
|
||||
$px2 = null;
|
||||
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
|
@ -242,14 +246,14 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<div class="fichecenter">';
|
||||
$stringtoshow .= '<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) {
|
||||
if ($shownb && $px1 !== null) {
|
||||
$stringtoshow .= $px1->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
$stringtoshow .= '</div>';
|
||||
$stringtoshow .= '<div class="fichehalfright">';
|
||||
}
|
||||
if ($showtot) {
|
||||
if ($showtot && $px2 !== null) {
|
||||
$stringtoshow .= $px2->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "box_graph_nb_ticket_last_x_days";
|
||||
public $boximg = "ticket";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
public $depends = array("ticket");
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ class box_graph_nb_tickets_type extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "box_graph_nb_tickets_type";
|
||||
public $boximg = "ticket";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
public $depends = array("ticket");
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "box_nb_tickets_type";
|
||||
public $boximg = "ticket";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
public $depends = array("ticket");
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,9 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
$prefix = '';
|
||||
$mesg = '';
|
||||
$px1 = null;
|
||||
$px2 = null;
|
||||
$socid = 0;
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
|
|
@ -246,14 +249,14 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<div class="fichecenter">';
|
||||
$stringtoshow .= '<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) {
|
||||
if ($shownb && $px1 !== null) {
|
||||
$stringtoshow .= $px1->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
$stringtoshow .= '</div>';
|
||||
$stringtoshow .= '<div class="fichehalfright">';
|
||||
}
|
||||
if ($showtot) {
|
||||
if ($showtot && $px2 !== null) {
|
||||
$stringtoshow .= $px2->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
$prefix = '';
|
||||
$mesg = '';
|
||||
$px1 = null;
|
||||
$px2 = null;
|
||||
$socid = 0;
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
|
|
@ -245,14 +248,14 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<div class="fichecenter">';
|
||||
$stringtoshow .= '<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) {
|
||||
if ($shownb && $px1 !== null) {
|
||||
$stringtoshow .= $px1->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
$stringtoshow .= '</div>';
|
||||
$stringtoshow .= '<div class="fichehalfright">';
|
||||
}
|
||||
if ($showtot) {
|
||||
if ($showtot && $px2 !== null) {
|
||||
$stringtoshow .= $px2->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
|
|
|
|||
|
|
@ -137,6 +137,10 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
|
||||
|
||||
$socid = empty($user->socid) ? 0 : $user->socid;
|
||||
$mesg = '';
|
||||
$px1 = null;
|
||||
$px2 = null;
|
||||
$px3 = null;
|
||||
$userid = 0; // No filter on user creation
|
||||
|
||||
$WIDTH = ($nbofgraph >= 2 || !empty($conf->dol_optimize_smallscreen)) ? '300' : '320';
|
||||
|
|
@ -373,30 +377,30 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
$stringtoshow .= '</div>';
|
||||
|
||||
if ($nbofgraph == 1) {
|
||||
if ($showpropalnb) {
|
||||
if ($showpropalnb && $px2 !== null) {
|
||||
$stringtoshow .= $px2->show();
|
||||
} elseif ($showordernb) {
|
||||
} elseif ($showordernb && $px3 !== null) {
|
||||
$stringtoshow .= $px3->show();
|
||||
} else {
|
||||
} elseif ($px1 !== null) {
|
||||
$stringtoshow .= $px1->show();
|
||||
}
|
||||
}
|
||||
if ($nbofgraph == 2) {
|
||||
$stringtoshow .= '<div class="fichecenter"><div class="containercenter"><div class="fichehalfleft">';
|
||||
if (isModEnabled('propal') && $showpropalnb) {
|
||||
if (isModEnabled('propal') && $showpropalnb && $px2 !== null) {
|
||||
$stringtoshow .= $px2->show();
|
||||
} elseif (isModEnabled('order') && $showordernb) {
|
||||
} elseif (isModEnabled('order') && $showordernb && $px3 !== null) {
|
||||
$stringtoshow .= $px3->show();
|
||||
}
|
||||
$stringtoshow .= '</div><div class="fichehalfright">';
|
||||
if (isModEnabled('invoice') && $showinvoicenb) {
|
||||
if (isModEnabled('invoice') && $showinvoicenb && $px1 !== null) {
|
||||
$stringtoshow .= $px1->show();
|
||||
} elseif (isModEnabled('order') && $showordernb) {
|
||||
} elseif (isModEnabled('order') && $showordernb && $px3 !== null) {
|
||||
$stringtoshow .= $px3->show();
|
||||
}
|
||||
$stringtoshow .= '</div></div></div>';
|
||||
}
|
||||
if ($nbofgraph == 3) {
|
||||
if ($nbofgraph == 3 && $px1 !== null && $px2 !== null && $px3 !== null) {
|
||||
$stringtoshow .= '<div class="fichecenter"><div class="containercenter"><div class="fichehalfleft">';
|
||||
$stringtoshow .= $px2->show();
|
||||
$stringtoshow .= '</div><div class="fichehalfright">';
|
||||
|
|
|
|||
|
|
@ -90,6 +90,9 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
$prefix = '';
|
||||
$mesg = '';
|
||||
$px1 = null;
|
||||
$px2 = null;
|
||||
$socid = 0;
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
|
|
@ -242,14 +245,14 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<div class="fichecenter">';
|
||||
$stringtoshow .= '<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) {
|
||||
if ($shownb && $px1 !== null) {
|
||||
$stringtoshow .= $px1->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
$stringtoshow .= '</div>';
|
||||
$stringtoshow .= '<div class="fichehalfright">';
|
||||
}
|
||||
if ($showtot) {
|
||||
if ($showtot && $px2 !== null) {
|
||||
$stringtoshow .= $px2->show();
|
||||
}
|
||||
if ($shownb && $showtot) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ class box_graph_ticket_by_severity extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "box_ticket_by_severity";
|
||||
public $boximg = "ticket";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
public $depends = array("ticket");
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ class box_last_modified_ticket extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "box_last_modified_ticket";
|
||||
public $boximg = "ticket";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
public $depends = array("ticket");
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ class box_last_ticket extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "box_last_ticket";
|
||||
public $boximg = "ticket";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
public $depends = array("ticket");
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ class box_project extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "project";
|
||||
public $boximg = "object_projectpub";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
// var $depends = array("projet");
|
||||
|
||||
|
|
@ -73,6 +76,7 @@ class box_project extends ModeleBoxes
|
|||
$totalMnt = 0;
|
||||
$totalnb = 0;
|
||||
$totalnbTask = 0;
|
||||
$num = 0;
|
||||
|
||||
$textHead = $langs->trans("OpenedProjects");
|
||||
$this->info_box_head = array('text' => $textHead, 'limit' => dol_strlen($textHead));
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ class box_project_opportunities extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "project_opportunities";
|
||||
public $boximg = "object_projectpub";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
// var $depends = array("projet");
|
||||
|
||||
|
|
@ -74,6 +77,7 @@ class box_project_opportunities extends ModeleBoxes
|
|||
$textHead = $langs->trans("OpenedProjectsOpportunities");
|
||||
$this->info_box_head = array('text' => $textHead, 'limit' => dol_strlen($textHead));
|
||||
|
||||
$num = 0;
|
||||
$i = 0;
|
||||
// list the summary of the orders
|
||||
if ($user->hasRight('projet', 'lire')) {
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ class box_services_contracts extends ModeleBoxes
|
|||
}
|
||||
$description = $objp->description;
|
||||
|
||||
$s = $form->textwithtooltip($text, $description, 3, '', '', '', 0, '');
|
||||
$s = $form->textwithtooltip($text, $description, 3, 0, '', '', 0, '');
|
||||
} else {
|
||||
$s = img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ class box_task extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "projettask";
|
||||
public $boximg = "object_projecttask";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
public $depends = array("projet");
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ class box_validated_projects extends ModeleBoxes
|
|||
{
|
||||
public $boxcode = "validated_project";
|
||||
public $boximg = "object_projectpub";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $boxlabel;
|
||||
//var $depends = array("projet");
|
||||
|
||||
|
|
|
|||
|
|
@ -237,13 +237,14 @@ class Canvas
|
|||
*
|
||||
* @param string $action Action string
|
||||
* @param int $id Object id
|
||||
* @return mixed Return return code of doActions of canvas
|
||||
* @return ?mixed Return return code of doActions of canvas
|
||||
* @see https://wiki.dolibarr.org/index.php/Canvas_development
|
||||
*/
|
||||
public function doActions(&$action = 'view', $id = 0)
|
||||
{
|
||||
if (method_exists($this->control, 'doActions')) {
|
||||
$ret = $this->control->doActions($action, $id);
|
||||
$control = $this->control;
|
||||
if (method_exists($control, 'doActions')) {
|
||||
$ret = $control->doActions($action, $id);
|
||||
return $ret;
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ abstract class CommonOrderLine extends CommonObjectLine
|
|||
* Unit price
|
||||
* @deprecated
|
||||
* @see $subprice
|
||||
* @var float
|
||||
*/
|
||||
public $price;
|
||||
|
||||
|
|
@ -194,7 +195,7 @@ abstract class CommonOrderLine extends CommonObjectLine
|
|||
|
||||
/**
|
||||
* Type of the product. 0 for product 1 for service
|
||||
* @var int
|
||||
* @var int<0,1>
|
||||
*/
|
||||
public $product_type = 0;
|
||||
|
||||
|
|
@ -234,7 +235,13 @@ abstract class CommonOrderLine extends CommonObjectLine
|
|||
*/
|
||||
public $localtax2_tx;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $localtax1_type;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $localtax2_type;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class ExtraFields
|
|||
public $db;
|
||||
|
||||
/**
|
||||
* @var array<string,array{label:array<string,string>,type:array<string,string>,size:array<string,string>,default:array<string,string>,computed:array<string,string>,unique:array<string,int>,required:array<string,int>,param:array<string,mixed>,perms:array<string,mixed>,list:array<string,int|string>,pos:array<string,int>,totalizable:array<string,int>,help:array<string,string>,printable:array<string,int>,enabled:array<string,int>,langfile:array<string,string>,css:array<string,string>,csslist:array<string,string>,cssview:array<string,string>,hidden:array<string,int>,mandatoryfieldsofotherentities:array<string,string>,loaded?:int,count:int}> New array to store extrafields definition Note: count set as present to avoid static analysis notices
|
||||
* @var array<string,array{label:array<string,string>,type:array<string,string>,size:array<string,string>,default:array<string,string>,computed:array<string,string>,unique:array<string,int>,required:array<string,int>,param:array<string,mixed>,perms:array<string,mixed>,list:array<string,int|string>,pos:array<string,int>,totalizable:array<string,int>,help:array<string,string>,printable:array<string,int>,enabled:array<string,int>,langfile:array<string,string>,css:array<string,string>,csslist:array<string,string>,cssview:array<string,string>,hidden:array<string,int>,mandatoryfieldsofotherentities:array<string,string>,alwayseditable:array<string,int<0,1>>,loaded?:int,count:int}> New array to store extrafields definition Note: count set as present to avoid static analysis notices
|
||||
*/
|
||||
public $attributes = array();
|
||||
|
||||
|
|
@ -651,7 +651,7 @@ class ExtraFields
|
|||
* @param int<0,1> $required Is field required or not
|
||||
* @param int<0,1> $pos Position of attribute
|
||||
* @param array<string,mixed|mixed[]> $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
||||
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
||||
* @param int<0,1> $alwayseditable Is attribute always editable regardless of the document status
|
||||
* @param string $perms Permission to check
|
||||
* @param string $list Visibility
|
||||
* @param string $help Help on tooltip
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*/
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
|
|
@ -7,6 +8,11 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
|
|||
/**
|
||||
* @var Conf $conf
|
||||
*/
|
||||
// Expected to be defined by including parent
|
||||
'
|
||||
@phan-var-force string $right
|
||||
@phan-var-force string $left
|
||||
';
|
||||
?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,20 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*/
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
}
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
*/
|
||||
|
||||
// Expected to be defined by including parent
|
||||
'
|
||||
@phan-var-force string $right
|
||||
@phan-var-force string $left
|
||||
';
|
||||
?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user