Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop

This commit is contained in:
Darkjeff 2017-08-20 17:47:06 +02:00
commit 9078f36883
80 changed files with 1252 additions and 598 deletions

View File

@ -1,16 +0,0 @@
build
build.xml
ChangeLog
composer.json
CONTRIBUTING.md
COPYING
COPYRIGHT
dev
doc
Dockerfile
INSTALL
README-FR.md
README.md
robots.txt
scripts
test

View File

@ -0,0 +1,3 @@
Dockerfile
README.md
docker-compose.yml

View File

@ -1,4 +1,7 @@
FROM php:5.6-apache
FROM php:7.0-apache
ENV HOST_USER_ID 33
ENV PHP_INI_DATE_TIMEZONE 'UTC'
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
&& rm -rf /var/lib/apt/lists/* \
@ -9,11 +12,9 @@ RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
&& docker-php-ext-install mysqli \
&& apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev
COPY htdocs/ /var/www/html/
RUN chown -hR www-data:www-data /var/www/html
VOLUME /var/www/html/conf
VOLUME /var/www/html/documents
COPY docker-run.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-run.sh
EXPOSE 80
ENTRYPOINT ["docker-run.sh"]

25
build/docker/README.md Normal file
View File

@ -0,0 +1,25 @@
# How to use it ?
The docker-compose.yml file is used to build and run Dolibarr in the current workspace.
Before build/run, define the variable HOST_USER_ID as following:
export HOST_USER_ID=$(id -u)
Go in repository build/docker :
cd build/docker
And then, you can run :
docker-compose up
This will run 3 container Docker : Dolibarr, MariaDB and PhpMyAdmin.
The URL to go to the Dolibarr is :
http://0.0.0.0
The URL to go to PhpMyAdmin is (login/password is root/root) :
http://0.0.0.0:8080

View File

@ -0,0 +1,25 @@
mariadb:
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dolibarr
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
PMA_HOST: mariadb
links:
- mariadb
ports:
- "8080:80"
web:
build: .
environment:
HOST_USER_ID: $HOST_USER_ID
volumes:
- ../../htdocs:/var/www/html
links:
- mariadb
ports:
- "80:80"

View File

@ -0,0 +1,15 @@
#!/bin/bash
usermod -u $HOST_USER_ID www-data
groupmod -g $HOST_USER_ID www-data
chown -hR www-data:www-data /var/www
if [ ! -f /usr/local/etc/php/php.ini ]; then
cat <<EOF > /usr/local/etc/php/php.ini
date.timezone = $PHP_INI_DATE_TIMEZONE
display_errors = On
EOF
fi
exec apache2-foreground

View File

@ -134,7 +134,7 @@ class AdherentType extends CommonObject
$sql.= "note = '".$this->db->escape($this->note)."',";
$sql.= "vote = '".$this->db->escape($this->vote)."',";
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
$sql .= " WHERE rowid =".$this->id;
$sql.= " WHERE rowid =".$this->id;
$result = $this->db->query($sql);
if ($result)
@ -252,7 +252,7 @@ class AdherentType extends CommonObject
$sql = "SELECT rowid, libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " WHERE entity IN (".getEntity('adherent').")";
$resql=$this->db->query($sql);
if ($resql)

View File

@ -389,37 +389,6 @@ $tmplist=array('show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->tra
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
print '</td></tr>'."\n";
// AGENDA NOTIFICATION
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
{
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_NOTIFICATION').'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n";
if (empty($conf->global->AGENDA_NOTIFICATION)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_NOTIFICATION">'.img_picto($langs->trans('Disabled'),'switch_off').'</a>';
print '</td></tr>'."\n";
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_NOTIFICATION">'.img_picto($langs->trans('Enabled'),'switch_on').'</a>';
print '</td></tr>'."\n";
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_NOTIFICATION_SOUND').'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n";
if (empty($conf->global->AGENDA_NOTIFICATION_SOUND)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_NOTIFICATION_SOUND">'.img_picto($langs->trans('Disabled'),'switch_off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_NOTIFICATION_SOUND">'.img_picto($langs->trans('Enabled'),'switch_on').'</a>';
}
print '</td></tr>'."\n";
}
}
print '</table>';
dol_fiche_end();

View File

@ -0,0 +1,255 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/agenda_reminder.php
* \ingroup agenda
* \brief Page to setup agenda reminder options
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("agenda");
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$param = GETPOST('param','alpha');
$cancel = GETPOST('cancel','alpha');
$scandir = GETPOST('scandir','alpha');
$type = 'action';
/*
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if (preg_match('/set_(.*)/',$action,$reg))
{
$code=$reg[1];
$value=(GETPOST($code) ? GETPOST($code) : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
if (preg_match('/del_(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
if ($action == 'set')
{
dolibarr_set_const($db, 'AGENDA_USE_EVENT_TYPE_DEFAULT', GETPOST('AGENDA_USE_EVENT_TYPE_DEFAULT'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', GETPOST('AGENDA_DEFAULT_FILTER_TYPE'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
}
else if ($action == 'specimen') // For orders
{
$modele=GETPOST('module','alpha');
$commande = new CommandeFournisseur($db);
$commande->initAsSpecimen();
$commande->thirdparty=$specimenthirdparty;
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir)
{
$file=dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php",0);
if (file_exists($file))
{
$filefound=1;
$classname = "pdf_".$modele;
break;
}
}
if ($filefound)
{
require_once $file;
$module = new $classname($db,$commande);
if ($module->write_file($commande,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf");
return;
}
else
{
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
// Activate a model
else if ($action == 'setmodel')
{
//print "sssd".$value;
$ret = addDocumentModel($value, $type, $label, $scandir);
}
else if ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
if ($conf->global->ACTION_EVENT_ADDON_PDF == "$value") dolibarr_del_const($db, 'ACTION_EVENT_ADDON_PDF',$conf->entity);
}
}
// Set default model
else if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->ACTION_EVENT_ADDON_PDF = $value;
}
// On active le modele
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
}
/**
* View
*/
$formactions=new FormActions($db);
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
llxHeader();
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print "<br>\n";
$head=agenda_prepare_head();
dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action');
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
print '<input type="hidden" name="action" value="set">';
print '<table class="noborder allwidth">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'.$langs->trans("Value").'</td>'."\n";
print '</tr>'."\n";
// AGENDA REMINDER EMAIL
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
{
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_EMAIL">'.img_picto($langs->trans('Disabled'),'switch_off').'</a>';
print '</td></tr>'."\n";
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_EMAIL">'.img_picto($langs->trans('Enabled'),'switch_on').'</a>';
print '</td></tr>'."\n";
}
}
// AGENDA REMINDER BROWSER
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
{
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER').'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_BROWSER">'.img_picto($langs->trans('Disabled'),'switch_off').'</a>';
print '</td></tr>'."\n";
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_BROWSER">'.img_picto($langs->trans('Enabled'),'switch_on').'</a>';
print '</td></tr>'."\n";
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER_SOUND').'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_BROWSER_SOUND">'.img_picto($langs->trans('Disabled'),'switch_off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_BROWSER_SOUND">'.img_picto($langs->trans('Enabled'),'switch_on').'</a>';
}
print '</td></tr>'."\n";
}
}
print '</table>';
dol_fiche_end();
print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
print '</form>';
print "<br>";
llxFooter();
$db->close();

View File

@ -1,4 +1,5 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
@ -21,15 +22,14 @@
/**
* \file htdocs/admin/bank.php
* \ingroup bank
* \brief Page to setup the bank module
* \ingroup bank
* \brief Page to setup the bank module
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
$langs->load("admin");
$langs->load("companies");
@ -38,12 +38,12 @@ $langs->load("other");
$langs->load("banks");
if (!$user->admin)
accessforbidden();
accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$action = GETPOST('action', 'alpha');
$value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scandir', 'alpha');
$type = 'bankaccount';
@ -52,100 +52,109 @@ $type = 'bankaccount';
*/
//Order display of bank account
if ($action == 'setbankorder')
{
if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",GETPOST('value','alpha'),'chaine',0,'',$conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
if ($action == 'setbankorder') {
if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",
GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) {
header("Location: " . $_SERVER["PHP_SELF"]);
exit;
}
else {
dol_print_error($db);
}
}
//Auto report last num releve on conciliate
if ($action == 'setreportlastnumreleve') {
if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0,
'', $conf->entity) > 0) {
header("Location: " . $_SERVER["PHP_SELF"]);
exit;
}
else {
dol_print_error($db);
}
}
elseif ($action == 'unsetreportlastnumreleve') {
if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0,
'', $conf->entity) > 0) {
header("Location: " . $_SERVER["PHP_SELF"]);
exit;
}
else {
dol_print_error($db);
}
}
if ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
if ($modele == 'sepamandate')
{
if ($action == 'specimen') {
$modele = GETPOST('module', 'alpha');
if ($modele == 'sepamandate') {
$object = new CompanyBankAccount($db);
}
else
{
else {
$object = new Account($db);
}
$object->initAsSpecimen();
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir)
{
$file=dol_buildpath($reldir."core/modules/bank/doc/pdf_".$modele.".modules.php",0);
if (file_exists($file))
{
$filefound=1;
$classname = "pdf_".$modele;
$file = '';
$classname = '';
$filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php",
0);
if (file_exists($file)) {
$filefound = 1;
$classname = "pdf_" . $modele;
break;
}
}
if ($filefound)
{
if ($filefound) {
require_once $file;
$module = new $classname($db);
if ($module->write_file($object,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bank&file=SPECIMEN.pdf");
if ($module->write_file($object, $langs) > 0) {
header("Location: " . DOL_URL_ROOT . "/document.php?modulepart=bank&file=SPECIMEN.pdf");
return;
}
else
{
else {
setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
else
{
else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
// Activate a model
if ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
if ($action == 'set') {
$ret = addDocumentModel($value, $type, $label, $scandir);
}
else if ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
if ($conf->global->BANKADDON_PDF == "$value") dolibarr_del_const($db, 'BANKADDON_PDF',$conf->entity);
}
else if ($action == 'del') {
$ret = delDocumentModel($value, $type);
if ($ret > 0) {
if ($conf->global->BANKADDON_PDF == "$value")
dolibarr_del_const($db, 'BANKADDON_PDF', $conf->entity);
}
}
// Set default model
else if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "BANKADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
else if ($action == 'setdoc') {
if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '',
$conf->entity)) {
// The constant that was read before the new set
// We therefore requires a variable to have a coherent view
$conf->global->BANKADDON_PDF = $value;
}
// On active le modele
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
if ($ret > 0) {
$ret = addDocumentModel($value, $type, $label, $scandir);
}
}
@ -156,80 +165,78 @@ else if ($action == 'setdoc')
* view
*/
$form=new Form($db);
$form = new Form($db);
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
llxHeader("",$langs->trans("BankSetupModule"));
llxHeader("", $langs->trans("BankSetupModule"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("BankSetupModule"),$linkback,'title_setup');
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback,
'title_setup');
$head = bank_admin_prepare_head(null);
dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account');
$var=true;
$var = true;
$var=! $var;
$var = !$var;
//Show bank account order
print load_fiche_titre($langs->trans("BankOrderShow"), '', '');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="140">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Example").'</td>';
print '<td align="center">'.$langs->trans("Status").'</td>';
print '<td width="140">' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td>' . $langs->trans("Example") . '</td>';
print '<td align="center">' . $langs->trans("Status") . '</td>';
print '<td align="center" width="60">&nbsp;</td>';
print "</tr>\n";
$bankorder[0][0]=$langs->trans("BankOrderGlobal");
$bankorder[0][1]=$langs->trans("BankOrderGlobalDesc");
$bankorder[0][2]='BankCode DeskCode BankAccountNumber BankAccountNumberKey';
$bankorder[1][0]=$langs->trans("BankOrderES");
$bankorder[1][1]=$langs->trans("BankOrderESDesc");
$bankorder[1][2]='BankCode DeskCode BankAccountNumberKey BankAccountNumber';
$bankorder[0][0] = $langs->trans("BankOrderGlobal");
$bankorder[0][1] = $langs->trans("BankOrderGlobalDesc");
$bankorder[0][2] = 'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
$bankorder[1][0] = $langs->trans("BankOrderES");
$bankorder[1][1] = $langs->trans("BankOrderESDesc");
$bankorder[1][2] = 'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
$var = true;
$i=0;
$i = 0;
$nbofbank=count($bankorder);
while ($i < $nbofbank)
{
$var = !$var;
$nbofbank = count($bankorder);
while ($i < $nbofbank) {
$var = !$var;
print '<tr class="oddeven">';
print '<td>'.$bankorder[$i][0]."</td><td>\n";
print $bankorder[$i][1];
print '</td>';
print '<td class="nowrap">';
$tmparray=explode(' ',$bankorder[$i][2]);
foreach($tmparray as $key => $val)
{
if ($key > 0) print ', ';
print $langs->trans($val);
}
print "</td>\n";
print '<tr class="oddeven">';
print '<td>' . $bankorder[$i][0] . "</td><td>\n";
print $bankorder[$i][1];
print '</td>';
print '<td class="nowrap">';
$tmparray = explode(' ', $bankorder[$i][2]);
foreach ($tmparray as $key => $val) {
if ($key > 0)
print ', ';
print $langs->trans($val);
}
print "</td>\n";
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i)
{
print '<td align="center">';
print img_picto($langs->trans("Activated"),'on');
print '</td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbankorder&amp;value='.$i.'">';
print img_picto($langs->trans("Disabled"),'off');
print '</a></td>';
}
print '<td>&nbsp;</td>';
print '</tr>'."\n";
$i++;
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) {
print '<td align="center">';
print img_picto($langs->trans("Activated"), 'on');
print '</td>';
}
else {
print '<td align="center"><a href="' . $_SERVER['PHP_SELF'] . '?action=setbankorder&amp;value=' . $i . '">';
print img_picto($langs->trans("Disabled"), 'off');
print '</a></td>';
}
print '<td>&nbsp;</td>';
print '</tr>' . "\n";
$i++;
}
print '</table>'."\n";
print '</table>' . "\n";
print '<br><br>';
@ -257,7 +264,8 @@ if ($resql) {
array_push($def, $array[0]);
$i ++;
}
} else {
}
else {
dol_print_error($db);
}
@ -273,11 +281,10 @@ print "</tr>\n";
clearstatcache();
foreach ($dirmodels as $reldir)
{
foreach ($dirmodels as $reldir) {
foreach (array('', '/doc') as $valdir) {
$dir = dol_buildpath($reldir . "core/modules/bank" . $valdir);
if (is_dir($dir)) {
$handle = opendir($dir);
if (is_resource($handle)) {
@ -286,23 +293,26 @@ foreach ($dirmodels as $reldir)
}
closedir($handle);
arsort($filelist);
foreach ($filelist as $file) {
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/',
$file)) {
if (file_exists($dir . '/' . $file)) {
$name = substr($file, 4, dol_strlen($file) - 16);
$classname = substr($file, 0, dol_strlen($file) - 12);
require_once $dir . '/' . $file;
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL
< 2)
$modulequalified = 0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1)
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL
< 1)
$modulequalified = 0;
if ($modulequalified) {
print '<tr class="oddeven"><td width="100">';
print(empty($module->name) ? $name : $module->name);
@ -312,29 +322,35 @@ foreach ($dirmodels as $reldir)
else
print $module->description;
print '</td>';
// Active
if (in_array($name, $def)) {
print '<td align="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&value=' . $name . '">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print img_picto($langs->trans("Enabled"),
'switch_on');
print '</a>';
print '</td>';
} else {
}
else {
print '<td align="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"),
'switch_off') . '</a>';
print "</td>";
}
// Default
print '<td align="center">';
if ($conf->global->BANKADDON_PDF == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
print img_picto($langs->trans("Default"),
'on');
}
else {
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"),
'off') . '</a>';
}
print '</td>';
// Info
$htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name;
$htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown"));
@ -342,27 +358,33 @@ foreach ($dirmodels as $reldir)
$htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
}
$htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
$htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
$htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo,
1, 1);
//$htmltooltip .= '<br>' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
//$htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1);
$htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1);
$htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang,
1, 1);
// $htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
// $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
//$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
print '<td align="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print $form->textwithpicto('', $htmltooltip, 1,
0);
print '</td>';
// Preview
print '<td align="center">';
if ($module->type == 'pdf') {
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'bill') . '</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"),
'bill') . '</a>';
}
else {
print img_object($langs->trans("PreviewNotAvailable"),
'generic');
}
print '</td>';
print "</tr>\n";
}
}
@ -372,9 +394,51 @@ foreach ($dirmodels as $reldir)
}
}
}
print '</table>';
//}
print '<br /><br />';
/*
* Document templates generators
*/
//if (! empty($conf->global->MAIN_FEATURES_LEVEL))
//{
print load_fiche_titre($langs->trans("BankAccountReleveModule"), '', '');
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td align="center" width="60">' . $langs->trans("Status") . "</td>\n";
print "</tr>\n";
print '<tr class="oddeven"><td width="100">';
print $langs->trans('AccountStatement');
print "</td><td>\n";
print $langs->trans('AutoReportLastAccountStatement');
print '</td>';
// Active
if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
print '<td align="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=unsetreportlastnumreleve">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>';
print '</td>';
}
else {
print '<td align="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setreportlastnumreleve">' . img_picto($langs->trans("Disabled"),
'switch_off') . '</a>';
print "</td>";
}
print "</tr>\n";
print '</table>';
dol_fiche_end();
llxFooter();

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
*
@ -103,6 +103,7 @@ else if ($action == 'delete')
exit;
}
/*
* View
*/

View File

@ -605,7 +605,7 @@ if ($resql)
// print '<td>';
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
print '<input class="flat" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):'').'" size="10">'; // The only default value is value we just entered
print '<input class="flat" id="num_releve" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):'').'" size="10">'; // The only default value is value we just entered
print '</div>';
if ($options) {
print $langs->trans("EventualyAddCategory").': ';
@ -649,6 +649,16 @@ if ($resql)
{
dol_print_error($db);
}
/**
* Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not)
*/
if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE == 1) {
print '
<script type="text/javascript">
$("#num_releve").val("' . $last_releve . '");
</script>
';
}
print '<br><br>';
// print '</td></tr></table>';
}
@ -1117,7 +1127,16 @@ if ($resql)
// Date ope
if (! empty($arrayfields['b.dateo']['checked']))
{
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
print '<td align="center" class="nowrap">';
print '<span id="dateoperation_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->do),"day")."</span>";
print '&nbsp;';
print '<span class="inline-block">';
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=doprev&amp;account='.$objp->bankid.'&amp;rowid='.$objp->rowid.'">';
print img_edit_remove() . "</a> ";
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=donext&amp;account='.$objp->bankid.'&amp;rowid='.$objp->rowid.'">';
print img_edit_add() ."</a>";
print '</span>';
print "</td>\n";
if (! $i) $totalarray['nbfield']++;
}

View File

@ -1959,6 +1959,67 @@ class AccountLine extends CommonObject
}
/**
* Increase/decrease operation date of a rowid
*
* @param int $rowid Id of line
* @param int $sign 1 or -1
* @return int >0 if OK, 0 if KO
*/
function dateo_change($rowid,$sign=1)
{
$sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
$resql = $this->db->query($sql);
if ($resql)
{
$obj=$this->db->fetch_object($resql);
$newdate=$this->db->jdate($obj->dateo)+(3600*24*$sign);
$sql = "UPDATE ".MAIN_DB_PREFIX."bank SET";
$sql.= " dateo = '".$this->db->idate($newdate)."'";
$sql.= " WHERE rowid = ".$rowid;
$result = $this->db->query($sql);
if ($result)
{
if ($this->db->affected_rows($result))
{
return 1;
}
}
else
{
dol_print_error($this->db);
return 0;
}
}
else dol_print_error($this->db);
return 0;
}
/**
* Increase operation date of a rowid
*
* @param int $id Id of line to change
* @return int >0 if OK, 0 if KO
*/
function dateo_next($id)
{
return $this->dateo_change($id,1);
}
/**
* Decrease operation date of a rowid
*
* @param int $id Id of line to change
* @return int >0 if OK, 0 if KO
*/
function dateo_previous($id)
{
return $this->dateo_change($id,-1);
}
/**
* Load miscellaneous information for tab "Info"
*

View File

@ -71,13 +71,20 @@ if ($cancel)
}
}
if ($user->rights->banque->consolidate && $action == 'dvnext')
if ($user->rights->banque->consolidate && $action == 'donext')
{
$al = new AccountLine($db);
$al->dateo_next($_GET["rowid"]);
}elseif ($user->rights->banque->consolidate && $action == 'doprev')
{
$al = new AccountLine($db);
$al->dateo_previous($_GET["rowid"]);
}elseif ($user->rights->banque->consolidate && $action == 'dvnext')
{
$al = new AccountLine($db);
$al->datev_next($_GET["rowid"]);
}
if ($user->rights->banque->consolidate && $action == 'dvprev')
}elseif ($user->rights->banque->consolidate && $action == 'dvprev')
{
$al = new AccountLine($db);
$al->datev_previous($_GET["rowid"]);
@ -479,6 +486,14 @@ if ($result)
{
print '<td>';
print $form->select_date($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
if (! $objp->rappro)
{
print ' &nbsp; ';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=doprev&amp;id='.$id.'&amp;rowid='.$objp->rowid.'">';
print img_edit_remove() . "</a> ";
print '<a href="'.$_SERVER['PHP_SELF'].'?action=donext&amp;id='.$id.'&amp;rowid='.$objp->rowid.'">';
print img_edit_add() ."</a>";
}
print '</td>';
}
else

View File

@ -440,26 +440,26 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
$outputlangs->setDefaultLang($newlang);
}
if(!empty($conf->global->USE_PDFTK_FOR_PDF_CONCAT)) {
if (!empty($conf->global->USE_PDFTK_FOR_PDF_CONCAT))
{
// Create output dir if not exists
dol_mkdir($diroutputmassaction);
// Defined name of merged file
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
$filename=preg_replace('/\s/','_',$filename);
// Save merged file
if ($filter=='paye:0')
{
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
}
if ($year) $filename.='_'.$year;
if ($month) $filename.='_'.$month;
dol_mkdir($diroutputmassaction);
// Defined name of merged file
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
$filename=preg_replace('/\s/','_',$filename);
// Save merged file
if ($filter=='paye:0')
{
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
}
if ($year) $filename.='_'.$year;
if ($month) $filename.='_'.$month;
if (count($files)>0)
{
$now=dol_now();
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
@ -474,14 +474,13 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$langs->load("exports");
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
$langs->load("exports");
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
}
else
{
setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors');
}
}
else {
// Create empty PDF
@ -519,18 +518,18 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
// Save merged file
if ($filter=='paye:0')
{
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
}
if ($year) $filename.='_'.$year;
if ($month) $filename.='_'.$month;
if ($pagecount)
{
$now=dol_now();
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
$pdf->Output($file,'F');
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$now=dol_now();
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
$pdf->Output($file,'F');
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$langs->load("exports");
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');

View File

@ -71,3 +71,27 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
exit;
}
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext')
{
// Increase date
$al = new AccountLine($db);
$al->dateo_next(GETPOST('rowid','int'));
$al->fetch(GETPOST('rowid','int'));
print '<span>'.dol_print_date($db->jdate($al->dateo),"day").'</span>';
exit;
}
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev')
{
// Decrease date
$al =new AccountLine($db);
$al->dateo_previous(GETPOST('rowid','int'));
$al->fetch(GETPOST('rowid','int'));
print '<span>'.dol_print_date($db->jdate($al->dateo),"day").'</span>';
exit;
}

View File

@ -3876,7 +3876,7 @@ abstract class CommonObject
*
* @param string $modelspath Relative folder where generators are placed
* @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf') for example.
* @param Translate $outputlangs Language to use
* @param Translate $outputlangs Output language to use
* @param int $hidedetails 1 to hide details. 0 by default
* @param int $hidedesc 1 to hide product description. 0 by default
* @param int $hideref 1 to hide product reference. 0 by default
@ -3885,7 +3885,7 @@ abstract class CommonObject
*/
protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
{
global $conf, $langs;
global $conf, $langs, $user;
$srctemplatepath='';
@ -3903,7 +3903,6 @@ abstract class CommonObject
$srctemplatepath=$tmp[1];
}
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array('/');
@ -3995,7 +3994,10 @@ abstract class CommonObject
$arrayofrecords = array(); // The write_file of templates of adherent class need this
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, $moreparams);
}
else $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams);
else
{
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams);
}
if ($resultwritefile > 0)
{
@ -4005,6 +4007,58 @@ abstract class CommonObject
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_delete_preview($this);
// Index file in database
if (! empty($obj->result['fullpath']))
{
$destfull = $obj->result['fullpath'];
$upload_dir = dirname($destfull);
$destfile = basename($destfull);
$rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir);
if (! preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir
{
$filename = basename($destfile);
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($this->db);
$result = $ecmfile->fetch(0, '', ($rel_dir?$rel_dir.'/':'').$filename);
if ($result > 0)
{
$ecmfile->label = md5_file(dol_osencode($destfull));
$ecmfile->fullpath_orig = '';
$ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content
$result = $ecmfile->update($user);
if ($result < 0)
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
}
else
{
$ecmfile->filepath = $rel_dir;
$ecmfile->filename = $filename;
$ecmfile->label = md5_file(dol_osencode($destfull));
$ecmfile->fullpath_orig = '';
$ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content
$result = $ecmfile->create($user);
if ($result < 0)
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
}
}
}
else
{
dol_syslog('Method ->write_file was called on object '.get_class($obj).' and return a success but the return array ->result["fullpath"] was not set.', LOG_WARNING);
}
// Success in building document. We build meta file.
dol_meta_create($this);

View File

@ -903,7 +903,8 @@ class FormFile
/**
* Show list of documents in $filearray (may be they are all in same directory but may not)
*
* This also sync database if $upload_dir is defined.
*
* @param array $filearray Array of files loaded by dol_dir_list('files') function before calling this.
* @param Object $object Object on which document is linked to.
* @param string $modulepart Value for modulepart used by download or viewimage wrapper.
@ -1031,78 +1032,10 @@ class FormFile
// Get list of files stored into database for same relative directory
if ($relativedir)
{
$filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC);
//var_dump($filearray);
//var_dump($filearrayindatabase);
// Complete filearray with properties found into $filearrayindatabase
foreach($filearray as $key => $val)
{
$found=0;
// Search if it exists into $filearrayindatabase
foreach($filearrayindatabase as $key2 => $val2)
{
if ($filearrayindatabase[$key2]['name'] == $filearray[$key]['name'])
{
$filearray[$key]['position_name']=($filearrayindatabase[$key2]['position']?$filearrayindatabase[$key2]['position']:'0').'_'.$filearrayindatabase[$key2]['name'];
$filearray[$key]['position']=$filearrayindatabase[$key2]['position'];
$filearray[$key]['cover']=$filearrayindatabase[$key2]['cover'];
$filearray[$key]['acl']=$filearrayindatabase[$key2]['acl'];
$filearray[$key]['rowid']=$filearrayindatabase[$key2]['rowid'];
$filearray[$key]['label']=$filearrayindatabase[$key2]['label'];
$found=1;
break;
}
}
if (! $found) // This happen in transition towerd version 6, or if files were added manually into os dir.
{
$filearray[$key]['position']='999999'; // File not indexed are at end. So if we add a file, it will not replace an existing position
$filearray[$key]['cover']=0;
$filearray[$key]['acl']='';
$rel_filename = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $filearray[$key]['fullname']);
if (! preg_match('/(\/temp\/|\/thumbs|\.meta$)/', $rel_filetorenameafter)) // If not a tmp file
{
dol_syslog("list_of_documents We found a file called '".$filearray[$key]['name']."' not indexed into database. We add it");
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($this->db);
// Add entry into database
$filename = basename($rel_filename);
$rel_dir = dirname($rel_filename);
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
$ecmfile->filepath = $rel_dir;
$ecmfile->filename = $filename;
$ecmfile->label = md5_file(dol_osencode($filearray[$key]['fullname'])); // $destfile is a full path to file
$ecmfile->fullpath_orig = $filearray[$key]['fullname'];
$ecmfile->gen_or_uploaded = 'unknown';
$ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content
$result = $ecmfile->create($user);
if ($result < 0)
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
else
{
$filearray[$key]['rowid']=$result;
}
}
else
{
$filearray[$key]['rowid']=0; // Should not happened
}
}
}
/*var_dump($filearray);
var_dump($sortfield);
var_dump($sortorder);*/
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
/*var_dump($sortfield);
var_dump($sortorder);*/
if ($sortfield && $sortorder)
{
$filearray=dol_sort_array($filearray, $sortfield, $sortorder);

View File

@ -90,7 +90,7 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
if (arr.length > 0) {
var audio = null;
<?php
if (! empty($conf->global->AGENDA_NOTIFICATION_SOUND)) {
if (! empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');';
}
?>

View File

@ -146,7 +146,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
$buf = fgets($fp, 4096);
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
if (preg_match('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i',$buf,$reg))
if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i',$buf,$reg))
{
$qualified=1;
@ -159,20 +159,29 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
// restrict on version
if ($qualified)
{
$versionrequest=explode('.',$reg[2]);
//print var_dump($versionrequest);
//print var_dump($versionarray);
if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0)
{
$qualified=0;
}
if (! empty($reg[2]))
{
if (is_numeric($reg[2])) // This is a version
{
$versionrequest=explode('.',$reg[2]);
//print var_dump($versionrequest);
//print var_dump($versionarray);
if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0)
{
$qualified=0;
}
}
else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE
{
if (empty($conf->db->dolibarr_main_db_collation) || ($reg[2] != strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation)))) $qualified=0;
}
}
}
if ($qualified)
{
// Version qualified, delete SQL comments
$buf=preg_replace('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i','',$buf);
$buf=preg_replace('/^--\sV(MYSQL|PGSQL)([^\s]*)/i','',$buf);
//print "Ligne $i qualifi?e par version: ".$buf.'<br>';
}
}
@ -545,10 +554,17 @@ function security_prepare_head()
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/security_file.php";
$head[$h][1] = $langs->trans("Files");
$head[$h][1] = $langs->trans("Files").' ('.$langs->trans("Upload").')';
$head[$h][2] = 'file';
$h++;
/*
$head[$h][0] = DOL_URL_ROOT."/admin/security_file_download.php";
$head[$h][1] = $langs->trans("Files").' ('.$langs->trans("Download").')';
$head[$h][2] = 'filedownload';
$h++;
*/
$head[$h][0] = DOL_URL_ROOT."/admin/proxy.php";
$head[$h][1] = $langs->trans("ExternalAccess");
$head[$h][2] = 'proxy';

View File

@ -412,6 +412,14 @@ function agenda_prepare_head()
$head[$h][2] = 'autoactions';
$h++;
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
{
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php";
$head[$h][1] = $langs->trans("Reminders");
$head[$h][2] = 'reminders';
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php";
$head[$h][1] = $langs->trans("ExportCal");
$head[$h][2] = 'xcal';

View File

@ -284,6 +284,90 @@ function dol_dir_list_in_database($path, $filter="", $excludefilter=null, $sortc
}
/**
* Complete $filearray with data from database.
* This will call doldir_list_indatabase to complate filearray.
*
* @param $filearray Array of files get using dol_dir_list
* @param $relativedir Relative dir from DOL_DATA_ROOT
* @return void
*/
function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir)
{
global $db, $user;
$filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC);
//var_dump($filearray);
//var_dump($filearrayindatabase);
// Complete filearray with properties found into $filearrayindatabase
foreach($filearray as $key => $val)
{
$found=0;
// Search if it exists into $filearrayindatabase
foreach($filearrayindatabase as $key2 => $val2)
{
if ($filearrayindatabase[$key2]['name'] == $filearray[$key]['name'])
{
$filearray[$key]['position_name']=($filearrayindatabase[$key2]['position']?$filearrayindatabase[$key2]['position']:'0').'_'.$filearrayindatabase[$key2]['name'];
$filearray[$key]['position']=$filearrayindatabase[$key2]['position'];
$filearray[$key]['cover']=$filearrayindatabase[$key2]['cover'];
$filearray[$key]['acl']=$filearrayindatabase[$key2]['acl'];
$filearray[$key]['rowid']=$filearrayindatabase[$key2]['rowid'];
$filearray[$key]['label']=$filearrayindatabase[$key2]['label'];
$found=1;
break;
}
}
if (! $found) // This happen in transition toward version 6, or if files were added manually into os dir.
{
$filearray[$key]['position']='999999'; // File not indexed are at end. So if we add a file, it will not replace an existing position
$filearray[$key]['cover']=0;
$filearray[$key]['acl']='';
$rel_filename = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $filearray[$key]['fullname']);
if (! preg_match('/([\\/]temp[\\/]|[\\/]thumbs|\.meta$)/', $rel_filetorenameafter)) // If not a tmp file
{
dol_syslog("list_of_documents We found a file called '".$filearray[$key]['name']."' not indexed into database. We add it");
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($db);
// Add entry into database
$filename = basename($rel_filename);
$rel_dir = dirname($rel_filename);
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
$ecmfile->filepath = $rel_dir;
$ecmfile->filename = $filename;
$ecmfile->label = md5_file(dol_osencode($filearray[$key]['fullname'])); // $destfile is a full path to file
$ecmfile->fullpath_orig = $filearray[$key]['fullname'];
$ecmfile->gen_or_uploaded = 'unknown';
$ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content
$result = $ecmfile->create($user);
if ($result < 0)
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
else
{
$filearray[$key]['rowid']=$result;
}
}
else
{
$filearray[$key]['rowid']=0; // Should not happened
}
}
}
/*var_dump($filearray);*/
}
/**
* Fast compare of 2 files identified by their properties ->name, ->date and ->size
*
@ -679,7 +763,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep
* Move a file into another name.
* Note:
* - This function differs from dol_move_uploaded_file, because it can be called in any context.
* - Database of files is updated.
* - Database indexes for files are updated.
* - Test on antivirus is done only if param testvirus is provided and an antivirus was set.
*
* @param string $srcfile Source file (can't be a directory. use native php @rename() to move a directory)
@ -742,7 +826,7 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1, $testvi
// Rename entry into ecm database
$rel_filetorenamebefore = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $srcfile);
$rel_filetorenameafter = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $destfile);
if (! preg_match('/(\/temp\/|\/thumbs|\.meta$)/', $rel_filetorenameafter)) // If not a tmp file
if (! preg_match('/([\\/]temp[\\/]|[\\/]thumbs|\.meta$)/', $rel_filetorenameafter)) // If not a tmp file
{
$rel_filetorenamebefore = preg_replace('/^[\\/]/', '', $rel_filetorenamebefore);
$rel_filetorenameafter = preg_replace('/^[\\/]/', '', $rel_filetorenameafter);
@ -999,7 +1083,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
}
/**
* Remove a file or several files with a mask
* Remove a file or several files with a mask.
* This delete file physically but also database indexes.
*
* @param string $file File to delete or mask of files to delete
* @param int $disableglob Disable usage of glob like * so function is an exact delete function that will return error if no file found
@ -1239,16 +1324,17 @@ function dol_delete_preview($object)
/**
* Create a meta file with document file into same directory.
* This should allow "grep" search.
* This feature is enabled only if option MAIN_DOC_CREATE_METAFILE is set.
* This make "grep" search possible.
* This feature to generate the meta file is enabled only if option MAIN_DOC_CREATE_METAFILE is set.
*
* @param CommonObject $object Object
* @return int 0 if we did nothing, >0 success, <0 error
* @return int 0 if do nothing, >0 if we update meta file too, <0 if KO
*/
function dol_meta_create($object)
{
global $conf;
// Create meta file
if (empty($conf->global->MAIN_DOC_CREATE_METAFILE)) return 0; // By default, no metafile.
// Define parent dir of elements
@ -1266,9 +1352,9 @@ function dol_meta_create($object)
{
$object->fetch_thirdparty();
$facref = dol_sanitizeFileName($object->ref);
$dir = $dir . "/" . $facref;
$file = $dir . "/" . $facref . ".meta";
$objectref = dol_sanitizeFileName($object->ref);
$dir = $dir . "/" . $objectref;
$file = $dir . "/" . $objectref . ".meta";
if (! is_dir($dir))
{
@ -1283,15 +1369,15 @@ function dol_meta_create($object)
DATE=\"" . dol_print_date($object->date,'') . "\"
NB_ITEMS=\"" . $nblignes . "\"
CLIENT=\"" . $client . "\"
TOTAL_HT=\"" . $object->total_ht . "\"
TOTAL_TTC=\"" . $object->total_ttc . "\"\n";
AMOUNT_WO_TAX=\"" . $object->total_ht . "\"
AMOUNT_INC_TAX=\"" . $object->total_ttc . "\"\n";
for ($i = 0 ; $i < $nblignes ; $i++)
{
//Pour les articles
$meta .= "ITEM_" . $i . "_QUANTITY=\"" . $object->lines[$i]->qty . "\"
ITEM_" . $i . "_TOTAL_HT=\"" . $object->lines[$i]->total_ht . "\"
ITEM_" . $i . "_TVA=\"" .$object->lines[$i]->tva_tx . "\"
ITEM_" . $i . "_AMOUNT_WO_TAX=\"" . $object->lines[$i]->total_ht . "\"
ITEM_" . $i . "_VAT=\"" .$object->lines[$i]->tva_tx . "\"
ITEM_" . $i . "_DESCRIPTION=\"" . str_replace("\r\n","",nl2br($object->lines[$i]->desc)) . "\"
";
}
@ -1305,6 +1391,10 @@ function dol_meta_create($object)
return 1;
}
else
{
dol_syslog('FailedToDetectDirInDolMetaCreateFor'.$object->element, LOG_WARNING);
}
return 0;
}
@ -1343,7 +1433,7 @@ function dol_init_file_process($pathtoscan='', $trackid='')
/**
* Get and save an upload file (for example after submitting a new file a mail form).
* Get and save an upload file (for example after submitting a new file a mail form). Database index of file is also updated if donotupdatesession is set.
* All information used are in db, conf, langs, user and _FILES.
* Note: This function can be used only into a HTML page context.
*
@ -1437,7 +1527,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
{
$rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir);
if (! preg_match('/[\\/]temp[\\/]/', $rel_dir)) // If not a tmp dir
if (! preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir
{
$filename = basename($destfile);
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);

View File

@ -748,7 +748,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($content), 0, 'C', 0);
$pdf->SetXY($curx, $cury + 1);
$curx += $tmplength;
$pdf->SetFont('', 'B', $default_font_size - 4);
$pdf->SetFont('', 'B', $default_font_size - $diffsizecontent);
$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities($val), 0, 'C', 0);
if (empty($onlynumber)) {
$pdf->line($curx, $cury + 1, $curx, $cury + 7);
@ -794,6 +794,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
$pdf->MultiCell(100, 3, $val, 0, 'L', 0);
$tmpy=$pdf->getStringHeight(100, $val);
$cury+=$tmpy;
$cur+=1;
}
else if (! $usedetailedbban) $cury+=1;

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
@ -583,11 +583,11 @@ function tax_by_date($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
{
$oldrowid=$assoc['rowid'];
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
$list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1'];
$list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2'];
}
$list[$assoc['rate']]['vat'] = $assoc['total_vat'];
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
$list[$assoc['rate']]['dtype'][] = 'ExpenseReportPayment';
$list[$assoc['rate']]['datef'][] = $assoc['datef'];

View File

@ -178,6 +178,8 @@ class CommActionRapport
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1;
}
}

View File

@ -249,6 +249,8 @@ class pdf_ban extends ModeleBankAccountDoc
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -396,6 +396,8 @@ class pdf_sepamandate extends ModeleBankAccountDoc
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -193,6 +193,8 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
$outputlangs->charset_output=$sav_charset_output;
return 1; // Pas d'erreur
}

View File

@ -275,9 +275,9 @@ class doc_generic_order_odt extends ModelePDFCommandes
dol_mkdir($conf->commande->dir_temp);
// If BILLING contact defined on invoice, we use it
// If CUSTOMER contact defined on order, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING');
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
if (count($arrayidcontact) > 0)
{
$usecontact=true;
@ -289,7 +289,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else $socobject = $object->thirdparty;
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
$contactobject = $object->contact;
}
}
else
{
@ -356,8 +360,12 @@ class doc_generic_order_odt extends ModelePDFCommandes
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in order as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact)
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
@ -459,6 +467,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -603,6 +603,8 @@ class pdf_einstein extends ModelePDFCommandes
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -454,6 +454,8 @@ class doc_generic_contract_odt extends ModelePDFContract
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -396,6 +396,8 @@ class pdf_strato extends ModelePDFContract
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1;
}
else

View File

@ -259,6 +259,8 @@ class html_cerfafr extends ModeleDon
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1;
}
else

View File

@ -510,6 +510,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -359,6 +359,8 @@ class pdf_merou extends ModelePdfExpedition
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1;
}
else

View File

@ -567,6 +567,8 @@ class pdf_rouget extends ModelePdfExpedition
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // No error
}
else

View File

@ -474,6 +474,8 @@ class pdf_standard extends ModeleExpenseReport
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -474,6 +474,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -701,6 +701,8 @@ class pdf_crabe extends ModelePDFFactures
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // No error
}
else

View File

@ -392,6 +392,8 @@ class pdf_soleil extends ModelePDFFicheinter
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1;
}
else

View File

@ -566,6 +566,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // pas d'erreur
}
else

View File

@ -418,6 +418,8 @@ class pdf_standard extends CommonStickerGenerator
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
// Output to http stream
if (empty($nooutput))
{

View File

@ -326,8 +326,6 @@ class pdf_standardlabel extends CommonStickerGenerator
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
// Output to http stream
clearstatcache();
@ -346,6 +344,8 @@ class pdf_standardlabel extends CommonStickerGenerator
readfile($file);
$this->result = array('fullpath'=>$file);
return 1;
}
}

View File

@ -367,8 +367,6 @@ class pdf_tcpdflabel extends CommonStickerGenerator
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
// Output to http stream
clearstatcache();
@ -387,6 +385,8 @@ class pdf_tcpdflabel extends CommonStickerGenerator
readfile($file);
$this->result = array('fullpath'=>$file);
return 1;
}
}

View File

@ -483,6 +483,8 @@ class doc_generic_product_odt extends ModelePDFProduct
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -542,6 +542,8 @@ class pdf_standard extends ModelePDFProduct
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -1066,6 +1066,8 @@ class doc_generic_project_odt extends ModelePDFProjects
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -329,6 +329,8 @@ class pdf_baleine extends ModelePDFProjects
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$ this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -503,6 +503,8 @@ class pdf_beluga extends ModelePDFProjects
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -829,6 +829,8 @@ class doc_generic_task_odt extends ModelePDFTask
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -494,6 +494,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -451,8 +451,6 @@ class pdf_azur extends ModelePDFPropales
// Description of product line
$curX = $this->posxdesc-1;
$showpricebeforepagebreak=1;
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
$pageposafter=$pdf->getPage();
@ -761,6 +759,8 @@ class pdf_azur extends ModelePDFPropales
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -275,7 +275,9 @@ class pdf_paiement
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1;
}

View File

@ -274,6 +274,8 @@ class pdf_paiement_fourn
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1;
}

View File

@ -459,6 +459,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -539,6 +539,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -110,17 +110,17 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if ($conf->global->PRODUCT_USE_UNITS)
{
$this->posxtva=99;
$this->posxtva=95;
$this->posxup=114;
$this->posxqty=130;
$this->posxqty=132;
$this->posxunit=147;
} else {
$this->posxtva=112;
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
}
//if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxup = $this->posxtva; // posxtva is picture position reference
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format
{
@ -167,6 +167,44 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$outputlangs->load("products");
$outputlangs->load("orders");
$nblignes = count($object->lines);
// Loop on each lines to detect if there is at least one image to show
$realpatharray=array();
if (! empty($conf->global->MAIN_GENERATE_SUPPLIER_ORDER_WITH_PICTURE))
{
for ($i = 0 ; $i < $nblignes ; $i++)
{
if (empty($object->lines[$i]->fk_product)) continue;
$objphoto = new Product($this->db);
$objphoto->fetch($object->lines[$i]->fk_product);
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
{
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
$dir = $conf->product->dir_output.'/'.$pdir;
}
else
{
$pdir = get_exdir(0,2,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/';
$dir = $conf->product->dir_output.'/'.$pdir;
}
$realpath='';
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
{
$filename=$obj['photo'];
//if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette'];
$realpath = $dir.$filename;
break;
}
if ($realpath) $realpatharray[$i]=$realpath;
}
}
if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva;
if ($conf->fournisseur->dir_output.'/commande')
{
$object->fetch_thirdparty();
@ -338,16 +376,52 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0);
// Define size of image if we need it
$imglinesize=array();
if (! empty($realpatharray[$i])) $imglinesize=pdf_getSizeForImage($realpatharray[$i]);
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
$showpricebeforepagebreak=1;
$posYAfterImage=0;
$posYAfterDescription=0;
// We start with Photo of product line
if (!empty($imglinesize['width']) && !empty($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page
{
$pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposbefore+1);
$curY = $tab_top_newpage;
$showpricebeforepagebreak=0;
}
if (!empty($imglinesize['width']) && !empty($imglinesize['height']))
{
$curX = $this->posxpicture-1;
$pdf->Image($realpatharray[$i], $curX + (($this->posxtva-$this->posxpicture-$imglinesize['width'])/2), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi
// $pdf->Image does not increase value return by getY, so we save it manually
$posYAfterImage=$curY+$imglinesize['height'];
}
// Description of product line
$curX = $this->posxdesc-1;
$showpricebeforepagebreak=1;
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1);
if ($posYAfterImage > 0)
{
$descWidth = $this->posxpicture-$curX;
}
else
{
$descWidth = $this->posxtva-$curX;
}
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$descWidth,3,$curX,$curY,$hideref,$hidedesc,1);
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
@ -355,7 +429,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,1);
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$descWidth,3,$curX,$curY,$hideref,$hidedesc,1);
$posyafter=$pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{
@ -472,6 +546,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
$this->tva[$vatrate] += $tvaligne;
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
// Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
@ -563,6 +638,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else
@ -924,7 +1001,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
$pdf->line($this->posxtva, $tab_top, $this->posxtva, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->posxtva-3, $tab_top+1);
@ -932,7 +1009,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
}
}
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
$pdf->line($this->posxup, $tab_top, $this->posxup, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->posxup-1, $tab_top+1);

View File

@ -442,6 +442,8 @@ class pdf_standard extends ModelePDFSuppliersPayments
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else

View File

@ -486,6 +486,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -108,7 +108,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->posxqty=145;
$this->posxdiscount=162;
$this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxup=$this->posxtva;
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format
{
@ -357,7 +357,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$posYAfterDescription=0;
// We start with Photo of product line
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page
if (!empty($imglinesize['width']) && !empty($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page
{
$pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
@ -368,7 +368,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$showpricebeforepagebreak=0;
}
if (isset($imglinesize['width']) && isset($imglinesize['height']))
if (!empty($imglinesize['width']) && !empty($imglinesize['height']))
{
$curX = $this->posxpicture-1;
$pdf->Image($realpatharray[$i], $curX + (($this->posxtva-$this->posxpicture-$imglinesize['width'])/2), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi
@ -380,7 +380,15 @@ class pdf_aurore extends ModelePDFSupplierProposal
$curX = $this->posxdesc-1;
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
if ($posYAfterImage > 0)
{
$descWidth = $this->posxpicture-$curX;
}
else
{
$descWidth = $this->posxtva-$curX;
}
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$descWidth,3,$curX,$curY,$hideref,$hidedesc,1);
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
@ -389,7 +397,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$descWidth,3,$curX,$curY,$hideref,$hidedesc);
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
@ -597,6 +605,8 @@ class pdf_aurore extends ModelePDFSupplierProposal
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1; // Pas d'erreur
}
else
@ -1131,20 +1141,10 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
}
if (! empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE))
{
$pdf->line($this->posxpicture-1, $tab_top, $this->posxpicture-1, $tab_top + $tab_height);
if (empty($hidetop))
{
//$pdf->SetXY($this->posxpicture-1, $tab_top+1);
//$pdf->MultiCell($this->posxtva-$this->posxpicture-1,2, $outputlangs->transnoentities("Photo"),'','C');
}
}
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
//$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
$pdf->line($this->posxtva-2, $tab_top, $this->posxtva-2, $tab_top + $tab_height);
$pdf->line($this->posxtva, $tab_top, $this->posxtva, $tab_top + $tab_height);
//$pdf->line($this->posxtva-2, $tab_top, $this->posxtva-2, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->posxtva-5, $tab_top+1);

View File

@ -408,6 +408,8 @@ class doc_generic_user_odt extends ModelePDFUser
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -485,6 +485,8 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -67,21 +67,29 @@ elseif ($module == 'product') { $permission=$user->rights->produit->creer;
if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:95%'; // Rem: This var is for all notes, not only thirdparties note.
else $typeofdata='textarea:12:95%';
print '<!-- BEGIN PHP TEMPLATE NOTES -->'."\n";
print '<div class="tagtable border table-border centpercent">'."\n";
if ($module != 'product') {
// No public note yet on products
print '<div class="tagtr table-border-row">'."\n";
print '<div class="tagtd tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'">'."\n";
print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0);
print '</div>'."\n";
print '<div class="tagtd table-val-border-col">'."\n";
print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n";
print '</div>'."\n";
print '</div>'."\n";
}
if (empty($user->societe_id)) {
print '<div class="tagtr table-border-row">'."\n";
print '<div class="tagtd tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass); .'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'">'."\n";
print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0);
print '</div>'."\n";
print '<div class="tagtd table-val-border-col">'."\n";
print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1);
print '</div>'."\n";
print '</div>'."\n";
}
print '</div>'."\n";
?>
<!-- BEGIN PHP TEMPLATE NOTES -->
<div class="tagtable border table-border centpercent">
<?php if ($module != 'product') { // No public note yet on products ?>
<div class="tagtr table-border-row">
<div class="tagtd tdtop table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); ?></div>
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?></div>
</div>
<?php } ?>
<?php if (empty($user->societe_id)) { ?>
<div class="tagtr table-border-row">
<div class="tagtd tdtop table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); ?></div>
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?></div>
</div>
<?php } ?>
</div>
<!-- END PHP TEMPLATE NOTES-->

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com>
*
* 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
@ -18,16 +19,20 @@
?>
<!-- BEGIN PHP TEMPLATE originproductline.tpl.php -->
<tr <?php echo $bc[$var]; ?>>
<td><?php echo $this->tpl['label']; ?></td>
<td><?php echo $this->tpl['description']; ?></td>
<td align="right"><?php echo $this->tpl['vat_rate']; ?></td>
<td align="right"><?php echo $this->tpl['price']; ?></td>
<?php if (!empty($conf->multicurrency->enabled)) { ?><td align="right"><?php echo $this->tpl['multicurrency_price']; ?></td><?php } ?>
<td align="right"><?php echo $this->tpl['qty']; ?></td>
<?php
if($conf->global->PRODUCT_USE_UNITS) echo '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>';
?>
<td align="right"><?php echo $this->tpl['remise_percent']; ?></td>
</tr>
<?php
print '<tr'.$bc[$var].'>';
print '<td>'.$this->tpl['label'].'</td>';
print '<td>'.$this->tpl['description'].'</td>';
print '<td align="right">'.$this->tpl['vat_rate'].'</td>';
print '<td align="right">'.$this->tpl['price'].'</td>';
if (!empty($conf->multicurrency->enabled))
print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>';
print '<td align="right">'.$this->tpl['qty'].'</td>';
if($conf->global->PRODUCT_USE_UNITS)
print '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>';
print '<td align="right">'.$this->tpl['remise_percent'].'</td>';
print '</tr>'."\n";
?>
<!-- END PHP TEMPLATE originproductline.tpl.php -->

View File

@ -231,12 +231,12 @@ class EcmFiles //extends CommonObject
/**
* Load object in memory from the database
*
* @param int $id Id object
* @param string $ref Not used yet. Will contains a hash id from filename+filepath
* @param string $fullpath Full path of file (relative path to document directory)
* @return int <0 if KO, 0 if not found, >0 if OK
* @param int $id Id object
* @param string $ref Not used yet. Will contains a hash id from filename+filepath
* @param string $relativepath Relative path of file from document directory. Example: path/path2/file
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function fetch($id, $ref = null, $fullpath = '')
public function fetch($id, $ref = null, $relativepath = '')
{
dol_syslog(__METHOD__, LOG_DEBUG);
@ -265,8 +265,8 @@ class EcmFiles //extends CommonObject
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND entity IN (" . getEntity('ecmfiles') . ")";
}*/
if ($fullpath) {
$sql .= " AND t.filepath = '" . $this->db->escape(dirname($fullpath)) . "' AND t.filename = '".$this->db->escape(basename($fullpath))."'";
if ($relativepath) {
$sql .= " AND t.filepath = '" . $this->db->escape(dirname($relativepath)) . "' AND t.filename = '".$this->db->escape(basename($relativepath))."'";
}
elseif (null !== $ref) {
$sql .= " AND t.ref = '".$this->db->escape($ref)."'";

View File

@ -571,7 +571,7 @@ if ($object->id > 0)
print '<tr class="liste_titre">';
print '<td colspan="3">';
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierOrders",($num<$MAXLIST?"":$MAXLIST)).'</td>';
print '<td align="right"><a class="notasortlink" href="commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
print '</tr></table>';
print '</td></tr>';

View File

@ -288,6 +288,7 @@ if (empty($reshook))
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
$date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
$date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
$prod_entry_mode = GETPOST('prod_entry_mode');
if ($prod_entry_mode == 'free')
{
$idprod=0;

View File

@ -274,7 +274,7 @@ if (empty($reshook))
}
// Set supplier ref
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
if ($action == 'setref_supplier' && $user->rights->fournisseur->facture->creer)
{
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
@ -302,13 +302,13 @@ if (empty($reshook))
}
// payments conditions
if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer)
if ($action == 'setconditions' && $user->rights->fournisseur->facture->creer)
{
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
}
// payment mode
else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer)
else if ($action == 'setmode' && $user->rights->fournisseur->facture->creer)
{
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
}
@ -1996,8 +1996,8 @@ else
$morehtmlref='<div class="refidno">';
// Ref supplier
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
@ -2005,7 +2005,7 @@ else
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->fournisseur->commande->creer)
if ($user->rights->fournisseur->facture->creer)
{
if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';

View File

@ -133,13 +133,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 3
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '0','0','VAT Rate 0',1);
-- INDIA (id country=117)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate',0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate',0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate', 0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate', 0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0', 0);
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST+CGST', 8, 8, '1', 0, '0', 0, 'IGST+CGST', 1);
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST', 0, 0, '0', 16, '1', 0, 'SGST', 1);
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST+CGST', 8, 8, '1', 0, '0', 0, 'IGST+CGST', 1);
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST' , 0, 0, '0', 16, '1', 0, 'SGST', 1);
-- IRELAND (id country=8)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '0','0','VAT Rate 0',1);

View File

@ -27,12 +27,14 @@
-- VMYSQLUTF8UNICODE ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODE ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODE ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODE ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODE ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODE ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;

View File

@ -18,3 +18,5 @@ RejectCheck=Cheque returned
RejectCheckDate=Date the cheque was returned
CheckRejected=Cheque returned
CheckRejectedAndInvoicesReopened=Cheque returned and invoices reopened
AutoReportLastAccountStatement=Use automatically last account statement to reconcile
BankAccountReleveModule=Bank Statement

View File

@ -526,7 +526,7 @@ Module510Name=Payment of employee wages
Module510Desc=Record and follow payment of your employee wages
Module520Name=Loan
Module520Desc=Management of loans
Module600Name=Notifications on events
Module600Name=Notifications on business events
Module600Desc=Send EMail notifications (triggered by some business events) to users (setup defined on each user), to third-party contacts (setup defined on each third party) or to fixed emails
Module600Long=Note that this module is dedicated to send real time emails when a dedicated business event occurs. If you are looking for a feature to send reminders by email of your agenda events, go into setup of module Agenda.
Module700Name=Donations
@ -1516,13 +1516,14 @@ AccountancyCodeBuy=Purchase account. code
AgendaSetup=Events and agenda module setup
PasswordTogetVCalExport=Key to authorize export link
PastDelayVCalExport=Do not export event older than
AGENDA_USE_EVENT_TYPE=Use events types (managed into menu Setup -> Dictionary -> Type of agenda events)
AGENDA_USE_EVENT_TYPE=Use events types (managed into menu Setup -> Dictionaries -> Type of agenda events)
AGENDA_USE_EVENT_TYPE_DEFAULT=Set automatically this default value for type of event into event create form
AGENDA_DEFAULT_FILTER_TYPE=Set automatically this type of event into search filter of agenda view
AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into search filter of agenda view
AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda
AGENDA_NOTIFICATION=Enable event notification on user browsers when event date is reached (each user is able to refuse this from the browser confirmation question)
AGENDA_NOTIFICATION_SOUND=Enable sound notification
AGENDA_REMINDER_EMAIL=Enable event reminder by emails (defined on each event). Note: Module <strong>%s</strong> must be enabled and correctly setup to have reminder sent at the correct frequency.
AGENDA_REMINDER_BROWSER=Enable event reminder on users browser (when event date is reached, each user is able to refuse this from the browser confirmation question)
AGENDA_REMINDER_BROWSER_SOUND=Enable sound notification
AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view
##### Clicktodial #####
ClickToDialSetup=Click To Dial module setup

View File

@ -38,6 +38,9 @@ AccountStatement=Relevé
AccountStatementShort=Relevé
AccountStatements=Relevés
LastAccountStatements=Derniers relevés bancaires
AutoReportLastAccountStatement=Proposer automatiquement le dernier relevé bancaire rapproché
BankAccountReleveModule=Rapprochement relevés bancaires
Conciliated=Rapproché
IOMonthlyReporting=Rapport mensuel E/S
BankAccountDomiciliation=Domiciliation du compte
BankAccountCountry=Pays du compte

View File

@ -1311,7 +1311,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
if (! defined('DISABLE_BROWSER_NOTIF'))
{
$enablebrowsernotif=false;
if (! empty($conf->agenda->enabled) && ! empty($conf->global->AGENDA_NOTIFICATION)) $enablebrowsernotif=true;
if (! empty($conf->agenda->enabled) && ! empty($conf->global->AGENDA_REMINDER_BROWSER)) $enablebrowsernotif=true;
if ($conf->browser->layout == 'phone') $enablebrowsernotif=false;
if ($enablebrowsernotif)
{

View File

@ -110,7 +110,7 @@ if (! empty($canvas))
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
$fieldtype = (! empty($id) ? 'rowid' : 'ref');
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype,$objcanvas);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context

View File

@ -4022,31 +4022,7 @@ class Product extends CommonObject
$filearray=array_merge($filearray, $filearrayold);
}
$filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC);
//var_dump($filearray);
//var_dump($filearrayindatabase);
// Complete filearray with properties found into $filearrayindatabase
foreach($filearray as $key => $val)
{
$found=0;
// Search if it exists into $filearrayindatabase
foreach($filearrayindatabase as $key2 => $val2)
{
if ($filearrayindatabase[$key2]['name'] == $filearray[$key]['name'])
{
$filearray[$key]['position_name']=($filearrayindatabase[$key2]['position']?$filearrayindatabase[$key2]['position']:'0').'_'.$filearrayindatabase[$key2]['name'];
$filearray[$key]['position']=$filearrayindatabase[$key2]['position'];
$filearray[$key]['cover']=$filearrayindatabase[$key2]['cover'];
$filearray[$key]['acl']=$filearrayindatabase[$key2]['acl'];
$filearray[$key]['rowid']=$filearrayindatabase[$key2]['rowid'];
$filearray[$key]['label']=$filearrayindatabase[$key2]['label'];
$found=1;
break;
}
}
}
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
if (count($filearray))
{

View File

@ -1171,6 +1171,9 @@ if ($action == 'edit_price' && $object->getRights()->creer)
}
print '</td>';
print '</tr>';
$parameters=array('colspan' => 2);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
$parameters=array('colspan' => 2);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook

View File

@ -66,64 +66,72 @@ $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
if ($action == 'confirm_add_resource')
$hookmanager->initHooks(array('resource_card_add','globalcard'));
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if (! $cancel)
{
$error='';
$ref=GETPOST('ref','alpha');
$description=GETPOST('description','alpha');
$fk_code_type_resource=GETPOST('fk_code_type_resource','alpha');
if (empty($ref))
{
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
setEventMessages($mesg, null, 'errors');
$error++;
}
if (! $error)
{
$object=new Dolresource($db);
$object->ref=$ref;
$object->description=$description;
$object->fk_code_type_resource=$fk_code_type_resource;
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) {
$error ++;
}
$result=$object->create($user);
if ($result > 0)
{
// Creation OK
$db->commit();
setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs');
Header("Location: card.php?id=" . $object->id);
return;
}
else
{
// Creation KO
setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
}
else
{
$action = '';
}
}
else
{
Header("Location: list.php");
}
if ($action == 'confirm_add_resource')
{
if (! $cancel)
{
$error='';
$ref=GETPOST('ref','alpha');
$description=GETPOST('description','alpha');
$fk_code_type_resource=GETPOST('fk_code_type_resource','alpha');
if (empty($ref))
{
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
setEventMessages($mesg, null, 'errors');
$error++;
}
if (! $error)
{
$object=new Dolresource($db);
$object->ref=$ref;
$object->description=$description;
$object->fk_code_type_resource=$fk_code_type_resource;
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) {
$error ++;
}
$result=$object->create($user);
if ($result > 0)
{
// Creation OK
$db->commit();
setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs');
Header("Location: card.php?id=" . $object->id);
return;
}
else
{
// Creation KO
setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
}
else
{
$action = '';
}
}
else
{
Header("Location: list.php");
}
}
}
/*
* View
*/

View File

@ -54,10 +54,13 @@ if ($user->societe_id > 0)
accessforbidden();
}
if( ! $user->rights->resource->read)
if (! $user->rights->resource->read)
accessforbidden();
$object = new Dolresource($db);
$objectFetchRes = $object->fetch($id);
if (! ($objectFetchRes > 0)) dol_print_error($db, $object->error);
$extrafields = new ExtraFields($db);
@ -162,7 +165,7 @@ llxHeader('',$pagetitle,'');
$form = new Form($db);
$formresource = new FormResource($db);
if ( $object->fetch($id) > 0 )
if ( $objectFetchRes > 0 )
{
$head=resource_prepare_head($object);

View File

@ -70,12 +70,12 @@ print '<table class="login tablesupport" width="100%">';
print '<tr class="title" valign="top">';
print '<td width="100%" align="left" valign="middle">';
print '<table summary="who"><tr><td>'.img_picto('','who.png','',1).'</td><td>';
print '<table summary="who"><tr><td>'.img_picto('','who.png','class="valigntextbottom"',1).'</td><td>';
print '<font style="'.$style1.'">'.$langs->trans("CommunitySupport").'</font>';
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommunauty").'</font>';
print '<br>'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': ';
print $langs->trans("TypeHelpDev").'/'.img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).'/'.img_picto_common('','star','',1).img_picto_common('','star','',1).img_picto_common('','star','',1).img_picto_common('','star','',1);
print $langs->trans("TypeHelpDev").'/'.img_picto_common('','redstar','class="valigntextbottom"',1).img_picto_common('','redstar','class="valigntextbottom"',1).'/'.img_picto_common('','star','class="valigntextbottom"',1).img_picto_common('','star','class="valigntextbottom"',1).img_picto_common('','star','class="valigntextbottom"',1).img_picto_common('','star','class="valigntextbottom"',1);
print '</td></tr></table>';
print '</td>';
@ -107,88 +107,17 @@ print "\n";
print '</div><div class="inline-block">';
/*
// Official support
print '<table class="login" width="100%">';
print '<tr class="title">';
print '<td width="100%" align="left" valign="middle">';
print '<table summary="community"><tr><td>'.img_picto('','internet.png','',1).'</td><td>';
print '<font style="'.$style1.'">'.$langs->trans("OfficialSupport").'</font>';
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';
print '<br>'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': ';
print $langs->trans("TypeHelpOnly").'/'.img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).'/'.img_picto_common('','star','',1).img_picto_common('','star','',1);
print '</td></tr></table>';
print '</td>';
print '</tr><tr>';
print '<td align="center" valign="middle">';
print '<table class="nocellnopadd">';
print '<tr><td align="center">';
//TODO Create commercial dedicated page into dolibarr.org?
$urlofficialsupport='http://wiki.dolibarr.org/index.php/Dolibarr_help_and_support';
//TODO Create commercial dedicated page into dolibarr.fr?
if (preg_match('/fr/i',$langs->defaultlang)) $urlofficialsupport='http://wiki.dolibarr.org/index.php/Assistance_Dolibarr';
if (preg_match('/es/i',$langs->defaultlang)) $urlofficialsupport='http://www.dolibarr.es/soporte/';
print '<br>'.$langs->trans("SeeOfficalSupport",$urlofficialsupport,$langs->transnoentities("ClickHere")).'<br>';
print '</td></tr></table>';
print '</td>';
print '</tr>';
print '</table>'."\n";
print "\n";
print '</div><div class="inline-block">';
// Online support
print '<table class="login" width="100%">';
print '<tr class="title">';
print '<td width="100%" align="left" valign="middle">';
print '<table summary="community"><tr><td>'.img_picto('','internet.png','',1).'</td><td>';
print '<font style="'.$style1.'">'.$langs->trans("RemoteControlSupport").'</font>';
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';
print '<br>'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': ';
print $langs->trans("TypeHelpOnly").'/'.img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).'/'.img_picto_common('','star','',1).img_picto_common('','star','',1);
print '</td></tr></table>';
print '</td>';
print '</tr><tr>';
print '<td align="center" valign="middle">';
print '<table class="nocellnopadd">';
print '<tr><td align="center">';
print '<br>'.$langs->trans("ToSeeListOfAvailableRessources").'<br>';
print '<b><a href="online.php">'.$langs->trans("ClickHere").'</a></b><br>';
print '<br><br>';
print '<br><br>';
print '</td></tr></table>';
print '</td>';
print '</tr>';
print '</table>'."\n";
print '</div><div class="inline-block">';
*/
// EMail support
print '<table class="login tablesupport" width="100%">';
print '<tr class="title" valign="top">';
print '<td width="100%" align="left" valign="middle">';
print '<table summary="mail"><tr><td>'.img_picto('','mail.png','',1).'</td><td>';
print '<table summary="mail"><tr><td>'.img_picto('','mail.png','class="valigntextbottom"',1).'</td><td>';
print '<font style="'.$style1.'">'.$langs->trans("EMailSupport").'</font>';
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';
print '<br>'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': ';
print $langs->trans("TypeHelpOnly").'/'.img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).'/'.img_picto_common('','star','',1).img_picto_common('','star','',1);
print $langs->trans("TypeHelpOnly").'/'.img_picto_common('','redstar','class="valigntextbottom"',1).img_picto_common('','redstar','class="valigntextbottom"',1).img_picto_common('','redstar','class="valigntextbottom"',1).'/'.img_picto_common('','star','class="valigntextbottom"',1).img_picto_common('','star','class="valigntextbottom"',1);
print '</td></tr></table>';
@ -216,7 +145,7 @@ print '<table class="login tablesupport" width="100%">';
print '<tr class="title">';
print '<td width="100%" align="left" valign="middle">';
print '<table summary="special"><tr><td>'.img_picto('','pagemaster.png','',1).'</td><td>';
print '<table summary="special"><tr><td>'.img_picto('','pagemaster.png','class="valigntextbottom"',1).'</td><td>';
print '<font style="'.$style1.'">'.$langs->trans("OtherSupport").'</font>';
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';