Merge pull request #29066 from mdeweerd/fix/dol_get_fiche_head

Fix arguments to dol_get_fiche_head and dol_get_fiche_end
This commit is contained in:
Laurent Destailleur 2024-03-28 14:16:45 +01:00 committed by GitHub
commit 54501bccc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 84 additions and 69 deletions

View file

@ -6,6 +6,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 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
@ -240,7 +241,7 @@ if ($user->hasRight('categorie', 'creer')) {
print load_fiche_titre($langs->trans("CreateCat"));
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<table width="100%" class="border">';
@ -282,7 +283,7 @@ if ($user->hasRight('categorie', 'creer')) {
print '</table>';
print dol_get_fiche_end('');
print dol_get_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button b" value="'.$langs->trans("CreateThisCat").'" name="creation" />';

View file

@ -5,6 +5,7 @@
* Copyright (C) 2021 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2023 Charlene Benke <charlene.r@patas-monkey.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
@ -138,7 +139,7 @@ class FormTicket
$this->withcompany = !getDolGlobalInt("TICKETS_NO_COMPANY_ON_FORM") && isModEnabled("societe");
$this->withfromsocid = 0;
$this->withfromcontactid = 0;
$this->withreadid=0;
$this->withreadid = 0;
//$this->withtitletopic='';
$this->withnotifytiersatcreate = 0;
$this->withusercreate = 1;
@ -911,8 +912,8 @@ class FormTicket
} elseif ($htmlname != '') {
$selectedgroups = array();
$groupvalue = "";
$groupticket=GETPOST($htmlname, 'aZ09');
$child_id=GETPOST($htmlname.'_child_id', 'aZ09') ? GETPOST($htmlname.'_child_id', 'aZ09') : 0;
$groupticket = GETPOST($htmlname, 'aZ09');
$child_id = GETPOST($htmlname.'_child_id', 'aZ09') ? GETPOST($htmlname.'_child_id', 'aZ09') : 0;
if (!empty($groupticket)) {
$tmpgroupticket = $groupticket;
$sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code";
@ -1025,7 +1026,7 @@ class FormTicket
if ($resql) {
$num_rows = $this->db->num_rows($resql);
$i = 0;
$arrayidused=array();
$arrayidused = array();
while ($i < $num_rows) {
$obj = $this->db->fetch_object($resql);
if ($obj) {
@ -1054,7 +1055,7 @@ class FormTicket
}
$stringtoprint .= '<option '.$iselected.' class="'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'" value="'.dol_escape_htmltag($groupvalue).'" data-html="'.dol_escape_htmltag($grouplabel).'">'.dol_escape_htmltag($grouplabel).'</option>';
if (empty($tabscript[$groupcodefather])) {
$tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid-1) : '').'").val() == "'.dol_escape_js($groupcodefather).'"){
$tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid - 1) : '').'").val() == "'.dol_escape_js($groupcodefather).'"){
$(".'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'").show()
console.log("We show child tickets of '.$groupcodefather.' group ticket")
}else{
@ -1068,11 +1069,11 @@ class FormTicket
} else {
dol_print_error($this->db);
}
$stringtoprint .='</select>';
$stringtoprint .= '</select>';
$stringtoprint .='<script nonce="'.getNonce().'">';
$stringtoprint .='arraynotparents = '.json_encode($arraycodenotparent).';'; // when the last visible combo list is number x, this is the array of group
$stringtoprint .='if (arraynotparents.includes($("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid-1) : '').'").val())){
$stringtoprint .= '<script nonce="'.getNonce().'">';
$stringtoprint .= 'arraynotparents = '.json_encode($arraycodenotparent).';'; // when the last visible combo list is number x, this is the array of group
$stringtoprint .= 'if (arraynotparents.includes($("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid - 1) : '').'").val())){
console.log("'.$htmlname.'_child_'.$levelid.'")
if($("#'.$htmlname.'_child_'.$levelid.'").val() == "" && ($("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")>'.$child_id.')){
$("#'.$htmlname.'_child_'.$levelid.'").hide();
@ -1084,7 +1085,7 @@ class FormTicket
console.log("We choose '.$htmlname.' input and reload hidden input");
}
}
$("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid-1) : '').'").change(function() {
$("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid - 1) : '').'").change(function() {
child_id = $("#'.$htmlname.($levelid > 1 ? '_child_'.$levelid : '').'").attr("child_id");
/* Change of value to select this value*/
@ -1128,11 +1129,11 @@ class FormTicket
foreach ($tabscript as $script) {
$stringtoprint .= $script;
}
$stringtoprint .='})';
$stringtoprint .='</script>';
$stringtoprint .= '})';
$stringtoprint .= '</script>';
}
$stringtoprint .='<script nonce="'.getNonce().'">';
$stringtoprint .='$("#'.$htmlname.'_child_'.$use_multilevel.'").change(function() {
$stringtoprint .= '<script nonce="'.getNonce().'">';
$stringtoprint .= '$("#'.$htmlname.'_child_'.$use_multilevel.'").change(function() {
$("#ticketcategory_select").val($(this).val());
$("#ticketcategory_select_child_id").val($(this).attr("child_id"));
tmpvalselect = $("#ticketcategory_select").val();
@ -1141,7 +1142,7 @@ class FormTicket
}
console.log($("#ticketcategory_select").val());
})';
$stringtoprint .='</script>';
$stringtoprint .= '</script>';
$stringtoprint .= ajax_combobox($htmlname);
return $stringtoprint;

View file

@ -3,6 +3,7 @@
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.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
@ -27,8 +28,8 @@
/**
* Return array head with list of tabs to view object information
*
* @param Adherent $object Member
* @return array head
* @param Adherent $object Member
* @return array<int,array<int,string>> head links
*/
function member_prepare_head(Adherent $object)
{
@ -128,7 +129,7 @@ function member_prepare_head(Adherent $object)
// Show agenda tab
$head[$h][0] = DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
$nbEvent = 0;
// Enable caching of thirdparty count actioncomm
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
@ -170,7 +171,7 @@ function member_prepare_head(Adherent $object)
* Return array head with list of tabs to view object information
*
* @param AdherentType $object Member
* @return array head
* @return array<int,array<int,string>> head links
*/
function member_type_prepare_head(AdherentType $object)
{
@ -216,7 +217,7 @@ function member_type_prepare_head(AdherentType $object)
/**
* Return array head with list of tabs to view object information
*
* @return array head
* @return array<int,array<int,string>> head links
*/
function member_admin_prepare_head()
{
@ -278,7 +279,7 @@ function member_admin_prepare_head()
* Return array head with list of tabs to view object stats information
*
* @param Adherent $object Member or null
* @return array head
* @return array<int,array<int,string>> head links
*/
function member_stats_prepare_head($object)
{
@ -332,7 +333,7 @@ function member_stats_prepare_head($object)
* Return array head with list of tabs to view object information
*
* @param Subscription $object Subscription
* @return array head
* @return array<int,array<int,string>> head links
*/
function subscription_prepare_head(Subscription $object)
{

View file

@ -11,6 +11,7 @@
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023 Benjamin Grembi <benjamin@oarces.fr>
* Copyright (C) 2023-2024 William Mead <william.mead@manchenumerique.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
@ -117,7 +118,7 @@ $usercancreate = $user->hasRight('ficheinter', 'creer');
* Actions
*/
$parameters = array('socid'=>$socid);
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -1185,7 +1186,7 @@ if ($action == 'create') {
}
if (!$formconfirm) {
$parameters = array('formConfirm' => $formconfirm, 'lineid'=>$lineid);
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$formconfirm .= $hookmanager->resPrint;
@ -1204,8 +1205,8 @@ if ($action == 'create') {
$morehtmlref = '<div class="refidno">';
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->hasRight('ficheinter', 'creer'), 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->hasRight('ficheinter', 'creer'), 'string', '', null, null, '', 1);
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->hasRight('ficheinter', 'creer'), 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->hasRight('ficheinter', 'creer'), 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
// Project

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2019-2020 Open-DSI <support@open-dsi.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
@ -234,7 +235,7 @@ if ($id > 0 && $action != 'edit') {
*/
//$head = intracommreport_prepare_head($object);
print dol_get_fiche_head("", 'general', $langs->trans("IntracommReport"), -1, 'user');
print dol_get_fiche_head(array(), 'general', $langs->trans("IntracommReport"), -1, 'user');
// Confirm remove report
if ($action == 'delete') {

View file

@ -4960,7 +4960,7 @@ if ($module == 'initmodule') {
print '<span class="opacitymedium">'.$langs->trans("EnterNameOfDictionaryDesc").'</span><br><br>';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<table class="border centpercent">';
print '<tbody>';
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Table").'</td><td><input type="text" name="dicname" maxlength="64" value="'.dol_escape_htmltag(GETPOST('dicname', 'alpha') ? GETPOST('dicname', 'alpha') : $modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("DicKey")).'" autofocus></td>';

View file

@ -1364,7 +1364,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
$object->country = $tmparray['label'];
}
print dol_get_fiche_head('');
print dol_get_fiche_head();
// Call Hook tabContentCreateProduct
$parameters = array();
@ -3032,7 +3032,7 @@ if (getDolGlobalString('PRODUCT_ADD_FORM_ADD_TO') && $object->id && ($action ==
print load_fiche_titre($langs->trans("AddToDraft"), '', '');
print dol_get_fiche_head('');
print dol_get_fiche_head();
$html .= '<tr><td class="nowrap">'.$langs->trans("Quantity").' ';
$html .= '<input type="text" class="flat" name="qty" size="1" value="1"></td>';

View file

@ -1417,7 +1417,7 @@ if ($action == 'edit_vat' && ($user->hasRight('produit', 'creer') || $user->hasR
print '<input type="hidden" name="action" value="update_vat">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<table class="border centpercent">';
@ -1446,7 +1446,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
print '<input type="hidden" name="action" value="update_price">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<div class="div-table-responsive-no-min">';
print '<table class="border centpercent">';
@ -1582,7 +1582,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
print '<input type="hidden" name="action" value="update_price">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
//print dol_get_fiche_head('', '', '', -1);
//print dol_get_fiche_head(array(), '', '', -1);
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && getDolGlobalString('PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL')) {
print $langs->trans('UseMultipriceRules').' <input type="checkbox" id="usePriceRules" name="usePriceRules" '.($object->price_autogen ? 'checked' : '').'><br><br>';

View file

@ -737,7 +737,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object-
print '<input type="hidden" name="id" value="'.$object->id.'">';
}
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<div class="div-table-responsive-no-min">';
print '<table class="border centpercent">';

View file

@ -8,6 +8,7 @@
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
* Copyright (C) 2022 Udo Tamm <dev@dolibit.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
@ -327,7 +328,7 @@ $messagemandatory = '<span class="">' . $langs->trans("FieldsWithAreMandatory",
//print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<script type="text/javascript">
jQuery(document).ready(function () {

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2021 Dorian Vabre <dorian.vabre@gmail.com>
* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -788,7 +789,7 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS
//print '<span class="opacitymedium">' . $langs->trans("FieldsWithAreMandatory", '*') . '</span><br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<script type="text/javascript">
jQuery(document).ready(function () {

View file

@ -8,6 +8,7 @@
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
* Copyright (C) 2022 Udo Tamm <dev@dolibit.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
@ -545,7 +546,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
//print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<script type="text/javascript">
jQuery(document).ready(function () {

View file

@ -7,6 +7,7 @@
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Waël Almoman <info@almoman.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
@ -276,7 +277,7 @@ if (empty($reshook) && $action == 'add') {
$company->state_id = GETPOSTINT('state_id');
$company->name_alias = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname'));
$resultat=$company->create($user);
$resultat = $company->create($user);
if ($resultat < 0) {
$error++;
$errmsg .= implode('<br>', $company->errors);
@ -581,7 +582,7 @@ $messagemandatory = '<span class="">'.$langs->trans("FieldsWithAreMandatory", '*
//print '<br><span class="opacitymedium small">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<script type="text/javascript">
jQuery(document).ready(function () {
@ -681,8 +682,8 @@ if (!getDolGlobalString('SOCIETE_DISABLE_STATE')) {
// Logo
//print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n";
// Other attributes
$parameters['tdclass']='titlefieldauto';
$parameters['tpl_context']='public'; // define template context to public
$parameters['tdclass'] = 'titlefieldauto';
$parameters['tpl_context'] = 'public'; // define template context to public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
// Comments
print '<tr>';

View file

@ -6,6 +6,7 @@
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.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
@ -482,7 +483,7 @@ print '<br>';
print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<script type="text/javascript">
jQuery(document).ready(function () {
@ -547,7 +548,7 @@ if (!getDolGlobalString('SOCIETE_DISABLE_STATE')) {
}
// Other attributes
$parameters['tpl_context']='public'; // define template context to public
$parameters['tpl_context'] = 'public'; // define template context to public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
// Comments
print '<tr>';

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2021 Dorian Vabre <dorian.vabre@gmail.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
@ -278,7 +279,7 @@ if (empty($reshook) && $action == 'add') {
}
$thirdparty->code_client = $tmpcode;
$readythirdparty = $thirdparty->create($user);
if ($readythirdparty <0) {
if ($readythirdparty < 0) {
$error++;
$errmsg .= $thirdparty->error;
$errors = array_merge($errors, $thirdparty->errors);
@ -291,7 +292,7 @@ if (empty($reshook) && $action == 'add') {
if (!$error) {
$contact = new Contact($db);
$resultcontact = $contact->fetch('', '', '', $email);
if ($resultcontact<=0) {
if ($resultcontact <= 0) {
// Need to create a contact
$contact->socid = $thirdparty->id;
$contact->lastname = (string) GETPOST("lastname", 'alpha');
@ -305,7 +306,7 @@ if (empty($reshook) && $action == 'add') {
$contact->statut = 1; //Default status to Actif
$resultcreatecontact = $contact->create($user);
if ($resultcreatecontact<0) {
if ($resultcreatecontact < 0) {
$error++;
$errmsg .= $contact->error;
}
@ -318,7 +319,7 @@ if (empty($reshook) && $action == 'add') {
$resultcategory = $category->fetch(getDolGlobalString('EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'));
if ($resultcategory<=0) {
if ($resultcategory <= 0) {
$error++;
$errmsg .= $category->error;
} else {
@ -403,13 +404,13 @@ if (empty($reshook) && $action == 'add') {
} else {
$resultconforbooth = $conforbooth->create($user);
}
if ($resultconforbooth<=0) {
if ($resultconforbooth <= 0) {
$error++;
$errmsg .= $conforbooth->error;
} else {
// Adding the contact to the project
$resultaddcontact = $conforbooth->add_contact($contact->id, 'RESPONSIBLE');
if ($resultaddcontact<0) {
if ($resultaddcontact < 0) {
$error++;
$errmsg .= $conforbooth->error;
} else {
@ -621,7 +622,7 @@ print '<input type="hidden" name="securekey" value="'.$securekeyreceived.'" />';
print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<script type="text/javascript">
jQuery(document).ready(function () {

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2021 Dorian Vabre <dorian.vabre@gmail.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
@ -279,7 +280,7 @@ if (empty($reshook) && $action == 'add') {
}
$thirdparty->code_client = $tmpcode;
$readythirdparty = $thirdparty->create($user);
if ($readythirdparty <0) {
if ($readythirdparty < 0) {
$error++;
$errmsg .= $thirdparty->error;
$errors = array_merge($errors, $thirdparty->errors);
@ -292,7 +293,7 @@ if (empty($reshook) && $action == 'add') {
if (!$error) {
$contact = new Contact($db);
$resultcontact = $contact->fetch('', '', '', $email);
if ($resultcontact<=0) {
if ($resultcontact <= 0) {
// Need to create a contact
$contact->socid = $thirdparty->id;
$contact->lastname = (string) GETPOST("lastname", 'alpha');
@ -305,7 +306,7 @@ if (empty($reshook) && $action == 'add') {
$contact->email = $email;
$contact->statut = 1; //Default status to Actif
$resultcreatecontact = $contact->create($user);
if ($resultcreatecontact<0) {
if ($resultcreatecontact < 0) {
$error++;
$errmsg .= $contact->error;
}
@ -318,7 +319,7 @@ if (empty($reshook) && $action == 'add') {
$resultcategory = $category->fetch(getDolGlobalString('EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'));
if ($resultcategory<=0) {
if ($resultcategory <= 0) {
$error++;
$errmsg .= $category->error;
} else {
@ -364,7 +365,7 @@ if (empty($reshook) && $action == 'add') {
$conforbooth->fk_project = $project->id;
$conforbooth->note = $note;
$conforbooth->fk_action = $eventtype;
$conforbooth->datep =$datestart;
$conforbooth->datep = $datestart;
$conforbooth->datep2 = $dateend;
$conforbooth->datec = dol_now();
$conforbooth->tms = dol_now();
@ -405,13 +406,13 @@ if (empty($reshook) && $action == 'add') {
} else {
$resultconforbooth = $conforbooth->create($user);
}
if ($resultconforbooth<=0) {
if ($resultconforbooth <= 0) {
$error++;
$errmsg .= $conforbooth->error;
} else {
// Adding the contact to the project
$resultaddcontact = $conforbooth->add_contact($contact->id, 'SPEAKER');
if ($resultaddcontact<0) {
if ($resultaddcontact < 0) {
$error++;
$errmsg .= $conforbooth->error;
} else {
@ -556,7 +557,7 @@ print '<input type="hidden" name="securekey" value="'.$securekeyreceived.'" />';
print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<script type="text/javascript">
jQuery(document).ready(function () {

View file

@ -807,7 +807,7 @@ if ($action == 'create') {
print '<input type="hidden" name="entrepot_id" value="'.GETPOSTINT('entrepot_id').'">';
}
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<table class="border centpercent">';

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2013-2014 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2023-2024 William Mead <william.mead@manchenumerique.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
@ -79,7 +80,7 @@ $permissiontodelete = $user->hasRight('resource', 'delete');
*/
$hookmanager->initHooks(array('resource', 'resource_card', 'globalcard'));
$parameters = array('resource_id'=>$id);
$parameters = array('resource_id' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -224,7 +225,7 @@ $formresource = new FormResource($db);
if ($action == 'create' || $object->fetch($id, $ref) > 0) {
if ($action == 'create') {
print load_fiche_titre($title, '', 'object_resource');
print dol_get_fiche_head('');
print dol_get_fiche_head();
} else {
$head = resource_prepare_head($object);
print dol_get_fiche_head($head, 'resource', $title, -1, 'resource');
@ -256,13 +257,13 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) {
print '</td></tr>';
// Zip / Town
print '<tr><td>'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).'</td><td'.($conf->browser->layout == 'phone' ? ' colspan="3"': '').'>';
print '<tr><td>'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).'</td><td'.($conf->browser->layout == 'phone' ? ' colspan="3"' : '').'>';
print $formresource->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100');
print '</td>';
if ($conf->browser->layout == 'phone') {
print '</tr><tr>';
}
print '<td>'.$form->editfieldkey('Town', 'town', '', $object, 0).'</td><td'.($conf->browser->layout == 'phone' ? ' colspan="3"': '').'>';
print '<td>'.$form->editfieldkey('Town', 'town', '', $object, 0).'</td><td'.($conf->browser->layout == 'phone' ? ' colspan="3"' : '').'>';
print $formresource->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
print $form->widgetForTranslation("town", $object, $permissiontoadd, 'string', 'alphanohtml', 'maxwidth100 quatrevingtpercent');
print '</td></tr>';

View file

@ -561,7 +561,7 @@ if ($action == 'create' && $permissiontoadd) {
print '</script>'."\n";
}
print dol_get_fiche_head('');
print dol_get_fiche_head();
print '<table class="border centpercent">';

View file

@ -1213,7 +1213,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<input type="hidden" name="code_auto" value="1">';
}
print dol_get_fiche_head(null, 'card', '', 0, '');
print dol_get_fiche_head(array(), 'card', '', 0, '');
// Call Hook tabContentCreateThirdparty
$parameters = array();

View file

@ -15,6 +15,7 @@
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 David Beniamine <David.Beniamine@Tetras-Libre.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
@ -890,7 +891,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
print dol_get_fiche_head('', '', '', 0, '');
print dol_get_fiche_head(array(), '', '', 0, '');
dol_set_focus('#lastname');

View file

@ -5,6 +5,7 @@
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
* 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
@ -274,7 +275,7 @@ if ($action == 'create') {
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print dol_get_fiche_head('', '', '', 0, '');
print dol_get_fiche_head(array(), '', '', 0, '');
print '<table class="border centpercent tableforfieldcreate">';