Merge branch 'develop' of github.com:Dolibarr/dolibarr into NEW_stockstransfers

This commit is contained in:
Gauthier PC portable 024 2021-10-07 10:37:09 +02:00
commit 70648477a7
183 changed files with 1003 additions and 638 deletions

View File

@ -154,18 +154,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Other application/modules
- Electronic Document Management (EDM)
- Electronic Document Management (EDM)
- Bookmarks management
- Reporting
- Data export/import
- Barcodes
- Barcodes
- Margin calculations
- LDAP connectivity
- ClickToDial integration
- Mass emailing
- RSS integration
- Skype integration
- Social platforms linking
- Social platforms linking
- Payment platforms integration (PayPal, Stripe, Paybox...)
- Email-Collector
@ -179,14 +179,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Multi-Users and groups with finely grained rights
- Multi-Currency
- Multi-Company (by adding of an external module)
- Very user friendly and easy to use
- customizable Dashboard
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
- APIs (REST, SOAP)
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
- Support a lot of country specific features:
- Spanish Tax RE and ISPF
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
@ -197,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Compatible with European GDPR rules
- ...
- Flexible PDF & ODT generation for invoices, proposals, orders...
-
- ...
### System Environment / Requirements

View File

@ -2056,7 +2056,7 @@ CREATE TABLE `llx_c_holiday_types` (
`label` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`affect` int(11) NOT NULL,
`delay` int(11) NOT NULL,
`newByMonth` double(8,5) NOT NULL DEFAULT 0.00000,
`newbymonth` double(8,5) NOT NULL DEFAULT 0.00000,
`fk_country` int(11) DEFAULT NULL,
`active` int(11) DEFAULT 1,
PRIMARY KEY (`rowid`),

View File

@ -186,12 +186,28 @@ if ($action == 'update') {
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
$ko++;
} else {
$db->begin();
$sql = '';
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, '".$db->escape($accountancy_field_name)."')";
$sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')";
$sql .= " ON DUPLICATE KEY UPDATE ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
$sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
$sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);
$resql_exists = $db->query($sql_exists);
if (!$resql_exists) {
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$resql_exists.'</pre></span></div>';
$ko++;
} else {
$nb_exists = $db->num_rows($resql_exists);
if ($nb_exists <= 0) {
// insert
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, '" . $db->escape($accountancy_field_name) . "')";
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
} else {
$obj_exists = $db->fetch_object($resql_exists);
// update
$sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity";
$sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'";
$sql .= " WHERE rowid = " . ((int) $obj_exists->rowid);
}
}
} else {
$sql = " UPDATE ".MAIN_DB_PREFIX."product";
$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
@ -199,6 +215,9 @@ if ($action == 'update') {
}
dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG);
$db->begin();
if ($db->query($sql)) {
$ok++;
$db->commit();

View File

@ -1012,7 +1012,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (count($listetype)) {
print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1);
} else {
print '<font class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</font>';
print '<span class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</span>';
}
print "</td>\n";
@ -1997,7 +1997,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</div>';
if ($isinspip == -1) {
print '<br><br><font class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</font>';
print '<br><br><span class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</span>';
}

View File

@ -190,7 +190,7 @@ if ($result > 0) {
if (empty($dn)) {
$langs->load("errors");
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</font></td></tr>';
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</span></td></tr>';
} else {
$records = $ldap->getAttribute($dn, $search);
@ -199,7 +199,7 @@ if ($result > 0) {
// Show tree
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
if (!is_array($records)) {
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</span></td></tr>';
} else {
$result = show_ldap_content($records, 0, $records['count'], true);
}

View File

@ -161,7 +161,7 @@ if ($result > 0) {
// Show tree
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
if (!is_array($records)) {
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</span></td></tr>';
} else {
$result = show_ldap_content($records, 0, $records['count'], true);
}

View File

@ -91,7 +91,7 @@ $form = new Form($db);
$formother = new FormOther($db);
$formcompany = new FormCompany($db);
$countrynotdefined = '<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
$countrynotdefined = '<span class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</span>';
print '<span class="opacitymedium">'.$langs->trans("AccountantDesc")."</span><br>\n";
print "<br>\n";

View File

@ -302,7 +302,7 @@ if (!isset($_SERVER['WINDIR'])) {
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.$conf->global->GENBARCODE_LOCATION.'">';
if (!empty($conf->global->GENBARCODE_LOCATION) && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
$langs->load("errors");
print '<br><font class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</font>';
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</span>';
}
print '</td></tr>';
}

View File

@ -369,7 +369,7 @@ $form = new Form($db);
$formother = new FormOther($db);
$formcompany = new FormCompany($db);
$countrynotdefined = '<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
$countrynotdefined = '<span class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</span>';
print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup');

View File

@ -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.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";
$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";
$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";
$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";
@ -548,7 +548,7 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
@ -1394,7 +1394,7 @@ if ($id) {
if ($value == 'delay') {
$valuetoshow = $langs->trans("NoticePeriod");
}
if ($value == 'newByMonth') {
if ($value == 'newbymonth') {
$valuetoshow = $langs->trans("NewByMonth");
}
if ($value == 'fk_tva') {
@ -1739,7 +1739,7 @@ if ($id) {
if ($value == 'delay') {
$valuetoshow = $langs->trans("NoticePeriod");
}
if ($value == 'newByMonth') {
if ($value == 'newbymonth') {
$valuetoshow = $langs->trans("NewByMonth");
}
if ($value == 'fk_tva') {

View File

@ -145,13 +145,18 @@ if ($action == 'updateMask') {
$draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
$res3 = 0;
if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
$res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
}
$dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int');
$res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
$res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
$amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
$res4 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
$res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
if (!($res1 > 0) || !($res2 > 0) || !($res3 > 0) || !($res4 >0)) {
if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) {
$error++;
}
@ -464,6 +469,14 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
print '</td></tr>'."\n";
if (!empty($conf->projet->enabled)) {
print '<tr class="oddeven"><td>';
print $langs->trans('ProjectIsRequiredOnExpenseReports');
print '</td><td class="right">';
print $form->selectyesno('EXPENSEREPORT_PROJECT_IS_REQUIRED', empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED) ? 0 : 1, 1);
print '</td></tr>';
}
print '<tr class="oddeven"><td>';
print $langs->trans('PrefillExpenseReportDatesWithCurrentMonth');
print '</td><td class="right">';

View File

@ -275,9 +275,9 @@ if ($resql) {
print "<td>".$langs->trans("Status")."</td>";
print "<td>";
if ($result > 0 && empty($rss->error)) {
print '<font class="ok">'.$langs->trans("Online").'</div>';
print '<span class="ok">'.$langs->trans("Online").'</div>';
} else {
print '<font class="error">'.$langs->trans("Offline");
print '<span class="error">'.$langs->trans("Offline");
$langs->load("errors");
if ($rssparser->error) {
print ' - '.$langs->trans($rssparser->error);

View File

@ -112,8 +112,8 @@ $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $act
print $hookmanager->resPrint;
if (empty($reshook)) {
// Show into other
print '<span class="opacitymedium">'.$langs->trans("SetupDescription5")."</span><br>";
print "<br>";
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("SetupDescription5")."</span><br>";
print '<br class="hideonsmartphone">';
// Show logo
print '<div class="center"><div class="logo_setup"></div></div>';

View File

@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
*
* 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
@ -153,7 +153,7 @@ $arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP");
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnSynchroActiveExample").'</span>';
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
print '<br><font class="error">'.$langs->trans("LDAPSetupNotComplete").'</font>';
print '<br><span class="error">'.$langs->trans("LDAPSetupNotComplete").'</span>';
}
print '</td></tr>';
@ -297,24 +297,24 @@ if (function_exists("ldap_connect")) {
if ($result > 0) {
// Test ldap connect and bind
print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</font>';
print '<span class="ok">'.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</span>';
print '<br>';
if ($conf->global->LDAP_ADMIN_DN && !empty($conf->global->LDAP_ADMIN_PASS)) {
if ($result == 2) {
print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</font>';
print '<span class="ok">'.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
print '<br>';
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</font>';
print '<span class="error">'.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
print '<br>';
print $langs->trans("Error").' '.$ldap->error;
print '<br>';
}
} else {
print img_picto('', 'warning').' ';
print '<font class="warning">'.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").'</font>';
print '<span class="warning">'.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").'</span>';
print '<br>';
}
@ -322,18 +322,18 @@ if (function_exists("ldap_connect")) {
// Test ldap_getversion
if (($ldap->getVersion() == 3)) {
print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSetupForVersion3").'</font>';
print '<span class="ok">'.$langs->trans("LDAPSetupForVersion3").'</span>';
print '<br>';
} else {
print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSetupForVersion2").'</font>';
print '<span class="ok">'.$langs->trans("LDAPSetupForVersion2").'</span>';
print '<br>';
}
$unbind = $ldap->unbind();
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</font>';
print '<span class="error">'.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</span>';
print '<br>';
print $langs->trans("Error").' '.$ldap->error;
print '<br>';

View File

@ -321,12 +321,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
@ -336,9 +336,9 @@ if (function_exists("ldap_connect")) {
print "\n<br>";
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
}

View File

@ -260,12 +260,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
@ -275,9 +275,9 @@ if (function_exists("ldap_connect")) {
print "\n<br>";
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
}
@ -331,9 +331,9 @@ if (function_exists("ldap_connect")) {
print "\n<br>";
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
}

View File

@ -472,12 +472,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
@ -487,9 +487,9 @@ if (function_exists("ldap_connect")) {
print "\n<br>";
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
}

View File

@ -223,12 +223,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
@ -238,9 +238,9 @@ if (function_exists("ldap_connect")) {
print "\n<br>";
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
}

View File

@ -444,12 +444,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
@ -459,9 +459,9 @@ if (function_exists("ldap_connect")) {
print "\n<br>";
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
}
@ -530,9 +530,9 @@ if (function_exists("ldap_connect")) {
print "\n<br>";
} else {
print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
print '</font><br>';
print '</span><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
}
}

View File

@ -307,7 +307,7 @@ for ($i = 1; $i <= 6; $i++) {
$pid = false;
}
} else {
$pid = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
$pid = img_warning().' <span class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</span>';
}
if ($pid) {
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid.'</td><td>';

View File

@ -183,7 +183,7 @@ if ($action == 'edit') {
if (count($listofmethods)) {
print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, $conf->global->MAIN_SMS_SENDMODE, 1);
} else {
print '<font class="error">'.$langs->trans("None").'</font>';
print '<span class="error">'.$langs->trans("None").'</span>';
}
print '</td></tr>';

View File

@ -132,6 +132,8 @@ if ($action == 'updateMask') {
if ($ret > 0) {
$ret = addDocumentModel($value, $type, $label, $scandir);
}
} elseif ($action == 'unsetdoc') {
dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity);
} elseif ($action == 'setmod') {
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@ -397,7 +399,8 @@ foreach ($dirmodels as $reldir) {
// Default
print '<td class="center">';
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
print img_picto($langs->trans("Default"), 'on');
// print img_picto($langs->trans("Default"), 'on');
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} else {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
}

View File

@ -89,6 +89,8 @@ if ($action == 'updateMask') {
if ($ret > 0) {
$ret = addDocumentModel($value, $type, $label, $scandir);
}
} elseif ($action == 'unsetdoc') {
dolibarr_del_const($db, "SUPPLIER_PAYMENT_ADDON_PDF", $conf->entity);
} elseif ($action == 'specimen') {
$modele = GETPOST('module', 'alpha');

View File

@ -258,6 +258,8 @@ print '<br>';
print '<strong>$dolibarr_nocsrfcheck</strong>: '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck);
if (!empty($dolibarr_nocsrfcheck)) {
print ' &nbsp; '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
} else {
print ' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 0)</span>';
}
print '<br>';

View File

@ -513,7 +513,7 @@ if (!empty($_SESSION["commandbackuplastdone"])) {
$_SESSION["commandbackupresult"] = '';
}
if (!empty($_SESSION["commandbackuptorun"])) {
print '<br><font class="warning">'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':</font><br>'."\n";
print '<br><span class="warning">'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':</span><br>'."\n";
print '<textarea id="commandbackuptoruntext" rows="'.ROWS_2.'" class="centpercent">'.$_SESSION["commandbackuptorun"].'</textarea><br>'."\n";
print ajax_autoselect("commandbackuptoruntext", 0);
print '<br>';

View File

@ -120,7 +120,7 @@ class Documents extends DolibarrApi
*
* Test sample 1: { "modulepart": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }.
*
* @param string $modulepart Name of module or area concerned by file download ('invoice', 'order', ...).
* @param string $modulepart Name of module or area concerned by file download ('thirdparty', 'member', 'proposal', 'supplier_proposal', 'order', 'supplier_order', 'invoice', 'supplier_invoice', 'shipment', 'project', ...)
* @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf).
* @param string $doctemplate Set here the doc template to use for document generation (If not set, use the default template).
* @param string $langcode Language code like 'en_US', 'fr_FR', 'es_ES', ... (If not set, use the default language).
@ -325,6 +325,20 @@ class Documents extends DolibarrApi
throw new RestException(404, 'Proposal not found');
}
$upload_dir = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal');
} elseif ($modulepart == 'supplier_proposal') {
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
if (!DolibarrApiAccess::$user->rights->supplier_proposal->read) {
throw new RestException(401);
}
$object = new Propal($this->db);
$result = $object->fetch($id, $ref);
if (!$result) {
throw new RestException(404, 'Supplier proposal not found');
}
$upload_dir = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal');
} elseif ($modulepart == 'commande' || $modulepart == 'order') {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
@ -340,6 +354,22 @@ class Documents extends DolibarrApi
}
$upload_dir = $conf->commande->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'commande');
} elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') {
$modulepart = 'supplier_order';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
if (empty(DolibarrApiAccess::$user->rights->fournisseur->commande->lire) && empty(DolibarrApiAccess::$user->rights->supplier_order->lire)) {
throw new RestException(401);
}
$object = new CommandeFournisseur($this->db);
$result = $object->fetch($id, $ref);
if (!$result) {
throw new RestException(404, 'Purchase order not found');
}
$upload_dir = $conf->fournisseur->dir_output."/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
} elseif ($modulepart == 'shipment' || $modulepart == 'expedition') {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
@ -373,7 +403,7 @@ class Documents extends DolibarrApi
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
if (!DolibarrApiAccess::$user->rights->fournisseur->facture->lire) {
if (empty(DolibarrApiAccess::$user->rights->fournisseur->facture->lire) && empty(DolibarrApiAccess::$user->rights->supplier_invoice->lire)) {
throw new RestException(401);
}
@ -504,7 +534,7 @@ class Documents extends DolibarrApi
* Test sample for medias file: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }.
*
* @param string $filename Name of file to create ('FA1705-0123.txt')
* @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...)
* @param string $modulepart Name of module or area concerned by file upload ('product', 'service', 'invoice', 'proposal', 'project', 'project_task', 'supplier_invoice', 'expensereport', 'member', ...)
* @param string $ref Reference of object (This will define subdir automatically and store submited file into it)
* @param string $subdir Subdirectory (Only if ref not provided)
* @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)

View File

@ -274,7 +274,7 @@ if ($conf->product->enabled || $conf->product->service) {
} else {
$disabled = 1;
$titleno = $langs->trans("NoBarcodeNumberingTemplateDefined");
print '<font class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined").'</font> (<a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>)<br>';
print '<span class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined").'</span> (<a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>)<br>';
}
if (empty($nbno)) {
$disabled1 = 1;

View File

@ -54,7 +54,9 @@ function bomAdminPrepareHead()
//$this->tabs = array(
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
//); // to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'bom');
complete_head_from_modules($conf, $langs, null, $head, $h, 'bom@mrp');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@mrp', 'remove');
return $head;
}

View File

@ -351,7 +351,7 @@ if ($object->id > 0) {
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
$tmpcheck = $object->check_codeclient();
if ($tmpcheck != 0 && $tmpcheck != -5) {
print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
print ' <span class="error">('.$langs->trans("WrongCustomerCode").')</span>';
}
print '</td></tr>';

View File

@ -912,7 +912,7 @@ if ($action == 'create') {
}
}
if (empty($nbemail)) {
$nbemail .= ' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
$nbemail .= ' '.img_warning('').' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');
@ -1161,7 +1161,7 @@ if ($action == 'create') {
}
}
if (empty($nbemail)) {
$nbemail .= ' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
$nbemail .= ' '.img_warning('').' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');

View File

@ -284,7 +284,7 @@ if ($object->fetch($id) >= 0) {
}
}
if (empty($nbemail)) {
$nbemail .= ' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
$nbemail .= ' '.img_warning('').' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');

View File

@ -363,7 +363,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
}
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).'</span></td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
print '<td>'.$facstatic->getLibStatut(3).'</td>';
$alreadypaid = $facstatic->getSommePaiement();
print '<td>'.$facstatic->getLibStatut(3, $alreadypaid).'</td>';
print '</tr>';
$total_ht += $obj->total_ht;
$total_ttc += $obj->total_ttc;
@ -711,7 +712,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user
print "</tr>\n";
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>';
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <span style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</span> </td>';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
print '<td class="right">'.price($tot_ht).'</td>';
}

View File

@ -165,7 +165,8 @@ class Contact extends CommonObject
/**
* @var int Thirdparty ID
*/
public $socid;
public $socid; // both socid and fk_soc are used
public $fk_soc; // both socid and fk_soc are used
/**
* @var int 0=inactive, 1=active
@ -1027,7 +1028,8 @@ class Contact extends CommonObject
$this->country_code = $obj->country_id ? $obj->country_code : '';
$this->country = $obj->country_id ? ($langs->trans('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : '';
$this->socid = $obj->fk_soc;
$this->fk_soc = $obj->fk_soc; // Both fk_soc and socid are used
$this->socid = $obj->fk_soc; // Both fk_soc and socid are used
$this->socname = $obj->socname;
$this->poste = $obj->poste;
$this->statut = $obj->statut;

View File

@ -173,7 +173,7 @@ if ($result > 0) {
// Show tree
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
if (!is_array($records)) {
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</span></td></tr>';
} else {
$result = show_ldap_content($records, 0, $records['count'], true);
}

View File

@ -129,7 +129,6 @@ if ($action == 'add' && !empty($permissiontoadd)) {
if (!$error) {
$result = $object->create($user);
var_dump($object);exit;
if ($result > 0) {
// Creation OK
if ($conf->categorie->enabled && method_exists($object, 'setCategories')) {
@ -298,6 +297,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
}
$result = $object->delete($user);
if ($result > 0) {
// Delete OK
setEventMessages("RecordDeleted", null, 'mesgs');

View File

@ -102,12 +102,12 @@ if ($action == 'builddoc' && $permissiontoadd) {
if (empty($donotredirect)) { // This is set when include is done by bulk action "Bill Orders"
setEventMessages($langs->trans("FileGenerated"), null);
$urltoredirect = $_SERVER['REQUEST_URI'];
/*$urltoredirect = $_SERVER['REQUEST_URI'];
$urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect);
$urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop
header('Location: '.$urltoredirect.'#builddoc');
exit;
exit;*/
}
}
}

View File

@ -334,7 +334,7 @@ if ($type == 'directory') {
$textifempty = $langs->trans('NoFileFound');
} elseif ($section === '0') {
if ($module == 'ecm') {
$textifempty = '<br><div class="center"><font class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</font></div><br>';
$textifempty = '<br><div class="center"><span class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</span></div><br>';
} else {
$textifempty = $langs->trans('NoFileFound');
}

View File

@ -283,7 +283,7 @@ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_
print '</td>';
print '<td class="left">';
if ($nbofsubdir && $nboffilesinsubdir) {
print '<font color="#AAAAAA">+'.$nboffilesinsubdir.'</font> ';
print '<span style="color: #AAAAAA">+'.$nboffilesinsubdir.'</span> ';
}
print '</td>';
@ -439,7 +439,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir,
print '</td>';
print '<td class="left">';
if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) {
print '<font class="opacitymedium">+'.$nboffilesinsubdir.'</font> ';
print '<span class="opacitymedium">+'.$nboffilesinsubdir.'</span> ';
}
print '</td>';

View File

@ -220,6 +220,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Define array with couple substitution key => substitution value
* For example {company_name}, {company_name_alias}
*
* @param Societe $object Object
* @param Translate $outputlangs Language object for output

View File

@ -5324,7 +5324,7 @@ abstract class CommonObject
$ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content
$ecmfile->keywords = ''; // keyword content
$ecmfile->src_object_type = $this->table_element.(empty($this->module) ? '' : '@'.$this->module);
$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
$ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user);
@ -7808,7 +7808,7 @@ abstract class CommonObject
$out .= $labeltoshow;
}
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) {
$out .= '&nbsp;<font color="red">*</font>';
$out .= '&nbsp;<span style="color: red">*</span>';
}
} else {
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) {

View File

@ -624,14 +624,15 @@ class Conf
if (!empty($this->global->MAILING_EMAIL_FROM)) {
$this->mailing->email_from = $this->global->MAILING_EMAIL_FROM;
}
if (!isset($this->global->MAIN_EMAIL_ADD_TRACK_ID)) {
$this->global->MAIN_EMAIL_ADD_TRACK_ID = 1;
}
if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
$this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
}
if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
$this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
}
// Format for date (used by default when not found or not searched in lang)
$this->format_date_short = "%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions)
$this->format_date_short_java = "dd/MM/yyyy"; // Format of day with Java tags

View File

@ -1268,6 +1268,7 @@ class Form
$selected_input_value = $societetmp->name;
unset($societetmp);
}
// mode 1
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '');
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
@ -1443,6 +1444,10 @@ class Form
$label .= ' ('.$obj->name_alias.')';
}
if ($conf->global->SOCIETE_SHOW_VAT_IN_LIST && !empty($obj->tva_intra)) {
$label .= ' - '.$obj->tva_intra.'';
}
if ($showtype) {
if ($obj->client || $obj->fournisseur) {
$label .= ' (';
@ -1680,11 +1685,6 @@ class Form
if ($resql) {
$num = $this->db->num_rows($resql);
if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
}
if ($htmlname != 'none' && !$options_only) {
$out .= '<select class="flat'.($moreclass ? ' '.$moreclass : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
}
@ -1815,6 +1815,11 @@ class Form
$out .= '</select>';
}
if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
}
$this->num = $num;
return $out;
} else {
@ -5783,11 +5788,11 @@ class Form
return $num;
} else {
$this->error = '<font class="error">'.$langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code).'</font>';
$this->error = '<span class="error">'.$langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code).'</span>';
return -1;
}
} else {
$this->error = '<font class="error">'.$this->db->error().'</font>';
$this->error = '<span class="error">'.$this->db->error().'</span>';
return -2;
}
}
@ -5838,9 +5843,9 @@ class Form
// Check parameters
if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
if ($societe_vendeuse->id == $mysoc->id) {
$return .= '<font class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</font>';
$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
} else {
$return .= '<font class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</font>';
$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
}
return $return;
}
@ -7923,7 +7928,7 @@ class Form
}
if (!$nboftypesoutput) {
print '<tr><td class="impair opacitymedium" colspan="7">'.$langs->trans("None").'</td></tr>';
print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print '</table>';
@ -8789,8 +8794,8 @@ class Form
public function showFilterButtons()
{
$out = '<div class="nowraponall">';
$out .= '<button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
$out .= '<button type="submit" class="liste_titre button_removefilter" name="button_removefilter_x" value="x"><span class="fa fa-remove"></span></button>';
$out .= '<button type="submit" class="liste_titre button_search reposition" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
$out .= '<button type="submit" class="liste_titre button_removefilter reposition" name="button_removefilter_x" value="x"><span class="fa fa-remove"></span></button>';
$out .= '</div>';
return $out;

View File

@ -393,6 +393,38 @@ class FormFile
global $langs, $conf, $user, $hookmanager;
global $form;
$reshook = 0;
if (is_object($hookmanager)) {
$parameters = array(
'modulepart'=>&$modulepart,
'modulesubdir'=>&$modulesubdir,
'filedir'=>&$filedir,
'urlsource'=>&$urlsource,
'genallowed'=>&$genallowed,
'delallowed'=>&$delallowed,
'modelselected'=>&$modelselected,
'allowgenifempty'=>&$allowgenifempty,
'forcenomultilang'=>&$forcenomultilang,
'noform'=>&$noform,
'param'=>&$param,
'title'=>&$title,
'buttonlabel'=>&$buttonlabel,
'codelang'=>&$codelang,
'morepicto'=>&$morepicto,
'hideifempty'=>&$hideifempty,
'removeaction'=>&$removeaction
);
$reshook = $hookmanager->executeHooks('showDocuments', $parameters, $object); // Note that parameters may have been updated by hook
// May report error
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
}
// Remode default action if $reskook > 0
if ($reshook > 0) {
return $hookmanager->resPrint;
}
if (!is_object($form)) {
$form = new Form($this->db);
}
@ -702,9 +734,10 @@ class FormFile
$urlsource .= '#'.$forname.'_form'; // So we switch to form after a generation
}
if (empty($noform)) {
$out .= '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc').'" id="'.$forname.'_form" method="post">';
$out .= '<form action="'.$urlsource.'" id="'.$forname.'_form" method="post">';
}
$out .= '<input type="hidden" name="action" value="builddoc">';
$out .= '<input type="hidden" name="page_y" value="">';
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
$out .= load_fiche_titre($titletoshow, '', '');
@ -754,7 +787,7 @@ class FormFile
}
// Button
$genbutton = '<input class="button buttongen" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"';
$genbutton = '<input class="button buttongen reposition" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"';
$genbutton .= ' type="submit" value="'.$buttonlabel.'"';
if (!$allowgenifempty && !is_array($modellist) && empty($modellist)) {
$genbutton .= ' disabled';
@ -899,19 +932,19 @@ class FormFile
}
$out .= '</td>';
// Show picto delete, print...
if ($delallowed || $printer || $morepicto) {
$out .= '<td class="right nowraponall">';
if ($delallowed) {
$tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource);
$out .= '<a href="'.$tmpurlsource.((strpos($tmpurlsource, '?') === false) ? '?' : '&').'action='.urlencode($removeaction).'&token='.newToken().'&file='.urlencode($relativepath);
$out .= '<a class="reposition" href="'.$tmpurlsource.((strpos($tmpurlsource, '?') === false) ? '?' : '&').'action='.urlencode($removeaction).'&token='.newToken().'&file='.urlencode($relativepath);
$out .= ($param ? '&'.$param : '');
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
$out .= '">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
}
if ($printer) {
//$out.= '<td class="right">';
$out .= '<a class="marginleftonly" href="'.$urlsource.(strpos($urlsource, '?') ? '&' : '?').'action=print_file&token='.newToken().'printer='.urlencode($modulepart).'&file='.urlencode($relativepath);
$out .= '<a class="marginleftonly reposition" href="'.$urlsource.(strpos($urlsource, '?') ? '&' : '?').'action=print_file&token='.newToken().'printer='.urlencode($modulepart).'&file='.urlencode($relativepath);
$out .= ($param ? '&'.$param : '');
$out .= '">'.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').'</a>';
}
@ -959,7 +992,7 @@ class FormFile
}
if (count($file_list) == 0 && count($link_list) == 0 && $headershown) {
$out .= '<tr><td colspan="'.(3 + ($addcolumforpicto ? 1 : 0)).'" class="opacitymedium">'.$langs->trans("None").'</td></tr>'."\n";
$out .= '<tr><td colspan="'.(3 + ($addcolumforpicto ? 1 : 0)).'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'."\n";
}
}
@ -1545,7 +1578,7 @@ class FormFile
*
* @param string $upload_dir Directory that was scanned. This directory will contains files into subdirs REF/files
* @param array $filearray Array of files loaded by dol_dir_list function before calling this function
* @param string $modulepart Value for modulepart used by download wrapper
* @param string $modulepart Value for modulepart used by download wrapper. Value can be $object->table_name (that is 'myobject' or 'mymodule_myobject') or $object->element.'-'.$module (for compatibility purpose)
* @param string $param Parameters on sort links
* @param int $forcedownload Force to open dialog box "Save As" when clicking on file
* @param string $relativepath Relative path of docs (autodefined if not provided)
@ -1709,7 +1742,8 @@ class FormFile
$id = 0;
$ref = '';
// To show ref or specific information according to view to show (defined by $module)
// To show ref or specific information according to view to show (defined by $modulepart)
// $modulepart can be $object->table_name (that is 'mymodule_myobject') or $object->element.'-'.$module (for compatibility purpose)
$reg = array();
if ($modulepart == 'company' || $modulepart == 'tax') {
preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg);
@ -1815,10 +1849,9 @@ class FormFile
// File
// Check if document source has external module part, if it the case use it for module part on document.php
preg_match('/^[^@]*@([^@]*)$/', $modulepart.'@expertisemedical', $modulesuffix);
print '<td>';
//print "XX".$file['name']; //$file['name'] must be utf8
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.(empty($modulesuffix) ? $modulepart : $modulesuffix[1]);
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.urlencode($modulepart);
if ($forcedownload) {
print '&attachment=1';
}
@ -1829,7 +1862,7 @@ class FormFile
//print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$');
print $this->showPreview($file, (empty($modulesuffix) ? $modulepart : $modulesuffix[1]), $file['relativename']);
print $this->showPreview($file, $modulepart, $file['relativename']);
print "</td>\n";

View File

@ -178,7 +178,7 @@ function limitChars(textarea, limit, infodiv)
} else {
if ($this->fromtype) {
$langs->load("errors");
print '<font class="warning"> &lt;'.$langs->trans("ErrorNoPhoneDefinedForThisUser").'&gt; </font>';
print '<span class="warning"> &lt;'.$langs->trans("ErrorNoPhoneDefinedForThisUser").'&gt; </span>';
}
}
print "</td></tr>\n";

View File

@ -724,7 +724,7 @@ function getFormeJuridiqueLabel($code)
function getCountriesInEEC()
{
// List of all country codes that are in europe for european vat rules
// List found on http://ec.europa.eu/taxation_customs/common/faq/faq_1179_en.htm#9
// List found on https://ec.europa.eu/taxation_customs/territorial-status-eu-countries-and-certain-territories_en
global $conf, $db;
$country_code_in_EEC = array();

View File

@ -6156,7 +6156,7 @@ function yn($yesno, $case = 1, $color = 0)
}
}
if ($color) {
return '<font class="'.$classname.'">'.$result.'</font>';
return '<span class="'.$classname.'">'.$result.'</span>';
}
return $result;
}

View File

@ -484,7 +484,7 @@ function getNumberInvoicesPieChart($mode)
$sql .= " sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", 1, 0).") as nblate30";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub15, 'Y-m-d')."'", 1, 0).") as nblate15";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($now, 'Y-m-d')."'", 1, 0).") as nblatenow";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($now, 'Y-m-d')."'", 1, 0).") as nbnotlatenow";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($now, 'Y-m-d')."' OR f.date_lim_reglement IS NULL", 1, 0).") as nbnotlatenow";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd15, 'Y-m-d')."'", 1, 0).") as nbnotlate15";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd30, 'Y-m-d')."'", 1, 0).") as nbnotlate30";
if ($mode == 'customers') {
@ -515,13 +515,20 @@ function getNumberInvoicesPieChart($mode)
,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15)
,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30)
,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30));*/
$dataseries[0]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30);
$dataseries[$i]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30);
$i++;
}
foreach ($dataseries as $key=>$value) {
$total += $value[1];
foreach ($dataseries[0] as $key=>$value) {
$total += $value;
}
$legend = array($langs->trans('InvoiceLate30Days'), $langs->trans('InvoiceLate15Days'), $langs->trans('InvoiceLateMinus15Days'), $langs->trans('InvoiceNotLate'), $langs->trans('InvoiceNotLate15Days'), $langs->trans('InvoiceNotLate30Days'));
$legend = array(
$langs->trans('InvoiceLate30Days'),
$langs->trans('InvoiceLate15Days'),
$langs->trans('InvoiceLateMinus15Days'),
$mode == 'customers' ? $langs->trans('InvoiceNotLate') : $langs->trans("InvoiceToPay"),
$mode == 'customers' ? $langs->trans('InvoiceNotLate15Days') : $langs->trans("InvoiceToPay15Days"),
$mode == 'customers' ? $langs->trans('InvoiceNotLate30Days') : $langs->trans("InvoiceToPay30Days"),
);
$colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11, '-'.$badgeStatus11);
@ -1226,7 +1233,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0)
print "</tr>\n";
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc - $totalam).')</font> </td>';
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <span style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc - $totalam).')</span> </td>';
print '<td>&nbsp;</td>';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
print '<td class="right"><span class="amount">'.price($total).'</span></td>';
@ -1391,7 +1398,7 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0)
print "</tr>\n";
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc - $totalam).')</font> </td>';
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <span style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc - $totalam).')</span> </td>';
print '<td>&nbsp;</td>';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
print '<td class="right">'.price($total).'</td>';

View File

@ -224,7 +224,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
}
if ($type == 'free') {
$out = $urltouse.'/public/payment/newpayment.php?amount='.($mode ? '<font color="#666666">' : '').$amount.($mode ? '</font>' : '').'&tag='.($mode ? '<font color="#666666">' : '').$freetag.($mode ? '</font>' : '');
$out = $urltouse.'/public/payment/newpayment.php?amount='.($mode ? '<span style="color: #666666">' : '').$amount.($mode ? '</span>' : '').'&tag='.($mode ? '<span style="color: #666666">' : '').$freetag.($mode ? '</span>' : '');
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
@ -234,120 +234,120 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
}
//if ($mode) $out.='&noidempotency=1';
} elseif ($type == 'order') {
$out = $urltouse.'/public/payment/newpayment.php?source=order&ref='.($mode ? '<font color="#666666">' : '');
$out = $urltouse.'/public/payment/newpayment.php?source=order&ref='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= 'order_ref';
}
if ($mode == 0) {
$out .= urlencode($ref);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
} else {
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)";
}
if ($mode == 0) {
$out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
}
}
} elseif ($type == 'invoice') {
$out = $urltouse.'/public/payment/newpayment.php?source=invoice&ref='.($mode ? '<font color="#666666">' : '');
$out = $urltouse.'/public/payment/newpayment.php?source=invoice&ref='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= 'invoice_ref';
}
if ($mode == 0) {
$out .= urlencode($ref);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
} else {
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)";
}
if ($mode == 0) {
$out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
}
}
} elseif ($type == 'contractline') {
$out = $urltouse.'/public/payment/newpayment.php?source=contractline&ref='.($mode ? '<font color="#666666">' : '');
$out = $urltouse.'/public/payment/newpayment.php?source=contractline&ref='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= 'contractline_ref';
}
if ($mode == 0) {
$out .= urlencode($ref);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
} else {
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)";
}
if ($mode == 0) {
$out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
}
}
} elseif ($type == 'member' || $type == 'membersubscription') {
$newtype = 'member';
$out = $urltouse.'/public/payment/newpayment.php?source=member&ref='.($mode ? '<font color="#666666">' : '');
$out = $urltouse.'/public/payment/newpayment.php?source=member&ref='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= 'member_ref';
}
if ($mode == 0) {
$out .= urlencode($ref);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
} else {
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$newtype."' + member_ref)";
}
if ($mode == 0) {
$out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$newtype.$ref, 2);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
}
}
}
if ($type == 'donation') {
$out = $urltouse.'/public/payment/newpayment.php?source=donation&ref='.($mode ? '<font color="#666666">' : '');
$out = $urltouse.'/public/payment/newpayment.php?source=donation&ref='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= 'donation_ref';
}
if ($mode == 0) {
$out .= urlencode($ref);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
} else {
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)";
}
if ($mode == 0) {
$out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
}
}
}
@ -450,7 +450,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0,
}
}
print '<font style="font-size: 10px;"><br><hr>'."\n";
print '<span style="font-size: 10px;"><br><hr>'."\n";
print $fromcompany->name.'<br>';
print $line1;
if (strlen($line1.$line2) > 50) {
@ -459,5 +459,5 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0,
print ' - ';
}
print $line2;
print '</font></div>'."\n";
print '</span></div>'."\n";
}

View File

@ -49,7 +49,7 @@ function pdf_admin_prepare_head()
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/admin/pdf.php';
$head[$h][1] = $langs->trans("Common");
$head[$h][1] = $langs->trans("Parameters");
$head[$h][2] = 'general';
$h++;
@ -2240,6 +2240,7 @@ function pdf_getTotalQty($object, $type, $outputlangs)
if (!empty($object->lines[$i]->fk_parent_line)) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$hidedetails = '';
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
$action = '';
$reshook = $hookmanager->executeHooks('pdf_getTotalQty', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks

View File

@ -853,7 +853,7 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho
print $hookmanager->resPrint;
if (empty($reshook)) {
if ($user->login) {
print $langs->trans("CurrentLogin").': <font class="error">'.$user->login.'</font><br>';
print $langs->trans("CurrentLogin").': <span class="error">'.$user->login.'</span><br>';
print $langs->trans("ErrorForbidden2", $langs->transnoentitiesnoconv("Home"), $langs->transnoentitiesnoconv("Users"));
} else {
print $langs->trans("ErrorForbidden3");

View File

@ -63,16 +63,16 @@ function getOnlineSignatureUrl($mode, $type, $ref = '')
$out = '';
if ($type == 'proposal') {
$out = DOL_MAIN_URL_ROOT.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '<font color="#666666">' : '');
$out = DOL_MAIN_URL_ROOT.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= 'proposal_ref';
}
if ($mode == 0) {
$out .= urlencode($ref);
}
$out .= ($mode ? '</font>' : '');
$out .= ($mode ? '</span>' : '');
if ($mode == 1) {
$out .= '&hashp=<font color="#666666">hash_of_file</font>';
$out .= '&hashp=<span style="color: #666666">hash_of_file</span>';
} else {
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propaltmp = new Propal($db);

View File

@ -546,7 +546,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
print '</div>'."\n";
$lastlevel0 = 'enabled';
} elseif ($showmenu) { // Not enabled but visible (so greyed)
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'."\n";
print '<div class="menu_titre">'.$tabstring.'<span class="vmenudisabled">'.$menu_array[$i]['titre'].'</span></div>'."\n";
$lastlevel0 = 'greyed';
} else {
$lastlevel0 = 'hidden';
@ -582,7 +582,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
}
print '</div>'."\n";
} elseif ($showmenu && $lastlevel0 == 'enabled') { // Not enabled but visible (so greyed), except if parent was not enabled.
print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring.'<span class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</span><br></div>'."\n";
}
}

View File

@ -309,7 +309,7 @@ class MenuManager
print '</ul>';
}
if ($val['enabled'] == 2) {
print '<font class="vsmenudisabled">'.$val['titre'].'</font>';
print '<span class="vsmenudisabled">'.$val['titre'].'</span>';
}
print '</li>';
print '</ul>'."\n";

View File

@ -2087,7 +2087,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
print '</div>'."\n";
$lastlevel0 = 'enabled';
} elseif ($showmenu) { // Not enabled but visible (so greyed)
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'."\n";
print '<div class="menu_titre">'.$tabstring.'<span class="vmenudisabled">'.$menu_array[$i]['titre'].'</span></div>'."\n";
$lastlevel0 = 'greyed';
} else {
$lastlevel0 = 'hidden';
@ -2128,7 +2128,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Not enabled but visible (so greyed), except if parent was not enabled.
print '<div class="menu_contenu'.$cssmenu.'">';
print $tabstring;
print '<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
print '<span class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</span><br></div>'."\n";
}
}

View File

@ -317,14 +317,14 @@ class MenuManager
print '</ul>';
}
if ($val['enabled'] == 2) {
print '<font class="vsmenudisabled">';
print '<span class="vsmenudisabled">';
// Add font-awesome
if ($val['level'] == 0 && !empty($val['prefix'])) {
print $val['prefix'];
}
print $val['titre'];
print '</font>';
print '</span>';
}
print '</li>';
print '</ul>'."\n";

View File

@ -320,7 +320,7 @@ class MenuManager
print '</ul>';
}
if ($val['enabled'] == 2) {
print '<font class="vsmenudisabled">'.$val['titre'].'</font>';
print '<span class="vsmenudisabled">'.$val['titre'].'</span>';
}
print '</li>';
print '</ul>'."\n";
@ -407,7 +407,7 @@ class MenuManager
if ($menu_array[$i]['enabled']) {
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.dol_buildpath($menu_array[$i]['url'], 1).'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>'.$menu_array[$i]['titre'].'</a></div>'."\n";
} else {
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'."\n";
print '<div class="menu_titre">'.$tabstring.'<span class="vmenudisabled">'.$menu_array[$i]['titre'].'</span></div>'."\n";
}
print '<div class="menu_top"></div>'."\n";
}
@ -433,7 +433,7 @@ class MenuManager
print '</span>';
}
} else {
print $tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font>';
print $tabstring.'<span class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</span>';
}
// If title is not pure text and contains a table, no carriage return added

View File

@ -295,12 +295,14 @@ class doc_generic_bom_odt extends ModelePDFBom
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
// On peut utiliser le nom de la societe du contact
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -53,7 +53,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
public $phpmin = array(5, 6);
/**
* @var string Dolibarr version of the loaded document
* Dolibarr version of the loaded document
* @var string
*/
public $version = 'dolibarr';
@ -96,7 +97,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
@ -234,6 +235,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$sav_charset_output = $outputlangs->charset_output;
$outputlangs->charset_output = 'UTF-8';
// Load translation files required by the page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
if ($conf->commande->dir_output) {
@ -271,7 +273,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
$newfiletmp = $objectref.'_'.$newfiletmp;
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
@ -307,11 +309,14 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
@ -379,6 +384,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$array_other = $this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in object as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact && is_object($contactobject)) {
$array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact');
}
@ -455,7 +461,6 @@ class doc_generic_order_odt extends ModelePDFCommandes
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

View File

@ -1449,7 +1449,7 @@ class pdf_einstein extends ModelePDFCommandes
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -1634,7 +1634,7 @@ class pdf_eratosthene extends ModelePDFCommandes
}
//Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -295,11 +295,14 @@ class doc_generic_contract_odt extends ModelePDFContract
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -720,7 +720,7 @@ class pdf_strato extends ModelePDFContract
$this->recipient = $object->thirdparty;
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -860,7 +860,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -859,7 +859,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -307,11 +307,14 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a SHIPPING contact and we dont use as recipient we store the contact object for later use
// if we have a SHIPPING contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -29,7 +29,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
/**
* Class to build sending documents with model espadon
@ -651,6 +651,11 @@ class pdf_espadon extends ModelePdfExpedition
$nexY = max($pdf->GetY(), $nexY);
}
if ($this->getColumnStatus('unit_order')) {
$this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit));
$nexY = max($pdf->GetY(), $nexY);
}
if ($this->getColumnStatus('qty_shipped')) {
$this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped);
$nexY = max($pdf->GetY(), $nexY);
@ -1121,7 +1126,7 @@ class pdf_espadon extends ModelePdfExpedition
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
@ -1312,6 +1317,20 @@ class pdf_espadon extends ModelePdfExpedition
),
);
$rank = $rank + 10;
$this->cols['unit_order'] = array(
'rank' => $rank,
'width' => 15, // in mm
'status' => empty($conf->global->PRODUCT_USE_UNITS) ? 0 : 1,
'title' => array(
'textkey' => 'Unit'
),
'border-left' => true, // add left line separator
'content' => array(
'align' => 'C',
),
);
$rank = $rank + 10;
$this->cols['qty_shipped'] = array(
'rank' => $rank,

View File

@ -676,7 +676,7 @@ class pdf_merou extends ModelePdfExpedition
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -1071,7 +1071,7 @@ class pdf_rouget extends ModelePdfExpedition
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -308,11 +308,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
// if we have a BILLING contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -1927,7 +1927,7 @@ class pdf_crabe extends ModelePDFFactures
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -2143,7 +2143,7 @@ class pdf_sponge extends ModelePDFFactures
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -674,7 +674,7 @@ class pdf_soleil extends ModelePDFFicheinter
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -295,11 +295,14 @@ class doc_generic_member_odt extends ModelePDFMember
// Recipient name
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -302,11 +302,14 @@ class doc_generic_mo_odt extends ModelePDFMo
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -118,15 +118,10 @@ class doc_generic_product_odt extends ModelePDFProduct
$form = new Form($this->db);
$texte = $this->description.".<br>\n";
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="setModuleOptions">';
$texte .= '<input type="hidden" name="param1" value="PRODUCT_ADDON_PDF_ODT_PATH">';
if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) {
$texte .= '<input type="hidden" name="param2" value="PRODUCT_ADDON_PDF_ODT_DEFAULT">';
$texte .= '<input type="hidden" name="param3" value="PRODUCT_ADDON_PDF_ODT_TOBILL">';
$texte .= '<input type="hidden" name="param4" value="PRODUCT_ADDON_PDF_ODT_CLOSED">';
}
$texte .= '<table class="nobordernopadding" width="100%">';
// List of directories area
@ -165,35 +160,25 @@ class doc_generic_product_odt extends ModelePDFProduct
$texte .= '<br></div></div>';
// Scan directories
if (count($listofdir)) {
$nbofiles = count($listoffiles);
if (!empty($conf->global->PRODUCT_ADDON_PDF_ODT_PATH)) {
$texte .= $langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
/*if ($conf->global->MAIN_PRODUCT_CHOOSE_ODT_DOCUMENT > 0)
{
// Model for creation
$liste=ModelePDFProduct::liste_modeles($this->db);
$texte.= '<table width="50%;">';
$texte.= '<tr>';
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelPropalCreate").'</td>';
$texte.= '<td colspan="">';
$texte.= $form->selectarray('value2',$liste,$conf->global->PRODUCT_ADDON_PDF_ODT_DEFAULT);
$texte.= "</td></tr>";
$texte.= '<tr>';
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelPropalToBill").'</td>';
$texte.= '<td colspan="">';
$texte.= $form->selectarray('value3',$liste,$conf->global->PRODUCT_ADDON_PDF_ODT_TOBILL);
$texte.= "</td></tr>";
$texte.= '<tr>';
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelPropalClosed").'</td>';
$texte.= '<td colspan="">';
$texte.= $form->selectarray('value4',$liste,$conf->global->PRODUCT_ADDON_PDF_ODT_CLOSED);
$texte.= "</td></tr>";
$texte.= '</table>';
}*/
}
if ($nbofiles) {
$texte .= '<div id="div_'.get_class($this).'" class="hiddenx">';
// Show list of found files
foreach ($listoffiles as $file) {
$texte .= '- '.$file['name'].' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=products/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a><br>';
}
$texte .= '</div>';
}
// Add input to upload a new template file.
$texte .= '<div>'.$langs->trans("UploadNewTemplate").' <input type="file" name="uploadfile">';
$texte .= '<input type="hidden" value="PRODUCT_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
$texte .= '<input type="submit" class="button small" value="'.dol_escape_htmltag($langs->trans("Upload")).'" name="upload">';
$texte .= '</div>';
$texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
@ -319,11 +304,14 @@ class doc_generic_product_odt extends ModelePDFProduct
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
@ -344,7 +332,7 @@ class doc_generic_product_odt extends ModelePDFProduct
// Line of free text
$newfreetext = '';
$paramfreetext = 'product_FREE_TEXT';
$paramfreetext = 'PRODUCT_FREE_TEXT';
if (!empty($conf->global->$paramfreetext)) {
$newfreetext = make_substitutions($conf->global->$paramfreetext, $substitutionarray);
}
@ -372,7 +360,6 @@ class doc_generic_product_odt extends ModelePDFProduct
//print html_entity_decode($odfHandler->__toString());
//print exit;
$object->fetch_optionals();
// Make substitutions into odt of freetext
try {
@ -399,7 +386,7 @@ class doc_generic_product_odt extends ModelePDFProduct
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -480,6 +467,7 @@ class doc_generic_product_odt extends ModelePDFProduct
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if (!empty($conf->global->MAIN_UMASK)) {

View File

@ -335,11 +335,14 @@ class doc_generic_proposal_odt extends ModelePDFPropales
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -1616,7 +1616,7 @@ class pdf_azur extends ModelePDFPropales
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -1731,7 +1731,7 @@ class pdf_cyan extends ModelePDFPropales
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -62,8 +62,7 @@ class doc_generic_reception_odt extends ModelePdfReception
{
global $conf, $langs, $mysoc;
$langs->load("main");
$langs->load("companies");
$langs->loadLangs(array("main", "companies"));
$this->db = $db;
$this->name = "ODT templates";
@ -173,6 +172,11 @@ class doc_generic_reception_odt extends ModelePdfReception
}
$texte .= '</div>';
}
// Add input to upload a new template file.
$texte .= '<div>'.$langs->trans("UploadNewTemplate").' <input type="file" name="uploadfile">';
$texte .= '<input type="hidden" value="RECEPTION_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
$texte .= '<input type="submit" class="button small" value="'.dol_escape_htmltag($langs->trans("Upload")).'" name="upload">';
$texte .= '</div>';
$texte .= '</td>';
@ -223,10 +227,7 @@ class doc_generic_reception_odt extends ModelePdfReception
$sav_charset_output = $outputlangs->charset_output;
$outputlangs->charset_output = 'UTF-8';
$outputlangs->load("main");
$outputlangs->load("dict");
$outputlangs->load("companies");
$outputlangs->load("bills");
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
if ($conf->reception->dir_output."/reception") {
// If $object is id instead of object
@ -288,21 +289,25 @@ class doc_generic_reception_odt extends ModelePdfReception
return -1;
}
// If BILLING contact defined on invoice, we use it
// If CUSTOMER contact defined on reception, we use it
$usecontact = false;
$arrayidcontact = $object->getIdContact('external', 'BILLING');
$arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
if (count($arrayidcontact) > 0) {
$usecontact = true;
$result = $object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
@ -318,6 +323,7 @@ class doc_generic_reception_odt extends ModelePdfReception
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
@ -343,6 +349,7 @@ class doc_generic_reception_odt extends ModelePdfReception
);
} catch (Exception $e) {
$this->error = $e->getMessage();
dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@ -359,67 +366,23 @@ class doc_generic_reception_odt extends ModelePdfReception
dol_syslog($e->getMessage(), LOG_INFO);
}
// Make substitutions into odt of user info
$tmparray = $this->get_substitutionarray_user($user, $outputlangs);
//var_dump($tmparray); exit;
foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
//var_dump($value);exit;
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
} else // Text
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
} catch (OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
// Define substitution array
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
$array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs);
$array_objet = $this->get_substitutionarray_object($object, $outputlangs);
$array_user = $this->get_substitutionarray_user($user, $outputlangs);
$array_soc = $this->get_substitutionarray_mysoc($mysoc, $outputlangs);
$array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
$array_other = $this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in object as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact && is_object($contactobject)) {
$array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact');
}
// Make substitutions into odt of mysoc
$tmparray = $this->get_substitutionarray_mysoc($mysoc, $outputlangs);
//var_dump($tmparray); exit;
foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
//var_dump($value);exit;
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
} else // Text
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
} catch (OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Make substitutions into odt of thirdparty
$tmparray = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
} else // Text
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
} catch (OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of object + external modules
$tmparray = $this->get_substitutionarray_reception($object, $outputlangs);
$tmparray = array_merge($substitutionarray, $array_object_from_properties, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other, $array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
@ -441,25 +404,36 @@ class doc_generic_reception_odt extends ModelePdfReception
}
// Replace tags of lines
try {
$listlines = $odfHandler->setSegment('lines');
foreach ($object->lines as $line) {
$tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $val) {
try {
$listlines->setVars($key, $val, true, 'UTF-8');
} catch (OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
} catch (SegmentException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
$foundtagforlines = 1;
try {
$listlines = $odfHandler->setSegment('lines');
} catch (OdfException $e) {
// We may arrive here if tags for lines not present into template
$foundtagforlines = 0;
dol_syslog($e->getMessage(), LOG_INFO);
}
if ($foundtagforlines) {
$linenumber = 0;
foreach ($object->lines as $line) {
$linenumber++;
$tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $val) {
try {
$listlines->setVars($key, $val, true, 'UTF-8');
} catch (OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
} catch (SegmentException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
}
$odfHandler->mergeSegment($listlines);
}
$odfHandler->mergeSegment($listlines);
} catch (OdfException $e) {
$this->error = $e->getMessage();
dol_syslog($this->error, LOG_WARNING);
@ -486,6 +460,7 @@ class doc_generic_reception_odt extends ModelePdfReception
$odfHandler->exportAsAttachedPDF($file);
} catch (Exception $e) {
$this->error = $e->getMessage();
dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
} else {
@ -493,6 +468,7 @@ class doc_generic_reception_odt extends ModelePdfReception
$odfHandler->saveToDisk($file);
} catch (Exception $e) {
$this->error = $e->getMessage();
dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
@ -505,6 +481,8 @@ class doc_generic_reception_odt extends ModelePdfReception
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
} else {
$this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);

View File

@ -972,7 +972,7 @@ class pdf_squille extends ModelePdfReception
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -308,11 +308,14 @@ class doc_generic_stock_odt extends ModelePDFStock
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -1238,7 +1238,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $mysoc;

View File

@ -298,11 +298,14 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -1407,7 +1407,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -1314,7 +1314,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
}
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;

View File

@ -332,11 +332,14 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -1418,7 +1418,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
// Recipient name
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socname = $object->contact;
} else {
$socname = $object->thirdparty;

View File

@ -293,11 +293,14 @@ class doc_generic_ticket_odt extends ModelePDFTicket
// Recipient name
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -325,7 +325,7 @@ class doc_generic_user_odt extends ModelePDFUser
// Recipient name
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;

View File

@ -315,11 +315,14 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
// Recipient name
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@ -146,10 +146,6 @@ if ($action == 'presend') {
$formmail->trackid = $trackid;
if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid);
}
$formmail->withfrom = 1;
// Fill list of recipient with email inside <>.

View File

@ -135,19 +135,19 @@ if ($permission) {
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="external" />
<input type="hidden" name="page_y" value="" />
<?php if (!empty($withproject)) {
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
} ?>
<div class="tagtd nowrap maxwidthonsmartphone noborderbottom">
<div class="tagtd nowrap noborderbottom">
<?php
$selectedCompany = GETPOSTISSET("newcompany") ? GETPOST("newcompany", 'int') : (empty($object->socid) ? 0 : $object->socid);
$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
</div>
<!-- <div class="tagtd nowrap noborderbottom"><?php echo img_object('', 'contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>-->
<div class="tagtd maxwidthonsmartphone noborderbottom">
<div class="tagtd noborderbottom minwidth500imp">
<?php
print img_object('', 'contact', 'class="pictofixedwidth"').$form->selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp');
print img_object('', 'contact', 'class="pictofixedwidth"').$form->selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp widthcentpercentminusxx maxwidth400');
$nbofcontacts = $form->num;
$newcardbutton = '';
@ -157,7 +157,7 @@ if ($permission) {
print $newcardbutton;
?>
</div>
<div class="tagtd maxwidthonsmartphone noborderbottom">
<div class="tagtd noborderbottom">
<?php
$tmpobject = $object;
if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) {

View File

@ -310,7 +310,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->fil
print '<a class="alogin" href="'.$url.'">'.$langs->trans("LoginUsingOpenID").'</a>';
} else {
$langs->load("errors");
print '<font class="warning">'.$langs->trans("ErrorOpenIDSetupNotComplete", 'MAIN_AUTHENTICATION_OPENID_URL').'</font>';
print '<span class="warning">'.$langs->trans("ErrorOpenIDSetupNotComplete", 'MAIN_AUTHENTICATION_OPENID_URL').'</span>';
}
echo '</div>';

View File

@ -114,10 +114,6 @@ if ($massaction == 'presend') {
$formmail->fromid = $user->id;
}
$formmail->trackid = $trackid;
if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid);
}
$formmail->withfrom = 1;
$liste = $langs->trans("AllRecipientSelected", count($arrayofselected));
if (count($listofselectedthirdparties) == 1) { // Only 1 different recipient selected, we can suggest contacts

View File

@ -195,15 +195,16 @@ if (($line->info_bits & 2) == 2) {
}
}
//print get_date_range($line->date_start, $line->date_end, $format);
}
// Add description in form
if ($line->fk_product > 0 && !empty($conf->global->PRODUIT_DESC_IN_FORM)) {
print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start || $line->date_end) ? '' : '<br>').'<br>'.dol_htmlentitiesbr($line->description) : '';
if ($line->element == 'facturedetrec') {
print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start_fill || $line->date_end_fill) ? '' : '<br>').'<br>'.dol_htmlentitiesbr($line->description) : '';
} else {
print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start || $line->date_end) ? '' : '<br>').'<br>'.dol_htmlentitiesbr($line->description) : '';
}
}
// Line extrafield

View File

@ -271,7 +271,6 @@ class ConferenceOrBooth extends ActionComm
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
//TODO set percent according status
global $conf;

View File

@ -105,9 +105,9 @@ class ConferenceOrBoothAttendee extends CommonObject
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"),
'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1,),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1, 'showoncombobox'=>'1',),
'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'),
'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,),

View File

@ -643,6 +643,7 @@ print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="page_y" value="">';
$title = $langs->trans("ListOfConferencesOrBooths");

View File

@ -57,9 +57,10 @@ $projectstatic = new Project($db);
$diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array
if ($conf_or_booth_id > 0) {
$confOrBooth = new ConferenceOrBooth($db);
$result = $confOrBooth->fetch($conf_or_booth_id);
$result = $confOrBooth->fetch($id > 0 ? $id : $conf_or_booth_id);
if ($result < 0) {
setEventMessages(null, $confOrBooth->errors, 'errors');
} else {
@ -102,6 +103,10 @@ if (empty($action) && empty($id) && empty($ref)) {
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Now we have loaded the attendee, we can force the project (in case value provided as parameter is wrong or value not provided)
if ($object->fk_project > 0) {
$fk_project = $object->fk_project;
}
$permissiontoread = $user->rights->eventorganization->read;
$permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
@ -125,7 +130,7 @@ if (empty($reshook)) {
$error = 0;
if (!empty($withproject)) {
$backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1';
$backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1&fk_project='.((int) $fk_project);
} else {
$backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php';
}
@ -151,7 +156,6 @@ if (empty($reshook)) {
$action = '';
}
$triggermodname = 'EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_MODIFY'; // Name of trigger action code to execute when we modify record
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
@ -653,14 +657,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($user->socid)) {
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle');
}
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken().'', '', $permissiontoadd);
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken(), '', $permissiontoadd);
// Clone
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd);
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontoadd);
// 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&token='.newToken().'', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
}
print '</div>'."\n";
}

View File

@ -697,8 +697,10 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
print '<input type="hidden" name="fk_project" value="'.$fk_project.'">';
print '<input type="hidden" name="page_y" value="">';
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd);
$params = array('morecss'=>'reposition');
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd, $params);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);

Some files were not shown because too many files have changed in this diff Show More