Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop
This commit is contained in:
Laurent Destailleur 2024-10-24 13:54:13 +02:00
commit 8abfcf71a9
73 changed files with 665 additions and 335 deletions

View File

@ -9,11 +9,11 @@
*/
return [
// # Issue statistics:
// PhanUndeclaredProperty : 770+ occurrences
// PhanPluginUnknownPropertyType : 710+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 600+ occurrences
// PhanUndeclaredProperty : 640+ occurrences
// PhanPluginUnknownPropertyType : 630+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 580+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 400+ occurrences
// PhanUndeclaredGlobalVariable : 380+ occurrences
// PhanUndeclaredGlobalVariable : 350+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 300+ occurrences
// PhanPluginUnknownArrayMethodParamType : 250+ occurrences
// PhanPossiblyUndeclaredVariable : 200+ occurrences
@ -29,22 +29,22 @@ return [
// PhanTypeInvalidDimOffset : 35+ occurrences
// PhanTypeMismatchDimFetch : 30+ occurrences
// PhanPluginUnknownObjectMethodCall : 15+ occurrences
// PhanTypeComparisonFromArray : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanUndeclaredMethod : 15+ occurrences
// PhanEmptyForeach : 10+ occurrences
// PhanPluginConstantVariableNull : 10+ occurrences
// PhanPossiblyNullTypeMismatchProperty : 10+ occurrences
// PhanTypeArraySuspiciousNull : 10+ occurrences
// PhanTypeComparisonFromArray : 10+ occurrences
// PhanTypeMismatchDimFetchNullable : 10+ occurrences
// PhanPluginBothLiteralsBinaryOp : 8 occurrences
// PhanPluginSuspiciousParamPosition : 8 occurrences
// PhanPluginDuplicateExpressionBinaryOp : 7 occurrences
// PhanParamTooMany : 5 occurrences
// PhanPluginDuplicateArrayKey : 4 occurrences
// PhanTypeExpectedObjectPropAccessButGotNull : 4 occurrences
// PhanEmptyFQSENInClasslike : 3 occurrences
// PhanInvalidFQSENInClasslike : 3 occurrences
// PhanTypeExpectedObjectPropAccessButGotNull : 3 occurrences
// PhanAccessMethodProtected : 1 occurrence
// PhanTypeConversionFromArray : 1 occurrence
@ -293,7 +293,7 @@ return [
'htdocs/core/class/html.formldap.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/core/class/html.formmail.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/html.formmargin.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'],
'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/core/class/html.formwebsite.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'],
'htdocs/core/class/ldap.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'],
@ -430,14 +430,12 @@ return [
'htdocs/core/tpl/filemanager.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/formlayoutai.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/list_print_total.tpl.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/core/tpl/login.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/tpl/notes.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/tpl/object_discounts.tpl.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/tpl/objectline_edit.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/tpl/objectline_title.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/tpl/onlinepaymentlinks.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'],
@ -445,7 +443,7 @@ return [
'htdocs/core/tpl/resource_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/core/triggers/dolibarrtriggers.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_50_modNotification_Notification.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess'],
@ -781,24 +779,20 @@ return [
'htdocs/salaries/paiement_salary.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'],
'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/societe/class/client.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/societe/class/companybankaccount.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/societe/class/companypaymentmode.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/societe/class/societeaccount.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/paymentmodes.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'],
'htdocs/societe/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'],
'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition'],
'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty'],
'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'],

View File

@ -97,6 +97,7 @@ $config['suppress_issue_types'] = [
'PhanPluginUnknownArrayMethodParamType', // this option costs more time to be supported than it solves time
'PhanPluginUnknownArrayMethodReturnType', // this option costs more time to be supported than it solves time
'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
];
return $config;

View File

@ -3179,6 +3179,7 @@ class Adherent extends CommonObject
$actioncomm->errors_to = '';
$actioncomm->fk_element = $adherent->id;
$actioncomm->elementid = $adherent->id;
$actioncomm->elementtype = $adherent->element;
$actioncomm->extraparams = $extraparams;

View File

@ -564,12 +564,7 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("TicketsAutoAssignTicket").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_AUTO_ASSIGN_USER_CREATE');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $formcategory->selectarray("TICKET_AUTO_ASSIGN_USER_CREATE", $arrval, getDolGlobalString('TICKET_AUTO_ASSIGN_USER_CREATE'));
}
print '<input class="minwidth100" type="text" id="TICKET_AUTO_ASSIGN_USER_CREATE" name="TICKET_AUTO_ASSIGN_USER_CREATE" value="'.getDolGlobalString('TICKET_AUTO_ASSIGN_USER_CREATE').'">';
print '</td>';
print '<td class="center">';
print $formcategory->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1, 'help');

View File

@ -142,7 +142,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
} else {
print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOSTINT('combinations'), 1);
}
$urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id);
$urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create'.(($filtertype == 1) ? '&leftmenu=service&type=1' : '&leftmenu=product&type=0').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id);
print '<a href="'.$urltocreateproduct.'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProduct").'"></span></a>';
echo '</span>';

View File

@ -188,12 +188,13 @@ if ($object->id > 0) {
print '</tr>';
$sql = "SELECT ac.id, ac.ref, ac.datep as date_start, ac.datep2 as date_end, ac.label, acr.fk_element";
$sql = "SELECT ac.id, ac.ref, ac.datep as date_start, ac.datep2 as date_end, ac.label, acr.fk_element as elementid";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as ac";
$sql .= " JOIN ".MAIN_DB_PREFIX."actioncomm_resources as acr on acr.fk_actioncomm = ac.id";
$sql .= " WHERE ac.fk_bookcal_calendar = ".((int) $object->id);
$sql .= " AND ac.code = 'AC_RDV'";
$sql .= " AND acr.element_type = 'socpeople'";
$resql = $db->query($sql);
$num = 0;
@ -203,10 +204,10 @@ if ($object->id > 0) {
$tmpcontact = new Contact($db);
$tmpactioncomm = new ActionComm($db);
$num = $db->num_rows($result);
$num = $db->num_rows($resql);
while ($i < $num) {
$obj = $db->fetch_object($resql);
$tmpcontact->fetch($obj->fk_element);
$tmpcontact->fetch($obj->elementid);
$tmpactioncomm->fetch($obj->id);
print '<tr class="oddeven">';
@ -230,7 +231,6 @@ if ($object->id > 0) {
print $tmpcontact->getNomUrl(1, -1);
print '</td>';
print "</tr>\n";
$i++;
}

View File

@ -376,6 +376,7 @@ if (empty($reshook) && $action == 'add' && $usercancreate) {
}
if ($hasPermissionOnLinkedObject) {
$object->fk_element = GETPOSTINT("fk_element");
$object->elementid = GETPOSTINT("fk_element");
$object->elementtype = GETPOST("elementtype", 'alpha');
}
}
@ -402,6 +403,7 @@ if (empty($reshook) && $action == 'add' && $usercancreate) {
}
$object->fk_element = $taskid;
$object->elementid = $taskid;
$object->elementtype = 'task';
}
@ -836,6 +838,7 @@ if (empty($reshook) && $action == 'update' && $usercancreate) {
}
if ($hasPermissionOnLinkedObject) {
$object->fk_element = GETPOSTINT("fk_element");
$object->elementid = GETPOSTINT("fk_element");
$object->elementtype = GETPOST("elementtype", 'alpha');
}
}

View File

@ -273,6 +273,7 @@ class ActionComm extends CommonObject
// Properties for links to other objects
/**
* @var int Id of linked object
* @deprecated Use $elementid
*/
public $fk_element; // Id of record
@ -480,6 +481,9 @@ class ActionComm extends CommonObject
if (empty($this->fk_element) && !empty($this->elementid)) {
$this->fk_element = $this->elementid;
}
if (empty($this->elementid) && !empty($this->fk_element)) {
$this->elementid = $this->fk_element;
}
if (!is_array($this->userassigned) && !empty($this->userassigned)) { // For backward compatibility when userassigned was an int instead of an array
$tmpid = (int) $this->userassigned;

View File

@ -947,6 +947,7 @@ if ($resql) {
$event->location = $obj->location;
$event->transparency = $obj->transparency;
$event->fk_element = $obj->fk_element;
$event->elementid = $obj->fk_element;
$event->elementtype = $obj->elementtype;
$event->fk_project = $obj->fk_project;

View File

@ -697,6 +697,7 @@ if ($resql) {
$event->contact_id = $obj->fk_contact;
$event->fk_element = $obj->fk_element;
$event->elementid = $obj->fk_element;
$event->elementtype = $obj->elementtype;
// Defined date_start_in_calendar and date_end_in_calendar property

View File

@ -731,6 +731,7 @@ if ($resql) {
$event->contact_id = $obj->fk_contact;
$event->fk_element = $obj->fk_element;
$event->elementid = $obj->fk_element;
$event->elementtype = $obj->elementtype;
// Defined date_start_in_calendar and date_end_in_calendar property

View File

@ -151,7 +151,7 @@ class AdvanceTargetingMailing extends CommonObject
*/
public function create($user, $notrigger = 0)
{
global $conf, $langs;
global $conf;
$error = 0;
// Clean parameters

View File

@ -417,11 +417,9 @@ class FormAdvTargetEmailing extends Form
*/
public function selectAdvtargetemailingTemplate($htmlname = 'template_id', $selected = 0, $showempty = 0, $type_element = 'mailing', $morecss = '')
{
global $conf, $user, $langs;
$out = '';
$sql = "SELECT c.rowid, c.name, c.fk_element";
$sql = "SELECT c.rowid, c.name, c.fk_element as elementid";
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as c";
$sql .= " WHERE type_element = '".$this->db->escape($type_element)."'";
$sql .= " ORDER BY c.name";
@ -440,7 +438,7 @@ class FormAdvTargetEmailing extends Form
$obj = $this->db->fetch_object($resql);
$label = $obj->name;
if (empty($label)) {
$label = $obj->fk_element;
$label = (string) $obj->elementid;
}
if ($selected > 0 && $selected == $obj->rowid) {
@ -455,7 +453,9 @@ class FormAdvTargetEmailing extends Form
} else {
dol_print_error($this->db);
}
$this->db->free($resql);
return $out;
}
}

View File

@ -2732,34 +2732,36 @@ while ($i < $imaxinloop) {
$numlines = count($generic_commande->lines); // Loop on each line of order
for ($lig = 0; $lig < $numlines; $lig++) {
if (isset($generic_commande->expeditions[$generic_commande->lines[$lig]->id])) {
$reliquat = $generic_commande->lines[$lig]->qty - $generic_commande->expeditions[$generic_commande->lines[$lig]->id];
$orderLine = $generic_commande->lines[$lig];
'@phan-var-force OrderLine $orderLine';
if (isset($generic_commande->expeditions[$orderLine->id])) {
$reliquat = $orderLine->qty - $generic_commande->expeditions[$orderLine->id];
} else {
$reliquat = $generic_commande->lines[$lig]->qty;
$reliquat = $orderLine->qty;
}
if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) { // If line is a product and not a service
if ($orderLine->product_type == 0 && $orderLine->fk_product > 0) { // If line is a product and not a service
$nbprod++; // order contains real products
$generic_product->id = $generic_commande->lines[$lig]->fk_product;
$generic_product->id = $orderLine->fk_product;
// Get local and virtual stock and store it into cache
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) {
if (empty($productstat_cache[$orderLine->fk_product])) {
$generic_product->load_stock('nobatch,warehouseopen'); // ->load_virtual_stock() is already included into load_stock()
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel;
$productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
$productstat_cache[$orderLine->fk_product]['stock_reel'] = $generic_product->stock_reel;
$productstat_cachevirtual[$orderLine->fk_product]['stock_reel'] = $generic_product->stock_theorique;
} else {
$generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
$generic_product->stock_reel = $productstat_cache[$orderLine->fk_product]['stock_reel'];
// @phan-suppress-next-line PhanTypeInvalidDimOffset
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
$generic_product->stock_theorique = $productstat_cachevirtual[$orderLine->fk_product]['stock_reel'];
}
if ($reliquat > $generic_product->stock_reel) {
$notshippable++;
}
if (!getDolGlobalString('SHIPPABLE_ORDER_ICON_IN_LIST')) { // Default code. Default should be this case.
$text_info .= $reliquat.' x '.$generic_commande->lines[$lig]->product_ref.'&nbsp;'.dol_trunc($generic_commande->lines[$lig]->product_label, 20);
$text_info .= $reliquat.' x '.$orderLine->product_ref.'&nbsp;'.dol_trunc($orderLine->product_label, 20);
$text_info .= ' - '.$langs->trans("Stock").': <span class="'.($generic_product->stock_reel > 0 ? 'ok' : 'error').'">'.$generic_product->stock_reel.'</span>';
$text_info .= ' - '.$langs->trans("VirtualStock").': <span class="'.($generic_product->stock_theorique > 0 ? 'ok' : 'error').'">'.$generic_product->stock_theorique.'</span>';
$text_info .= ($reliquat != $generic_commande->lines[$lig]->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($generic_commande->lines[$lig]->qty - $reliquat).')</span>' : '');
$text_info .= ($reliquat != $orderLine->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($orderLine->qty - $reliquat).')</span>' : '');
$text_info .= '<br>';
} else { // BUGGED CODE.
// DOES NOT TAKE INTO ACCOUNT MANUFACTURING. THIS CODE SHOULD BE USELESS. PREVIOUS CODE SEEMS COMPLETE.
@ -2770,29 +2772,29 @@ while ($i < $imaxinloop) {
$stock_order_supplier = 0;
if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { // What about other options ?
if (isModEnabled('order')) {
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) {
if (empty($productstat_cache[$orderLine->fk_product]['stats_order_customer'])) {
$generic_product->load_stats_commande(0, '1,2');
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
$productstat_cache[$orderLine->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
} else {
// @phan-suppress-next-line PhanTypeInvalidDimOffset
$generic_product->stats_commande['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'];
$generic_product->stats_commande['qty'] = $productstat_cache[$orderLine->fk_product]['stats_order_customer'];
}
$stock_order = $generic_product->stats_commande['qty'];
}
if (isModEnabled("supplier_order")) {
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
if (empty($productstat_cache[$orderLine->fk_product]['stats_order_supplier'])) {
$generic_product->load_stats_commande_fournisseur(0, '3');
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
$productstat_cache[$orderLine->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
} else {
// @phan-suppress-next-line PhanTypeInvalidDimOffset
$generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'];
$generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$orderLine->fk_product]['stats_order_supplier'];
}
$stock_order_supplier = $generic_product->stats_commande_fournisseur['qty'];
}
}
$text_info .= $reliquat.' x '.$generic_commande->lines[$lig]->ref.'&nbsp;'.dol_trunc($generic_commande->lines[$lig]->product_label, 20);
$text_info .= $reliquat.' x '.$orderLine->ref.'&nbsp;'.dol_trunc($orderLine->product_label, 20);
$text_stock_reel = $generic_product->stock_reel.'/'.$stock_order;
if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) {
if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $orderLine->qty)) {
$warning++;
$text_warning .= '<span class="warning">'.$langs->trans('Available').'&nbsp;:&nbsp;'.$text_stock_reel.'</span>';
}
@ -2804,7 +2806,7 @@ while ($i < $imaxinloop) {
if (isModEnabled("supplier_order")) {
$text_info .= '&nbsp;'.$langs->trans('SupplierOrder').'&nbsp;:&nbsp;'.$stock_order_supplier;
}
$text_info .= ($reliquat != $generic_commande->lines[$lig]->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($generic_commande->lines[$lig]->qty - $reliquat).')</span>' : '');
$text_info .= ($reliquat != $orderLine->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($orderLine->qty - $reliquat).')</span>' : '');
$text_info .= '<br>';
}
}

View File

@ -159,6 +159,8 @@ class BankAccounts extends DolibarrApi
$result = $this->_validate($request_data);
$account = new Account($this->db);
// Date of the initial balance (required to create an account).
$account->date_solde = time();
foreach ($request_data as $field => $value) {
if ($field === 'caller') {
// Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller
@ -168,8 +170,6 @@ class BankAccounts extends DolibarrApi
$account->$field = $this->_checkValForAPI($field, $value, $account);
}
// Date of the initial balance (required to create an account).
$account->date_solde = time();
// courant and type are the same thing but the one used when
// creating an account is courant
$account->courant = $account->type; // deprecated

View File

@ -1890,7 +1890,10 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf
}
}
$parameters['toselect'] = (empty($toselect) ? array() : $toselect);
if (empty($toselect)) {
$toselect=[];
}
$parameters['toselect'] = &$toselect;
$parameters['uploaddir'] = $uploaddir;
$parameters['massaction'] = $massaction;
$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null;

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2007-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -78,7 +79,7 @@ if ($boxorder && $zone != '' && $userid > 0) {
// boxorder value is the target order: "A:idboxA1,idboxA2,A-B:idboxB1,idboxB2,B"
dol_syslog("AjaxBox boxorder=".$boxorder." zone=".$zone." userid=".$userid, LOG_DEBUG);
$result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid);
$result = InfoBox::saveboxorder($db, (int) $zone, $boxorder, $userid);
if ($result > 0) {
$langs->load("boxes");
if (!GETPOST('closing')) {

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2016 Sergio Sanchis <sergiosanchis@hotmail.com>
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2016 Sergio Sanchis <sergiosanchis@hotmail.com>
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -66,7 +66,6 @@ if ($action == 'stopreminder') { // Test on permission not required here. Endpoi
if (!$resql) {
dol_print_error($db);
}
//}
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';

View File

@ -391,7 +391,7 @@ class FormProjets extends Form
// Use select2 selector
if (empty($option_only) && !empty($conf->use_javascript_ajax)) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
$comboenhancement = ajax_combobox($htmlname, [], 0, $forcefocus);
$out .= $comboenhancement;
$morecss .= ' minwidth150imp';
}
@ -906,7 +906,7 @@ class FormProjets extends Form
if (empty($lineOnly)) {
if (!empty($conf->use_javascript_ajax)) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlNameInvoiceLine, '', 0, 0);
$comboenhancement = ajax_combobox($htmlNameInvoiceLine, [], 0, 0);
$out .= $comboenhancement;
$morecss = 'minwidth200imp maxwidth500';
}

View File

@ -445,7 +445,7 @@ function ajax_dialog($title, $message, $w = 350, $h = 150)
* TODO: It is used when COMPANY_USE_SEARCH_TO_SELECT and CONTACT_USE_SEARCH_TO_SELECT are set by html.formcompany.class.php. Should use ajax_autocompleter instead like done by html.form.class.php for select_produits.
*
* @param string $htmlname Name of html select field ('myid' or '.myclass')
* @param array<array{method:string,url:string,htmlname:string,params:array<string,string>}> $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param array<array{method:string,url:string,htmlname:string,params?:array<string,string>}> $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete
* @param int $forcefocus Force focus on field
* @param string $widthTypeOfAutocomplete 'resolve' or 'off'

View File

@ -540,63 +540,61 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t
}
if ($mode == 'target' || preg_match('/targetwithdetails/', $mode)) {
if ($usecontact) {
if (is_object($targetcontact)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1));
if ($usecontact && (is_object($targetcontact))) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1));
if (!empty($targetcontact->address)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n";
} else {
$companytouseforaddress = $targetcompany;
if (!empty($targetcontact->address)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n";
} else {
$companytouseforaddress = $targetcompany;
// Contact on a thirdparty that is a different thirdparty than the thirdparty of object
if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) {
$targetcontact->fetch_thirdparty();
$companytouseforaddress = $targetcontact->thirdparty;
}
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress))."\n";
}
// Country
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code));
} elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code));
// Contact on a thirdparty that is a different thirdparty than the thirdparty of object
if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) {
$targetcontact->fetch_thirdparty();
$companytouseforaddress = $targetcontact->thirdparty;
}
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || preg_match('/targetwithdetails/', $mode)) {
// Phone
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) {
if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": ";
}
if (!empty($targetcontact->phone_pro)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro);
}
if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) {
$stringaddress .= " / ";
}
if (!empty($targetcontact->phone_mobile)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile);
}
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress))."\n";
}
// Country
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code));
} elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code));
}
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || preg_match('/targetwithdetails/', $mode)) {
// Phone
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) {
if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": ";
}
// Fax
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) {
if ($targetcontact->fax) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
}
if (!empty($targetcontact->phone_pro)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro);
}
// EMail
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) {
if ($targetcontact->email) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email);
}
if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) {
$stringaddress .= " / ";
}
// Web
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) {
if ($targetcontact->url) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url);
}
if (!empty($targetcontact->phone_mobile)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile);
}
}
// Fax
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) {
if ($targetcontact->fax) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
}
}
// EMail
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) {
if ($targetcontact->email) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email);
}
}
// Web
if (getDolGlobalString('MAIN_PDF_ADDALSOTARGETDETAILS') || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) {
if ($targetcontact->url) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url);
}
}
}

View File

@ -1,9 +1,9 @@
<?php
/**
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -25,7 +25,7 @@
* Returns an array with the tabs for the "salaries" section
* It loads tabs from modules looking for the entity salaries
*
* @param Paiement $object Current salaries object
* @param Salary $object Current salaries object
* @return array<array{0:string,1:string,2:string}> Tabs for the salaries section
*/
function salaries_prepare_head($object)

View File

@ -183,7 +183,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=4', 'StatusOrderProcessed', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&amp;leftmenu=orders', 'Statistics', 1, 'orders', '(!empty($conf->global->MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS)?$user->hasRight("commande", "commande", "export"):$user->hasRight("commande", "lire"))', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $conf->global->MAIN_FEATURES_LEVEL >= 1 && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&amp;leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&amp;leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 1, __ENTITY__);
-- Commercial - Supplier's proposals
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1650__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 4, __ENTITY__);

View File

@ -1382,7 +1382,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
//$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->hasRight('commande', 'lire'));
$newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire'));
}
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 && empty($user->socid)) {
if (empty($user->socid)) {
$newmenu->add("/commande/list_det.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->hasRight('commande', 'lire'));
}
if (getDolGlobalInt('MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) {

View File

@ -198,7 +198,7 @@ class modAi extends DolibarrModules
/* Example:
$this->dictionaries=array(
'langs'=>'ai@ai',
// List of tables we want to see into dictonnary editor
// List of tables we want to see into dictionary editor
'tabname'=>array("table1", "table2", "table3"),
// Label of tables
'tablib'=>array("Table1", "Table2", "Table3"),

View File

@ -195,7 +195,7 @@ class modBookCal extends DolibarrModules
/* Example:
$this->dictionaries=array(
'langs'=>'bookcal@bookcal',
// List of tables we want to see into dictonnary editor
// List of tables we want to see into dictionary editor
'tabname'=>array("table1", "table2", "table3"),
// Label of tables
'tablib'=>array("Table1", "Table2", "Table3"),

View File

@ -86,7 +86,7 @@ class modIncoterm extends DolibarrModules
}
$this->dictionaries = array(
'langs' => 'incoterm',
'tabname' => array("c_incoterms"), // List of tables we want to see into dictonnary editor
'tabname' => array("c_incoterms"), // List of tables we want to see into dictionary editor
'tablib' => array("Incoterms"), // Label of tables
'tabsql' => array('SELECT rowid, code, libelle, active FROM '.MAIN_DB_PREFIX.'c_incoterms'), // Request to select fields
'tabsqlsort' => array("rowid ASC"), // Sort order

View File

@ -214,7 +214,7 @@ class modPartnership extends DolibarrModules
// Dictionaries
$this->dictionaries = array(
'langs' => 'partnership',
// List of tables we want to see into dictonnary editor
// List of tables we want to see into dictionary editor
'tabname' => array("c_partnership_type"),
// Label of tables
'tablib' => array("PartnershipType"),

View File

@ -176,7 +176,7 @@ class modStockTransfer extends DolibarrModules
/* Example:
$this->dictionaries=array(
'langs'=>'stocktransfer@stocktransfer',
// List of tables we want to see into dictonnary editor
// List of tables we want to see into dictionary editor
'tabname'=>array(MAIN_DB_PREFIX."table1", MAIN_DB_PREFIX."table2", MAIN_DB_PREFIX."table3"),
// Label of tables
'tablib'=>array("Table1", "Table2", "Table3"),

View File

@ -205,7 +205,7 @@ class modWebPortal extends DolibarrModules
/* Example:
$this->dictionaries=array(
'langs'=>'website',
// List of tables we want to see into dictonnary editor
// List of tables we want to see into dictionary editor
'tabname'=>array("table1", "table2", "table3"),
// Label of tables
'tablib'=>array("Table1", "Table2", "Table3"),

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -199,7 +200,7 @@ class modWebhook extends DolibarrModules
/* Example:
$this->dictionaries=array(
'langs'=>'',
// List of tables we want to see into dictonnary editor
// List of tables we want to see into dictionary editor
'tabname'=>array(MAIN_DB_PREFIX."table1", MAIN_DB_PREFIX."table2", MAIN_DB_PREFIX."table3"),
// Label of tables
'tablib'=>array("Table1", "Table2", "Table3"),

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -23,7 +23,8 @@
* \brief File to manage captcha generation according to dolibarr native code
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/security/captcha/modules_captcha.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/security/captcha/modules_captcha.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/security/generate/modGeneratePassStandard.class.php';
/**
@ -74,7 +75,24 @@ class modCaptchaStandard extends ModeleCaptcha
*/
public function getExample()
{
return '';
global $db, $conf, $langs, $user;
$generator = new modGeneratePassStandard($db, $conf, $langs, $user);
$example = $generator->getExample();
$img = imagecreate(80, 32);
if (!$img) {
return "Problem with GD creation";
}
$background_color = imagecolorallocate($img, 250, 250, 250);
$ecriture_color = imagecolorallocate($img, 0, 0, 0);
imagestring($img, 4, 15, 8, $example, $ecriture_color);
ob_start();
imagepng($img);
$image_data = ob_get_contents();
ob_end_clean();
return '<img class="inline-block valignmiddle" src="data:image/png;base64,' . base64_encode($image_data) . '" border="0" width="80" height="32" />';
}

View File

@ -40,6 +40,27 @@ if ($size > 10000) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
'
@phan-var-force string $captcha_refresh
@phan-var-force int<0,1> $dol_hide_leftmenu
@phan-var-force int<0,1> $dol_hide_topmenu
@phan-var-force int<0,1> $dol_no_mouse_hover
@phan-var-force int<0,1> $dol_optimize_smallscreen
@phan-var-force int<0,1> $dol_use_jmobile
@phan-var-force string $focus_element
@phan-var-force string $helpcenterlink
@phan-var-force string $login
@phan-var-force string $main_authentication
@phan-var-force string $main_home
@phan-var-force string $password
@phan-var-force string $session_name
@phan-var-force string $titletruedolibarrversion
@phan-var-force string $urllogo
@phan-var-force int<0,1> $forgetpasslink
@phan-var-force int<0,1> $helpcenterlink
';
header('Cache-Control: Public, must-revalidate');

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -415,8 +415,11 @@ if ($massaction == 'preapproveleave') {
}
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
if (empty($toselect)) {
$toselect=[];
}
$parameters = array(
'toselect' => isset($toselect) ? $toselect : array(),
'toselect' => &$toselect,
'uploaddir' => isset($uploaddir) ? $uploaddir : null,
'massaction' => $massaction
);

View File

@ -41,6 +41,13 @@ if (empty($object) || !is_object($object)) {
exit(1);
}
'
@phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|FactureFournisseur|FactureFournisseur|SupplierProposal $object
@phan-var-force PropaleLigne|ContratLigne|CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|DeliveryLine|FactureFournisseurLigneRec|SupplierInvoiceLine|SupplierProposalLine $line
@phan-var-force ThirdParty $seller
@phan-var-force ThirdParty $buyer
@phan-var-force string $var
';
$usemargins = 0;
if (isModEnabled('margin') && !empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande'))) {
@ -208,6 +215,7 @@ $coldisplay++;
// VAT Rate
$coldisplay++;
$type_tva = null;
if ($object->element == 'propal' || $object->element == 'commande' || $object->element == 'facture' || $object->element == 'facturerec') {
$type_tva = 1;
} elseif ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier' || $object->element == 'invoice_supplier_rec') {
@ -369,6 +377,8 @@ $coldisplay++;
<td colspan="<?php echo $coldisplay - (!getDolGlobalString('MAIN_VIEW_LINE_NUMBER') ? 0 : 1) ?>"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
<?php
$prefillDates = false;
$date_start_prefill = 0;
$date_end_prefill = 0;
if (getDolGlobalString('MAIN_FILL_SERVICE_DATES_FROM_LAST_SERVICE_LINE') && !empty($object->lines) && $i > 0) {
for ($j = $i - 1; $j >= 0; $j--) {
$lastline = $object->lines[$j];

View File

@ -46,10 +46,15 @@ if (empty($object) || !is_object($object)) {
exit(1);
}
'@phan-var-force CommonObject $this
@phan-var-force CommonObject $object
@phan-var-force 0|1 $forceall
@phan-var-force int $num
'
@phan-var-force PropaleLigne|ContratLigne|CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|DeliveryLine|FactureFournisseurLigneRec|SupplierInvoiceLine|SupplierProposalLine $line
@phan-var-force CommonObject $this
@phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|FactureFournisseur|FactureFournisseur|SupplierProposal $object
@phan-var-force 0|1 $forceall
@phan-var-force int $num
@phan-var-force ?Product $product_static
@phan-var-force string $text
@phan-var-force string $description
';
global $mysoc;
@ -464,9 +469,14 @@ if ($this->status == 0 && $tmppermtoedit && $action != 'selectlines') {
if (isModEnabled('asset') && $object->element == 'invoice_supplier') {
print '<td class="linecolasset center">';
$coldisplay++;
if (!empty($product_static->accountancy_code_buy) ||
!empty($product_static->accountancy_code_buy_intra) ||
!empty($product_static->accountancy_code_buy_export)
if (
$product_static !== null
&&
(
!empty($product_static->accountancy_code_buy) ||
!empty($product_static->accountancy_code_buy_intra) ||
!empty($product_static->accountancy_code_buy_export)
)
) {
$accountancy_category_asset = getDolGlobalString('ASSET_ACCOUNTANCY_CATEGORY');
$filters = array();

View File

@ -1,15 +1,14 @@
<?php
/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2023-2024 William Mead <william.mead@manchenumerique.fr>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -105,6 +104,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Actions
if ($action == 'COMPANY_CREATE') {
'@phan-var-force Societe $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "companies"));
@ -122,6 +122,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
$object->socid = $object->id;
} elseif ($action == 'COMPANY_MODIFY') {
'@phan-var-force Societe $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "companies"));
@ -144,6 +145,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
$object->socid = $object->id;
} elseif ($action == 'COMPANY_SENTBYMAIL') {
'@phan-var-force Societe $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@ -158,6 +160,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'CONTACT_CREATE') {
'@phan-var-force Contact $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "companies"));
@ -175,6 +178,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array($object->id => $object->id);
// $object->socid = $object->socid;
} elseif ($action == 'CONTACT_MODIFY') {
'@phan-var-force Contrat $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "companies"));
@ -192,6 +196,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array($object->id => $object->id);
// $object->socid = $object->socid;
} elseif ($action == 'CONTRACT_VALIDATE') {
'@phan-var-force Contrat $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "contracts"));
@ -208,6 +213,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'CONTRACT_SENTBYMAIL') {
'@phan-var-force Contrat $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "contracts"));
@ -225,6 +231,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROPAL_VALIDATE') {
'@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -241,6 +248,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPAL_MODIFY') {
'@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -257,6 +265,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPAL_SENTBYMAIL') {
'@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -274,6 +283,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROPAL_CLOSE_SIGNED') {
'@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -290,6 +300,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPAL_CLASSIFY_BILLED') {
'@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -306,6 +317,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPAL_CLOSE_REFUSED') {
'@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -322,6 +334,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_VALIDATE') {
'@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "orders"));
@ -338,6 +351,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_CLOSE') {
'@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@ -354,6 +368,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_CLASSIFY_BILLED') {
'@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@ -370,6 +385,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_CANCEL') {
'@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@ -386,6 +402,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_SENTBYMAIL') {
'@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@ -403,6 +420,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'BILL_VALIDATE') {
'@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@ -419,6 +437,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_UNVALIDATE') {
'@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@ -435,6 +454,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_SENTBYMAIL') {
'@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@ -452,6 +472,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'BILL_PAYED') {
'@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@ -469,6 +490,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_CANCEL') {
'@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@ -485,6 +507,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'FICHINTER_CREATE') {
'@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@ -503,6 +526,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'FICHINTER_VALIDATE') {
'@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@ -521,6 +545,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'FICHINTER_MODIFY') {
'@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@ -539,6 +564,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'FICHINTER_SENTBYMAIL') {
'@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@ -556,6 +582,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'FICHINTER_CLASSIFY_BILLED') {
'@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@ -572,6 +599,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'FICHINTER_CLASSIFY_UNBILLED') {
'@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@ -588,6 +616,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'FICHINTER_CLOSE') {
'@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@ -606,6 +635,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'FICHINTER_DELETE') {
'@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@ -624,6 +654,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'SHIPPING_VALIDATE') {
'@phan-var-force Expedition $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "sendings"));
@ -641,6 +672,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'SHIPPING_SENTBYMAIL') {
'@phan-var-force Expedition $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "sendings"));
@ -658,6 +690,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'RECEPTION_VALIDATE') {
'@phan-var-force Reception $object';
$langs->load("agenda");
$langs->load("other");
$langs->load("receptions");
@ -676,6 +709,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'RECEPTION_SENTBYMAIL') {
'@phan-var-force Reception $object';
$langs->load("agenda");
$langs->load("other");
$langs->load("receptions");
@ -694,6 +728,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROPOSAL_SUPPLIER_VALIDATE') {
'@phan-var-force SupplierProposal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -710,6 +745,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPOSAL_SUPPLIER_SENTBYMAIL') {
'@phan-var-force SupplierProposal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -727,6 +763,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_SIGNED') {
'@phan-var-force SupplierProposal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -743,6 +780,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_REFUSED') {
'@phan-var-force SupplierProposal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@ -776,6 +814,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_SUPPLIER_VALIDATE') {
'@phan-var-force CommandeFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@ -853,6 +892,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_SUPPLIER_SUBMIT') {
'@phan-var-force CommandeFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@ -943,6 +983,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_SUPPLIER_VALIDATE') {
'@phan-var-force FactureFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@ -959,6 +1000,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_SUPPLIER_UNVALIDATE') {
'@phan-var-force FactureFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@ -975,6 +1017,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL') {
'@phan-var-force FactureFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills", "orders"));
@ -992,6 +1035,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'BILL_SUPPLIER_PAYED') {
'@phan-var-force FactureFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@ -1024,6 +1068,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_VALIDATE') {
'@phan-var-force Adherent $object';
// Members
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@ -1043,6 +1088,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_MODIFY') {
'@phan-var-force Adherent $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@ -1061,6 +1107,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_SUBSCRIPTION_CREATE') {
'@phan-var-force Subscription $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@ -1092,6 +1139,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->socid = $object->fk_soc;
}
} elseif ($action == 'MEMBER_SUBSCRIPTION_MODIFY') {
'@phan-var-force Subscription $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@ -1122,6 +1170,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->socid = $object->fk_soc;
}
} elseif ($action == 'MEMBER_SUBSCRIPTION_DELETE') {
'@phan-var-force Subscription $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@ -1153,6 +1202,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->socid = $object->fk_soc;
}
} elseif ($action == 'MEMBER_RESILIATE') {
'@phan-var-force Adherent $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@ -1171,6 +1221,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_DELETE') {
'@phan-var-force Adherent $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@ -1189,6 +1240,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_EXCLUDE') {
'@phan-var-force Adherent $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@ -1207,6 +1259,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROJECT_CREATE') {
'@phan-var-force Project $object';
// Projects
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@ -1225,6 +1278,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROJECT_VALIDATE') {
'@phan-var-force Project $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@ -1242,6 +1296,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROJECT_MODIFY') {
'@phan-var-force Project $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@ -1263,6 +1318,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROJECT_SENTBYMAIL') {
'@phan-var-force Project $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@ -1280,6 +1336,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROJECT_DELETE') {
'@phan-var-force Project $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@ -1306,6 +1363,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'TASK_CREATE') {
'@phan-var-force Task $object';
// Project tasks
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@ -1324,6 +1382,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'TASK_MODIFY') {
'@phan-var-force Task $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@ -1341,6 +1400,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'TASK_DELETE') {
'@phan-var-force Task $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@ -1358,6 +1418,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'TICKET_ASSIGNED') {
'@phan-var-force Ticket $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@ -1509,7 +1570,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$contactforactionid = reset($object->sendtoid);
}
} else {
if ($object->sendtoid > 0) {
if ($object->sendtoid > 0) { // @phan-suppress-current-line PhanTypeComparisonFromArray
$contactforactionid = $object->sendtoid;
}
}
@ -1524,6 +1585,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$projectid = isset($object->fk_project) ? $object->fk_project : 0;
if ($object->element == 'project') {
'@phan-var-force Project $object';
$projectid = $object->id;
}
@ -1531,6 +1593,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$elementtype = $object->element;
$elementmodule = (empty($object->module) ? '' : $object->module);
if ($object->element == 'subscription') {
'@phan-var-force Subscription $object';
$elementid = $object->fk_adherent;
$elementtype = 'member';
}
@ -1552,8 +1615,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->contact_id = $contactforactionid; // deprecated, now managed by setting $actioncomm->socpeopleassigned later
$actioncomm->authorid = $user->id; // User saving action
$actioncomm->userownerid = $user->id; // Owner of action
// Fields defined when action is an email (content should be into object->actionmsg to be added into event note, subject should be into object->actionms2 to be added into event label)
// Fields defined when action is an email (content should be into object->actionmsg to be added into event note, subject should be into object->actionmsg2 to be added into event label)
if (!property_exists($object, 'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) {
'@phan-var-force ActionComm $object'; // TODO: Non of the dolibarr classes has all the fields, check class type or properties (email_date)
$actioncomm->datep = empty($object->email_date) ? $now : $object->email_date;
$actioncomm->datef = empty($object->email_date) ? $now : $object->email_date;
$actioncomm->email_msgid = empty($object->email_msgid) ? null : $object->email_msgid;
@ -1573,13 +1637,19 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->elementtype = $elementtype.($elementmodule ? '@'.$elementmodule : '');
}
// @phan-suppress-next-line PhanUndeclaredProperty
if (property_exists($object, 'attachedfiles') && is_array($object->attachedfiles) && count($object->attachedfiles) > 0) {
// @phan-suppress-next-line PhanUndeclaredProperty
$actioncomm->attachedfiles = $object->attachedfiles;
}
// @phan-suppress-next-line PhanUndeclaredProperty
if (property_exists($object, 'sendtouserid') && is_array($object->sendtouserid) && count($object->sendtouserid) > 0) {
// @phan-suppress-next-line PhanUndeclaredProperty
$actioncomm->userassigned = $object->sendtouserid;
}
// @phan-suppress-next-line PhanUndeclaredProperty
if (property_exists($object, 'sendtoid') && is_array($object->sendtoid) && count($object->sendtoid) > 0) {
// @phan-suppress-next-line PhanUndeclaredProperty
foreach ($object->sendtoid as $val) {
$actioncomm->socpeopleassigned[$val] = $val;
}
@ -1588,13 +1658,17 @@ class InterfaceActionsAuto extends DolibarrTriggers
$ret = $actioncomm->create($user); // User creating action
if ($ret > 0 && getDolGlobalString('MAIN_COPY_FILE_IN_EVENT_AUTO')) {
// @phan-suppress-next-line PhanUndeclaredProperty
if (property_exists($object, 'attachedfiles') && is_array($object->attachedfiles) && array_key_exists('paths', $object->attachedfiles) && count($object->attachedfiles['paths']) > 0) {
// Note: None of the dolibarr classes seem to have an attachedfiles property
// Get directory of object
$tmpelems = getElementProperties($object->element.($object->module ? '@'.$object->module : ''));
$destdir = $tmpelems['dir_output'].'/'.$ret;
// @phan-suppress-next-line PhanUndeclaredProperty
foreach ($object->attachedfiles['paths'] as $key => $filespath) {
$srcfile = $filespath;
// @phan-suppress-next-line PhanUndeclaredProperty
$destfile = $destdir.'/'.$object->attachedfiles['names'][$key];
if (dol_mkdir($destdir) >= 0) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

View File

@ -273,7 +273,7 @@ class Delivery extends CommonObject
* Create a line
*
* @param int $origin_id Id of order
* @param string $qty Quantity
* @param float $qty Quantity
* @param int $fk_product Id of predefined product
* @param string $description Description
* @param array<string,?mixed> $array_options Array options
@ -637,8 +637,6 @@ class Delivery extends CommonObject
*/
public function addline($origin_id, $qty, $array_options = [])
{
global $conf;
$num = count($this->lines);
$line = new DeliveryLine($this->db);
@ -763,8 +761,8 @@ class Delivery extends CommonObject
$datas = [];
$datas['picto'] = img_picto('', $this->picto).' <u>'.$langs->trans("ShowReceiving").'</u>:<br>';
$datas['picto'] .= '<b>'.$langs->trans("Status").'</b>: '.$this->ref;
$datas['picto'] = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly').' <u>'.$langs->trans("ShowReceiving").'</u>:<br>';
$datas['ref'] = '<b>'.$langs->trans("Ref").'</b>: '.$this->ref;
return $datas;
}

View File

@ -9,6 +9,7 @@
* Copyright (C) 2017-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2020 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -675,7 +676,7 @@ if ($object->id > 0 || !empty($object->ref)) {
print "</tr>\n";
}
$nbfreeproduct = 0; // Nb of lins of free products/services
$nbfreeproduct = 0; // Nb of lines of free products/services
$nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default)
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.

View File

@ -61,7 +61,7 @@ class Fichinter extends CommonObject
'dateo' => array('type' => 'date', 'label' => 'Dateo', 'enabled' => 1, 'visible' => -1, 'position' => 85),
'datee' => array('type' => 'date', 'label' => 'Datee', 'enabled' => 1, 'visible' => -1, 'position' => 90),
'datet' => array('type' => 'date', 'label' => 'Datet', 'enabled' => 1, 'visible' => -1, 'position' => 95),
'duree' => array('type' => 'double', 'label' => 'Duree', 'enabled' => 1, 'visible' => -1, 'position' => 100),
'duree' => array('type' => 'integer', 'label' => 'Duree', 'enabled' => 1, 'visible' => -1, 'position' => 100),
'signed_status' => array('type' => 'smallint(6)', 'label' => 'SignedStatus', 'enabled' => 1, 'visible' => -1, 'position' => 101, 'arrayofkeyval' => array(0 => 'NoSignature', 1 => 'SignedSender', 2 => 'SignedReceiver', 3 => 'SignedReceiverOnline', 9 => 'SignedAll')),
'description' => array('type' => 'html', 'label' => 'Description', 'enabled' => 1, 'visible' => -1, 'position' => 105, 'showoncombobox' => 2),
'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110),
@ -83,11 +83,6 @@ class Fichinter extends CommonObject
*/
public $table_element = 'fichinter';
/**
* @var string Field with ID of parent key if this field has a parent
*/
public $fk_element = 'fk_fichinter';
/**
* @var string Name of subtable line
*/
@ -139,7 +134,7 @@ class Fichinter extends CommonObject
/**
* Date modification record (tms)
*
* @var integer
* @var int
*/
public $datem;
@ -1122,7 +1117,7 @@ class Fichinter extends CommonObject
if (!$error) {
$main = MAIN_DB_PREFIX.'fichinterdet';
$ef = $main."_extrafields";
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_fichinter = ".((int) $this->id).")";
$sql = "DELETE FROM ".$this->db->sanitize($ef)." WHERE fk_object IN (SELECT rowid FROM ".$this->db->sanitize($main)." WHERE fk_fichinter = ".((int) $this->id).")";
$resql = $this->db->query($sql);
if (!$resql) {

View File

@ -47,8 +47,7 @@ class FichinterLigne extends CommonObjectLine
public $error = '';
/**
* From llx_fichinterdet
* @var int ID
* @var int ID of intervention (field from llx_fichinterdet)
*/
public $fk_fichinter;

View File

@ -45,11 +45,6 @@ class FichinterRec extends Fichinter
public $table_element = 'fichinter_rec';
public $table_element_line = 'fichinterdet_rec';
/**
* @var string Fieldname with ID of parent key if this field has a parent
*/
public $fk_element = 'fk_fichinter';
/**
* {@inheritdoc}
*/

View File

@ -294,7 +294,7 @@ class Skill extends CommonObject
if (!$error) {
$this->db->commit();
setEventMessage($langs->trans('SkillCreated', $i));
setEventMessage($langs->trans('SkillCreated', $i - 1));
return 1;
} else {
$this->db->rollback();

View File

@ -706,7 +706,7 @@ while ($i < $imaxinloop) {
} elseif ($key == 'rowid') {
print $object->showOutputField($val, $key, $object->id, '');
} elseif ($key == 'label') {
print $object->getNomUrl(1);
print $object->showOutputField($val, $key, $object->label, '');
} else {
print $object->showOutputField($val, $key, $object->$key, '');
}

View File

@ -128,13 +128,34 @@ if (empty($reshook)) {
$triggermodname = 'HRM_SKILL_MODIFY'; // Name of trigger action code to execute when we modify record
// action update on Skilldet must be done before real update action in core/actions_addupdatedelete.inc.php
$skilldetArray = GETPOST("descriptionline", "array:alphanohtml");
if (!$error) {
if (is_array($skilldetArray) && count($skilldetArray) > 0) {
if ($action == 'update' && $permissiontoadd) {
foreach ($skilldetArray as $key => $SkValueToUpdate) {
$skilldetObj = new Skilldet($object->db);
$res = $skilldetObj->fetch($key);
if ($res > 0) {
$skilldetObj->description = $SkValueToUpdate;
$resupd = $skilldetObj->update($user);
if ($resupd <= 0) {
setEventMessage($langs->trans('errorUpdateSkilldet'), 'errors');
$error++;
}
}
}
}
}
}
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
$noback = 1;
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
if (in_array($action, array("confirm_delete", "update"))) {
$noback = 0;
}
// action update on Skilldet
$skilldetArray = GETPOST("descriptionline", "array:alphanohtml");
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
if (!$error) {
if (is_array($skilldetArray) && count($skilldetArray) > 0) {
@ -153,19 +174,8 @@ if (empty($reshook)) {
}
$index++;
}
}
if ($action == 'update' && $permissiontoadd) {
foreach ($skilldetArray as $key => $SkValueToUpdate) {
$skilldetObj = new Skilldet($object->db);
$res = $skilldetObj->fetch($key);
if ($res > 0) {
$skilldetObj->description = $SkValueToUpdate;
$resupd = $skilldetObj->update($user);
if ($resupd <= 0) {
setEventMessage($langs->trans('errorUpdateSkilldet'), 'errors');
}
}
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
exit;
}
}
}

View File

@ -444,7 +444,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($objecttype != 'user' && $permissiontoadd) {
print '<td class="linecoledit"></td>';
print '<td class="linecoldelete">';
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $skillElement->fk_object . '&amp;objecttype=' . $objecttype . '&amp;action=ask_deleteskill&amp;lineid=' . $skillElement->rowid . '">';
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $skillElement->fk_object . '&amp;objecttype=' . $objecttype . '&amp;action=ask_deleteskill&amp;lineid=' . $skillElement->rowid . '&amp;token='.newToken().'">';
print img_delete();
print '</a>';
}

View File

@ -113,7 +113,7 @@ TicketsLimitViewAssignedOnlyHelp=Only tickets assigned to the current user will
TicketsActivatePublicInterface=Activate public interface
TicketsActivatePublicInterfaceHelp=Public interface allow any visitors to create tickets.
TicketsAutoAssignTicket=Automatically assign the user who created the ticket
TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket.
TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket(Examples: 0=Never automatically assigned to the ticket, 1=Automatically assigned to the ticket if no one is assigned, 2=Automatically assigned to the ticket even if someone was defined).
TicketAutoChangeStatusOnAnswer=Automatically assign a status when answering a ticket
TicketAutoChangeStatusOnAnswerHelp=When a user answers to a ticket, the status will automatically be applied to the ticket
TicketNumberingModules=Tickets numbering module

View File

@ -221,7 +221,7 @@ class modMyModule extends DolibarrModules
/* Example:
$this->dictionaries=array(
'langs' => 'mymodule@mymodule',
// List of tables we want to see into dictonnary editor
// List of tables we want to see into dictionary editor
'tabname' => array("table1", "table2", "table3"),
// Label of tables
'tablib' => array("Table1", "Table2", "Table3"),

View File

@ -298,7 +298,7 @@ class FormProduct
dol_syslog(get_class($this)."::selectWarehouses " . (is_array($selected) ? 'selected is array' : $selected) . ", $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG);
$out = '';
if (!getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
if ((!getDolGlobalString('ENTREPOT_EXTRA_STATUS')) && ($filterstatus==="warehouseinternal")) {
$filterstatus = '';
}
if (!empty($fk_product) && $fk_product > 0) {

View File

@ -68,8 +68,8 @@ $resultboxes = FormOther::getBoxesArea($user, "4");
if (GETPOST('addbox')) {
// Add box (when submit is done from a form when ajax disabled)
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
$zone = GETPOST('areacode', 'int');
$userid = GETPOST('userid', 'int');
$zone = GETPOSTINT('areacode');
$userid = GETPOSTINT('userid');
$boxorder = GETPOST('boxorder', 'aZ09');
$boxorder .= GETPOST('boxcombo', 'aZ09');
$result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid);

View File

@ -632,7 +632,7 @@ if (!empty($arrayfields['timeconsumed']['checked'])) {
print '<td class="right maxwidth75">'.$langs->trans("TimeSpentSmall").($usertoprocess->firstname ? '<br><span class="nowraponall">'.$usertoprocess->getNomUrl(-2).'<span class="opacitymedium paddingleft">'.dol_trunc($usertoprocess->firstname, 10).'</span></span>' : '').'</td>';
}
foreach ($TWeek as $week_number) {
print '<td width="6%" class="center bold hide">'.$langs->trans("WeekShort").' '.$week_number.'<br>('.$TFirstDays[$week_number].'...'.$TLastDays[$week_number].')</td>';
print '<td width="6%" class="center bold hide"><a href="'.DOL_URL_ROOT.'/projet/activity/perweek.php?year='.$year.'&month='.$month.'&day='.$TFirstDays[$week_number].'">'.$langs->trans("WeekShort").' '.$week_number.'<br>('.$TFirstDays[$week_number].'...'.$TLastDays[$week_number].')</a></td>';
}
//print '<td></td>';

View File

@ -694,9 +694,14 @@ for ($idw = 0; $idw < 7; $idw++) {
$cssonholiday .= 'onholidayafternoon ';
}
$year = (int) dol_print_date($dayinloopfromfirstdaytoshow, '%Y');
$month = (int) dol_print_date($dayinloopfromfirstdaytoshow, '%m');
$day = (int) dol_print_date($dayinloopfromfirstdaytoshow, '%d');
print '<th width="6%" class="center bold hide'.$idw.($cssonholiday ? ' '.$cssonholiday : '').($cssweekend ? ' '.$cssweekend : '').'">';
print '<a href="'.DOL_URL_ROOT.'/projet/activity/perday.php?year='.$year.'&month='.$month.'&day='.$day.'">';
print dol_print_date($dayinloopfromfirstdaytoshow, '%a');
print '<br>'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').'</th>';
print '<br>'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').'</a></th>';
}
//print '<td></td>';

View File

@ -715,10 +715,12 @@ if ($event->type == 'payout.created') {
$companypaymentmode->number = $event->data->object->id;
$companypaymentmode->last_four = $event->data->object->card->last4;
$companypaymentmode->card_type = $event->data->object->card->branding;
$companypaymentmode->owner_name = $event->data->object->billing_details->name;
$companypaymentmode->proprio = $companypaymentmode->owner_name; // We still need this formodulebuilder because name of field is "proprio"
$companypaymentmode->exp_date_month = $event->data->object->card->exp_month;
$companypaymentmode->exp_date_year = $event->data->object->card->exp_year;
$companypaymentmode->proprio = $companypaymentmode->owner_name; // We may still need this formodulebuilder because name of field is "proprio"
$companypaymentmode->exp_date_month = (int) $event->data->object->card->exp_month;
$companypaymentmode->exp_date_year = (int) $event->data->object->card->exp_year;
$companypaymentmode->cvn = null;
$companypaymentmode->datec = $event->data->object->created;
$companypaymentmode->default_rib = 0;
@ -755,8 +757,8 @@ if ($event->type == 'payout.created') {
$companypaymentmode->number = $db->escape($event->data->object->id);
$companypaymentmode->last_four = $db->escape($event->data->object->card->last4);
$companypaymentmode->proprio = $db->escape($event->data->object->billing_details->name);
$companypaymentmode->exp_date_month = $db->escape($event->data->object->card->exp_month);
$companypaymentmode->exp_date_year = $db->escape($event->data->object->card->exp_year);
$companypaymentmode->exp_date_month = (int) $event->data->object->card->exp_month;
$companypaymentmode->exp_date_year = (int) $event->data->object->card->exp_year;
$companypaymentmode->cvn = null;
$companypaymentmode->datec = $db->escape($event->data->object->created);
$companypaymentmode->default_rib = 0;

View File

@ -586,7 +586,7 @@ if ($id > 0 || !empty($ref)) {
print "</tr>\n";
}
$nbfreeproduct = 0; // Nb of lins of free products/services
$nbfreeproduct = 0; // Nb of lines of free products/services
$nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default)
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.

View File

@ -1,12 +1,12 @@
<?php
/* Copyright (C) 2011-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2014-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 Maxime Nicolas <maxime@oarces.com>
* Copyright (C) 2023 Benjamin GREMBI <benjamin@oarces.com>
/* Copyright (C) 2011-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2014-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 Maxime Nicolas <maxime@oarces.com>
* Copyright (C) 2023 Benjamin GREMBI <benjamin@oarces.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -1115,28 +1115,30 @@ if ($id > 0) {
}
// Reopen
if ($object->paye && $permissiontoadd) {
if ($object->status == $object::STATUS_PAID && $permissiontoadd) {
print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
}
// Edit
if ($object->paye == 0 && $permissiontoadd) {
if ($object->status == $object::STATUS_UNPAID && $permissiontoadd) {
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, '');
}
// Emit payment
if ($object->paye == 0 && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) {
if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) {
print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='. $object->id, '');
}
// Classify 'paid'
// If payment complete $resteapayer <= 0 on a positive salary, or if amount is negative, we allow to classify as paid.
if ($object->paye == 0 && (($resteapayer <= 0 && $object->amount > 0) || ($object->amount <= 0)) && $permissiontoadd) {
if ($object->status == $object::STATUS_UNPAID && (($resteapayer <= 0 && $object->amount > 0) || ($object->amount <= 0)) && $permissiontoadd) {
print dolGetButtonAction('', $langs->trans('ClassifyPaid'), 'default', $_SERVER["PHP_SELF"].'?action=paid&token='.newToken().'&id='.$object->id, '');
}
// Transfer request
print dolGetButtonAction('', $langs->trans('MakeTransferRequest'), 'default', DOL_URL_ROOT.'/salaries/virement_request.php?id='.$object->id, '');
if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) {
print dolGetButtonAction('', $langs->trans('MakeTransferRequest'), 'default', DOL_URL_ROOT . '/salaries/virement_request.php?id=' . $object->id, '');
}
// Clone
if ($permissiontoadd) {
@ -1196,7 +1198,7 @@ if ($id > 0) {
print '</div></div>';
}
//Select mail models is same action as presend
// Select mail models is same action as presend
if (GETPOST('modelselected')) {
$action = 'presend';
}

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2011-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -366,6 +366,7 @@ class PaymentSalary extends CommonObject
$this->datec = $this->db->jdate($obj->datec);
$this->tms = $this->db->jdate($obj->tms);
$this->datepaye = $this->db->jdate($obj->datep);
$this->datep = $this->db->jdate($obj->datep);
$this->amount = $obj->amount;
$this->fk_typepayment = $obj->fk_typepayment;
$this->num_paiement = $obj->num_payment;

View File

@ -1,12 +1,12 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre SPANGARO <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre SPANGARO <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -166,13 +166,34 @@ class CompanyBankAccount extends Account
* @var string label
*/
public $label;
/**
* @var string
*/
public $code_banque;
/**
* @var string
*/
public $code_guichet;
/**
* @var string
*/
public $number;
/**
* @var string
*/
public $cle_rib;
/**
* @var string
*/
public $bic;
/**
* @var string
*/
public $iban_prefix;
/**
* @var string
*/
public $bank;
/**
@ -185,6 +206,9 @@ class CompanyBankAccount extends Account
*/
public $fk_country;
/**
* @var string
*/
public $country_code;
/**
@ -213,22 +237,58 @@ class CompanyBankAccount extends Account
* @var string
*/
public $frstrecur;
/**
* @var string
*/
public $import_key;
/**
* @var string
*/
public $last_four;
/**
* @var string
*/
public $card_type;
/**
* @var string
*/
public $cvn;
/**
* @var int
*/
public $exp_date_month;
/**
* @var int
*/
public $exp_date_year;
/**
* @var int
*/
public $approved;
/**
* @var string email
*/
public $email;
/**
* @var int|string
*/
public $ending_date;
/**
* @var float
*/
public $max_total_amount_of_all_payments;
/**
* @var string
*/
public $preapproval_key;
/**
* @var int|string
*/
public $starting_date;
/**
* @var float
*/
public $total_amount_of_all_payments;

View File

@ -131,53 +131,145 @@ class CompanyPaymentMode extends CommonObject
*/
public $label;
/**
* @var ?string
*/
public $bank;
/**
* @var string
*/
public $code_banque;
/**
* @var string
*/
public $code_guichet;
/**
* @var string
*/
public $number;
/**
* @var string
*/
public $cle_rib;
/**
* @var string
*/
public $bic;
/**
* @var string iban
* @deprecated
* @deprecated Use $iban_prefix, or wait the field in database is renamed into iban.
* @see $iban_prefix
*/
public $iban;
/**
* iban_prefix
* @var string
* @var string IBAN prefix
*/
public $iban_prefix;
/** @deprecated Use address */
/**
* @var string
* @deprecated Use address
*/
public $domiciliation;
/**
* @var string
*/
public $address;
/** @deprecated Use owner_name*/
/**
* @var string
* @deprecated Use owner_name
*/
public $proprio;
/**
* @var string
*/
public $owner_name;
/**
* @var string
*/
public $owner_address;
/**
* @var int
*/
public $default_rib;
/**
* @var string
*/
public $rum;
/**
* @var int
*/
public $date_rum;
/**
* @var string
*/
public $frstrecur;
/**
* @var string
*/
public $type;
/**
* @var string
*/
public $last_four;
/**
* @var string
*/
public $card_type;
/**
* @var ?string
*/
public $cvn;
/**
* @var int
*/
public $exp_date_month;
/**
* @var int
*/
public $exp_date_year;
/**
* @var string
*/
public $country_code;
/**
* @var int
*/
public $approved;
/**
* @var string
*/
public $email;
/**
* @var float
*/
public $max_total_amount_of_all_payments;
/**
* @var string
*/
public $preapproval_key;
/**
* @var float
*/
public $total_amount_of_all_payments;
/**
* @var string
*/
public $stripe_card_ref; // External system payment mode ID
/**
* @var string
*/
public $stripe_account; // External system customer ID
/**
* @var string
*/
public $ext_payment_site; // External system 'StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ...
/**
@ -185,16 +277,25 @@ class CompanyPaymentMode extends CommonObject
*/
public $status;
/**
* @var int
*/
public $starting_date;
/**
* @var int
*/
public $ending_date;
/**
* Date creation record (datec)
*
* @var integer
* @var int
*/
public $datec;
/**
* @var string
*/
public $import_key;
// END MODULEBUILDER PROPERTIES
@ -355,11 +456,11 @@ class CompanyPaymentMode extends CommonObject
/**
* Return a link to the object card (with optionally the picto)
*
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to ('nolink', ...)
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int<0,2> $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to ('nolink', ...)
* @param int<0,1> $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int<-1,1> $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
@ -424,9 +525,9 @@ class CompanyPaymentMode extends CommonObject
/**
* Set a Payment mode as Default
*
* @param int $id Payment mode ID
* @param int $alltypes 1=The default is for all payment types instead of per type
* @return int 0 if KO, 1 if OK
* @param int $id Payment mode ID
* @param int<0,1> $alltypes 1=The default is for all payment types instead of per type
* @return int 0 if KO, 1 if OK
*/
public function setAsDefault($id = 0, $alltypes = 0)
{
@ -482,8 +583,8 @@ class CompanyPaymentMode extends CommonObject
/**
* Return label of the status
*
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label of status
* @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label of status
*/
public function getLibStatut($mode = 0)
{
@ -494,8 +595,8 @@ class CompanyPaymentMode extends CommonObject
/**
* Return the status
*
* @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @param int $status Id status
* @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label of status
*/
public function LibStatut($status, $mode = 0)

View File

@ -94,10 +94,12 @@ $stripe = null; // Stripe object
$stripeacc = null; // Stripe Account
$stripecu = null; // Remote stripe customer
$servicestatus = 0;
$site_account = 'UnknownSiteAccount';
// Init Stripe objects
if (isModEnabled('stripe')) {
$service = 'StripeTest';
$servicestatus = 0;
if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeLive';
$servicestatus = 1;
@ -168,7 +170,8 @@ if (empty($reshook)) {
}
if (!$error) {
$companybankaccount->oldcopy = dol_clone($companybankaccount, 2);
$cbClassName = get_class($companybankaccount);
$cbClassName::$oldcopy = dol_clone($companybankaccount, 2);
$companybankaccount->socid = $object->id;
@ -245,7 +248,8 @@ if (empty($reshook)) {
$companypaymentmode->fetch($id);
if (!$error) {
$companybankaccount->oldcopy = dol_clone($companybankaccount, 2);
$cbClassName = get_class($companybankaccount);
$cbClassName::$oldcopy = dol_clone($companybankaccount, 2);
$companypaymentmode->fk_soc = $object->id;
@ -906,7 +910,7 @@ if (!$id) {
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$companybankaccount->fetch(0, '', $object->id);
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$companypaymentmode->fetch(0, null, $object->id, 'card');
$companypaymentmode->fetch(0, '', $object->id, 'card');
} else {
$companybankaccount->fetch($id);
$companypaymentmode->fetch($id);
@ -1143,6 +1147,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
// Get list of remote payment modes
$listofsources = array();
$customerstripe = null;
if (isset($stripe) && is_object($stripe)) {
try {
$customerstripe = $stripe->customerStripe($object, $stripeacc, $servicestatus);
@ -1632,14 +1637,14 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
// } elseif ($val == 'IBAN') {
// $string .= $rib->iban.' ';*/
//}
}
if (!empty($rib->label) && $rib->number) {
if (!checkBanForAccount($rib)) {
$string .= ' '.img_picto($langs->trans("ValueIsNotValid"), 'warning');
} else {
$string .= ' '.img_picto($langs->trans("ValueIsValid"), 'info');
if (!empty($rib->label) && $rib->number) {
if (!checkBanForAccount($rib)) {
$string .= ' '.img_picto($langs->trans("ValueIsNotValid"), 'warning');
} else {
$string .= ' '.img_picto($langs->trans("ValueIsValid"), 'info');
}
}
}
} // EndFor $rib_list as $rib
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($string).'">';
print $string;
print '</td>';
@ -1722,7 +1727,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if ($conf->browser->layout == 'phone') {
$morecss = 'maxwidth100';
}
$out .= $formadmin->select_language($defaultlang, 'lang_idrib'.$rib->id, 0, 0, 0, 0, 0, $morecss);
$out .= $formadmin->select_language($defaultlang, 'lang_idrib'.$rib->id, 0, array(), 0, 0, 0, $morecss);
}
// Button
$out .= '<input class="button buttongen reposition nomargintop nomarginbottom" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"';
@ -1926,7 +1931,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$companybankaccounttemp = new CompanyBankAccount($db);
$companypaymentmodetemp = new CompanyPaymentMode($db);
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$result = $companypaymentmodetemp->fetch(0, null, $object->id, 'ban');
$result = $companypaymentmodetemp->fetch(0, '', $object->id, 'ban');
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile = new EcmFiles($db);
@ -1995,6 +2000,9 @@ if ($socid && $action == 'edit' && $permissiontoaddupdatepaymentinformation) {
foreach ($bankaccount->getFieldsToShow(1) as $val) {
$require = false;
$tooltip = '';
$name = 'Unset';
$size = 8;
$content = 'NoContent';
if ($val == 'BankCode') {
$name = 'code_banque';
$size = 8;
@ -2032,6 +2040,7 @@ if ($socid && $action == 'edit' && $permissiontoaddupdatepaymentinformation) {
print '<tr>';
print '<td'.($require ? ' class="fieldrequired" ' : '').'>';
if ($tooltip) {
// $tooltip looks like $tooltiptrigger so: @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print $form->textwithpicto($langs->trans($val), $tooltip, 4, 'help', '', 0, 3, $name);
} else {
print $langs->trans($val);
@ -2167,6 +2176,9 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) {
foreach ($companybankaccount->getFieldsToShow(1) as $val) {
$require = false;
$tooltip = '';
$size = 8;
$name = 'Unknown';
$content = 'NoContent';
if ($val == 'BankCode') {
$name = 'code_banque';
$size = 8;
@ -2203,6 +2215,7 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) {
print '<tr><td'.($require ? ' class="fieldrequired" ' : '').'>';
if ($tooltip) {
// tooltip lookslike tooltip trigger so @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print $form->textwithpicto($langs->trans($val), $tooltip, 4, 'help', '', 0, 3, $name);
} else {
print $langs->trans($val);

View File

@ -110,7 +110,7 @@ if ($action == 'getConnexionToken') {
$stripe = new Stripe($db);
$customer = $stripe->customerStripe($object->thirdparty, $stripeacc, $servicestatus, 1);
$intent = $stripe->getPaymentIntent($json_obj->amount, $object->multicurrency_code, null, 'Stripe payment: '.$fulltag.(is_object($object) ? ' ref='.$object->ref : ''), $object, $customer, $stripeacc, $servicestatus, 1, 'terminal', false, null, 0, 1);
$intent = $stripe->getPaymentIntent($json_obj->amount, $object->multicurrency_code, '', 'Stripe payment: '.$fulltag.(is_object($object) ? ' ref='.$object->ref : ''), $object, $customer, $stripeacc, $servicestatus, 1, 'terminal', false, null, 0, 1);
echo json_encode(array('client_secret' => $intent->client_secret));
} catch (Error $e) {

View File

@ -59,10 +59,10 @@ class ActionsStripeconnect extends CommonHookActions
/**
* formObjectOptions
*
* @param array $parameters Parameters
* @param CommonObject $object Object
* @param string $action Action
* @return int
* @param array<string,mixed> $parameters Parameters
* @param CommonObject $object Object
* @param string $action Action
* @return int
*/
public function formObjectOptions($parameters, &$object, &$action)
{
@ -82,6 +82,7 @@ class ActionsStripeconnect extends CommonHookActions
}
if (is_object($object) && $object->element == 'societe') {
'@phan-var-force Societe $object';
$this->resprints .= '<tr><td>';
$this->resprints .= '<table width="100%" class="nobordernopadding"><tr><td>';
$this->resprints .= $langs->trans('StripeCustomer');
@ -99,6 +100,7 @@ class ActionsStripeconnect extends CommonHookActions
}
$this->resprints .= '</td></tr>';
} elseif ($object instanceof CommonObject && $object->element == 'member') {
'@phan-var-force Adherent $object';
$this->resprints .= '<tr><td>';
$this->resprints .= '<table width="100%" class="nobordernopadding"><tr><td>';
$this->resprints .= $langs->trans('StripeCustomer');
@ -133,6 +135,7 @@ class ActionsStripeconnect extends CommonHookActions
}
$this->resprints .= '</td></tr>';
} elseif ($object instanceof CommonObject && $object->element == 'adherent_type') {
'@phan-var-force Adherent $object';
$this->resprints .= '<tr><td>';
$this->resprints .= '<table width="100%" class="nobordernopadding"><tr><td>';
$this->resprints .= $langs->trans('PlanStripe');
@ -157,9 +160,9 @@ class ActionsStripeconnect extends CommonHookActions
/**
* addMoreActionsButtons
*
* @param array $parameters Parameters
* @param Object $object Object
* @param string $action action
* @param array<string,mixed> $parameters Parameters
* @param Object $object Object
* @param string $action action
* @return int 0
*/
public function addMoreActionsButtons($parameters, &$object, &$action)

View File

@ -170,13 +170,13 @@ class Stripe extends CommonObject
* Get the Stripe customer of a thirdparty (with option to create it in Stripe if not linked yet).
* Search on site_account = 0 or = $stripearrayofkeysbyenv[$status]['publishable_key']
*
* @param CommonObject $object Object thirdparty to check, or create on stripe (create on stripe also update the stripe_account table for current entity). Used for AdherentType and Societe.
* @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect
* @param int $status Status (0=test, 1=live)
* @param int $createifnotlinkedtostripe 1=Create the stripe customer and the link if the thirdparty is not yet linked to a stripe customer
* @param Societe|Adherent $object Object thirdparty to check, or create on stripe (create on stripe also update the stripe_account table for current entity). Used for AdherentType and Societe.
* @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect
* @param int<0,1> $status Status (0=test, 1=live)
* @param int<0,1> $createifnotlinkedtostripe 1=Create the stripe customer and the link if the thirdparty is not yet linked to a stripe customer
* @return \Stripe\Customer|null Stripe Customer or null if not found
*/
public function customerStripe(CommonObject $object, $key = '', $status = 0, $createifnotlinkedtostripe = 0)
public function customerStripe($object, $key = '', $status = 0, $createifnotlinkedtostripe = 0)
{
global $conf, $user;
@ -1362,7 +1362,7 @@ class Stripe extends CommonObject
$charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$description", "stripe_account" => "$account"));
}
}
'@phan-var-force stdclass|\Stripe\Charge $charge';
'@phan-var-force stdClass|\Stripe\Charge $charge';
if (isset($charge->id)) {
}
@ -1377,7 +1377,7 @@ class Stripe extends CommonObject
} elseif ($charge->source->type == 'three_d_secure') {
$stripe = new Stripe($this->db);
$src = \Stripe\Source::retrieve("".$charge->source->three_d_secure->card, array(
"stripe_account" => $stripe->getStripeAccount($service)
"stripe_account" => $stripe->getStripeAccount($service)
));
$return->message = $src->card->brand." ....".$src->card->last4;
} else {

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016 Jean-François Ferry <hello@librethic.io>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2016 Jean-François Ferry <hello@librethic.io>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -35,12 +36,15 @@ class TicketStats extends Stats
*/
public $table_element;
/**
* @var int thirdparty ID
*/
public $socid;
public $userid;
public $from;
public $field;
public $where;
/**
* @var int User ID
*/
public $userid;
/**
* Constructor
@ -106,7 +110,7 @@ class TicketStats extends Stats
$sql .= $this->db->order('dm', 'DESC');
$res = $this->_getNbByMonth($year, $sql, $format);
//var_dump($res);print '<br>';
return $res;
}
@ -127,7 +131,7 @@ class TicketStats extends Stats
$sql .= $this->db->order('dm', 'DESC');
$res = $this->_getAmountByMonth($year, $sql, $format);
//var_dump($res);print '<br>';
return $res;
}

View File

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -186,8 +186,18 @@ if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
$title = getDolGlobalString('MAIN_APPLICATION_TITLE');
}
// Select templates
if (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten.tpl.php")) {
// Select templates dir
$template_dir = '';
if (!empty($conf->modules_parts['tpl'])) { // Using this feature slow down application
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl/'));
foreach ($dirtpls as $reldir) {
$tmp = dol_buildpath($reldir.'passwordforgotten.tpl.php');
if (file_exists($tmp)) {
$template_dir = preg_replace('/passwordforgotten\.tpl\.php$/', '', $tmp);
break;
}
}
} elseif (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten.tpl.php")) {
$template_dir = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/";
} else {
$template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";

View File

@ -113,6 +113,9 @@ class WebPortalInvoice extends Facture
);
//public $rowid;
//public $ref;
/**
* @var int date invoice
*/
public $datef;
//public $date_lim_reglement;
//public $total_ht;

View File

@ -142,6 +142,9 @@ class WebPortalMember extends Adherent
'status' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => 5, 'notnull' => 1, 'position' => 500, 'arrayofkeyval' => self::ARRAY_STATUS_LABEL, 'showonheader' => 1,),
);
/**
* @var int
*/
public $rowid;
//public $ref;
//public $lastname;
@ -159,6 +162,9 @@ class WebPortalMember extends Adherent
//public $url;
//public $socialnetworks;
//public $login;
/**
* @var int
*/
public $fk_adherent_type;
//public $morphy;
//public $societe;

View File

@ -355,26 +355,10 @@ class Hook extends CommonObject
public function fetch($id, $ref = null)
{
$result = $this->fetchCommon($id, $ref);
if ($result > 0 && !empty($this->table_element_line)) {
//$this->fetchLines();
}
return $result;
}
/**
* Load object lines in memory from the database
*
* @return int Return integer <0 if KO, 0 if not found, >0 if OK
*/
/*public function fetchLines()
{
$this->lines=array();
// Load lines with object MyObjectLine
return count($this->lines)?1:0;
}*/
/**
* Load list of objects in memory from the database.
*
@ -385,7 +369,7 @@ class Hook extends CommonObject
* @param string $filter Filter as an Universal Search string.
* Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
* @param string $filtermode No more used
* @return array|int int <0 if KO, array of pages if OK
* @return Hook[]|int int <0 if KO, array of pages if OK
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
{

View File

@ -85,7 +85,6 @@ parameters:
- '#(?:convertSecondToTime) expects int, float\|string given#'
- '#(?:Comm(?:(?:ande::updateline|on(?:Invoice::getLibStatut|StickerGenerator::(?:Set_Char_Size|_Croix|convertMetric)))\(\))|Facture(?:(?:::update|FournisseurRec::add)line\(\))|(?:Holiday::addLogCP|Loan::getLibStatut|SupplierProposal::updateline)\(\)|c(?:alcul_price_total|onvert(?:DurationtoHour|SecondToTime))|dol_time_plus_duree|pdf_(?:azur::_tableau_(?:(?:info|tot)\(\))|ban(?:::_tableau\(\)|k)|c(?:anelle::_tableau_(?:(?:tot|versements)\(\))|ornas::_tableau_(?:(?:info|tot)\(\))|rabe::_tableau_(?:(?:info|tot|versements)\(\))|yan::draw(?:(?:Info|Total)Table\(\)))|e(?:agle(?:(?:::_tableau_tot|_proforma::drawTotalTable)\(\))|instein::_tableau_(?:(?:info|tot)\(\))|ratosthene::draw(?:(?:Info|Total)Table\(\))|spadon::_tableau_tot\(\))|muscadet::_tableau_(?:(?:info|tot)\(\))|octopus::(?:_table(?:(?:FirstPage|au)\(\))|draw(?:(?:Info|Total)Table\(\)))|page(?:foot|head)|(?:rouget::_tableau_tot|s(?:epamandate::_tableau(?:_info)?|ponge::draw(?:(?:Info|Total)Table)|quille::_tableau_tot|t(?:andard_(?:e(?:(?:valuation|xpensereport)::_tableau|xpensereport::tablePayments)|(?:myobjec|supplierpaymen)t::_tableau|supplierpayment::_tableau_cheque)|orm::_tableau_info|rato::tabSignature))|t(?:cpdflabel::writeBarcode|yphon::_tableau_info)|vinci::_tableau_info)\(\)|w(?:atermark|rite(?:LinkedObjects|linedesc))|zenith::_tableau_tot\(\))|usleep) expects int, float given\.#'
- '#::saveboxorder\(\) expects int, array#'
- '#(?:dol_(?:mktime|remove_file_process)|fetchObjectByElement|print_actions_filter) expects int, array\|string given\.#'
- '# (CSMSFile) constructor expects int, array\|string given.#'
@ -93,10 +92,8 @@ parameters:
- '#(?:(?:Asset::addDepreciationL|Facture(?:(?:(?:Fournisseur)?::add|Fournisseur::update)l))ine\(\)|calcul_price_total|dol_convertToWord|(?:loanCalcMonthlyPaymen|print_paypal_redirec)t) expects float, string given.#'
- '#EvalMath::trigger\(\) expects string\|null,#'
- '#(?:F(?:acture(?:(?:Fournisseur)?Rec::addline\(\))|ichinterRec::addLineRec\(\))|dolMd2Html|setEventMessages) expects string\|null,#'
- '# (envoi_mail|sendEmailTo) expects string, \(float\|int\) given.#'
- '#::printStdColumnContent\(\) expects string, float(\|(int|array)(\<.*\>)?)* given.#'
- '#::HTML2OpenIDServer\(\) expects string, array given.#'
- '#create_line\(\) expects string, float given.#'
- '# dol_stringtotime expects string, DateTime given.#'
- '#expects string, bool\|mysqli_result\|resource given.#'
- '#( |::)((multi)?selectarray)\(\) expects array#'
@ -104,7 +101,6 @@ parameters:
- '#::(_validateMyObject|select_company)\(\) expects array<string#'
- '# getCommonSubstitutionArray expects array#'
- '# ldap_search expects array\|LDAP#'
- '# ajax_combobox expects array#'
- '# FormWebPortal::selectForForms\(\) expects int, array#'
- '# Lettering::getBankLinesFromFkDocAndDocType\(\) expects array#'
- '# (Odf) constructor expects #'
@ -115,7 +111,6 @@ parameters:
- '#(?:ldap_(?:(?:ad|bin)d|delete|err(?:no|or)|first_entry|get_(?:(?:attribut|entri)es|(?:optio|values_le)n)|mod_(?:add|del|replace)|rename|set_option|unbind)) expects LDAP\\Connection#'
- '#(?:MultiCurrencies::_cleanObjectDatasRate\(\)) expects MultiCurrency#'
- '# (?:pdf_(?:(?:eagle_proforma::drawTotalTable|muscadet::_tableau_tot)\(\))) expects Facture#'
- '# (?:salaries_prepare_head) expects Paiement#'
- '# (?:pg_(?:affected_rows|f(?:etch_(?:array|object|row)|ree_result)|num_rows)) expects PgSql\\Result#'
- '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#'
- '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#'
@ -123,6 +118,7 @@ parameters:
- '#Call to function array_key_exists.. with .error. .* will always evaluate to false.#'
- '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#'
- '#(?:make_substitutions expects array<string, string>,) string given\.#'
- '# (Workstation|WorkstationResource|WorkstationUserGroup|Zapier)::.* has no value type specified in iterable type array\.#'
internalErrorsCountLimit: 50
cache:

View File

@ -1,11 +1,11 @@
#!/usr/bin/env php
<?php
/*
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -155,7 +155,7 @@ if ($resql) {
if ($startbreak) {
// Break onto sales representative (new email or cid)
if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) {
sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldtarget, (int) $duration_value);
sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget, (int) $duration_value);
$trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid;
} else {
if ($oldemail != 'none') {
@ -209,7 +209,7 @@ if ($resql) {
// If there are remaining messages to send in the buffer
if ($foundtoprocess) {
if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) { // Break onto email (new email)
sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldtarget, (int) $duration_value);
sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget, (int) $duration_value);
$trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid;
} else {
if ($oldemail != 'none') {

View File

@ -125,7 +125,7 @@ if ($resql) {
if (($obj->email != $oldemail || $obj->uid != $olduid) || $oldemail == 'none') {
// Break onto sales representative (new email or uid)
if (dol_strlen($oldemail) && $oldemail != 'none') {
envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative);
envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative);
} else {
if ($oldemail != 'none') {
print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n";
@ -173,7 +173,7 @@ if ($resql) {
// If there are remaining messages to send in the buffer
if ($foundtoprocess) {
if (dol_strlen($oldemail) && $oldemail != 'none') { // Break onto email (new email)
envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative);
envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative);
} else {
if ($oldemail != 'none') {
print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n";