diff --git a/ChangeLog b/ChangeLog index c477a17d684..66bccd31c06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,16 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 15.0.0 compared to 14.0.0 ***** + +For developers: +--------------- + +WARNING: + +Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook. + ***** ChangeLog for 14.0.0 compared to 13.0.0 ***** For users: diff --git a/dev/tools/spider.php b/dev/tools/spider.php new file mode 100644 index 00000000000..954978b24df --- /dev/null +++ b/dev/tools/spider.php @@ -0,0 +1,145 @@ +#!/usr/bin/env php +. + */ + +/** + * \file dev/tools/spider.php + * \brief Script to spider Dolibarr app. + * + * To use it: + * - Disable module "bookmark" + * - Exclude param optioncss, token, sortfield, sortorder + */ + +$crawledLinks=array(); +const MAX_DEPTH=2; + + +/** + * @param string $url URL + * @param string $depth Depth + * @return string String + */ +function followLink($url, $depth = 0) +{ + global $crawledLinks; + $crawling=array(); + if ($depth>MAX_DEPTH) { + echo "
| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' |
| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' |
| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' |
| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' |
| '.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTTERM"); +print ' | '; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTTERM'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTTERM", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM); +} +print ' |
| '.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTMODE"); +print ' | '; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTMODE'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTMODE", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE); +} +print ' |
| '.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").' | ';
if ($conf->use_javascript_ajax) {
diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php
index 4c52182cff7..d24ba63ef55 100644
--- a/htdocs/bookmarks/bookmarks.lib.php
+++ b/htdocs/bookmarks/bookmarks.lib.php
@@ -72,10 +72,12 @@ function printDropdownBookmarksList()
// Url to go on create new bookmark page
$newbtn = '';
if (!empty($user->rights->bookmark->creer)) {
- //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
- $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
- $newbtn .= '';
- $newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'';
+ if (!preg_match('/bookmarks\/card.php/', $_SERVER['PHP_SELF'])) {
+ //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
+ $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
+ $newbtn .= '';
+ $newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'';
+ }
}
// Menu with list of bookmarks
@@ -105,9 +107,11 @@ function printDropdownBookmarksList()
$searchForm .= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...';
// Url to go on create new bookmark page
if (!empty($user->rights->bookmark->creer)) {
- $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
- $searchForm .= '';
+ if (!preg_match('/bookmarks\/card.php/', $_SERVER['PHP_SELF'])) {
+ $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
+ $searchForm .= '';
+ }
}
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 36df3b1a7b9..7f26c83a727 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -123,6 +123,12 @@ abstract class CommonObject
*/
protected $table_ref_field = '';
+ /**
+ * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
+ * @var integer
+ */
+ public $restrictiononfksoc = 0;
+
// Following vars are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them.
@@ -4805,13 +4811,18 @@ abstract class CommonObject
if (!empty($this->lines)) {
foreach ($this->lines as $line) {
- if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) {
+ $reshook = 0;
+ //if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) {
+ if (is_object($hookmanager)) { // Old code is commented on preceding line.
if (empty($line->fk_parent_line)) {
- $parameters = array('line'=>$line, 'i'=>$i);
- $action = '';
- $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+ $parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines);
+ $reshook = $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+ } else {
+ $parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines, 'fk_parent_line'=>$line->fk_parent_line);
+ $reshook = $hookmanager->executeHooks('printOriginObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
}
- } else {
+ }
+ if (empty($reshook)) {
$this->printOriginLine($line, '', $restrictlist, '/core/tpl', $selectedLines);
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 9bcbf08f71a..42ffcbb2f6d 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -958,7 +958,7 @@ class Form
if ($row['code_iso']) {
$labeltoshow .= ' ('.$row['code_iso'].')';
if (empty($hideflags)) {
- $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"');
+ $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
$labeltoshow = $tmpflag.' '.$labeltoshow;
}
}
@@ -969,7 +969,7 @@ class Form
$out .= '';
+ $out .= ''."\n";
}
}
$out .= '';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 899b3b0ffda..a9cb45e06fb 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3790,7 +3790,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
return $fullpathpicto;
}
// tag title is used for tooltip on , tag alt can be used with very simple text on image for blind people
- return ' \n\n__(FindYourSEPAMandate)__ : \n__MYCOMPANY_NAME__ \n__MYCOMPANY_FULLADDRESS__ \n__(Sincerely)__ \n__USER_SIGNATURE__',null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'$conf->societe->enabled && $conf->banque->enabled && $conf->prelevement->enabled',0,'__(YourSEPAMandate)__','__(Hello)__, \n\n__(FindYourSEPAMandate)__ : \n__MYCOMPANY_NAME__ \n__MYCOMPANY_FULLADDRESS__ \n__(Sincerely)__ \n__USER_SIGNATURE__',null, 0); -- Members -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipWasValidated)__ __(FirstName)__ : __MEMBER_FIRSTNAME__ __(LastName)__ : __MEMBER_LASTNAME__ __(ID)__ : __MEMBER_ID__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__ \n\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 1); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfSubscriptionReminderEmail)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(YourMembershipWasCanceled)__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__, \n\n__(ThisIsContentOfYourCard)__ \n__(ID)__ : __ID__ \n__(Civiliyty)__ : __MEMBER_CIVILITY__ \n__(Firstname)__ : __MEMBER_FIRSTNAME__ \n__(Lastname)__ : __MEMBER_LASTNAME__ \n__(Fullname)__ : __MEMBER_FULLNAME__ \n__(Company)__ : __MEMBER_COMPANY__ \n__(Address)__ : __MEMBER_ADDRESS__ \n__(Zip)__ : __MEMBER_ZIP__ \n__(Town)__ : __MEMBER_TOWN__ \n__(Country)__ : __MEMBER_COUNTRY__ \n__(Email)__ : __MEMBER_EMAIL__ \n__(Birthday)__ : __MEMBER_BIRTH__ \n__(Photo)__ : __MEMBER_PHOTO__ \n__(Login)__ : __MEMBER_LOGIN__ \n__(Password)__ : __MEMBER_PASSWORD__ \n__(Phone)__ : __MEMBER_PHONE__ \n__(PhonePerso)__ : __MEMBER_PHONEPRO__ \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__ \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipWasValidated)__ __(FirstName)__ : __MEMBER_FIRSTNAME__ __(LastName)__ : __MEMBER_LASTNAME__ __(ID)__ : __MEMBER_ID__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__ \n\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfSubscriptionReminderEmail)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(YourMembershipWasCanceled)__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__, \n\n__(ThisIsContentOfYourCard)__ \n__(ID)__ : __ID__ \n__(Civiliyty)__ : __MEMBER_CIVILITY__ \n__(Firstname)__ : __MEMBER_FIRSTNAME__ \n__(Lastname)__ : __MEMBER_LASTNAME__ \n__(Fullname)__ : __MEMBER_FULLNAME__ \n__(Company)__ : __MEMBER_COMPANY__ \n__(Address)__ : __MEMBER_ADDRESS__ \n__(Zip)__ : __MEMBER_ZIP__ \n__(Town)__ : __MEMBER_TOWN__ \n__(Country)__ : __MEMBER_COUNTRY__ \n__(Email)__ : __MEMBER_EMAIL__ \n__(Birthday)__ : __MEMBER_BIRTH__ \n__(Photo)__ : __MEMBER_PHOTO__ \n__(Login)__ : __MEMBER_LOGIN__ \n__(Password)__ : __MEMBER_PASSWORD__ \n__(Phone)__ : __MEMBER_PHONE__ \n__(PhonePerso)__ : __MEMBER_PHONEPRO__ \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__ \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); -- Recruiting -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__, \n\n__(YourCandidatureAnswerMessage)__ __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__, \n\n__(YourCandidatureAnswerMessage)__ __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0); -- Event organization INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__ __ONLINE_PAYMENT_TEXT_AND_URL__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null); @@ -41,3 +41,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__ __(Sincerely)__ __MYCOMPANY_NAME__ __USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null); + +-- Partnership +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipWillSoonBeCanceled)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipWillSoonBeCanceledTopic)__', 0, '\n __(Hello)__, \n\n \n\n __(Sincerely)__ \n __[MAIN_INFO_SOCIETE_NOM]__ \n \n'); +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipCanceled)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipCanceledTopic)__', 0, '\n __(Hello)__, \n\n \n\n __(Sincerely)__ \n __[MAIN_INFO_SOCIETE_NOM]__ \n \n'); +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipRefused)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipRefusedTopic)__', 0, '\n __(Hello)__, \n\n \n\n __(Sincerely)__ \n __[MAIN_INFO_SOCIETE_NOM]__ \n \n'); +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipAccepted)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipAcceptedTopic)__', 0, '\n __(Hello)__, \n\n \n\n __(Sincerely)__ \n __[MAIN_INFO_SOCIETE_NOM]__ \n \n'); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 36fc408a2b2..09bc9bbac1e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1193,6 +1193,9 @@ SetupDescription2=The following two sections are mandatory (the two first entrie SetupDescription3=%s -> %s Basic parameters used to customize the default behavior of your application (e.g for country-related features). SetupDescription4=%s -> %s This software is a suite of many modules/applications. The modules related to your needs must be enabled and configured. Menu entries will appears with the activation of these modules. SetupDescription5=Other Setup menu entries manage optional parameters. +SetupDescriptionLink=%s - %s +SetupDescription3b=Basic parameters used to customize the default behavior of your application (e.g for country-related features). +SetupDescription4b=This software is a suite of many modules/applications. The modules related to your needs must be enabled and configured. Menu entries will appears with the activation of these modules. AuditedSecurityEvents=Security events that are audited NoSecurityEventsAreAduited=No security events are audited. You can enable them from menu %s Audit=Security events @@ -1993,6 +1996,8 @@ MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line MAIN_PDF_HIDE_SENDER_NAME=Hide sender name in address +PROPOSAL_PDF_HIDE_PAYMENTTERM=Hide payments conditions +PROPOSAL_PDF_HIDE_PAYMENTMODE=Hide payment mode MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups @@ -2132,6 +2137,7 @@ AskThisIDToYourBank=Contact your bank to get this ID AdvancedModeOnly=Permision available in Advanced permission mode only ConfFileIsReadableOrWritableByAnyUsers=The conf file is readable or writable by any users. Give permission to web server user and group only. MailToSendEventOrganization=Event Organization +MailToPartnership=Partnership AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form YouShouldDisablePHPFunctions=You should disable PHP functions IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands in custom code, you shoud disable PHP functions diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index a94cff8925d..feef3c7e81f 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -65,8 +65,9 @@ class Partnership extends CommonObject const STATUS_DRAFT = 0; - const STATUS_ACCEPTED = 1; - const STATUS_REFUSED = 2; + const STATUS_VALIDATED = 1; // Validate (no more draft) + const STATUS_ACCEPTED = 2; // Approved + const STATUS_REFUSED = 3; // Refused const STATUS_CANCELED = 9; @@ -590,7 +591,7 @@ class Partnership extends CommonObject $error = 0; // Protection - if ($this->status == self::STATUS_ACCEPTED) { + if ($this->status == self::STATUS_VALIDATED) { dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING); return 0; } @@ -619,7 +620,7 @@ class Partnership extends CommonObject // Validate $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql .= " SET ref = '".$this->db->escape($num)."',"; - $sql .= " status = ".self::STATUS_ACCEPTED; + $sql .= " status = ".self::STATUS_VALIDATED; if (!empty($this->fields['date_validation'])) { $sql .= ", date_validation = '".$this->db->idate($now)."'"; } @@ -686,7 +687,7 @@ class Partnership extends CommonObject // Set new ref and current status if (!$error) { $this->ref = $num; - $this->status = self::STATUS_ACCEPTED; + $this->status = self::STATUS_VALIDATED; } if (!$error) { @@ -1064,17 +1065,24 @@ class Partnership extends CommonObject global $langs; //$langs->load("partnership"); $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); $this->labelStatus[self::STATUS_ACCEPTED] = $langs->trans('Accepted'); $this->labelStatus[self::STATUS_REFUSED] = $langs->trans('Refused'); $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated'); $this->labelStatusShort[self::STATUS_ACCEPTED] = $langs->trans('Accepted'); $this->labelStatusShort[self::STATUS_REFUSED] = $langs->trans('Refused'); $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled'); } $statusType = 'status'.$status; - //if ($status == self::STATUS_ACCEPTED) $statusType = 'status1'; + if ($status == self::STATUS_ACCEPTED) { + $statusType = 'status4'; + } + if ($status == self::STATUS_REFUSED) { + $statusType = 'status9'; + } if ($status == self::STATUS_CANCELED) { $statusType = 'status6'; } diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index e79924caf48..e0fa5b90f4c 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2021 NextGestion |