From 278b708e1729345b1d47f022ec2c55f3cd8651ad Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 11 Apr 2019 11:57:50 +0200 Subject: [PATCH 001/497] use subproducts costprice and pmp if empty on father --- htdocs/fourn/ajax/getSupplierPrices.php | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 85b0ed37155..57874e3a122 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -86,12 +86,46 @@ if ($idprod > 0) // Add price for costprice $price=$producttmp->cost_price; + if (empty($price)) + { + // get costprice for subproducts if any + $producttmp->get_sousproduits_arbo(); + $prods_arbo=$producttmp->get_arbo_each_prod(); + if (!empty($prods_arbo)) + { + $price = 0; + foreach($prods_arbo as $child) + { + $sousprod = new Product($db); + $sousprod->fetch($child['id']); + $price += $sousprod->cost_price; + } + } + } + $prices[] = array("id" => 'costprice', "price" => price2num($price), "label" => $langs->trans("CostPrice").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() if(!empty($conf->stock->enabled)) { // Add price for pmp $price=$producttmp->pmp; + if (empty($price)) + { + // get pmp for subproducts if any + $producttmp->get_sousproduits_arbo(); + $prods_arbo=$producttmp->get_arbo_each_prod(); + if (!empty($prods_arbo)) + { + $price = 0; + foreach($prods_arbo as $child) + { + $sousprod = new Product($db); + $sousprod->fetch($child['id']); + $price += $sousprod->pmp; + } + } + } + $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() } } From 30ad0e7e11260d089d30743f1536ab4248031fc8 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 16 Apr 2019 09:00:39 +0200 Subject: [PATCH 002/497] introduce PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY --- htdocs/fourn/ajax/getSupplierPrices.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 57874e3a122..211734f1129 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -86,7 +86,7 @@ if ($idprod > 0) // Add price for costprice $price=$producttmp->cost_price; - if (empty($price)) + if (empty($price) && ! empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) { // get costprice for subproducts if any $producttmp->get_sousproduits_arbo(); From 4aab805b4edfbb536690b2c279e0078374d7b165 Mon Sep 17 00:00:00 2001 From: Laurent Magnin Date: Fri, 16 Apr 2021 12:39:39 +0200 Subject: [PATCH 003/497] FIX:Add ticket substition template --- htdocs/core/lib/functions.lib.php | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2b981530834..c3ce5128f57 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6838,6 +6838,28 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, /*$substitutionarray['__MEMBER_NOTE_PUBLIC__'] = '__MEMBER_NOTE_PUBLIC__'; $substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/ } +// add variables subtitutions ticket + if (!empty($conf->ticket->enabled) && (!is_object($object) || $object->element == 'ticket')) { + $substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__'; + $substitutionarray['__TICKET_REF__'] = '__TICKET_REF__'; + $substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__'; + $substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__'; + $substitutionarray['__TICKET_SEVERITY__'] = '__TICKET_SEVERITY__'; + $substitutionarray['__TICKET_CATEGORY__'] = '__TICKET_CATEGORY__'; + $substitutionarray['__TICKET_ANALYTIC_CODE__'] = '__TICKET_ANALYTIC_CODE__'; + $substitutionarray['__TICKET_MESSAGE__'] = '__TICKET_MESSAGE__'; + $substitutionarray['__TICKET_PROGRESSION__'] = '__TICKET_PROGRESSION__'; + $substitutionarray['__TICKET_USER_ASSIGN__'] = '__TICKET_USER_ASSIGN__'; + $substitutionarray['__TICKET_USER_CREATE__'] = '__TICKET_USER_CREATE__'; + + +} + + + + + + if (!empty($conf->recruitment->enabled) && (!is_object($object) || $object->element == 'candidature')) { $substitutionarray['__CANDIDATE_FULLNAME__'] = '__CANDIDATE_FULLNAME__'; $substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__'; @@ -7025,6 +7047,21 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = dol_print_date($datenextexpiration, 'dayrfc'); $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard'); } +// add substition variable for ticket + if (is_object($object) && $object->element == 'ticket') { + $substitutionarray['__TICKET_TRACKID__'] = $object->track_id; + $substitutionarray['__TICKET_REF__'] = $object->ref; + $substitutionarray['__TICKET_SUBJECT__'] = $object->subject; + $substitutionarray['__TICKET_TYPE__'] = $object->type_code; + $substitutionarray['__TICKET_SEVERITY__'] = $object->severity_code; + $substitutionarray['__TICKET_CATEGORY__'] = $object->category_code; // For backward compatibility + $substitutionarray['__TICKET_ANALYTIC_CODE__'] = $object->category_code; + $substitutionarray['__TICKET_MESSAGE__'] = $object->message; + $substitutionarray['__TICKET_PROGRESSION__'] = $object->progress; + $substitutionarray['__TICKET_USER_ASSIGN__'] = dolGetFirstLastname($user->firstname, $user->lastname); + $substitutionarray['__TICKET_USER_CREATE__'] = dolGetFirstLastname($user->firstname, $user->lastname); + } + // Create dynamic tags for __EXTRAFIELD_FIELD__ if ($object->table_element && $object->id > 0) { From 30e04714513f99c9f31a23078fa2f11558794d30 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Thu, 10 Jun 2021 23:04:56 +0200 Subject: [PATCH 004/497] NEW: leave requests: add field into type dictionary to block request if balance is negative --- htdocs/admin/dict.php | 20 +++++++++++++++---- htdocs/holiday/class/holiday.class.php | 11 ++++++++++ .../install/mysql/migration/13.0.0-14.0.0.sql | 2 +- .../mysql/tables/llx_c_holiday_types.sql | 1 + htdocs/langs/en_US/holiday.lang | 2 ++ 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index b8bf1a5998a..2d4c651255f 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -223,7 +223,7 @@ $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFI $tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")"; //$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units"; $tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm"; -$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; +$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.block_if_negative, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; $tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; $tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; //$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s"; @@ -315,7 +315,7 @@ $tabfield[24] = "code,label"; $tabfield[25] = "code,label"; //$tabfield[26]= "code,label,short_label"; $tabfield[27] = "code,libelle,picto"; -$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country"; +$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country,block_if_negative"; $tabfield[29] = "code,label,percent,position"; $tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfield[31]= "pcg_version,label"; @@ -361,7 +361,7 @@ $tabfieldvalue[24] = "code,label"; $tabfieldvalue[25] = "code,label"; //$tabfieldvalue[26]= "code,label,short_label"; $tabfieldvalue[27] = "code,libelle,picto"; -$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country"; +$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country,block_if_negative"; $tabfieldvalue[29] = "code,label,percent,position"; $tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldvalue[31]= "pcg_version,label"; @@ -407,7 +407,7 @@ $tabfieldinsert[24] = "code,label"; $tabfieldinsert[25] = "code,label"; //$tabfieldinsert[26]= "code,label,short_label"; $tabfieldinsert[27] = "code,libelle,picto"; -$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country"; +$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country,block_if_negative"; $tabfieldinsert[29] = "code,label,percent,position"; $tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldinsert[31]= "pcg_version,label"; @@ -1413,6 +1413,9 @@ if ($id) { if ($value == 'public' && $tablib[$id] == 'TicketDictCategory') { $valuetoshow = $langs->trans('TicketGroupIsPublic'); $class = 'center'; } + if ($value == 'block_if_negative') { + $valuetoshow = $langs->trans('BlockHolidayIfNegative'); + } if ($id == 2) { // Special case for state page if ($value == 'region_id') { @@ -1758,6 +1761,9 @@ if ($id) { if ($value == 'public' && $tablib[$id] == 'TicketDictCategory') { $valuetoshow = $langs->trans('TicketGroupIsPublic'); $cssprefix = 'center '; } + if ($value == 'block_if_negative') { + $valuetoshow = $langs->trans('BlockHolidayIfNegative'); + } if ($value == 'region_id' || $value == 'country_id') { $showfield = 0; @@ -1984,6 +1990,8 @@ if ($id) { } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_productbatch_qcstatus') { $langs->load("productbatch"); $valuetoshow = $langs->trans($obj->{$value}); + } elseif ($value == 'block_if_negative') { + $valuetoshow = yn($obj->{$value}); } $class .= ($class ? ' ' : '').'tddict'; if ($value == 'note' && $id == 10) { @@ -2366,6 +2374,10 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print $form->selectExpenseRanges($obj->fk_range); print ''; + } elseif ($value == 'block_if_negative') { + print ''; + print $form->selectyesno("block_if_negative", (!empty($obj->{$value}) ? $obj->{$value}:''), 1); + print ''; } else { $fieldValue = isset($obj->{$value}) ? $obj->{$value}:''; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 7e3585bd5bc..dc992e53285 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -259,6 +259,17 @@ class Holiday extends CommonObject $this->error = "ErrorBadParameterFkType"; return -1; } + $checkBalance = getDictvalue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); + + if ($checkBalance > 0) { + $balance = $this->getCPforUser($this->fk_user, $this->fk_type); + + if ($balance < 0) { + $this->error = 'LeaveRequestCreationBlockedBecauseBalanceIsNegative'; + return -1; + } + } + // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday("; $sql .= "ref,"; diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 741d92a88a1..6cc9bbeafd6 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -543,4 +543,4 @@ create table llx_c_partnership_type active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; - +ALTER TABLE llx_c_holiday_types ADD COLUMN block_if_negative integer NOT NULL DEFAULT 0 AFTER fk_country; diff --git a/htdocs/install/mysql/tables/llx_c_holiday_types.sql b/htdocs/install/mysql/tables/llx_c_holiday_types.sql index 9c09d486bec..612df739d04 100644 --- a/htdocs/install/mysql/tables/llx_c_holiday_types.sql +++ b/htdocs/install/mysql/tables/llx_c_holiday_types.sql @@ -24,5 +24,6 @@ CREATE TABLE llx_c_holiday_types ( delay integer NOT NULL, -- Minimum delay to be allowed to make request newByMonth double(8,5) DEFAULT 0 NOT NULL, -- Amount of new days for each user each month fk_country integer DEFAULT NULL, -- This type is dedicated to a country + block_if_negative integer NOT NULL DEFAULT 0, active integer DEFAULT 1 ) ENGINE=innodb; diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 2393a02ee50..95e77130564 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -132,3 +132,5 @@ FreeLegalTextOnHolidays=Free text on PDF WatermarkOnDraftHolidayCards=Watermarks on draft leave requests HolidaysToApprove=Holidays to approve NobodyHasPermissionToValidateHolidays=Nobody has permission to validate holidays +BlockHolidayIfNegative=Block if balance negative +LeaveRequestCreationBlockedBecauseBalanceIsNegative=The creation of this leave request is blocked because your balance is negative From 084abe45474def01903f404227d2bbc71bfc4120 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 22 Jun 2021 16:27:43 +0200 Subject: [PATCH 005/497] FIX: holiday: also block if balance is negative at request update, validation and approval --- htdocs/holiday/class/holiday.class.php | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index dc992e53285..2db0f36115f 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -703,6 +703,17 @@ class Holiday extends CommonObject global $conf, $langs; $error = 0; + $checkBalance = getDictvalue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); + + if ($checkBalance > 0) { + $balance = $this->getCPforUser($this->fk_user, $this->fk_type); + + if ($balance < 0) { + $this->error = 'LeaveRequestCreationBlockedBecauseBalanceIsNegative'; + return -1; + } + } + // Define new ref if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref) || $this->ref == $this->id)) { $num = $this->getNextNumRef(null); @@ -767,6 +778,17 @@ class Holiday extends CommonObject global $conf, $langs; $error = 0; + $checkBalance = getDictvalue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); + + if ($checkBalance > 0) { + $balance = $this->getCPforUser($this->fk_user, $this->fk_type); + + if ($balance < 0) { + $this->error = 'LeaveRequestCreationBlockedBecauseBalanceIsNegative'; + return -1; + } + } + // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET"; @@ -876,6 +898,17 @@ class Holiday extends CommonObject global $conf, $langs; $error = 0; + $checkBalance = getDictvalue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); + + if ($checkBalance > 0) { + $balance = $this->getCPforUser($this->fk_user, $this->fk_type); + + if ($balance < 0) { + $this->error = 'LeaveRequestCreationBlockedBecauseBalanceIsNegative'; + return -1; + } + } + // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET"; From db0b00f93abcf4b804f5a9eaa25b76ada2902f0b Mon Sep 17 00:00:00 2001 From: Laurent Magnin Date: Fri, 2 Jul 2021 12:30:07 +0200 Subject: [PATCH 006/497] Standard ticket substitutions --- htdocs/core/lib/functions.lib.php | 26 +++++++++++++------------- htdocs/ticket/card.php | 25 ------------------------- 2 files changed, 13 insertions(+), 38 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f25e13ee88c..149cbd8530a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6848,7 +6848,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, /*$substitutionarray['__MEMBER_NOTE_PUBLIC__'] = '__MEMBER_NOTE_PUBLIC__'; $substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/ } -// add variables subtitutions ticket + // add variables subtitutions ticket if (!empty($conf->ticket->enabled) && (!is_object($object) || $object->element == 'ticket')) { $substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__'; $substitutionarray['__TICKET_REF__'] = '__TICKET_REF__'; @@ -6861,14 +6861,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__TICKET_PROGRESSION__'] = '__TICKET_PROGRESSION__'; $substitutionarray['__TICKET_USER_ASSIGN__'] = '__TICKET_USER_ASSIGN__'; $substitutionarray['__TICKET_USER_CREATE__'] = '__TICKET_USER_CREATE__'; - - -} - - - - - + } if (!empty($conf->recruitment->enabled) && (!is_object($object) || $object->element == 'candidature')) { $substitutionarray['__CANDIDATE_FULLNAME__'] = '__CANDIDATE_FULLNAME__'; @@ -7058,7 +7051,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = dol_print_date($datenextexpiration, 'dayrfc'); $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard'); } -// add substition variable for ticket + // add substition variable for ticket if (is_object($object) && $object->element == 'ticket') { $substitutionarray['__TICKET_TRACKID__'] = $object->track_id; $substitutionarray['__TICKET_REF__'] = $object->ref; @@ -7069,10 +7062,17 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__TICKET_ANALYTIC_CODE__'] = $object->category_code; $substitutionarray['__TICKET_MESSAGE__'] = $object->message; $substitutionarray['__TICKET_PROGRESSION__'] = $object->progress; - $substitutionarray['__TICKET_USER_ASSIGN__'] = dolGetFirstLastname($user->firstname, $user->lastname); - $substitutionarray['__TICKET_USER_CREATE__'] = dolGetFirstLastname($user->firstname, $user->lastname); - } + $userstat = new User($db); + if ($object->fk_user_assign > 0) { + $userstat->fetch($object->fk_user_assign); + $substitutionarray['__TICKET_USER_ASSIGN__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); + } + if ($object->fk_user_create > 0) { + $userstat->fetch($object->fk_user_create); + $substitutionarray['__TICKET_USER_CREATE__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); + } + } // Create dynamic tags for __EXTRAFIELD_FIELD__ if ($object->table_element && $object->id > 0) { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5faa7b201b7..7de6ea2d966 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1347,31 +1347,6 @@ if ($action == 'create' || $action == 'presend') { $morehtmlright = ''; $help = ""; $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); - if ($object->fk_soc > 0) { - $substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name; - } - $substitutionarray['__USER_SIGNATURE__'] = $user->signature; - $substitutionarray['__TICKET_TRACKID__'] = $object->track_id; - $substitutionarray['__TICKET_REF__'] = $object->ref; - $substitutionarray['__TICKET_SUBJECT__'] = $object->subject; - $substitutionarray['__TICKET_TYPE__'] = $object->type_code; - $substitutionarray['__TICKET_SEVERITY__'] = $object->severity_code; - $substitutionarray['__TICKET_CATEGORY__'] = $object->category_code; // For backward compatibility - $substitutionarray['__TICKET_ANALYTIC_CODE__'] = $object->category_code; - $substitutionarray['__TICKET_MESSAGE__'] = $object->message; - $substitutionarray['__TICKET_PROGRESSION__'] = $object->progress; - if ($object->fk_user_assign > 0) { - $userstat->fetch($object->fk_user_assign); - $substitutionarray['__TICKET_USER_ASSIGN__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); - } - - if ($object->fk_user_create > 0) { - $userstat->fetch($object->fk_user_create); - $substitutionarray['__TICKET_USER_CREATE__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); - } - foreach ($substitutionarray as $key => $val) { - $help .= $key.' -> '.$langs->trans($val).'
'; - } $morehtmlright .= $form->textwithpicto(''.$langs->trans("TicketMessageSubstitutionReplacedByGenericValues").'', $help, 1, 'helpclickable', '', 0, 3, 'helpsubstitution'); print '
'; From 78b593c067a8b957ecaaafe9f18606edaa039720 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Thu, 30 Sep 2021 17:42:59 +0200 Subject: [PATCH 007/497] FIX: leave request block moved to v15 --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 912eb7fe0eb..b5c7ec5013b 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -150,3 +150,6 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2010', ' INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2011', 'Ideell förening'); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', 'Stiftelse'); + +ALTER TABLE llx_c_holiday_types ADD COLUMN block_if_negative integer NOT NULL DEFAULT 0 AFTER fk_country; + From 7c8fb4a5fb3c917a57025f980c7e103fb8fa6238 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Thu, 30 Sep 2021 17:48:20 +0200 Subject: [PATCH 008/497] FIX: leave request blocking when balance negative: don't check when creating, check only when updating not in draft --- htdocs/holiday/class/holiday.class.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 5c82f0ab4b3..31d850846e2 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -270,17 +270,6 @@ class Holiday extends CommonObject $this->error = "ErrorBadParameterFkType"; return -1; } - $checkBalance = getDictvalue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); - - if ($checkBalance > 0) { - $balance = $this->getCPforUser($this->fk_user, $this->fk_type); - - if ($balance < 0) { - $this->error = 'LeaveRequestCreationBlockedBecauseBalanceIsNegative'; - return -1; - } - } - // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday("; $sql .= "ref,"; @@ -910,7 +899,7 @@ class Holiday extends CommonObject $checkBalance = getDictvalue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); - if ($checkBalance > 0) { + if ($checkBalance > 0 && $this->statut != self::STATUS_DRAFT) { $balance = $this->getCPforUser($this->fk_user, $this->fk_type); if ($balance < 0) { From 901bab2ca2608559d8865800e8768fc24c29fde4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 14:33:22 +0200 Subject: [PATCH 009/497] Update holiday.class.php --- htdocs/holiday/class/holiday.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 31d850846e2..7b64048997e 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -703,7 +703,7 @@ class Holiday extends CommonObject global $conf, $langs; $error = 0; - $checkBalance = getDictvalue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); + $checkBalance = getDictionaryValue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); if ($checkBalance > 0) { $balance = $this->getCPforUser($this->fk_user, $this->fk_type); @@ -778,7 +778,7 @@ class Holiday extends CommonObject global $conf, $langs; $error = 0; - $checkBalance = getDictvalue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); + $checkBalance = getDictionaryValue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); if ($checkBalance > 0) { $balance = $this->getCPforUser($this->fk_user, $this->fk_type); From b03bad98ae87f1899fa3327732871e0815e5bb66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 14:42:56 +0200 Subject: [PATCH 010/497] Update dict.php --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 8853e1f0813..5ce504a1b50 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1979,7 +1979,7 @@ if ($id) { } } } elseif ($value == 'fk_c_exp_tax_cat') { - $valuetoshow = getDictvalue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $valuetoshow); + $valuetoshow = getDictionaryValue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $valuetoshow); $valuetoshow = $langs->trans($valuetoshow); } elseif ($tabname[$id] == MAIN_DB_PREFIX.'c_exp_tax_cat') { $valuetoshow = $langs->trans($valuetoshow); From 4bb17745682cbd0739544dd38eba54e5731149ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 14:43:47 +0200 Subject: [PATCH 011/497] Update holiday.class.php --- htdocs/holiday/class/holiday.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 7b64048997e..79b6b81e680 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -897,7 +897,7 @@ class Holiday extends CommonObject global $conf, $langs; $error = 0; - $checkBalance = getDictvalue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); + $checkBalance = getDictionaryValue(MAIN_DB_PREFIX.'c_holiday_types', 'block_if_negative', $this->fk_type); if ($checkBalance > 0 && $this->statut != self::STATUS_DRAFT) { $balance = $this->getCPforUser($this->fk_user, $this->fk_type); From 69d92adb8a03cfa0f4362d430a710f6330925534 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 14:45:24 +0200 Subject: [PATCH 012/497] Update dict.php --- htdocs/admin/dict.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5ce504a1b50..9116d8410fe 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1979,8 +1979,9 @@ if ($id) { } } } elseif ($value == 'fk_c_exp_tax_cat') { - $valuetoshow = getDictionaryValue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $valuetoshow); - $valuetoshow = $langs->trans($valuetoshow); + $tmpid = $valuetoshow; + $valuetoshow = getDictionaryValue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $tmpid); + $valuetoshow = $langs->trans($valuetoshow ? $valuetoshow : $tmpid); } elseif ($tabname[$id] == MAIN_DB_PREFIX.'c_exp_tax_cat') { $valuetoshow = $langs->trans($valuetoshow); } elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_units') { From 5f40c2e9dde572e872796fc1d40538cc603867a0 Mon Sep 17 00:00:00 2001 From: Laurent Magnin Date: Fri, 19 Nov 2021 17:08:07 +0100 Subject: [PATCH 013/497] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 648a2e6b0dc..f3a7a6116e9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6992,7 +6992,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, // add variables subtitutions ticket if (!empty($conf->ticket->enabled) && (!is_object($object) || $object->element == 'ticket')) { $substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__'; - $substitutionarray['__TICKET_REF__'] = '__TICKET_REF__'; $substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__'; $substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__'; $substitutionarray['__TICKET_SEVERITY__'] = '__TICKET_SEVERITY__'; @@ -7001,7 +7000,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__TICKET_MESSAGE__'] = '__TICKET_MESSAGE__'; $substitutionarray['__TICKET_PROGRESSION__'] = '__TICKET_PROGRESSION__'; $substitutionarray['__TICKET_USER_ASSIGN__'] = '__TICKET_USER_ASSIGN__'; - $substitutionarray['__TICKET_USER_CREATE__'] = '__TICKET_USER_CREATE__'; } if (!empty($conf->recruitment->enabled) && (!is_object($object) || $object->element == 'candidature')) { From c8c6d5c1d24f5e9f091ff789f8fdb523a5522085 Mon Sep 17 00:00:00 2001 From: Laurent Magnin Date: Fri, 19 Nov 2021 17:09:51 +0100 Subject: [PATCH 014/497] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f3a7a6116e9..f2c968412b2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7194,7 +7194,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, // add substition variable for ticket if (is_object($object) && $object->element == 'ticket') { $substitutionarray['__TICKET_TRACKID__'] = $object->track_id; - $substitutionarray['__TICKET_REF__'] = $object->ref; + $substitutionarray['__REF__'] = $object->ref; $substitutionarray['__TICKET_SUBJECT__'] = $object->subject; $substitutionarray['__TICKET_TYPE__'] = $object->type_code; $substitutionarray['__TICKET_SEVERITY__'] = $object->severity_code; @@ -7210,7 +7210,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if ($object->fk_user_create > 0) { $userstat->fetch($object->fk_user_create); - $substitutionarray['__TICKET_USER_CREATE__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); + $substitutionarray['__USER_CREATE__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); } } From dc3bfcfb87e90aa6a2f3e1a937ed8bd494e1b62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Nov 2021 19:57:26 +0100 Subject: [PATCH 015/497] can modify tooltip by reference --- htdocs/bom/class/bom.class.php | 4 ++-- htdocs/bookmarks/class/bookmark.class.php | 2 +- htdocs/categories/class/categorie.class.php | 12 +++++++++++- htdocs/comm/action/class/actioncomm.class.php | 2 +- htdocs/comm/mailing/class/mailing.class.php | 2 +- htdocs/comm/propal/class/propal.class.php | 12 +++++++++++- htdocs/commande/class/commande.class.php | 12 +++++++++++- htdocs/compta/bank/class/paymentvarious.class.php | 2 +- .../compta/cashcontrol/class/cashcontrol.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- .../prelevement/class/bonprelevement.class.php | 2 +- htdocs/contact/class/contact.class.php | 2 +- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/delivery/class/delivery.class.php | 12 +++++++++++- htdocs/don/class/don.class.php | 12 +++++++++++- htdocs/don/class/paymentdonation.class.php | 11 ++++++++++- htdocs/ecm/class/ecmdirectory.class.php | 11 ++++++++++- htdocs/ecm/class/ecmfiles.class.php | 12 +++++++++++- .../emailcollector/class/emailcollector.class.php | 2 +- .../class/emailcollectoraction.class.php | 2 +- .../class/emailcollectorfilter.class.php | 2 +- .../class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 2 +- htdocs/expedition/class/expedition.class.php | 13 +++++++++++-- htdocs/expensereport/class/expensereport.class.php | 11 ++++++++++- .../class/paymentexpensereport.class.php | 12 ++++++++++-- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 11 ++++++++++- htdocs/fourn/class/fournisseur.facture.class.php | 11 ++++++++++- htdocs/fourn/class/fournisseur.product.class.php | 11 ++++++++++- htdocs/fourn/class/paiementfourn.class.php | 11 ++++++++++- htdocs/holiday/class/holiday.class.php | 11 ++++++++++- htdocs/hrm/class/establishment.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/class/skill.class.php | 2 +- htdocs/hrm/class/skilldet.class.php | 2 +- htdocs/hrm/class/skillrank.class.php | 2 +- .../class/knowledgerecord.class.php | 2 +- htdocs/loan/class/loan.class.php | 11 ++++++++++- htdocs/loan/class/paymentloan.class.php | 11 ++++++++++- .../modulebuilder/template/class/myobject.class.php | 2 +- htdocs/mrp/class/mo.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/partnership/class/partnership_type.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- .../product/class/productfournisseurprice.class.php | 2 +- htdocs/product/stock/class/entrepot.class.php | 2 +- htdocs/projet/class/project.class.php | 2 +- htdocs/reception/class/reception.class.php | 12 +++++++++++- .../class/recruitmentcandidature.class.php | 2 +- .../class/recruitmentjobposition.class.php | 2 +- htdocs/resource/class/dolresource.class.php | 11 ++++++++++- htdocs/salaries/class/salary.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- .../class/supplier_proposal.class.php | 11 ++++++++++- htdocs/ticket/class/cticketcategory.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/user/class/usergroup.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- htdocs/zapier/class/hook.class.php | 2 +- 63 files changed, 261 insertions(+), 66 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index fd8d4a19a75..3a89c97bd26 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -838,7 +838,7 @@ class BOM extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('bomdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -1444,7 +1444,7 @@ class BOMLine extends CommonObjectLine global $action, $hookmanager; $hookmanager->initHooks(array('bomlinedao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 9a5b3a53c20..39bb06c2ada 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -344,7 +344,7 @@ class Bookmark extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('mybookmarkdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 9a449d63700..380e7f686c2 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1612,7 +1612,7 @@ class Categorie extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $moreparam = '') { - global $langs; + global $langs, $hookmanager; $result = ''; $label = $langs->trans("ShowCategory").': '.($this->ref ? $this->ref : $this->label); @@ -1640,6 +1640,16 @@ class Categorie extends CommonObject if ($withpicto != 2) { $result .= $link.dol_trunc(($this->ref ? $this->ref : $this->label), $maxlength).$linkend; } + + global $action; + $hookmanager->initHooks(array('categoriedao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 3e2520f43da..eb8dbef2f6e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1662,7 +1662,7 @@ class ActionComm extends CommonObject global $action; $hookmanager->initHooks(array('actiondao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index cb900f7ac7b..3ec97f09cda 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -740,7 +740,7 @@ class Mailing extends CommonObject global $action; $hookmanager->initHooks(array('emailingdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 2f055f54a42..2d82595c2f1 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3557,7 +3557,7 @@ class Propal extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = -1) { - global $langs, $conf, $user; + global $langs, $conf, $user, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -3678,6 +3678,16 @@ class Propal extends CommonObject } } + global $action; + $hookmanager->initHooks(array('propaldao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + return $result; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 9b315698527..3da5b7c0428 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3654,7 +3654,7 @@ class Commande extends CommonOrder */ public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) { - global $conf, $langs, $user; + global $conf, $langs, $user, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -3755,6 +3755,16 @@ class Commande extends CommonOrder } } + global $action; + $hookmanager->initHooks(array('orderdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + return $result; } diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index d88676563d6..cdcd26490a3 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -721,7 +721,7 @@ class PaymentVarious extends CommonObject global $action; $hookmanager->initHooks(array('variouspayment')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 5308c8df1d6..63dae3a3a1c 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -466,7 +466,7 @@ class CashControl extends CommonObject global $action; $hookmanager->initHooks(array('cashfencedao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 649b7b0c093..8846d0bcc14 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1558,7 +1558,7 @@ class Facture extends CommonInvoice global $action, $hookmanager; $hookmanager->initHooks(array('invoicedao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a8836d215b2..a0911f92acb 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1329,7 +1329,7 @@ class BonPrelevement extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('banktransferdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index fa1dfb93c7a..908625b2825 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1487,7 +1487,7 @@ class Contact extends CommonObject global $action; $hookmanager->initHooks(array('contactdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index fe8edd30ea4..10771ec5228 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2041,7 +2041,7 @@ class Contrat extends CommonObject global $action; $hookmanager->initHooks(array('contractdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 6bfe3a33dd7..ccf197c7092 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -725,7 +725,7 @@ class Delivery extends CommonObject */ public function getNomUrl($withpicto = 0, $save_lastsearch_value = -1) { - global $langs; + global $langs, $hookmanager; $result = ''; @@ -757,6 +757,16 @@ class Delivery extends CommonObject $result .= ' '; } $result .= $linkstart.$this->ref.$linkend; + + global $action; + $hookmanager->initHooks(array('deliverydao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 7ca70a31aa2..ea8e53da2a0 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -899,7 +899,7 @@ class Don extends CommonObject */ public function getNomUrl($withpicto = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1) { - global $conf, $langs; + global $conf, $langs, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -940,6 +940,16 @@ class Don extends CommonObject } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('dondao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + return $result; } diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index b5775ce18ac..f1028146397 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -661,7 +661,7 @@ class PaymentDonation extends CommonObject */ public function getNomUrl($withpicto = 0, $maxlen = 0) { - global $langs; + global $langs, $hookmanager; $result = ''; @@ -684,6 +684,15 @@ class PaymentDonation extends CommonObject } } + global $action; + $hookmanager->initHooks(array('paymentdonationdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } } diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 03413a56eb1..7381beb6fea 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -474,7 +474,7 @@ class EcmDirectory extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $max = 0, $more = '', $notooltip = 0) { - global $langs; + global $langs, $hookmanager; $result = ''; //$newref=str_replace('_',' ',$this->ref); @@ -506,6 +506,15 @@ class EcmDirectory extends CommonObject } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('ecmdirectorydao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 6c2b8fc4023..9121ddacd0e 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -831,7 +831,7 @@ class EcmFiles extends CommonObject { global $db, $conf, $langs; global $dolibarr_main_authentication, $dolibarr_main_demo; - global $menumanager; + global $menumanager, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -868,6 +868,16 @@ class EcmFiles extends CommonObject } } $result .= $linkstart.$this->ref.$linkend; + + global $action; + $hookmanager->initHooks(array('ecmfilesdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 729762be327..8874f086b2a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -563,7 +563,7 @@ class EmailCollector extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('emailcollectordao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index bd044f37d0f..eaa4b0737b9 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -389,7 +389,7 @@ class EmailCollectorAction extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('emailcollectoractiondao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index d926a8bf14f..a99c5198d72 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -363,7 +363,7 @@ class EmailCollectorFilter extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('emailcollectorfilterdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index ac9e465b43b..46c13fd33c5 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -601,7 +601,7 @@ class ConferenceOrBooth extends ActionComm global $action, $hookmanager; $hookmanager->initHooks(array('conferenceorboothdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 96131aa5946..bdd81660a12 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -855,7 +855,7 @@ class ConferenceOrBoothAttendee extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('conferenceorboothattendeedao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 8ef7be75f52..0e79ab05428 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1778,7 +1778,7 @@ class Expedition extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1) { - global $langs, $conf; + global $langs, $conf, $hookmanager; $result = ''; $label = ''.$langs->trans("Shipment").''; @@ -1823,8 +1823,17 @@ class Expedition extends CommonObject if ($withpicto != 2) { $result .= $this->ref; } - $result .= $linkend; + $result .= $linkend; + global $action; + $hookmanager->initHooks(array('shippingdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 877a7c79ade..9a0a6f1949c 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1639,7 +1639,7 @@ class ExpenseReport extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1) { - global $langs, $conf; + global $langs, $conf, $hookmanager; $result = ''; @@ -1708,6 +1708,15 @@ class ExpenseReport extends CommonObject } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('expensereportdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 48adeab929d..e21e34de971 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -628,7 +628,7 @@ class PaymentExpenseReport extends CommonObject */ public function getNomUrl($withpicto = 0, $maxlen = 0) { - global $langs; + global $langs, $hookmanager; $result = ''; @@ -651,7 +651,15 @@ class PaymentExpenseReport extends CommonObject $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend; } } - + global $action; + $hookmanager->initHooks(array('paymentexpensereportdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 297e03fa379..22746014c8d 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -816,7 +816,7 @@ class Fichinter extends CommonObject global $action; $hookmanager->initHooks(array('interventiondao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9b68ef199db..24ae04ea204 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -787,7 +787,7 @@ class CommandeFournisseur extends CommonOrder */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) { - global $langs, $conf, $user; + global $langs, $conf, $user, $hookmanager; $result = ''; @@ -869,6 +869,15 @@ class CommandeFournisseur extends CommonOrder } } + global $action; + $hookmanager->initHooks(array('supplierorderdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a1db1826684..b70f35674ec 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2478,7 +2478,7 @@ class FactureFournisseur extends CommonInvoice */ public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) { - global $langs, $conf, $user; + global $langs, $conf, $user, $hookmanager; $result = ''; @@ -2597,6 +2597,15 @@ class FactureFournisseur extends CommonInvoice } } + global $action; + $hookmanager->initHooks(array('supplierinvoicedao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 5b523d8d7e8..3f4f853a4f5 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1087,7 +1087,7 @@ class ProductFournisseur extends Product */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { - global $db, $conf, $langs; + global $db, $conf, $langs, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -1222,6 +1222,15 @@ class ProductFournisseur extends Product $result .= $linkend; //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + global $action; + $hookmanager->initHooks(array('supplierproductdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index fa58139b7e7..812f7ff570b 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -593,7 +593,7 @@ class PaiementFourn extends Paiement */ public function getNomUrl($withpicto = 0, $option = '', $mode = 'withlistofinvoices', $notooltip = 0, $morecss = '') { - global $langs; + global $langs, $conf, $hookmanager; $result = ''; @@ -638,6 +638,15 @@ class PaiementFourn extends Paiement } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('supplierpaymentdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 89760c4d1ac..1a204ab9155 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1237,7 +1237,7 @@ class Holiday extends CommonObject */ public function getNomUrl($withpicto = 0, $save_lastsearch_value = -1, $notooltip = 0) { - global $langs; + global $langs, $hookmanager; $result = ''; @@ -1273,6 +1273,15 @@ class Holiday extends CommonObject } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('holidaydao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 88e93f1398f..2a2c4e4b3dd 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -506,7 +506,7 @@ class Establishment extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('establishmentdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 75dc03cc6f2..02c69bc4e01 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -808,7 +808,7 @@ class Evaluation extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('evaluationdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 115571bb6ba..0ca56d84e60 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -780,7 +780,7 @@ class Evaluationline extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('evaluationlinedao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index fc94f4ba6ae..c7f2e1a5f6b 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -814,7 +814,7 @@ class Job extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('jobdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 26298c31aa7..aa4b320ba56 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -788,7 +788,7 @@ class Position extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('positiondao')); - $parameters = array('id' => $this->id, 'getnomurl' => $result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 478b267ac1f..84d8143d0e5 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -831,7 +831,7 @@ class Skill extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('jobdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index c3acdd0982e..acda6908002 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -768,7 +768,7 @@ class Skilldet extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('skilldetdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index a07015ef763..1aac86842b8 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -807,7 +807,7 @@ class SkillRank extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('skillrankdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index a152a693343..7e662372fa2 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -791,7 +791,7 @@ class KnowledgeRecord extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('knowledgerecorddao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index ec9ce00b7e9..2530ffcecfe 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -556,7 +556,7 @@ class Loan extends CommonObject */ public function getNomUrl($withpicto = 0, $maxlen = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { - global $conf, $langs; + global $conf, $langs, $hookmanager; $result = ''; @@ -606,6 +606,15 @@ class Loan extends CommonObject } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('loandao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 841ffa7b373..f998b3f1077 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -617,7 +617,7 @@ class PaymentLoan extends CommonObject */ public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1) { - global $langs, $conf; + global $langs, $conf, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -654,6 +654,15 @@ class PaymentLoan extends CommonObject } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('loanpaymentdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 6e5d6efcff4..d84fbfad843 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -836,7 +836,7 @@ class MyObject extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('myobjectdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index cdad4e71968..e5c7d354aa4 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1072,7 +1072,7 @@ class Mo extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('modao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 4981dde2b45..c0656e4fa3c 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -1035,7 +1035,7 @@ class Partnership extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('partnershipdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index 6916d95e4f3..5b6ed5e5378 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -434,7 +434,7 @@ class PartnershipType extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('myobjectdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1d4a5926b6e..fc7bfd1444b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4930,7 +4930,7 @@ class Product extends CommonObject global $action; $hookmanager->initHooks(array('productdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index d82d1784938..84262e13c66 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -642,7 +642,7 @@ class ProductFournisseurPrice extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('productfournisseurpricedao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $result = $hookmanager->resPrint; else $result .= $hookmanager->resPrint; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index fe36b6364fc..ea80bd3fa46 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -760,7 +760,7 @@ class Entrepot extends CommonObject global $action; $hookmanager->initHooks(array('warehousedao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'withpicto' => $withpicto, 'option' => $option, 'showfullpath' => $showfullpath, 'notooltip'=> $notooltip); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result, 'withpicto' => $withpicto, 'option' => $option, 'showfullpath' => $showfullpath, 'notooltip'=> $notooltip); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 6d8b54d1954..164f289b94e 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1264,7 +1264,7 @@ class Project extends CommonObject global $action; $hookmanager->initHooks(array('projectdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 954e7f192cd..13d49111bea 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1116,7 +1116,7 @@ class Reception extends CommonObject */ public function getNomUrl($withpicto = 0, $option = 0, $max = 0, $short = 0, $notooltip = 0) { - global $conf, $langs; + global $conf, $langs, $hookmanager; $result = ''; $label = img_picto('', $this->picto).' '.$langs->trans("Reception").''; $label .= '
'.$langs->trans('Ref').': '.$this->ref; @@ -1149,6 +1149,16 @@ class Reception extends CommonObject $result .= ' '; } $result .= $linkstart.$this->ref.$linkend; + + global $action; + $hookmanager->initHooks(array('receptiondao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index f05f1389e75..e93e9af1178 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -762,7 +762,7 @@ class RecruitmentCandidature extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('recruitmentcandidaturedao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 3b52e5b4fa6..bc46b40f186 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -863,7 +863,7 @@ class RecruitmentJobPosition extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('recruitmentjobpositiondao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index a0f80d7b27c..81c0c04ebce 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -933,7 +933,7 @@ class Dolresource extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { - global $conf, $langs; + global $conf, $langs, $hookmanager; $result = ''; $label = img_picto('', $this->picto).' '.$langs->trans("Resource").''; @@ -986,6 +986,15 @@ class Dolresource extends CommonObject } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('dolresourcedao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 454a94bcf1f..fbf13ee6a39 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -550,7 +550,7 @@ class Salary extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('salarypayment')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $result = $hookmanager->resPrint; else $result .= $hookmanager->resPrint; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 22276cc7bee..4edecfdbf00 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2721,7 +2721,7 @@ class Societe extends CommonObject $hookmanager->initHooks(array('thirdpartydao')); $parameters = array( 'id'=>$this->id, - 'getnomurl'=>$result, + 'getnomurl' => &$result, 'withpicto '=> $withpicto, 'option'=> $option, 'maxlen'=> $maxlen, diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 9c84e2c2e89..b4e85080090 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2462,7 +2462,7 @@ class SupplierProposal extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) { - global $langs, $conf, $user; + global $langs, $conf, $user, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -2546,6 +2546,15 @@ class SupplierProposal extends CommonObject } } + global $action; + $hookmanager->initHooks(array('supplierpropaldao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 37142a0d278..cfaab7f3768 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -709,7 +709,7 @@ class CTicketCategory extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('cticketcategorydao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 18cfb950619..f2142df4914 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2719,7 +2719,7 @@ class User extends CommonObject global $action; $hookmanager->initHooks(array('userdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index b1b3175aaa9..b59f437d8c0 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -785,7 +785,7 @@ class UserGroup extends CommonObject global $action; $hookmanager->initHooks(array('groupdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index f66f2c51f49..529108981b3 100755 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -814,7 +814,7 @@ class Workstation extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('workstationdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index c3b9147a46d..e27658838bd 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -565,7 +565,7 @@ class Hook extends CommonObject $hookmanager->initHooks(array('hookdao')); $parameters = array( 'id' => $this->id, - 'getnomurl' => $result, + 'getnomurl' => &$result, ); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); From c01cc0c2124c681bfb3682660c3aeba2a1278c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Nov 2021 20:06:51 +0100 Subject: [PATCH 016/497] can modify tooltip by reference --- htdocs/accountancy/class/accountingaccount.class.php | 11 ++++++++++- htdocs/accountancy/class/accountingjournal.class.php | 11 ++++++++++- htdocs/accountancy/class/bookkeeping.class.php | 11 ++++++++++- htdocs/asset/class/asset.class.php | 11 ++++++++++- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 730e52c805a..ad2ab87ae62 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -464,7 +464,7 @@ class AccountingAccount extends CommonObject */ public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '') { - global $langs, $conf; + global $langs, $conf, $hookmanager; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; if (!empty($conf->dol_no_mouse_hover)) { @@ -549,6 +549,15 @@ class AccountingAccount extends CommonObject if ($withpicto != 2) { $result .= $linkstart . $label_link . $linkend; } + global $action; + $hookmanager->initHooks(array('accountingjournaldao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 376178b45ba..24e42c367aa 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -221,7 +221,7 @@ class AccountingJournal extends CommonObject */ public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0) { - global $langs, $conf, $user; + global $langs, $conf, $user, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -276,6 +276,15 @@ class AccountingJournal extends CommonObject } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('accountingjournaldao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 9cda04f6155..c6acc50ba3e 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -460,7 +460,7 @@ class BookKeeping extends CommonObject { global $db, $conf, $langs; global $dolibarr_main_authentication, $dolibarr_main_demo; - global $menumanager; + global $menumanager, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -512,6 +512,15 @@ class BookKeeping extends CommonObject $result .= $linkend; //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + global $action; + $hookmanager->initHooks(array('bookkeepingdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index e5ec21bfa6d..5772da8c0cf 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -307,7 +307,7 @@ class Asset extends CommonObject { global $db, $conf, $langs; global $dolibarr_main_authentication, $dolibarr_main_demo; - global $menumanager; + global $menumanager, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -361,6 +361,15 @@ class Asset extends CommonObject $result .= $linkend; //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + global $action; + $hookmanager->initHooks(array('assetdao')); + $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } From e562bf5b1cb9c2d98867a69a21f2a3cd25b9c034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Nov 2021 20:08:21 +0100 Subject: [PATCH 017/497] can modify tooltip by reference --- htdocs/accountancy/class/accountingaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index ad2ab87ae62..3ee51f5ad32 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -550,7 +550,7 @@ class AccountingAccount extends CommonObject $result .= $linkstart . $label_link . $linkend; } global $action; - $hookmanager->initHooks(array('accountingjournaldao')); + $hookmanager->initHooks(array('accountingaccountdao')); $parameters = array('id'=>$this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { From e43b95f05a191a1a541bf6918c862b66541fa534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lina?= Date: Tue, 30 Nov 2021 15:41:46 +0100 Subject: [PATCH 018/497] Show reference product --- htdocs/takepos/index.php | 20 +++++++++++++++++--- htdocs/takepos/invoice.php | 6 +++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 8bd1c4dbca9..ad123ccd5e7 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -335,7 +335,11 @@ function LoadProducts(position, issubcat) { var titlestring = ; global->TAKEPOS_HIDE_PRODUCT_IMAGES) { echo '$("#prodivdesc"+ishow).show();'; - echo '$("#prodesc"+ishow).text(data[parseInt(idata)][\'label\']);'; + if ($conf->global->TAKEPOS_SHOW_PRODUCT_REFERENCE == 1) { + echo '$("#prodesc"+ishow).html(data[parseInt(idata)][\'ref\'].bold() + \' - \' + data[parseInt(idata)][\'label\']);'; + } else { + echo '$("#prodesc"+ishow).text(data[parseInt(idata)][\'label\']);'; + } echo '$("#proimg"+ishow).attr("title", titlestring);'; echo '$("#proimg"+ishow).attr("src", "genimg/index.php?query=pro&id="+data[idata][\'id\']);'; } else { @@ -401,7 +405,12 @@ function MoreProducts(moreorless) { else if ((data[idata]['status']) == "1") { //Only show products with status=1 (for sell) $("#prodivdesc"+ishow).show(); - $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); + global->TAKEPOS_SHOW_PRODUCT_REFERENCE == 1) { ?> + $("#prodesc"+ishow).html(data[parseInt(idata)]['ref'].bold() + ' - ' + data[parseInt(idata)]['label']); + + $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); + $("#probutton"+ishow).text(data[parseInt(idata)]['label']); $("#probutton"+ishow).show(); if (data[parseInt(idata)]['price_formated']) { @@ -579,7 +588,12 @@ function Search2(keyCodeForEnter) { $titlestring .= " + ' - ".dol_escape_js($langs->trans("Barcode").': ')."' + data[i]['barcode']"; ?> var titlestring = ; - $("#prodesc" + i).text(data[i]['label']); + global->TAKEPOS_SHOW_PRODUCT_REFERENCE == 1) { ?> + $("#prodesc" + i).html(data[i]['ref'].bold() + ' - ' + data[i]['label']); + + $("#prodesc" + i).text(data[i]['label']); + $("#prodivdesc" + i).show(); $("#probutton" + i).text(data[i]['label']); $("#probutton" + i).show(); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 2a951a505ae..01599cae4b6 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1447,7 +1447,11 @@ if ($placeid > 0) { $tooltiptext .= $line->desc; } } - $htmlforlines .= $form->textwithpicto($line->product_label ? $line->product_label : ($line->product_ref ? $line->product_ref : dolGetFirstLineOfText($line->desc, 1)), $tooltiptext); + if ($conf->global->TAKEPOS_SHOW_PRODUCT_REFERENCE == 1) { + $htmlforlines .= $form->textwithpicto($line->product_label ? '' . $line->product_ref . ' - ' . $line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); + } else { + $htmlforlines .= $form->textwithpicto($line->product_label ? $line->product_label : ($line->product_ref ? $line->product_ref : dolGetFirstLineOfText($line->desc, 1)), $tooltiptext); + } } else { if ($line->product_label) { $htmlforlines .= $line->product_label; From 7c3b2f1e9bed3f2b45438810a89d2bba6c266dda Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 30 Nov 2021 15:07:59 +0000 Subject: [PATCH 019/497] Fixing style errors. --- htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index ad123ccd5e7..bf5428f81d0 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -589,7 +589,7 @@ function Search2(keyCodeForEnter) { ?> var titlestring = ; global->TAKEPOS_SHOW_PRODUCT_REFERENCE == 1) { ?> + if ($conf->global->TAKEPOS_SHOW_PRODUCT_REFERENCE == 1) { ?> $("#prodesc" + i).html(data[i]['ref'].bold() + ' - ' + data[i]['label']); $("#prodesc" + i).text(data[i]['label']); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 01599cae4b6..2f857e7a3ce 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1447,9 +1447,9 @@ if ($placeid > 0) { $tooltiptext .= $line->desc; } } - if ($conf->global->TAKEPOS_SHOW_PRODUCT_REFERENCE == 1) { + if ($conf->global->TAKEPOS_SHOW_PRODUCT_REFERENCE == 1) { $htmlforlines .= $form->textwithpicto($line->product_label ? '' . $line->product_ref . ' - ' . $line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); - } else { + } else { $htmlforlines .= $form->textwithpicto($line->product_label ? $line->product_label : ($line->product_ref ? $line->product_ref : dolGetFirstLineOfText($line->desc, 1)), $tooltiptext); } } else { From 16ab6ce800a10887e31890d772a6356b34759f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lina?= Date: Wed, 1 Dec 2021 10:26:24 +0100 Subject: [PATCH 020/497] No Category --- htdocs/takepos/index.php | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 8bd1c4dbca9..59205c638a6 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1186,13 +1186,22 @@ if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) {
+ } ?>" + global->TAKEPOS_NO_CATEGORY == 1) { + print ''; + } + ?>> -
- global->TAKEPOS_NO_CATEGORY == 1) { + print '