| '.$langs->trans("CashDeskIdWareHouse").' | '; // Force warehouse (this is not a default value)
print '';
if (!$disabled) {
+ print img_picto('', 'bank_account', 'class="pictofixedwidth"');
print $formproduct->selectWarehouses($conf->global->{'CASHDESK_ID_WAREHOUSE'.$terminal}, 'CASHDESK_ID_WAREHOUSE'.$terminal, '', 1, $disabled, 0, '', 0, 0, array(), 'maxwidth250');
print ' ';
} else {
From 18e911a6364db16c1cd0a7f8c32e38a9a5f9fed2 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 28 Apr 2021 20:44:22 +0200
Subject: [PATCH 60/64] FIX dol_print_date for %a and %b with some Timezone
---
htdocs/core/lib/functions.lib.php | 11 ++++++-----
htdocs/projet/activity/perday.php | 21 ++++++++++++---------
htdocs/projet/activity/perweek.php | 11 +++++++++--
htdocs/takepos/index.php | 2 +-
test/phpunit/DateLibTest.php | 11 +++++++++++
5 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index d4b94deba51..79f36b1dbcd 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2197,8 +2197,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
if ($tzoutput == 'tzserver') {
$to_gmt = false;
$offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion'
- $offsettz = 0;
- $offsetdst = 0;
+ $offsettz = 0; // Timezone offset with server timezone, so 0
+ $offsetdst = 0; // Dst offset with server timezone, so 0
} elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') {
$to_gmt = true;
$offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion'
@@ -2308,7 +2308,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
if ($time < 100000000000) { // Protection against bad date values
$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
- $ret = adodb_strftime($format, $timetouse, $to_gmt);
+ $ret = adodb_strftime($format, $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
} else {
$ret = 'Bad value '.$time.' for date';
}
@@ -2318,7 +2318,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
// Here ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs.
- $month = adodb_strftime('%m', $timetouse, true);
+ $month = adodb_strftime('%m', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
$month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'.
if ($encodetooutput) {
$monthtext = $outputlangs->transnoentities('Month'.$month);
@@ -2334,9 +2334,10 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
//return $ret;
}
if (preg_match('/__a__/i', $format)) {
+ //print "time=$time offsettz=$offsettz offsetdst=$offsetdst offsettzstring=$offsettzstring";
$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
- $w = adodb_strftime('%w', $timetouse, true); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
+ $w = adodb_strftime('%w', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
$dayweek = $outputlangs->transnoentitiesnoconv('Day'.$w);
$ret = str_replace('__A__', $dayweek, $ret);
$ret = str_replace('__a__', dol_substr($dayweek, 0, 3), $ret);
diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index 3c67673ad49..b0195200dd5 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -81,13 +81,16 @@ $monthofday = GETPOST('addtimemonth');
$dayofday = GETPOST('addtimeday');
$yearofday = GETPOST('addtimeyear');
-$daytoparse = $now;
-if ($yearofday && $monthofday && $dayofday) {
- $daytoparse = dol_mktime(0, 0, 0, $monthofday, $dayofday, $yearofday); // xxxofday is value of day after submit action 'addtime'
-} elseif ($year && $month && $day) {
- $daytoparse = dol_mktime(0, 0, 0, $month, $day, $year); // this are value submited after submit of action 'submitdateselect'
-}
+/*var_dump(GETPOST('remonth'));
+var_dump(GETPOST('button_search_x'));
+var_dump(GETPOST('button_addtime'));*/
+$daytoparse = $now;
+if ($year && $month && $day) {
+ $daytoparse = dol_mktime(0, 0, 0, $month, $day, $year); // this are value submited after submit of action 'submitdateselect'
+} elseif ($yearofday && $monthofday && $dayofday) {
+ $daytoparse = dol_mktime(0, 0, 0, $monthofday, $dayofday, $yearofday); // xxxofday is value of day after submit action 'addtime'
+}
if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id) {
$usertoprocess = $user;
@@ -416,10 +419,10 @@ $search_options_pattern = 'search_task_options_';
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// Show navigation bar
-$nav = ''.img_previous($langs->trans("Previous"))."\n";
+$nav = ''.img_previous($langs->trans("Previous"))."\n";
$nav .= dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "%A").' ';
$nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "day")." \n";
-$nav .= ''.img_next($langs->trans("Next"))."\n";
+$nav .= ''.img_next($langs->trans("Next"))."\n";
$nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' ';
$nav .= ' ';
@@ -773,7 +776,7 @@ print '';
print ''."\n";
print ' ';
-print '';
+print '';
print ' ';
print '';
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php
index 3d380ab7f4e..0a275cb46e3 100644
--- a/htdocs/projet/activity/perweek.php
+++ b/htdocs/projet/activity/perweek.php
@@ -665,7 +665,12 @@ if (!empty($arrayfields['timeconsumed']['checked'])) {
for ($idw = 0; $idw < 7; $idw++) {
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
$dayinloop = dol_time_plus_duree($startday, $idw, 'd');
-
+ /*print $dayinloopfromfirstdaytoshow;
+ print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour', 'gmt');
+ print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour');
+ print dol_print_date($dayinloopfromfirstdaytoshow, '%a', 'gmt');
+ print dol_print_date($dayinloopfromfirstdaytoshow, '%a');
+ print ' ';*/
$cssweekend = '';
if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) { // This is a day is not inside the setup of working days, so we use a week-end css.
$cssweekend = 'weekend';
@@ -682,7 +687,9 @@ for ($idw = 0; $idw < 7; $idw++) {
$cssonholiday .= 'onholidayafternoon ';
}
- print ''.dol_print_date($dayinloopfromfirstdaytoshow, '%a').' '.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').' | ';
+ print '';
+ print dol_print_date($dayinloopfromfirstdaytoshow, '%a');
+ print ' '.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').' | ';
}
//print ' | ';
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 4c3ef11294f..1f9e6c32b2b 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -1029,7 +1029,7 @@ if ($conf->global->TAKEPOS_DIRECT_PAYMENT) {
// BAR RESTAURANT specific menu
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
if ($conf->global->TAKEPOS_ORDER_PRINTERS) {
- $menus[$r++] = array('title'=>$langs->trans("Order"), 'action'=>'TakeposPrintingOrder();');
+ $menus[$r++] = array('title'=>''.$langs->trans("Order").'', 'action'=>'TakeposPrintingOrder();');
}
//Button to print receipt before payment
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php
index 78f5b36da49..7ff09de495e 100644
--- a/test/phpunit/DateLibTest.php
+++ b/test/phpunit/DateLibTest.php
@@ -390,6 +390,17 @@ class DateLibTest extends PHPUnit\Framework\TestCase
print __METHOD__." result=".$result."\n";
$this->assertEquals('Jeu Jan. Janvier', $result);
+
+ $result=dol_print_date(1619388000, '%Y-%m-%d %a', 'gmt', $outputlangs);
+ print __METHOD__." result=".$result."\n";
+ $this->assertEquals('2021-04-25 Dim', $result);
+
+ /* This test is disabled because result depends on TZ of server
+ $result=dol_print_date(1619388000, '%Y-%m-%d %a', 'tzserver', $outputlangs); // If TZ is +2, then result will be Lun for 1619388000
+ print __METHOD__." result=".$result."\n";
+ $this->assertEquals('2021-04-26 Lun', $result);
+ */
+
// Check day format for en_US
$outputlangs=new Translate('', $conf);
$outputlangs->setDefaultLang('en_US');
From 887bce8235e4736d92fd60f81b8be1925248aca6 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 28 Apr 2021 20:59:21 +0200
Subject: [PATCH 61/64] Avoid duplicate declaration
---
htdocs/adherents/class/adherent.class.php | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 7fdc548efa7..80d14ee9ceb 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -204,12 +204,11 @@ class Adherent extends CommonObject
*/
public $morphy;
+ /**
+ * @var int Info can be public
+ */
public $public;
- // -2:excluded, -1:draft, 0:resiliated, >=1:valided,payed
- // def in common object
- public $statut; // TODO modify to set statut as deprecated
-
/**
* @var string photo of member
*/
From b1d858eb26bab28849ac0cd09294702eb13c0bab Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 28 Apr 2021 22:44:57 +0200
Subject: [PATCH 62/64] Fix translation of new modules
---
.tx/config | 12 ++++++++++++
htdocs/core/modules/modPartnership.class.php | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.tx/config b/.tx/config
index b98bf7828f2..6d3518fabd4 100644
--- a/.tx/config
+++ b/.tx/config
@@ -128,6 +128,12 @@ source_file = htdocs/langs/en_US/errors.lang
source_lang = en_US
type = MOZILLAPROPERTIES
+[dolibarr.eventorganization]
+file_filter = htdocs/langs//eventorganization.lang
+source_file = htdocs/langs/en_US/eventorganization.lang
+source_lang = en_US
+type = MOZILLAPROPERTIES
+
[dolibarr.exports]
file_filter = htdocs/langs//exports.lang
source_file = htdocs/langs/en_US/exports.lang
@@ -278,6 +284,12 @@ source_file = htdocs/langs/en_US/other.lang
source_lang = en_US
type = MOZILLAPROPERTIES
+[dolibarr.partnership]
+file_filter = htdocs/langs//partnership.lang
+source_file = htdocs/langs/en_US/partnership.lang
+source_lang = en_US
+type = MOZILLAPROPERTIES
+
[dolibarr.paybox]
file_filter = htdocs/langs//paybox.lang
source_file = htdocs/langs/en_US/paybox.lang
diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php
index 17c137a7e3c..be31ad3278a 100644
--- a/htdocs/core/modules/modPartnership.class.php
+++ b/htdocs/core/modules/modPartnership.class.php
@@ -144,7 +144,7 @@ class modPartnership extends DolibarrModules
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
// The language file dedicated to your module
- $this->langfiles = array("partnership@partnership");
+ $this->langfiles = array("partnership");
// Prerequisites
$this->phpmin = array(5, 6); // Minimum version of PHP required by module
From 64374f46daf52934997f885fe68768a5c09a7c8b Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 28 Apr 2021 23:01:20 +0200
Subject: [PATCH 63/64] Debug v14
---
htdocs/core/lib/functions.lib.php | 6 +-
htdocs/core/modules/modPartnership.class.php | 2 +-
htdocs/langs/en_US/partnership.lang | 4 +-
htdocs/partnership/README.md | 86 ---------------
htdocs/partnership/admin/about.php | 103 ------------------
.../admin/partnership_extrafields.php | 7 +-
htdocs/partnership/admin/setup.php | 11 +-
.../partnership/class/partnership.class.php | 8 +-
.../partnership/modules_partnership.php | 4 +-
htdocs/partnership/lib/partnership.lib.php | 11 +-
htdocs/partnership/partnership_agenda.php | 2 +-
htdocs/partnership/partnership_card.php | 2 +-
htdocs/partnership/partnership_contact.php | 2 +-
htdocs/partnership/partnership_document.php | 2 +-
htdocs/partnership/partnership_list.php | 2 +-
htdocs/partnership/partnership_note.php | 2 +-
htdocs/partnership/partnershipindex.php | 2 +-
17 files changed, 36 insertions(+), 220 deletions(-)
delete mode 100644 htdocs/partnership/README.md
delete mode 100644 htdocs/partnership/admin/about.php
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 79f36b1dbcd..9308ea07d53 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3526,7 +3526,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_inventory', 'object_intracommreport', 'object_label',
'object_margin', 'object_members', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
'object_lot', 'object_mrp', 'object_other',
- 'object_payment', 'object_pdf', 'object_product', 'object_propal',
+ 'object_partnership', 'object_payment', 'object_pdf', 'object_product', 'object_propal',
'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
'object_reception', 'object_recruitmentjobposition', 'object_recruitmentcandidature',
'object_salary', 'object_shipment', 'object_share-alt', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock',
@@ -3538,7 +3538,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies',
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
- 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
+ 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
'error', 'warning',
'recruitmentcandidature', 'recruitmentjobposition', 'resource',
'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
@@ -3582,7 +3582,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
'other'=>'square',
'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature',
- 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
+ 'partnership'=>'handshake', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
'refresh'=>'redo', 'resource'=>'laptop-house',
diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php
index be31ad3278a..1165461368b 100644
--- a/htdocs/core/modules/modPartnership.class.php
+++ b/htdocs/core/modules/modPartnership.class.php
@@ -86,7 +86,7 @@ class modPartnership extends DolibarrModules
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
// To use a supported fa-xxx css style of font awesome, use this->picto='xxx'
- $this->picto = 'generic';
+ $this->picto = 'partnership';
// Define some features supported by module (triggers, login, substitutions, menus, css, etc...)
$this->module_parts = array(
diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang
index 63b3bec0bb6..7681449755e 100644
--- a/htdocs/langs/en_US/partnership.lang
+++ b/htdocs/langs/en_US/partnership.lang
@@ -51,4 +51,6 @@ DatePartnershipEnd=End date
PartnershipDraft = Draft
PartnershipAccepted = Accepted
PartnershipRefused = Refused
-PartnershipCanceled = Canceled
\ No newline at end of file
+PartnershipCanceled = Canceled
+
+PartnershipManagedFor=Partners are
\ No newline at end of file
diff --git a/htdocs/partnership/README.md b/htdocs/partnership/README.md
deleted file mode 100644
index ca8d9f7b551..00000000000
--- a/htdocs/partnership/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-# PARTNERSHIP FOR [DOLIBARR ERP CRM](https://www.dolibarr.org)
-
-## Features
-
-Description of the module...
-
-
-
-Other external modules are available on [Dolistore.com](https://www.dolistore.com).
-
-## Translations
-
-Translations can be completed manually by editing files into directories *langs*.
-
-
-
-
-
-## Licenses
-
-### Main code
-
-GPLv3 or (at your option) any later version. See file COPYING for more information.
-
-### Documentation
-
-All texts and readmes are licensed under GFDL.
diff --git a/htdocs/partnership/admin/about.php b/htdocs/partnership/admin/about.php
deleted file mode 100644
index 2d5f17b1877..00000000000
--- a/htdocs/partnership/admin/about.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- * Copyright (C) 2021 Dorian Laurent
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * \file partnership/admin/about.php
- * \ingroup partnership
- * \brief About page of module Partnership.
- */
-
-// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
-
-// Libraries
-require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-require_once '../lib/partnership.lib.php';
-
-// Translations
-$langs->loadLangs(array("errors", "admin", "partnership@partnership"));
-
-// Access control
-if (!$user->admin) {
- accessforbidden();
-}
-
-// Parameters
-$action = GETPOST('action', 'aZ09');
-$backtopage = GETPOST('backtopage', 'alpha');
-
-
-/*
- * Actions
- */
-
-// None
-
-
-/*
- * View
- */
-
-$form = new Form($db);
-
-$page_name = "PartnershipAbout";
-llxHeader('', $langs->trans($page_name));
-
-// Subheader
-$linkback = ''.$langs->trans("BackToModuleList").'';
-
-print load_fiche_titre($langs->trans($page_name), $linkback, 'object_partnership@partnership');
-
-// Configuration header
-$head = partnershipAdminPrepareHead();
-print dol_get_fiche_head($head, 'about', '', 0, 'partnership@partnership');
-
-dol_include_once('/partnership/core/modules/modPartnership.class.php');
-$tmpmodule = new modPartnership($db);
-print $tmpmodule->getDescLong();
-
-// Page end
-print dol_get_fiche_end();
-llxFooter();
-$db->close();
diff --git a/htdocs/partnership/admin/partnership_extrafields.php b/htdocs/partnership/admin/partnership_extrafields.php
index a69ec9d1372..3ecf00f2689 100644
--- a/htdocs/partnership/admin/partnership_extrafields.php
+++ b/htdocs/partnership/admin/partnership_extrafields.php
@@ -58,7 +58,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once '../lib/partnership.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array('partnership@partnership', 'admin'));
+$langs->loadLangs(array('partnership', 'admin'));
$extrafields = new ExtraFields($db);
$form = new Form($db);
@@ -91,17 +91,18 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
* View
*/
+$help_url = '';
llxHeader('', $langs->trans("PartnershipSetup"), $help_url);
$linkback = ''.$langs->trans("BackToModuleList").'';
-print load_fiche_titre($langs->trans("PartnershipSetup"), $linkback, 'title_setup');
+print load_fiche_titre($langs->trans("PartnershipSetup"), $linkback, 'object_partnership');
$head = partnershipAdminPrepareHead();
-print dol_get_fiche_head($head, 'partnership_extrafields', $langs->trans("PartnershipExtraFields"), -1, 'account');
+print dol_get_fiche_head($head, 'partnership_extrafields', $langs->trans("PartnershipExtraFields"), -1, 'partnership');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php
index d55daab2347..46c6e8291db 100644
--- a/htdocs/partnership/admin/setup.php
+++ b/htdocs/partnership/admin/setup.php
@@ -58,7 +58,7 @@ require_once '../lib/partnership.lib.php';
//require_once "../class/myclass.class.php";
// Translations
-$langs->loadLangs(array("admin", "partnership@partnership"));
+$langs->loadLangs(array("admin", "partnership"));
// Security check
if (!$user->admin) {
@@ -71,6 +71,7 @@ $value = GETPOST('value', 'alpha');
$error = 0;
+
/*
* Actions
*/
@@ -91,10 +92,10 @@ if ($action == 'setting') {
$partnership->tabs = array();
if ($modulemenu == 'member') {
- $partnership->tabs[] = array('data'=>'member:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/partnership/partnership.php?socid=__ID__');
+ $partnership->tabs[] = array('data'=>'member:+partnership:Partnership:partnership:$user->rights->partnership->read:/partnership/partnership.php?socid=__ID__');
$fk_mainmenu = "members";
} else {
- $partnership->tabs[] = array('data'=>'thirdparty:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/partnership/partnership.php?socid=__ID__');
+ $partnership->tabs[] = array('data'=>'thirdparty:+partnership:Partnership:partnership:$user->rights->partnership->read:/partnership/partnership.php?socid=__ID__');
$fk_mainmenu = "companies";
}
@@ -131,10 +132,10 @@ $tab = $langs->trans("PartnershipSetup");
llxHeader('', $title);
$linkback = ''.$langs->trans("BackToModuleList").'';
-print load_fiche_titre($title, $linkback, 'title_setup');
+print load_fiche_titre($title, $linkback, 'object_partnership');
$head = partnershipAdminPrepareHead();
-print dol_get_fiche_head($head, 'settings', $tab, -1, 'partnership');
+print dol_get_fiche_head($head, 'settings', $tab, -1, 'object_partnership');
$form = new Form($db);
diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php
index 019d72a6012..d842644800a 100644
--- a/htdocs/partnership/class/partnership.class.php
+++ b/htdocs/partnership/class/partnership.class.php
@@ -61,7 +61,7 @@ class Partnership extends CommonObject
/**
* @var string String with name of icon for partnership. Must be the part after the 'object_' into object_partnership.png
*/
- public $picto = 'partnership@partnership';
+ public $picto = 'partnership';
const STATUS_DRAFT = 0;
@@ -969,7 +969,7 @@ class Partnership extends CommonObject
// phpcs:enable
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
global $langs;
- //$langs->load("partnership@partnership");
+ //$langs->load("partnership");
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
$this->labelStatus[self::STATUS_ACCEPTED] = $langs->trans('Accepted');
$this->labelStatus[self::STATUS_REFUSED] = $langs->trans('Refused');
@@ -1076,7 +1076,7 @@ class Partnership extends CommonObject
public function getNextNumRef()
{
global $langs, $conf;
- $langs->load("partnership@partnership");
+ $langs->load("partnership");
if (empty($conf->global->PARTNERSHIP_ADDON)) {
$conf->global->PARTNERSHIP_ADDON = 'mod_partnership_standard';
@@ -1141,7 +1141,7 @@ class Partnership extends CommonObject
$result = 0;
$includedocgeneration = 0;
- $langs->load("partnership@partnership");
+ $langs->load("partnership");
if (!dol_strlen($modele)) {
$modele = 'standard_partnership';
diff --git a/htdocs/partnership/core/modules/partnership/modules_partnership.php b/htdocs/partnership/core/modules/partnership/modules_partnership.php
index aea00b41415..005d77835b6 100644
--- a/htdocs/partnership/core/modules/partnership/modules_partnership.php
+++ b/htdocs/partnership/core/modules/partnership/modules_partnership.php
@@ -91,7 +91,7 @@ abstract class ModeleNumRefPartnership
public function info()
{
global $langs;
- $langs->load("partnership@partnership");
+ $langs->load("partnership");
return $langs->trans("NoDescription");
}
@@ -103,7 +103,7 @@ abstract class ModeleNumRefPartnership
public function getExample()
{
global $langs;
- $langs->load("partnership@partnership");
+ $langs->load("partnership");
return $langs->trans("NoExample");
}
diff --git a/htdocs/partnership/lib/partnership.lib.php b/htdocs/partnership/lib/partnership.lib.php
index 0cb4f1d0ea1..5305f86132e 100644
--- a/htdocs/partnership/lib/partnership.lib.php
+++ b/htdocs/partnership/lib/partnership.lib.php
@@ -30,7 +30,7 @@ function partnershipAdminPrepareHead()
{
global $langs, $conf;
- $langs->load("partnership@partnership");
+ $langs->load("partnership");
$h = 0;
$head = array();
@@ -46,11 +46,12 @@ function partnershipAdminPrepareHead()
$head[$h][2] = 'partnership_extrafields';
$h++;
-
+ /*
$head[$h][0] = dol_buildpath("/partnership/admin/about.php", 1);
$head[$h][1] = $langs->trans("About");
$head[$h][2] = 'about';
$h++;
+ */
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
@@ -75,7 +76,7 @@ function partnershipPrepareHead($object)
{
global $db, $langs, $conf;
- $langs->load("partnership@partnership");
+ $langs->load("partnership");
$h = 0;
$head = array();
@@ -128,9 +129,9 @@ function partnershipPrepareHead($object)
//$this->tabs = array(
// 'entity:-tabname:Title:@partnership:/partnership/mypage.php?id=__ID__'
//); // to remove a tab
- complete_head_from_modules($conf, $langs, $object, $head, $h, 'partnership@partnership');
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'partnership');
- complete_head_from_modules($conf, $langs, $object, $head, $h, 'partnership@partnership', 'remove');
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'partnership', 'remove');
return $head;
}
diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php
index 712455840b8..51f417399df 100644
--- a/htdocs/partnership/partnership_agenda.php
+++ b/htdocs/partnership/partnership_agenda.php
@@ -82,7 +82,7 @@ dol_include_once('/partnership/lib/partnership.lib.php');
// Load translation files required by the page
-$langs->loadLangs(array("partnership@partnership", "other"));
+$langs->loadLangs(array("partnership", "other"));
// Get parameters
$id = GETPOST('id', 'int');
diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php
index dbf889137d8..d2647a43a8b 100644
--- a/htdocs/partnership/partnership_card.php
+++ b/htdocs/partnership/partnership_card.php
@@ -81,7 +81,7 @@ dol_include_once('/partnership/class/partnership.class.php');
dol_include_once('/partnership/lib/partnership.lib.php');
// Load translation files required by the page
-$langs->loadLangs(array("partnership@partnership", "other"));
+$langs->loadLangs(array("partnership", "other"));
// Get parameters
$id = GETPOST('id', 'int');
diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php
index 02aa67f7365..632047acf25 100644
--- a/htdocs/partnership/partnership_contact.php
+++ b/htdocs/partnership/partnership_contact.php
@@ -59,7 +59,7 @@ dol_include_once('/partnership/class/partnership.class.php');
dol_include_once('/partnership/lib/partnership.lib.php');
// Load translation files required by the page
-$langs->loadLangs(array("partnership@partnership", "companies", "other", "mails"));
+$langs->loadLangs(array("partnership", "companies", "other", "mails"));
$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha');
diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php
index d455f342516..d6f89c07d00 100644
--- a/htdocs/partnership/partnership_document.php
+++ b/htdocs/partnership/partnership_document.php
@@ -82,7 +82,7 @@ dol_include_once('/partnership/class/partnership.class.php');
dol_include_once('/partnership/lib/partnership.lib.php');
// Load translation files required by the page
-$langs->loadLangs(array("partnership@partnership", "companies", "other", "mails"));
+$langs->loadLangs(array("partnership", "companies", "other", "mails"));
$action = GETPOST('action', 'aZ09');
diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php
index 0e0ee3da9c3..441ef1a2de8 100644
--- a/htdocs/partnership/partnership_list.php
+++ b/htdocs/partnership/partnership_list.php
@@ -85,7 +85,7 @@ require_once __DIR__.'/class/partnership.class.php';
//dol_include_once('/othermodule/class/otherobject.class.php');
// Load translation files required by the page
-$langs->loadLangs(array("partnership@partnership", "other"));
+$langs->loadLangs(array("partnership", "other"));
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php
index 5e752666b39..29a59f67ef4 100644
--- a/htdocs/partnership/partnership_note.php
+++ b/htdocs/partnership/partnership_note.php
@@ -78,7 +78,7 @@ dol_include_once('/partnership/class/partnership.class.php');
dol_include_once('/partnership/lib/partnership.lib.php');
// Load translation files required by the page
-$langs->loadLangs(array("partnership@partnership", "companies"));
+$langs->loadLangs(array("partnership", "companies"));
// Get parameters
$id = GETPOST('id', 'int');
diff --git a/htdocs/partnership/partnershipindex.php b/htdocs/partnership/partnershipindex.php
index 8db6be052bb..8076f105dbb 100644
--- a/htdocs/partnership/partnershipindex.php
+++ b/htdocs/partnership/partnershipindex.php
@@ -58,7 +58,7 @@ if (!$res) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load translation files required by the page
-$langs->loadLangs(array("partnership@partnership"));
+$langs->loadLangs(array("partnership"));
$action = GETPOST('action', 'aZ09');
From 6f1f26096ee2c99973e17c774a20f033c7659d11 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 28 Apr 2021 23:25:26 +0200
Subject: [PATCH 64/64] Debug partnership module
---
htdocs/core/lib/functions.lib.php | 6 +++---
htdocs/modulebuilder/template/myobject_card.php | 8 ++++----
htdocs/partnership/admin/partnership_extrafields.php | 2 +-
htdocs/partnership/admin/setup.php | 2 +-
htdocs/partnership/class/partnership.class.php | 2 +-
htdocs/partnership/partnership_card.php | 6 +++---
6 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 9308ea07d53..c996640bc2c 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3628,7 +3628,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (in_array($pictowithouttext, array('conferenceorbooth', 'collab', 'eventorganization', 'holiday', 'project', 'workstation'))) {
$morecss = 'em088';
}
- if (in_array($pictowithouttext, array('intervention', 'info', 'payment', 'loan', 'stock', 'technic'))) {
+ if (in_array($pictowithouttext, array('intervention', 'info', 'payment', 'loan', 'partnership', 'stock', 'technic'))) {
$morecss = 'em080';
}
@@ -3680,7 +3680,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944',
'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'inventory'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944',
'other'=>'#ddd',
- 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba',
+ 'partnership'=>'#6c6aa8', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba',
'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'timespent'=>'#555',
'uncheck'=>'#800', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa',
'website'=>'#304', 'workstation'=>'#a69944'
@@ -9717,7 +9717,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
$tag = !empty($attr['href']) ? 'a' : 'span';
- return '<'.$tag.' '.$compiledAttributes.'>'.$html.''.$tag.'> ';
+ return '<'.$tag.' '.$compiledAttributes.'>'.$html.''.$tag.'>';
}
/**
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index fe4cd496df0..7de7d8d9c5c 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -492,10 +492,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Back to draft
if ($object->status == $object::STATUS_VALIDATED) {
- print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes', '', $permissiontoadd);
+ print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
}
- print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit', '', $permissiontoadd);
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
// Validate
if ($object->status == $object::STATUS_DRAFT) {
@@ -509,7 +509,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Clone
- print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd);
+ print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken(), '', $permissiontoadd);
/*
if ($permissiontoadd) {
@@ -529,7 +529,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
*/
// Delete (need delete permission, or if draft, just need create/modify permission)
- print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
+ print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
}
print ' '."\n";
}
diff --git a/htdocs/partnership/admin/partnership_extrafields.php b/htdocs/partnership/admin/partnership_extrafields.php
index 3ecf00f2689..a7f8bd9409e 100644
--- a/htdocs/partnership/admin/partnership_extrafields.php
+++ b/htdocs/partnership/admin/partnership_extrafields.php
@@ -102,7 +102,7 @@ print load_fiche_titre($langs->trans("PartnershipSetup"), $linkback, 'object_par
$head = partnershipAdminPrepareHead();
-print dol_get_fiche_head($head, 'partnership_extrafields', $langs->trans("PartnershipExtraFields"), -1, 'partnership');
+print dol_get_fiche_head($head, 'partnership_extrafields', $langs->trans("PartnershipExtraFields"), -1, '');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php
index 46c6e8291db..7894b24b5bb 100644
--- a/htdocs/partnership/admin/setup.php
+++ b/htdocs/partnership/admin/setup.php
@@ -135,7 +135,7 @@ $linkback = 'trans('Accept'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_accept&confirm=yes', '', 0);
- print ''.$langs->trans("Accept").'';
+ print ''.$langs->trans("Validate").'';
}
}
@@ -628,7 +628,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Delete (need delete permission, or if draft, just need create/modify permission)
- print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
+ print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
}
print ''."\n";
}
|