Merge branch 'develop' into patch-11
This commit is contained in:
commit
33d3eb0949
73 changed files with 659 additions and 422 deletions
|
|
@ -27,6 +27,9 @@ The following changes may create regressions for some external modules, but were
|
|||
cross platform compatibility. On linux the exit(-1) was caught as 255, it may be now exit(1) so will be caught as 1.
|
||||
* the parameter $filter of method fetchAll does not accept array of SQL but must be a string of an Universal Search Filter syntax.
|
||||
* Use of dol_eval with parameter $returnvalue=0 is deprecated.
|
||||
* The signature for all ->delete() method has been modified to match the modulebuilder template (so first paramis now always $user), except
|
||||
the delete for thirdparty (still accept the id of thirdparty to delete as first parameter). Will probably be modified into another version.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 19.0.1 compared to 19.0.0 *****
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ if ($reshook < 0) {
|
|||
}
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == "yes") {
|
||||
$result = $object->delete($id);
|
||||
$result = $object->delete($user);
|
||||
if ($result >= 0) {
|
||||
header("Location: fiscalyear.php");
|
||||
exit();
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class AccountingAccount extends CommonObject
|
|||
* Load record in memory
|
||||
*
|
||||
* @param int $rowid Id
|
||||
* @param string $account_number Account number
|
||||
* @param string|null $account_number Account number
|
||||
* @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active chart of account
|
||||
* @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC' (better and faster than previous parameter if you have chart of account code).
|
||||
* @return int Return integer <0 if KO, 0 if not found, Id of record if OK and found
|
||||
|
|
|
|||
|
|
@ -1231,7 +1231,7 @@ class BookKeeping extends CommonObject
|
|||
} elseif ($key == 't.reconciled_option') {
|
||||
$sqlwhere[] = 't.lettering_code IS NULL';
|
||||
} else {
|
||||
$sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->escape($this->db->escapeforlike($value))."%'";
|
||||
$sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if ($user->hasRight('adherent', 'supprimer') && $action == 'confirm_delete' && $confirm == 'yes') {
|
||||
$result = $object->delete($id, $user);
|
||||
$result = $object->delete($user);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'errors');
|
||||
if (!empty($backtopage) && !preg_match('/'.preg_quote($_SERVER["PHP_SELF"], '/').'/', $backtopage)) {
|
||||
|
|
|
|||
|
|
@ -1061,21 +1061,18 @@ class Adherent extends CommonObject
|
|||
/**
|
||||
* Fonction to delete a member and its data
|
||||
*
|
||||
* @param int $rowid Id of member to delete
|
||||
* @param User $user User object
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int Return integer <0 if KO, 0=nothing to do, >0 if OK
|
||||
*/
|
||||
public function delete($rowid, $user, $notrigger = 0)
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
$result = 0;
|
||||
$error = 0;
|
||||
$errorflag = 0;
|
||||
|
||||
// Check parameters
|
||||
if (empty($rowid)) {
|
||||
$rowid = $this->id;
|
||||
}
|
||||
$rowid = $this->id;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ class Members extends DolibarrApi
|
|||
}
|
||||
|
||||
|
||||
$res = $member->delete($member->id, DolibarrApiAccess::$user);
|
||||
$res = $member->delete(DolibarrApiAccess::$user);
|
||||
if ($res < 0) {
|
||||
throw new RestException(500, "Can't delete, error occurs");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2022 Alice Adminson <aadminson@example.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
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file bookcal/lib/bookcal.lib.php
|
||||
* \file htdocs/bookcal/lib/bookcal.lib.php
|
||||
* \ingroup bookcal
|
||||
* \brief Library files with common functions for BookCal
|
||||
*/
|
||||
|
|
@ -35,13 +36,13 @@ function bookcalAdminPrepareHead()
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/bookcal/admin/setup.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/admin/setup.php';
|
||||
$head[$h][1] = $langs->trans("Settings");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
/*
|
||||
$head[$h][0] = dol_buildpath("/bookcal/admin/myobject_extrafields.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT.'/bookcal/admin/myobject_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$head[$h][2] = 'myobject_extrafields';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2022 Alice Adminson <aadminson@example.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
|
||||
|
|
@ -41,13 +42,13 @@ function availabilitiesPrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/bookcal/availabilities_card.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_card.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
if ($showtabofpagecontact) {
|
||||
$head[$h][0] = dol_buildpath("/bookcal/availabilities_contact.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_contact.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Contacts");
|
||||
$head[$h][2] = 'contact';
|
||||
$h++;
|
||||
|
|
@ -62,10 +63,10 @@ function availabilitiesPrepareHead($object)
|
|||
if (!empty($object->note_public)) {
|
||||
$nbNote++;
|
||||
}
|
||||
$head[$h][0] = dol_buildpath('/bookcal/availabilities_note.php', 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_note.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
|
||||
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">' . $nbNote . '</span>' : '');
|
||||
}
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
|
|
@ -73,22 +74,22 @@ function availabilitiesPrepareHead($object)
|
|||
}
|
||||
|
||||
if ($showtabofpagedocument) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->bookcal->dir_output."/availabilities/".dol_sanitizeFileName($object->ref);
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||
$upload_dir = $conf->bookcal->dir_output . "/availabilities/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = dol_buildpath("/bookcal/availabilities_document.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_document.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
if (($nbFiles + $nbLinks) > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($showtabofpageagenda) {
|
||||
$head[$h][0] = dol_buildpath("/bookcal/availabilities_agenda.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_agenda.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2023 Alice Adminson <aadminson@example.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
|
||||
|
|
@ -41,13 +42,13 @@ function calendarPrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/bookcal/calendar_card.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_card.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Calendar");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
if ($object->status == Calendar::STATUS_VALIDATED) {
|
||||
$head[$h][0] = dol_buildpath("/bookcal/booking_list.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/booking_list.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Bookings");
|
||||
$head[$h][2] = 'booking';
|
||||
$h++;
|
||||
|
|
@ -55,7 +56,7 @@ function calendarPrepareHead($object)
|
|||
|
||||
|
||||
if ($showtabofpagecontact) {
|
||||
$head[$h][0] = dol_buildpath("/bookcal/calendar_contact.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_contact.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Contacts");
|
||||
$head[$h][2] = 'contact';
|
||||
$h++;
|
||||
|
|
@ -70,10 +71,10 @@ function calendarPrepareHead($object)
|
|||
if (!empty($object->note_public)) {
|
||||
$nbNote++;
|
||||
}
|
||||
$head[$h][0] = dol_buildpath('/bookcal/calendar_note.php', 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_note.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= (!getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
|
||||
$head[$h][1] .= (!getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">' . $nbNote . '</span>' : '');
|
||||
}
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
|
|
@ -81,22 +82,22 @@ function calendarPrepareHead($object)
|
|||
}
|
||||
|
||||
if ($showtabofpagedocument) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->bookcal->dir_output."/calendar/".dol_sanitizeFileName($object->ref);
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||
$upload_dir = $conf->bookcal->dir_output . "/calendar/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = dol_buildpath("/bookcal/calendar_document.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_document.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
if (($nbFiles + $nbLinks) > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($showtabofpageagenda) {
|
||||
$head[$h][0] = dol_buildpath("/bookcal/calendar_agenda.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_agenda.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -1051,7 +1051,7 @@ if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes
|
|||
|
||||
if ($user->hasRight('agenda', 'myactions', 'delete')
|
||||
|| $user->hasRight('agenda', 'allactions', 'delete')) {
|
||||
$result = $object->delete();
|
||||
$result = $object->delete($user);
|
||||
|
||||
if ($result >= 0) {
|
||||
header("Location: index.php");
|
||||
|
|
|
|||
|
|
@ -1022,15 +1022,13 @@ class ActionComm extends CommonObject
|
|||
|
||||
/**
|
||||
* Delete event from database
|
||||
* @TODO Add User $user as first param
|
||||
*
|
||||
* @param User $user User making the delete
|
||||
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete($notrigger = 0)
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$error = 0;
|
||||
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ $mode = GETPOST('mode', 'alpha');
|
|||
// Search Fields
|
||||
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
||||
$search_user = GETPOSTINT('search_user');
|
||||
if ($search_user==-1) $search_user=0;
|
||||
$search_sale = GETPOSTINT('search_sale');
|
||||
$search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
|
||||
$search_refcustomer = GETPOST('search_refcustomer', 'alpha');
|
||||
|
|
@ -587,7 +588,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s
|
|||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
|
||||
|
||||
$sql .= ', '.MAIN_DB_PREFIX.'propal as p';
|
||||
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'propal as p ON p.fk_soc = s.rowid';
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)";
|
||||
}
|
||||
|
|
@ -598,8 +599,10 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid';
|
|||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON pr.rowid = p.fk_projet";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_availability as ava on (ava.rowid = p.fk_availability)";
|
||||
if ($search_user > 0) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."element_contact as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_contact as c";
|
||||
$sql .= " ON c.element_id = p.rowid AND c.fk_socpeople = ".((int) $search_user);
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||
$sql .= " ON c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal'";
|
||||
}
|
||||
|
||||
// Add table from hooks
|
||||
|
|
@ -607,8 +610,8 @@ $parameters = array();
|
|||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= ' WHERE p.fk_soc = s.rowid';
|
||||
$sql .= ' AND p.entity IN ('.getEntity('propal').')';
|
||||
$sql .= ' WHERE';
|
||||
$sql .= ' p.entity IN ('.getEntity('propal').')';
|
||||
if ($search_town) {
|
||||
$sql .= natural_search('s.town', $search_town);
|
||||
}
|
||||
|
|
@ -718,9 +721,6 @@ if ($search_date_delivery_start) {
|
|||
if ($search_date_delivery_end) {
|
||||
$sql .= " AND p.date_livraison <= '".$db->idate($search_date_delivery_end)."'";
|
||||
}
|
||||
if ($search_user > 0) {
|
||||
$sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".((int) $search_user);
|
||||
}
|
||||
if ($search_date_signature_start) {
|
||||
$sql .= " AND p.date_signature >= '".$db->idate($search_date_signature_start)."'";
|
||||
}
|
||||
|
|
@ -1147,7 +1147,7 @@ if ($search_date_signature_endyear) {
|
|||
if ($user->hasRight('user', 'user', 'lire')) {
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$tmptitle = $langs->trans('LinkedToSpecificUsers');
|
||||
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
|
||||
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers((empty($search_user)?-2:0), 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
// If the user can view products
|
||||
|
|
|
|||
|
|
@ -1009,7 +1009,7 @@ if (empty($reshook)) {
|
|||
$paiement = new Paiement($db);
|
||||
$result = $paiement->fetch(GETPOSTINT('paiement_id'));
|
||||
if ($result > 0) {
|
||||
$result = $paiement->delete(); // If fetch ok and found
|
||||
$result = $paiement->delete($user); // If fetch ok and found
|
||||
if ($result >= 0) {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ if (empty($reshook)) {
|
|||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('facture', 'paiement')) {
|
||||
$db->begin();
|
||||
|
||||
$result = $object->delete();
|
||||
$result = $object->delete($user);
|
||||
if ($result > 0) {
|
||||
$db->commit();
|
||||
|
||||
|
|
|
|||
|
|
@ -594,15 +594,13 @@ class Paiement extends CommonObject
|
|||
* Delete a payment and generated links into account
|
||||
* - Si le paiement porte sur un ecriture compte qui est rapprochee, on refuse
|
||||
* - Si le paiement porte sur au moins une facture a "payee", on refuse
|
||||
* @TODO Add first param User $user
|
||||
*
|
||||
* @param User $user User making the deletion
|
||||
* @param int $notrigger No trigger
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete($notrigger = 0)
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$bank_line_id = $this->bank_line;
|
||||
|
|
|
|||
|
|
@ -1084,13 +1084,8 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
|||
|
||||
if ($objecttmp->element == 'societe') {
|
||||
/** @var Societe $objecttmp */
|
||||
// TODO Change signature of delete for Societe
|
||||
$result = $objecttmp->delete($objecttmp->id, $user, 1);
|
||||
} elseif ($objecttmp->element == 'member') {
|
||||
/** @var Adherent $objecttmp */
|
||||
$result = $objecttmp->delete($objecttmp->id, $user, 0);
|
||||
} elseif ($objecttmp->element == 'action') {
|
||||
/** @var ActionComm $objecttmp */
|
||||
$result = $objecttmp->delete(); // TODO Add User $user as first param
|
||||
} else {
|
||||
$result = $objecttmp->delete($user);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,16 +254,16 @@ class Fiscalyear extends CommonObject
|
|||
/**
|
||||
* Delete record
|
||||
*
|
||||
* @param int $id Id of record to delete
|
||||
* @param User $user User that delete
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete($id)
|
||||
public function delete($user)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".$this->db->prefix()."accounting_fiscalyear WHERE rowid = ".((int) $id);
|
||||
$sql = "DELETE FROM ".$this->db->prefix()."accounting_fiscalyear";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$this->db->commit();
|
||||
|
|
|
|||
|
|
@ -1521,7 +1521,7 @@ class FormMail extends Form
|
|||
'basic' => 'basic',
|
||||
'news' => 'news',
|
||||
'commerce' => 'commerce',
|
||||
'text' => 'text'
|
||||
//'text' => 'text'
|
||||
);
|
||||
|
||||
foreach ($templates as $template => $templateFunction) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-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
|
||||
|
|
@ -41,6 +41,10 @@ class FormSms
|
|||
public $fromid;
|
||||
public $fromname;
|
||||
public $fromsms;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $fromtype;
|
||||
public $replytoname;
|
||||
public $replytomail;
|
||||
|
|
@ -48,9 +52,25 @@ class FormSms
|
|||
public $tomail;
|
||||
|
||||
public $withsubstit; // Show substitution array
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $withfrom;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $withto;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $withtopic;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $withbody;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -628,19 +628,19 @@ function ajax_event($htmlname, $events)
|
|||
/**
|
||||
* On/off button for constant
|
||||
*
|
||||
* @param string $code Name of constant
|
||||
* @param array $input Array of complementary actions to do if success ("disabled"|"enabled'|'set'|'del') => CSS element to switch, 'alert' => message to show, ... Example: array('disabled'=>array(0=>'cssid'))
|
||||
* @param int $entity Entity. Current entity is used if null.
|
||||
* @param int $revertonoff 1=Revert on/off
|
||||
* @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant
|
||||
* @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input)
|
||||
* @param int $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin.
|
||||
* @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code.
|
||||
* @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it
|
||||
* @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red'
|
||||
* @param string $mode Add parameter &mode= to the href link (Used for href link)
|
||||
* @param string $morecss More CSS
|
||||
* @return string
|
||||
* @param string $code Name of constant
|
||||
* @param array $input Array of complementary actions to do if success ("disabled"|"enabled'|'set'|'del') => CSS element to switch, 'alert' => message to show, ... Example: array('disabled'=>array(0=>'cssid'))
|
||||
* @param int|null $entity Entity. Current entity is used if null.
|
||||
* @param int $revertonoff 1=Revert on/off
|
||||
* @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant
|
||||
* @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input)
|
||||
* @param int $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin.
|
||||
* @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code.
|
||||
* @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it
|
||||
* @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red'
|
||||
* @param string $mode Add parameter &mode= to the href link (Used for href link)
|
||||
* @param string $morecss More CSS
|
||||
* @return string
|
||||
*/
|
||||
function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '', $morecss = 'inline-block')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6890,7 +6890,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
|
|||
if (($mysoc->country_code == $thirdpartytouse->country_code)
|
||||
|| (in_array($mysoc->country_code, array('FR', 'MC')) && in_array($thirdpartytouse->country_code, array('FR', 'MC')))
|
||||
|| (in_array($mysoc->country_code, array('MQ', 'GP')) && in_array($thirdpartytouse->country_code, array('MQ', 'GP')))
|
||||
) {
|
||||
) {
|
||||
// If country of thirdparty to consider is ours
|
||||
if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object
|
||||
$result = $product->get_buyprice($idprodfournprice, 0, 0, 0);
|
||||
|
|
@ -8274,12 +8274,13 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false)
|
|||
/**
|
||||
* Return array of possible common substitutions. This includes several families like: 'system', 'mycompany', 'object', 'objectamount', 'date', 'user'
|
||||
*
|
||||
* @param Translate $outputlangs Output language
|
||||
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are trunc and html sanitized (to use for help tooltip)
|
||||
* @param array $exclude Array of family keys we want to exclude. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||
* @param Object $object Object for keys on object
|
||||
* @param array $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||
* @return array Array of substitutions
|
||||
* @param Translate $outputlangs Output language
|
||||
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys),
|
||||
* 2=Values are trunc and html sanitized (to use for help tooltip)
|
||||
* @param array|null $exclude Array of family keys we want to exclude. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||
* @param Object|null $object Object for keys on object
|
||||
* @param array|null $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||
* @return array Array of substitutions
|
||||
* @see setSubstitFromObject()
|
||||
*/
|
||||
function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $object = null, $include = null)
|
||||
|
|
@ -9756,13 +9757,13 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if a variable with name $var start with $text.
|
||||
* Check if a variable with name $var startx with $text.
|
||||
* Can be used to forge dol_eval() conditions.
|
||||
*
|
||||
* @param $var string Variable
|
||||
* @param $regextext string Text that must be a valid regex string
|
||||
* @param $matchrule int 1=Test if start with, 0=Test if equal
|
||||
* @return boolean|string True or False, text if bad use.
|
||||
* @param string $var Variable
|
||||
* @param string $regextext Text that must be a valid regex string
|
||||
* @param int $matchrule 1=Test if start with, 0=Test if equal
|
||||
* @return boolean|string True or False, text if bad usage.
|
||||
*/
|
||||
function isStringVarMatching($var, $regextext, $matchrule = 1)
|
||||
{
|
||||
|
|
@ -13078,6 +13079,8 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||
}
|
||||
|
||||
$histo = array();
|
||||
'@phan-var-force array<int,array{type:string,tododone:string,id:string,datestart:int|string,dateend:int|string,note:string,message:string,percent:string,userid:string,login:string,userfirstname:string,userlastname:string,userphoto:string,msg_from?:string,contact_id?:string,socpeopleassigned?:int[],lastname?:string,firstname?:string,fk_element?:int,elementtype?:string,acode:string,alabel?:string,libelle?:string,apicto?:string}> $histo';
|
||||
|
||||
$numaction = 0;
|
||||
$now = dol_now();
|
||||
|
||||
|
|
@ -13157,7 +13160,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||
}
|
||||
|
||||
$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
|
||||
if ($force_filter_contact === false) {
|
||||
if (!$force_filter_contact) {
|
||||
if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) {
|
||||
$sql .= " AND a.fk_soc = ".((int) $filterobj->id);
|
||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) {
|
||||
|
|
@ -13285,6 +13288,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||
while ($i < $imaxinloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
'@phan-var-force array{apicto:string,contact_id:string,dp:string,dp2:string,firstname:string,label:string,message:string,msg_from:string,ref:string,type:string,user_lastname:string} $obj';
|
||||
if ($obj->type == 'action') {
|
||||
$contactaction = new ActionComm($db);
|
||||
$contactaction->id = $obj->id;
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
|
|||
* @param Contact|string|null $targetcontact Target contact object
|
||||
* @param int $usecontact Use contact instead of company
|
||||
* @param string $mode Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url)
|
||||
* @param Object $object Object we want to build document for
|
||||
* @param Object|null $object Object we want to build document for
|
||||
* @return string|int String with full address or -1 if KO
|
||||
*/
|
||||
function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source', $object = null)
|
||||
|
|
@ -718,7 +718,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t
|
|||
/**
|
||||
* Show header of page for PDF generation
|
||||
*
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $page_height Height of page
|
||||
* @return void
|
||||
|
|
@ -752,11 +752,11 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height)
|
|||
/**
|
||||
* Return array of possible substitutions for PDF content (without external module substitutions).
|
||||
*
|
||||
* @param Translate $outputlangs Output language
|
||||
* @param array $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...)
|
||||
* @param Object $object Object
|
||||
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip)
|
||||
* @param array $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||
* @param Translate $outputlangs Output language
|
||||
* @param array|null $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...)
|
||||
* @param Object|null $object Object
|
||||
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip)
|
||||
* @param array|null $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||
* @return array Array of substitutions
|
||||
*/
|
||||
function pdf_getSubstitutionArray($outputlangs, $exclude = null, $object = null, $onlykey = 0, $include = null)
|
||||
|
|
@ -2296,11 +2296,11 @@ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0)
|
|||
/**
|
||||
* Return line percent
|
||||
*
|
||||
* @param Object $object Object
|
||||
* @param int $i Current line number
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||
* @param HookManager $hookmanager Hook manager instance
|
||||
* @param Object $object Object
|
||||
* @param int $i Current line number
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||
* @param HookManager|null $hookmanager Hook manager instance
|
||||
* @return string
|
||||
*/
|
||||
function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
|
||||
|
|
|
|||
|
|
@ -714,7 +714,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||
* @param Object $object Object to show
|
||||
* @param int|float $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return int
|
||||
* @return int|float
|
||||
*/
|
||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ class pdf_zenith extends ModelePDFSupplierProposal
|
|||
* @param SupplierProposal $object Object to show
|
||||
* @param int|float $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return integer
|
||||
* @return int|float
|
||||
*/
|
||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ $coldisplay++;
|
|||
<td colspan="<?php echo $coldisplay - (!getDolGlobalString('MAIN_VIEW_LINE_NUMBER') ? 0 : 1) ?>"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
|
||||
<?php
|
||||
$prefillDates = false;
|
||||
if (getDolGlobalString('MAIN_FILL_SERVICE_DATES_FROM_LAST_SERVICE_LINE') && !empty($object->lines)) {
|
||||
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];
|
||||
if ($lastline->product_type == Product::TYPE_SERVICE && (!empty($lastline->date_start) || !empty($lastline->date_end))) {
|
||||
|
|
|
|||
|
|
@ -501,11 +501,7 @@ class DataPolicyCron
|
|||
}
|
||||
|
||||
if ($action == 'delete') { // If object to clean is not used
|
||||
if ($object->element == 'adherent') {
|
||||
$result = $object->delete($obj->rowid, $user);
|
||||
} else {
|
||||
$result = $object->delete($user);
|
||||
}
|
||||
$result = $object->delete($user);
|
||||
if ($result < 0) {
|
||||
$errormsg = $object->error;
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -38,13 +38,12 @@ function emailcollectorPrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/admin/emailcollector_card.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/admin/emailcollector_card.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("EmailCollector");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
/*if (isset($object->fields['note_public']) || isset($object->fields['note_private']))
|
||||
{
|
||||
/*if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) {
|
||||
$nbNote = 0;
|
||||
if (!empty($object->note_private)) $nbNote++;
|
||||
if (!empty($object->note_public)) $nbNote++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* 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
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file lib/eventorganization_conferenceorbooth.lib.php
|
||||
* \file htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php
|
||||
* \ingroup eventorganization
|
||||
* \brief Library files with common functions for ConferenceOrBooth
|
||||
*/
|
||||
|
|
@ -37,18 +38,18 @@ function conferenceorboothPrepareHead($object, $with_project = 0)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$withProjectUrl='';
|
||||
if ($with_project>0) {
|
||||
$withProjectUrl = '';
|
||||
if ($with_project > 0) {
|
||||
$withProjectUrl = "&withproject=1";
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?id='.$object->id.$withProjectUrl;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_card.php?id=' . $object->id . $withProjectUrl;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
if (getDolGlobalString('MAIN_FEATURES_LEVEL') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
$head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_contact.php?id='.$object->id.$withProjectUrl;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_contact.php?id=' . $object->id . $withProjectUrl;
|
||||
$head[$h][1] = $langs->trans("ContactsAddresses");
|
||||
$head[$h][2] = 'contact';
|
||||
$h++;
|
||||
|
|
@ -82,15 +83,15 @@ function conferenceorboothPrepareHead($object, $with_project = 0)
|
|||
$h++;
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->eventorganization->dir_output."/conferenceorbooth/".dol_sanitizeFileName($object->ref);
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||
$upload_dir = $conf->eventorganization->dir_output . "/conferenceorbooth/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_document.php", 1).'?id='.$object->id.$withProjectUrl;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_document.php?id=' . $object->id . $withProjectUrl;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
if (($nbFiles + $nbLinks) > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
|
@ -125,22 +126,22 @@ function conferenceorboothProjectPrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_list.php", 1).'?projectid='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . 'eventorganization/conferenceorbooth_list.php?projectid=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("ConferenceOrBooth");
|
||||
$head[$h][2] = 'conferenceorbooth';
|
||||
// Enable caching of conf or booth count attendees
|
||||
$nbAttendees = 0;
|
||||
$nbConferenceOrBooth= 0;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||
$cachekey = 'count_conferenceorbooth_project_'.$object->id;
|
||||
$nbConferenceOrBooth = 0;
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
|
||||
$cachekey = 'count_conferenceorbooth_project_' . $object->id;
|
||||
$dataretrieved = dol_getcache($cachekey);
|
||||
if (!is_null($dataretrieved)) {
|
||||
$nbAttendees = $dataretrieved;
|
||||
} else {
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
|
||||
$conforbooth=new ConferenceOrBooth($db);
|
||||
$result = $conforbooth->fetchAll('', '', 0, 0, '(t.fk_project:=:'.((int) $object->id).')');
|
||||
if (!is_array($result) && $result<0) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorbooth.class.php';
|
||||
$conforbooth = new ConferenceOrBooth($db);
|
||||
$result = $conforbooth->fetchAll('', '', 0, 0, '(t.fk_project:=:' . ((int) $object->id) . ')');
|
||||
if (!is_array($result) && $result < 0) {
|
||||
setEventMessages($conforbooth->error, $conforbooth->errors, 'errors');
|
||||
} else {
|
||||
$nbConferenceOrBooth = count($result);
|
||||
|
|
@ -148,25 +149,25 @@ function conferenceorboothProjectPrepareHead($object)
|
|||
dol_setcache($cachekey, $nbConferenceOrBooth, 120); // If setting cache fails, this is not a problem, so we do not test result.
|
||||
}
|
||||
if ($nbConferenceOrBooth > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbConferenceOrBooth.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbConferenceOrBooth . '</span>';
|
||||
}
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_list.php", 1).'?fk_project='.$object->id.'&withproject=1';
|
||||
$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorboothattendee_list.php?fk_project=' . $object->id . '&withproject=1';
|
||||
$head[$h][1] = $langs->trans("Attendees");
|
||||
$head[$h][2] = 'attendees';
|
||||
// Enable caching of conf or booth count attendees
|
||||
$nbAttendees = 0;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||
$cachekey = 'count_attendees_conferenceorbooth_project_'.$object->id;
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
|
||||
$cachekey = 'count_attendees_conferenceorbooth_project_' . $object->id;
|
||||
$dataretrieved = dol_getcache($cachekey);
|
||||
if (!is_null($dataretrieved)) {
|
||||
$nbAttendees = $dataretrieved;
|
||||
} else {
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
$attendees=new ConferenceOrBoothAttendee($db);
|
||||
$result = $attendees->fetchAll('', '', 0, 0, '(t.fk_project:=:'.((int) $object->id).')');
|
||||
if (!is_array($result) && $result<0) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
$attendees = new ConferenceOrBoothAttendee($db);
|
||||
$result = $attendees->fetchAll('', '', 0, 0, '(t.fk_project:=:' . ((int) $object->id) . ')');
|
||||
if (!is_array($result) && $result < 0) {
|
||||
setEventMessages($attendees->error, $attendees->errors, 'errors');
|
||||
} else {
|
||||
$nbAttendees = count($result);
|
||||
|
|
@ -174,7 +175,7 @@ function conferenceorboothProjectPrepareHead($object)
|
|||
dol_setcache($cachekey, $nbAttendees, 120); // If setting cache fails, this is not a problem, so we do not test result.
|
||||
}
|
||||
if ($nbAttendees > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbAttendees.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbAttendees . '</span>';
|
||||
}
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'conferenceorboothproject@eventorganization');
|
||||
|
|
@ -200,7 +201,7 @@ function conferenceorboothAttendeePrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/eventorganization/conferenceorboothattendee_card.php?id=".((int) $object->id).($object->fk_actioncomm > 0 ? '&conforboothid='.((int) $object->fk_actioncomm) : '').($object->fk_project > 0 ? '&withproject=1&fk_project='.((int) $object->fk_project) : '');
|
||||
$head[$h][0] = DOL_URL_ROOT . "/eventorganization/conferenceorboothattendee_card.php?id=" . ((int) $object->id) . ($object->fk_actioncomm > 0 ? '&conforboothid=' . ((int) $object->fk_actioncomm) : '') . ($object->fk_project > 0 ? '&withproject=1&fk_project=' . ((int) $object->fk_project) : '');
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -2763,7 +2763,7 @@ if ($action == 'create') {
|
|||
|
||||
// Presend form
|
||||
$modelmail = 'shipping_send';
|
||||
$defaulttopic = $langs->trans('SendShippingRef');
|
||||
$defaulttopic = 'SendShippingRef';
|
||||
$diroutput = $conf->expedition->dir_output.'/sending';
|
||||
$trackid = 'shi'.$object->id;
|
||||
|
||||
|
|
|
|||
|
|
@ -1376,13 +1376,18 @@ class Expedition extends CommonObject
|
|||
* Delete shipment.
|
||||
* Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element)
|
||||
*
|
||||
* @param int $notrigger Disable triggers
|
||||
* @param bool $also_update_stock true if the stock should be increased back (false by default)
|
||||
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
|
||||
* @param User $user User making the deletion
|
||||
* @param int $notrigger Disable triggers
|
||||
* @param bool $also_update_stock true if the stock should be increased back (false by default)
|
||||
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
|
||||
*/
|
||||
public function delete($notrigger = 0, $also_update_stock = false)
|
||||
public function delete($user = null, $notrigger = 0, $also_update_stock = false)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
global $conf, $langs;
|
||||
|
||||
if (empty($user)) {
|
||||
global $user;
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -4158,6 +4158,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||
/**
|
||||
* Delete line in database
|
||||
*
|
||||
* @param User $user User making the change
|
||||
* @param int $notrigger 1=Disable call to triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -428,13 +428,15 @@ class PaiementFourn extends Paiement
|
|||
* Si le paiement porte sur un ecriture compte qui est rapprochee, on refuse
|
||||
* Si le paiement porte sur au moins une facture a "payee", on refuse
|
||||
* @TODO Add User $user as first param
|
||||
*
|
||||
* @param User $user User making the deletion
|
||||
* @param int $notrigger No trigger
|
||||
* @return int Return integer <0 si ko, >0 si ok
|
||||
* @return int Return integer <0 si ko, >0 si ok
|
||||
*/
|
||||
public function delete($notrigger = 0)
|
||||
public function delete($user = null, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
if (empty($user)) {
|
||||
global $user;
|
||||
}
|
||||
|
||||
$bank_line_id = $this->bank_line;
|
||||
|
||||
|
|
|
|||
|
|
@ -747,7 +747,7 @@ if (empty($reshook)) {
|
|||
$paiementfourn = new PaiementFourn($db);
|
||||
$result = $paiementfourn->fetch(GETPOST('paiement_id'));
|
||||
if ($result > 0) {
|
||||
$result = $paiementfourn->delete();
|
||||
$result = $paiementfourn->delete($user);
|
||||
if ($result > 0) {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight("fournis
|
|||
$db->begin();
|
||||
|
||||
$object->fetch($id);
|
||||
$result = $object->delete();
|
||||
$result = $object->delete($user);
|
||||
if ($result > 0) {
|
||||
$db->commit();
|
||||
header('Location: '.DOL_URL_ROOT.'/fourn/paiement/list.php');
|
||||
|
|
|
|||
|
|
@ -326,16 +326,18 @@ class Establishment extends CommonObject
|
|||
/**
|
||||
* Delete record
|
||||
*
|
||||
* @param User $user User making the change
|
||||
* @param int $id Id of record to delete
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete($id)
|
||||
public function delete($user)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."establishment WHERE rowid = ".((int) $id);
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."establishment WHERE rowid = ".((int) $user->id);
|
||||
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$this->db->commit();
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ class Job extends CommonObject
|
|||
* @param string $filtermode No more used
|
||||
* @return array|int int <0 if KO, array of pages if OK
|
||||
*/
|
||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ if (empty($permissiontoread)) {
|
|||
*/
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == "yes") {
|
||||
$result = $object->delete($id);
|
||||
$result = $object->delete($user);
|
||||
if ($result >= 0) {
|
||||
header("Location: ../admin/admin_establishment.php");
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ if ($reshook < 0) {
|
|||
}
|
||||
|
||||
if ($permissiontodelete && $action == 'confirm_delete' && $confirm == 'yes') {
|
||||
$result = $object->delete($id, $user);
|
||||
$result = $object->delete($user);
|
||||
if ($result > 0) {
|
||||
if (!empty($backtopage)) {
|
||||
header("Location: ".$backtopage);
|
||||
|
|
|
|||
|
|
@ -134,12 +134,11 @@ class IntracommReport extends CommonObject
|
|||
/**
|
||||
* Function delete
|
||||
*
|
||||
* @param int $id object ID
|
||||
* @param User $user User
|
||||
* @param int $notrigger notrigger
|
||||
* @return int
|
||||
*/
|
||||
public function delete($id, $user, $notrigger = 0)
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class Loan extends CommonObject
|
|||
public $fk_project;
|
||||
|
||||
/**
|
||||
* @var int totalpaid
|
||||
* @var float totalpaid
|
||||
*/
|
||||
public $totalpaid;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2014-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2023 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -61,7 +61,10 @@ class PaymentLoan extends CommonObject
|
|||
*/
|
||||
public $datep = '';
|
||||
|
||||
public $amounts = array(); // Array of amounts
|
||||
/**
|
||||
* @var array Array of amounts
|
||||
*/
|
||||
public $amounts = array();
|
||||
|
||||
public $amount_capital; // Total amount of payment
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class MyModuleApi extends DolibarrApi
|
|||
* @param int $id ID of myobject
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET myobjects/{id}
|
||||
* @url GET mymodule/myobjects/{id}
|
||||
*
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 404 Not found
|
||||
|
|
@ -103,7 +103,7 @@ class MyModuleApi extends DolibarrApi
|
|||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 503 System error
|
||||
*
|
||||
* @url GET /myobjects/
|
||||
* @url GET /mymodule/myobjects/
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
|
|
@ -191,7 +191,7 @@ class MyModuleApi extends DolibarrApi
|
|||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url POST myobjects/
|
||||
* @url POST mymodule/myobjects/
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
|
|
@ -232,7 +232,7 @@ class MyModuleApi extends DolibarrApi
|
|||
* @throws RestException 404 Not found
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url PUT myobjects/{id}
|
||||
* @url PUT mymodule/myobjects/{id}
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
|
|
@ -282,7 +282,7 @@ class MyModuleApi extends DolibarrApi
|
|||
* @throws RestException 409 Nothing to do
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url DELETE myobjects/{id}
|
||||
* @url DELETE mymodule/myobjects/{id}
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,24 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Laurent Destailleur (eldy) <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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/mrp/ajax/interface.php
|
||||
* \brief Ajax search component for Mrp.
|
||||
*/
|
||||
|
||||
if (!defined('NOREQUIRESOC')) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 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
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file mrp/lib/mrp.lib.php
|
||||
* \file htdocs/mrp/lib/mrp.lib.php
|
||||
* \ingroup mrp
|
||||
* \brief Library files with common functions for Mrp
|
||||
*/
|
||||
|
|
@ -38,21 +39,21 @@ function mrpAdminPrepareHead()
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/admin/mrp.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/admin/mrp.php';
|
||||
$head[$h][1] = $langs->trans("Settings");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/admin/mrp_extrafields.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/admin/mrp_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['mrp_mo']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'mrp_extrafields';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/admin/mrp_production_extrafields.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/admin/mrp_production_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$head[$h][2] = 'mrp_production_extrafields';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* 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
|
||||
|
|
@ -36,26 +37,26 @@ function moPrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/mrp/mo_card.php?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/mrp/mo_card.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("ManufacturingOrder");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/mrp/mo_production.php?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/mrp/mo_production.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Production");
|
||||
$arrayproduced = $object->fetchLinesLinked('produced', 0);
|
||||
$nbProduced = 0;
|
||||
foreach ($arrayproduced as $lineproduced) {
|
||||
$nbProduced += $lineproduced['qty'];
|
||||
}
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbProduced.' / '.$object->qty.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbProduced . ' / ' . $object->qty . '</span>';
|
||||
$head[$h][2] = 'production';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/mrp/mo_movements.php?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/mrp/mo_movements.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("StockMovements");
|
||||
$nbMove = $object->countMovements();
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbMove.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbMove . '</span>';
|
||||
$head[$h][2] = 'stockmovement';
|
||||
$h++;
|
||||
|
||||
|
|
@ -67,29 +68,29 @@ function moPrepareHead($object)
|
|||
if (!empty($object->note_public)) {
|
||||
$nbNote++;
|
||||
}
|
||||
$head[$h][0] = dol_buildpath('/mrp/mo_note.php', 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/mrp/mo_note.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->mrp->dir_output."/".dol_sanitizeFileName($object->ref);
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||
$upload_dir = $conf->mrp->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = dol_buildpath("/mrp/mo_document.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/mrp/mo_document.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
if (($nbFiles + $nbLinks) > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/mrp/mo_agenda.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/mrp/mo_agenda.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* 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
|
||||
|
|
@ -30,8 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
dol_include_once('/mrp/class/mo.class.php');
|
||||
dol_include_once('/mrp/lib/mrp_mo.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2007-2017 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
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file mo_document.php
|
||||
* \file htdocs/mrp/mo_document.php
|
||||
* \ingroup mrp
|
||||
* \brief Tab for documents linked to Mo
|
||||
*/
|
||||
|
|
@ -30,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
dol_include_once('/mrp/class/mo.class.php');
|
||||
dol_include_once('/mrp/lib/mrp_mo.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp", "companies", "other", "mails"));
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
|
||||
* 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
|
||||
|
|
@ -33,8 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
|
||||
|
||||
dol_include_once('/mrp/class/mo.class.php');
|
||||
dol_include_once('/mrp/lib/mrp_mo.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp", "stocks", "other"));
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2007-2017 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
|
||||
|
|
@ -26,8 +27,8 @@ require '../main.inc.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
|
||||
dol_include_once('/mrp/class/mo.class.php');
|
||||
dol_include_once('/mrp/lib/mrp_mo.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp", "companies"));
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2019-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2023 Christian Humpel <christian.humpel@gmail.com>
|
||||
* Copyright (C) 2023 Vincent de Grandpré <vincent@de-grandpre.quebec>
|
||||
* 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
|
||||
|
|
@ -96,7 +97,7 @@ $result = restrictedArea($user, 'mrp', $object->id, 'mrp_mo', '', 'fk_soc', 'row
|
|||
$permissionnote = $user->hasRight('mrp', 'write'); // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $user->hasRight('mrp', 'write'); // Used by the include of actions_dellink.inc.php
|
||||
$permissiontoadd = $user->hasRight('mrp', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
$permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
||||
$permissiontodelete = $user->hasRight('mrp', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
||||
|
||||
$permissiontoproduce = $permissiontoadd;
|
||||
$permissiontoupdatecost = $user->hasRight('bom', 'read'); // User who can define cost must have knowledge of pricing
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2021 Dorian Laurent <i.merraha@sofimedmaroc.com>
|
||||
/* Copyright (C) 2021 Dorian Laurent <i.merraha@sofimedmaroc.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
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file partnership/lib/partnership.lib.php
|
||||
* \file htdocs/partnership/lib/partnership.lib.php
|
||||
* \ingroup partnership
|
||||
* \brief Library files with common functions for Partnership
|
||||
*/
|
||||
|
|
@ -38,22 +39,22 @@ function partnershipAdminPrepareHead()
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/partnership/admin/setup.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/partnership/admin/setup.php';
|
||||
$head[$h][1] = $langs->trans("Settings");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
|
||||
$head[$h][0] = dol_buildpath("/partnership/admin/partnership_extrafields.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/partnership/admin/partnership_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['partnership']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'partnership_extrafields';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/partnership/admin/website.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/partnership/admin/website.php';
|
||||
$head[$h][1] = $langs->trans("BlankSubscriptionForm");
|
||||
$head[$h][2] = 'website';
|
||||
$h++;
|
||||
|
|
@ -88,7 +89,7 @@ function partnershipPrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/partnership/partnership_card.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_card.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
|
@ -101,29 +102,29 @@ function partnershipPrepareHead($object)
|
|||
if (!empty($object->note_public)) {
|
||||
$nbNote++;
|
||||
}
|
||||
$head[$h][0] = dol_buildpath('/partnership/partnership_note.php', 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_note.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
|
||||
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">' . $nbNote . '</span>' : '');
|
||||
}
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->partnership->dir_output."/partnership/".dol_sanitizeFileName($object->ref);
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||
$upload_dir = $conf->partnership->dir_output . "/partnership/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = dol_buildpath("/partnership/partnership_document.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_document.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
if (($nbFiles + $nbLinks) > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/partnership/partnership_agenda.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_agenda.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,11 @@ class Product extends CommonObject
|
|||
*/
|
||||
public $fk_element = 'fk_product';
|
||||
|
||||
/**
|
||||
* @var Product
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
*/
|
||||
|
|
@ -290,7 +295,7 @@ class Product extends CommonObject
|
|||
public $duration;
|
||||
|
||||
/**
|
||||
* Service Workstation
|
||||
* @var int Service Workstation
|
||||
*/
|
||||
public $fk_default_workstation;
|
||||
|
||||
|
|
@ -487,6 +492,10 @@ class Product extends CommonObject
|
|||
public $fourn_qty;
|
||||
public $fourn_pu;
|
||||
public $fourn_price_base_type;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fourn_socid;
|
||||
|
||||
/**
|
||||
|
|
@ -529,7 +538,7 @@ class Product extends CommonObject
|
|||
public $sousprods;
|
||||
|
||||
/**
|
||||
* Path of subproducts. Build from ->sousprods with get_arbo_each_prod()
|
||||
* @var array Path of subproducts. Build from ->sousprods with get_arbo_each_prod()
|
||||
*/
|
||||
public $res;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022-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
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file recruitment/lib/recruitment.lib.php
|
||||
* \file htdocs/recruitment/lib/recruitment.lib.php
|
||||
* \ingroup recruitment
|
||||
* \brief Library files with common functions for Recruitment
|
||||
*/
|
||||
|
|
@ -40,35 +40,35 @@ function recruitmentAdminPrepareHead()
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/admin/setup.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/setup.php';
|
||||
$head[$h][1] = $langs->trans("JobPositions");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/admin/setup_candidatures.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/setup_candidatures.php';
|
||||
$head[$h][1] = $langs->trans("RecruitmentCandidatures");
|
||||
$head[$h][2] = 'settings_candidatures';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/admin/public_interface.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/public_interface.php';
|
||||
$head[$h][1] = $langs->trans("PublicUrl");
|
||||
$head[$h][2] = 'publicurl';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/admin/jobposition_extrafields.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/jobposition_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtrafieldsJobPosition");
|
||||
$nbExtrafields = $extrafields->attributes['recruitment_recruitmentjobposition']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'jobposition_extrafields';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/admin/candidature_extrafields.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/candidature_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtrafieldsApplication");
|
||||
$nbExtrafields = $extrafields->attributes['recruitment_recruitmentcandidature']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'candidature_extrafields';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* 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
|
||||
|
|
@ -36,13 +37,13 @@ function recruitmentCandidaturePrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/recruitmentcandidature_card.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_card.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("RecruitmentCandidature");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
// if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
// $head[$h][0] = dol_buildpath("/recruitment/recruitmentrating_card.php", 1).'?id='.$object->id;
|
||||
// $head[$h][0] = DOL_URL_ROOT.'/recruitment/recruitmentrating_card.php?id='.$object->id;
|
||||
// $head[$h][1] = $langs->trans("Rating");
|
||||
// $head[$h][2] = 'rating';
|
||||
// $h++;
|
||||
|
|
@ -56,29 +57,29 @@ function recruitmentCandidaturePrepareHead($object)
|
|||
if (!empty($object->note_public)) {
|
||||
$nbNote++;
|
||||
}
|
||||
$head[$h][0] = dol_buildpath('/recruitment/recruitmentcandidature_note.php', 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_note.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->recruitment->dir_output."/recruitmentcandidature/".dol_sanitizeFileName($object->ref);
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||
$upload_dir = $conf->recruitment->dir_output . "/recruitmentcandidature/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = dol_buildpath("/recruitment/recruitmentcandidature_document.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_document.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
if (($nbFiles + $nbLinks) > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/recruitmentcandidature_agenda.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_agenda.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* 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
|
||||
|
|
@ -36,21 +37,21 @@ function recruitmentjobpositionPrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/recruitmentjobposition_card.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentjobposition_card.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("PositionToBeFilled");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/recruitmentcandidature_list.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_list.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("RecruitmentCandidatures");
|
||||
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature WHERE fk_recruitmentjobposition = ".((int) $object->id);
|
||||
$sql = "SELECT COUNT(rowid) as nb FROM " . MAIN_DB_PREFIX . "recruitment_recruitmentcandidature WHERE fk_recruitmentjobposition = " . ((int) $object->id);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
$nCandidature = $obj->nb;
|
||||
if ($nCandidature > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nCandidature.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nCandidature . '</span>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -67,29 +68,29 @@ function recruitmentjobpositionPrepareHead($object)
|
|||
if (!empty($object->note_public)) {
|
||||
$nbNote++;
|
||||
}
|
||||
$head[$h][0] = dol_buildpath('/recruitment/recruitmentjobposition_note.php', 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentjobposition_note.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->recruitment->dir_output."/recruitmentjobposition/".dol_sanitizeFileName($object->ref);
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||
$upload_dir = $conf->recruitment->dir_output . "/recruitmentjobposition/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = dol_buildpath("/recruitment/recruitmentjobposition_document.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentjobposition_document.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
if (($nbFiles + $nbLinks) > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>';
|
||||
}
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/recruitment/recruitmentjobposition_agenda.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentjobposition_agenda.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
|
@ -126,8 +127,8 @@ function getPublicJobPositionUrl($mode, $ref = '', $localorexternal = 0)
|
|||
$out = '';
|
||||
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
$urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot . DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
$urltouse = DOL_MAIN_URL_ROOT;
|
||||
|
|
@ -135,7 +136,7 @@ function getPublicJobPositionUrl($mode, $ref = '', $localorexternal = 0)
|
|||
$urltouse = $urlwithroot;
|
||||
}
|
||||
|
||||
$out = $urltouse.'/public/recruitment/view.php?ref='.($mode ? '<span style="color: #666666">' : '').$ref.($mode ? '</span>' : '');
|
||||
$out = $urltouse . '/public/recruitment/view.php?ref=' . ($mode ? '<span style="color: #666666">' : '') . $ref . ($mode ? '</span>' : '');
|
||||
/*if (!empty($conf->global->RECRUITMENT_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->RECRUITMENT_SECURITY_TOKEN)) $out .= '&securekey='.urlencode($conf->global->RECRUITMENT_SECURITY_TOKEN);
|
||||
|
|
@ -144,7 +145,7 @@ function getPublicJobPositionUrl($mode, $ref = '', $localorexternal = 0)
|
|||
|
||||
// For multicompany
|
||||
if (!empty($out) && isModEnabled('multicompany')) {
|
||||
$out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities
|
||||
$out .= "&entity=" . $conf->entity; // Check the entity because we may have the same reference in several entities
|
||||
}
|
||||
|
||||
return $out;
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ if (empty($reshook)) {
|
|||
if ($action == 'confirm_delete_resource' && $user->hasRight('resource', 'delete') && $confirm === 'yes') {
|
||||
$res = $object->fetch($id);
|
||||
if ($res > 0) {
|
||||
$result = $object->delete($id);
|
||||
$result = $object->delete($user);
|
||||
|
||||
if ($result >= 0) {
|
||||
setEventMessages($langs->trans('RessourceSuccessfullyDeleted'), null);
|
||||
|
|
|
|||
|
|
@ -520,13 +520,14 @@ class Dolresource extends CommonObject
|
|||
/**
|
||||
* Delete a resource object
|
||||
*
|
||||
* @param int $rowid Id of resource line to delete
|
||||
* @param User $user User making the change
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @return int if OK: >0 || if KO: <0
|
||||
*/
|
||||
public function delete(int $rowid, int $notrigger = 0)
|
||||
public function delete(User $user, int $notrigger = 0)
|
||||
{
|
||||
global $user, $conf;
|
||||
global $conf;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$error = 0;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2013-2014 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.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
|
||||
|
|
@ -31,37 +32,37 @@ require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
|
|||
$langs->loadLangs(array("resource", "companies", "other"));
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOSTINT('id');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$id = GETPOSTINT('id');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'interventionlist';
|
||||
|
||||
$lineid = GETPOSTINT('lineid');
|
||||
$element = GETPOST('element', 'alpha');
|
||||
$element_id = GETPOSTINT('element_id');
|
||||
$resource_id = GETPOSTINT('resource_id');
|
||||
$lineid = GETPOSTINT('lineid');
|
||||
$element = GETPOST('element', 'alpha');
|
||||
$element_id = GETPOSTINT('element_id');
|
||||
$resource_id = GETPOSTINT('resource_id');
|
||||
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
// Initialize context for list
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'resourcelist';
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'resourcelist';
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new Dolresource($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
if (!is_array($search_array_options)) {
|
||||
$search_array_options = array();
|
||||
}
|
||||
$search_ref = GETPOST("search_ref", 'alpha');
|
||||
$search_type = GETPOST("search_type", 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$search_ref = GETPOST("search_ref", 'alpha');
|
||||
$search_type = GETPOST("search_type", 'alpha');
|
||||
|
||||
$filter = array();
|
||||
|
||||
|
|
@ -73,12 +74,11 @@ if (empty($sortorder)) {
|
|||
if (empty($sortfield)) {
|
||||
$sortfield = "t.ref";
|
||||
}
|
||||
if (empty($arch)) {
|
||||
$arch = 0;
|
||||
}
|
||||
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
// Load variable for pagination
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
@ -102,21 +102,28 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
|||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
|
||||
$search_ref = "";
|
||||
$search_type = "";
|
||||
$toselect = array();
|
||||
$search_array_options = array();
|
||||
$filter = array();
|
||||
}
|
||||
|
||||
if (!$user->hasRight('resource', 'read')) {
|
||||
$permissiontoread = $user->hasRight('resource', 'read');
|
||||
$permissiontoadd = $user->hasRight('resource', 'write');
|
||||
$permissiontodelete = $user->hasRight('resource', 'delete');
|
||||
if (!$permissiontoread) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass = 'Dolresource';
|
||||
$objectlabel = 'Resources';
|
||||
$uploaddir = $conf->resource->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
|
@ -136,21 +143,126 @@ if ($reshook < 0) {
|
|||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$objectstatic = new Dolresource($db);
|
||||
|
||||
//$help_url="EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
|
||||
$help_url = '';
|
||||
$title = $langs->trans('Resources');
|
||||
llxHeader('', $title, $help_url);
|
||||
$morejs = array();
|
||||
$morecss = array();
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
$sql = '';
|
||||
$sql = "SELECT";
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.entity,";
|
||||
$sql .= " t.ref,";
|
||||
$sql .= " t.address,";
|
||||
$sql .= " t.zip,";
|
||||
$sql .= " t.town,";
|
||||
$sql .= " t.fk_country,";
|
||||
$sql .= " t.fk_state,";
|
||||
$sql .= " t.description,";
|
||||
$sql .= " t.phone,";
|
||||
$sql .= " t.email,";
|
||||
$sql .= " t.max_users,";
|
||||
$sql .= " t.url,";
|
||||
$sql .= " t.fk_code_type_resource,";
|
||||
$sql .= " t.tms as date_modification,";
|
||||
$sql .= " t.datec as date_creation, ";
|
||||
$sql .= " ty.label as type_label ";
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sqlfields = $sql; // $sql fields to remove for count total
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."resource as t";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_resource as ty ON ty.code=t.fk_code_type_resource";
|
||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
}
|
||||
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " WHERE t.entity IN (".getEntity('resource').")";
|
||||
if ($search_ref) {
|
||||
$sql .= natural_search('t.ref', $search_ref);
|
||||
}
|
||||
if ($search_type) {
|
||||
$sql .= natural_search('ty.label', $search_type);
|
||||
}
|
||||
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
$resql = $db->query($sqlforcount);
|
||||
if ($resql) {
|
||||
$objforcount = $db->fetch_object($resql);
|
||||
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
// Complete request and execute it with limit
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
// Direct jump if only one record found
|
||||
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && !$page) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".dol_buildpath('/resource/card.php', 1).'?id='.$id);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Output page
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
|
|
@ -159,38 +271,29 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
|||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.((int) $limit);
|
||||
}
|
||||
|
||||
if ($search_ref != '') {
|
||||
$param .= '&search_ref='.urlencode($search_ref);
|
||||
$filter['t.ref'] = $search_ref;
|
||||
}
|
||||
if ($search_type != '') {
|
||||
$param .= '&search_type='.urlencode($search_type);
|
||||
$filter['ty.label'] = $search_type;
|
||||
}
|
||||
|
||||
// Including the previous script generate the correct SQL filter for all the extrafields
|
||||
// we are playing with the behaviour of the Dolresource::fetchAll() by generating a fake
|
||||
// extrafields filter key to make it works
|
||||
$filter['ef.resource'] = $sql;
|
||||
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
||||
|
||||
// Confirmation suppression resource line
|
||||
if ($action == 'delete_resource') {
|
||||
print $form->formconfirm($_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id."&lineid=".$lineid, $langs->trans("DeleteResource"), $langs->trans("ConfirmDeleteResourceElement"), "confirm_delete_resource", '', '', 1);
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array();
|
||||
if (!empty($permissiontodelete)) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
|
|
@ -200,71 +303,58 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
|||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$ret = $object->fetchAll('', '', 0, 0, $filter);
|
||||
if ($ret == -1) {
|
||||
dol_print_error($db, $object->error);
|
||||
exit;
|
||||
} else {
|
||||
$nbtotalofrecords = $ret;
|
||||
}
|
||||
}
|
||||
$newcardbutton = '';
|
||||
$url = DOL_URL_ROOT.'/resource/card.php?action=create';
|
||||
|
||||
// Load object list
|
||||
$ret = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter);
|
||||
if ($ret == -1) {
|
||||
dol_print_error($db, $object->error);
|
||||
exit;
|
||||
} else {
|
||||
$newcardbutton = '';
|
||||
if ($user->hasRight('resource', 'write')) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('MenuResourceAdd'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/resource/card.php?action=create');
|
||||
}
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewResource'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret + 1, $nbtotalofrecords, 'object_resource', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
}
|
||||
print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$moreforfilter = '';
|
||||
$objecttmp = new Dolresource($db);
|
||||
$trackid = 'int'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = ($form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'))); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
print '<table class="tagtable liste">'."\n";
|
||||
|
||||
// Fields title search
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.ref']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_ref" value="'.$search_ref.'" size="6">';
|
||||
print '<input type="text" class="flat" name="search_ref" value="'.$search_ref.'" size="8">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['ty.label']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_type" value="'.$search_type.'" size="6">';
|
||||
print '<input type="text" class="flat" name="search_type" value="'.$search_type.'" size="8">';
|
||||
print '</td>';
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print '<td class="liste_titre center maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
|
||||
// Fields title label
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
}
|
||||
if (!empty($arrayfields['t.ref']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.ref']['label'], $_SERVER["PHP_SELF"], "t.ref", "", $param, "", $sortfield, $sortorder);
|
||||
}
|
||||
|
|
@ -279,77 +369,84 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|||
}
|
||||
print "</tr>\n";
|
||||
|
||||
// Loop on record
|
||||
|
||||
$i = 0;
|
||||
$savnbfield = $totalarray['nbfield'];
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||
while ($i < $imaxinloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$objectstatic->id = $obj->rowid;
|
||||
$objectstatic->ref = $obj->ref;
|
||||
$objectstatic->type_label = $obj->type_label;
|
||||
|
||||
if ($ret) {
|
||||
foreach ($object->lines as $resource) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda" href="./card.php?action=edit&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print ' ';
|
||||
print '<a href="./card.php?action=delete&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_delete('', 'class="marginleftonly"');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['t.ref']['checked'])) {
|
||||
print '<td>';
|
||||
print $resource->getNomUrl(5);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['ty.label']['checked'])) {
|
||||
print '<td>';
|
||||
print $resource->type_label;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
$obj = (object) $resource->array_options;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda" href="./card.php?action=edit&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print ' ';
|
||||
print '<a href="./card.php?action=delete&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_delete('', 'class="marginleftonly"');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.ref']['checked'])) {
|
||||
print '<td>';
|
||||
print $objectstatic->getNomUrl(5);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
} else {
|
||||
|
||||
if (!empty($arrayfields['ty.label']['checked'])) {
|
||||
print '<td>';
|
||||
print $objectstatic->type_label;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Show total line
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||
|
||||
// If no record found
|
||||
if ($num == 0) {
|
||||
$colspan = 1;
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
}
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>'."\n";
|
||||
print '</form>'."\n";
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
|
||||
* 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
|
||||
|
|
@ -30,8 +31,14 @@ include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
|||
*/
|
||||
class Client extends Societe
|
||||
{
|
||||
public $next_prev_filter = "te.client in (1,2,3)"; // Used to add a filter in Form::showrefnav method
|
||||
/**
|
||||
* @var string Used to add a filter in Form::showrefnav method
|
||||
*/
|
||||
public $next_prev_filter = "te.client in (1,2,3)";
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $cacheprospectstatus = array();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2111,7 +2111,7 @@ class Societe extends CommonObject
|
|||
*/
|
||||
public function delete($id, User $fuser = null, $call_trigger = 1)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
global $conf, $user;
|
||||
|
||||
if (empty($fuser)) {
|
||||
$fuser = $user;
|
||||
|
|
|
|||
|
|
@ -806,7 +806,7 @@ if (empty($reshook)) {
|
|||
$sql .= " WHERE sr.stripe_card_ref = '".$db->escape($source)."'";
|
||||
$resql = $db->query($sql);
|
||||
} else {
|
||||
$card->delete();
|
||||
$card->delete($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -836,9 +836,10 @@ if (empty($reshook)) {
|
|||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib as sr ";
|
||||
$sql .= " SET stripe_card_ref = null";
|
||||
$sql .= " WHERE sr.stripe_card_ref = '".$db->escape($source)."'";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
} else {
|
||||
$card->delete();
|
||||
$card->delete($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,28 @@
|
|||
<?php
|
||||
/*
|
||||
/* Copyright (C) 2004-2017 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/theme/eldy/flag-sprite.inc.php
|
||||
* \brief File for CSS style sheet Eldy
|
||||
*/
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
die('Must be call by stylesheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > don't remove this line it's an ide hack */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,26 @@
|
|||
<?php
|
||||
/*
|
||||
/* Copyright (C) 2004-2017 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/theme/eldy/global.inc.php
|
||||
* \brief File for CSS style sheet Eldy
|
||||
*/
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,30 @@
|
|||
<?php if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
<?php
|
||||
/*
|
||||
/* Copyright (C) 2004-2017 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/theme/eldy/global.inc.php
|
||||
* \brief File for CSS style sheet Eldy
|
||||
*/
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by stylesheet');
|
||||
}
|
||||
?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
.mainmenu::before{
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ class Tickets extends DolibarrApi
|
|||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
if (!$this->ticket->delete($id)) {
|
||||
if (!$this->ticket->delete($user)) {
|
||||
throw new RestException(500, 'Error when deleting ticket');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1133,7 +1133,6 @@ class Ticket extends CommonObject
|
|||
*/
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 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
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file webhook/lib/webhook.lib.php
|
||||
* \file htdocs/webhook/lib/webhook.lib.php
|
||||
* \ingroup webhook
|
||||
* \brief Library files with common functions for Webhook
|
||||
*/
|
||||
|
|
@ -32,12 +33,12 @@ function webhookAdminPrepareHead()
|
|||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
$head[$h][0] = dol_buildpath("/admin/webhook.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/admin/webhook.php';
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/webhook/target_list.php?mode=modulesetup", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/webhook/target_list.php?mode=modulesetup';
|
||||
$head[$h][1] = $langs->trans("Targets");
|
||||
$head[$h][2] = 'targets';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2022 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
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file lib/webhook_target.lib.php
|
||||
* \file htdocs/webhook/lib/webhook_target.lib.php
|
||||
* \ingroup webhook
|
||||
* \brief Library files with common functions for Target
|
||||
*/
|
||||
|
|
@ -24,7 +25,7 @@
|
|||
* Prepare array of tabs for Target
|
||||
*
|
||||
* @param Target $object Target
|
||||
* @return array Array of tabs
|
||||
* @return array Returns an array of tabs
|
||||
*/
|
||||
function targetPrepareHead($object)
|
||||
{
|
||||
|
|
@ -33,7 +34,7 @@ function targetPrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/webhook/target_card.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/webhook/target_card.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -41,17 +41,17 @@ function webportalAdminPrepareHead()
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/webportal/admin/setup.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '"/webportal/admin/setup.php';
|
||||
$head[$h][1] = $langs->trans("Settings");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/webportal/admin/setup_theme.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/webportal/admin/setup_theme.php';
|
||||
$head[$h][1] = $langs->trans("SkinAndColors");
|
||||
$head[$h][2] = 'themesettings';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/webportal/admin/configcss.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/webportal/admin/configcss.php';
|
||||
$head[$h][1] = $langs->trans("CSSPage");
|
||||
$head[$h][2] = 'css';
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 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
|
||||
|
|
@ -34,13 +35,12 @@ function websiteaccountPrepareHead($object)
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/website/websiteaccount_card.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/website/websiteaccount_card.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("WebsiteAccount");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
/*if (isset($object->fields['note_public']) || isset($object->fields['note_private']))
|
||||
{
|
||||
/*if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) {
|
||||
$nbNote = 0;
|
||||
if(!empty($object->fields['note_private'])) $nbNote++;
|
||||
if(!empty($object->fields['note_public'])) $nbNote++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Frédéric FRANCE <frederic.france@free.fr>
|
||||
/* Copyright (C) 2019-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
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file zapier/lib/zapier.lib.php
|
||||
* \file htdocs/zapier/lib/zapier.lib.php
|
||||
* \ingroup zapier
|
||||
* \brief Library files with common functions for ZapierForDolibarr
|
||||
*/
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
/**
|
||||
* Prepare admin pages header
|
||||
*
|
||||
* @return array Array with list of tab entries
|
||||
* @return array Returns an array with list of tab entries
|
||||
*/
|
||||
function zapierAdminPrepareHead()
|
||||
{
|
||||
|
|
@ -33,11 +33,11 @@ function zapierAdminPrepareHead()
|
|||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/zapier/admin/setup.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/zapier/admin/setup.php';
|
||||
$head[$h][1] = $langs->trans("Settings");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
$head[$h][0] = dol_buildpath("/zapier/admin/about.php", 1);
|
||||
$head[$h][0] = DOL_URL_ROOT . '/zapier/admin/about.php';
|
||||
$head[$h][1] = $langs->trans("About");
|
||||
$head[$h][2] = 'about';
|
||||
$h++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue