Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop
This commit is contained in:
commit
9078f36883
@ -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
|
|
||||||
3
build/docker/.dockerignore
Normal file
3
build/docker/.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Dockerfile
|
||||||
|
README.md
|
||||||
|
docker-compose.yml
|
||||||
@ -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 \
|
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& 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 \
|
&& docker-php-ext-install mysqli \
|
||||||
&& apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev
|
&& apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev
|
||||||
|
|
||||||
COPY htdocs/ /var/www/html/
|
COPY docker-run.sh /usr/local/bin/
|
||||||
|
RUN chmod +x /usr/local/bin/docker-run.sh
|
||||||
RUN chown -hR www-data:www-data /var/www/html
|
|
||||||
|
|
||||||
VOLUME /var/www/html/conf
|
|
||||||
VOLUME /var/www/html/documents
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
ENTRYPOINT ["docker-run.sh"]
|
||||||
25
build/docker/README.md
Normal file
25
build/docker/README.md
Normal 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
|
||||||
25
build/docker/docker-compose.yml
Normal file
25
build/docker/docker-compose.yml
Normal 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"
|
||||||
15
build/docker/docker-run.sh
Normal file
15
build/docker/docker-run.sh
Normal 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
|
||||||
@ -134,7 +134,7 @@ class AdherentType extends CommonObject
|
|||||||
$sql.= "note = '".$this->db->escape($this->note)."',";
|
$sql.= "note = '".$this->db->escape($this->note)."',";
|
||||||
$sql.= "vote = '".$this->db->escape($this->vote)."',";
|
$sql.= "vote = '".$this->db->escape($this->vote)."',";
|
||||||
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
|
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
|
||||||
$sql .= " WHERE rowid =".$this->id;
|
$sql.= " WHERE rowid =".$this->id;
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -252,7 +252,7 @@ class AdherentType extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT rowid, libelle";
|
$sql = "SELECT rowid, libelle";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||||
$sql.= " WHERE entity = ".$conf->entity;
|
$sql.= " WHERE entity IN (".getEntity('adherent').")";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -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 $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
print '</td></tr>'."\n";
|
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"> </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"> </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>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
255
htdocs/admin/agenda_reminder.php
Normal file
255
htdocs/admin/agenda_reminder.php
Normal 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"> </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"> </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"> </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"> </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();
|
||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
@ -21,15 +22,14 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/bank.php
|
* \file htdocs/admin/bank.php
|
||||||
* \ingroup bank
|
* \ingroup bank
|
||||||
* \brief Page to setup the bank module
|
* \brief Page to setup the bank module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.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 . '/core/lib/bank.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.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 . '/societe/class/companybankaccount.class.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
@ -38,12 +38,12 @@ $langs->load("other");
|
|||||||
$langs->load("banks");
|
$langs->load("banks");
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scandir', 'alpha');
|
||||||
$type = 'bankaccount';
|
$type = 'bankaccount';
|
||||||
|
|
||||||
|
|
||||||
@ -52,91 +52,101 @@ $type = 'bankaccount';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//Order display of bank account
|
//Order display of bank account
|
||||||
if ($action == 'setbankorder')
|
if ($action == 'setbankorder') {
|
||||||
{
|
if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",
|
||||||
if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",GETPOST('value','alpha'),'chaine',0,'',$conf->entity) > 0)
|
GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) {
|
||||||
{
|
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
exit;
|
||||||
exit;
|
}
|
||||||
}
|
else {
|
||||||
else
|
dol_print_error($db);
|
||||||
{
|
}
|
||||||
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')
|
if ($action == 'specimen') {
|
||||||
{
|
$modele = GETPOST('module', 'alpha');
|
||||||
$modele=GETPOST('module','alpha');
|
|
||||||
|
|
||||||
if ($modele == 'sepamandate')
|
if ($modele == 'sepamandate') {
|
||||||
{
|
|
||||||
$object = new CompanyBankAccount($db);
|
$object = new CompanyBankAccount($db);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$object = new Account($db);
|
$object = new Account($db);
|
||||||
}
|
}
|
||||||
$object->initAsSpecimen();
|
$object->initAsSpecimen();
|
||||||
|
|
||||||
// Search template files
|
// Search template files
|
||||||
$file=''; $classname=''; $filefound=0;
|
$file = '';
|
||||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
$classname = '';
|
||||||
foreach($dirmodels as $reldir)
|
$filefound = 0;
|
||||||
{
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
$file=dol_buildpath($reldir."core/modules/bank/doc/pdf_".$modele.".modules.php",0);
|
foreach ($dirmodels as $reldir) {
|
||||||
if (file_exists($file))
|
$file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php",
|
||||||
{
|
0);
|
||||||
$filefound=1;
|
if (file_exists($file)) {
|
||||||
$classname = "pdf_".$modele;
|
$filefound = 1;
|
||||||
|
$classname = "pdf_" . $modele;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($filefound)
|
if ($filefound) {
|
||||||
{
|
|
||||||
require_once $file;
|
require_once $file;
|
||||||
|
|
||||||
$module = new $classname($db);
|
$module = new $classname($db);
|
||||||
|
|
||||||
if ($module->write_file($object,$langs) > 0)
|
if ($module->write_file($object, $langs) > 0) {
|
||||||
{
|
header("Location: " . DOL_URL_ROOT . "/document.php?modulepart=bank&file=SPECIMEN.pdf");
|
||||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bank&file=SPECIMEN.pdf");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages($module->error, null, 'errors');
|
setEventMessages($module->error, null, 'errors');
|
||||||
dol_syslog($module->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
if ($action == 'set')
|
if ($action == 'set') {
|
||||||
{
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
|
||||||
}
|
}
|
||||||
|
else if ($action == 'del') {
|
||||||
else if ($action == 'del')
|
$ret = delDocumentModel($value, $type);
|
||||||
{
|
if ($ret > 0) {
|
||||||
$ret = delDocumentModel($value, $type);
|
if ($conf->global->BANKADDON_PDF == "$value")
|
||||||
if ($ret > 0)
|
dolibarr_del_const($db, 'BANKADDON_PDF', $conf->entity);
|
||||||
{
|
}
|
||||||
if ($conf->global->BANKADDON_PDF == "$value") dolibarr_del_const($db, 'BANKADDON_PDF',$conf->entity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
else if ($action == 'setdoc') {
|
||||||
{
|
if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '',
|
||||||
if (dolibarr_set_const($db, "BANKADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
$conf->entity)) {
|
||||||
{
|
|
||||||
// The constant that was read before the new set
|
// The constant that was read before the new set
|
||||||
// We therefore requires a variable to have a coherent view
|
// We therefore requires a variable to have a coherent view
|
||||||
$conf->global->BANKADDON_PDF = $value;
|
$conf->global->BANKADDON_PDF = $value;
|
||||||
@ -144,8 +154,7 @@ else if ($action == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0) {
|
||||||
{
|
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -156,80 +165,78 @@ else if ($action == 'setdoc')
|
|||||||
* view
|
* 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>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
print load_fiche_titre($langs->trans("BankSetupModule"),$linkback,'title_setup');
|
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback,
|
||||||
|
'title_setup');
|
||||||
|
|
||||||
$head = bank_admin_prepare_head(null);
|
$head = bank_admin_prepare_head(null);
|
||||||
dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account');
|
dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account');
|
||||||
|
|
||||||
$var=true;
|
$var = true;
|
||||||
|
|
||||||
$var=! $var;
|
$var = !$var;
|
||||||
|
|
||||||
//Show bank account order
|
//Show bank account order
|
||||||
print load_fiche_titre($langs->trans("BankOrderShow"), '', '');
|
print load_fiche_titre($langs->trans("BankOrderShow"), '', '');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="140">'.$langs->trans("Name").'</td>';
|
print '<td width="140">' . $langs->trans("Name") . '</td>';
|
||||||
print '<td>'.$langs->trans("Description").'</td>';
|
print '<td>' . $langs->trans("Description") . '</td>';
|
||||||
print '<td>'.$langs->trans("Example").'</td>';
|
print '<td>' . $langs->trans("Example") . '</td>';
|
||||||
print '<td align="center">'.$langs->trans("Status").'</td>';
|
print '<td align="center">' . $langs->trans("Status") . '</td>';
|
||||||
print '<td align="center" width="60"> </td>';
|
print '<td align="center" width="60"> </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$bankorder[0][0]=$langs->trans("BankOrderGlobal");
|
$bankorder[0][0] = $langs->trans("BankOrderGlobal");
|
||||||
$bankorder[0][1]=$langs->trans("BankOrderGlobalDesc");
|
$bankorder[0][1] = $langs->trans("BankOrderGlobalDesc");
|
||||||
$bankorder[0][2]='BankCode DeskCode BankAccountNumber BankAccountNumberKey';
|
$bankorder[0][2] = 'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
|
||||||
$bankorder[1][0]=$langs->trans("BankOrderES");
|
$bankorder[1][0] = $langs->trans("BankOrderES");
|
||||||
$bankorder[1][1]=$langs->trans("BankOrderESDesc");
|
$bankorder[1][1] = $langs->trans("BankOrderESDesc");
|
||||||
$bankorder[1][2]='BankCode DeskCode BankAccountNumberKey BankAccountNumber';
|
$bankorder[1][2] = 'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
|
||||||
|
|
||||||
$var = true;
|
$var = true;
|
||||||
$i=0;
|
$i = 0;
|
||||||
|
|
||||||
$nbofbank=count($bankorder);
|
$nbofbank = count($bankorder);
|
||||||
while ($i < $nbofbank)
|
while ($i < $nbofbank) {
|
||||||
{
|
$var = !$var;
|
||||||
$var = !$var;
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$bankorder[$i][0]."</td><td>\n";
|
print '<td>' . $bankorder[$i][0] . "</td><td>\n";
|
||||||
print $bankorder[$i][1];
|
print $bankorder[$i][1];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmparray=explode(' ',$bankorder[$i][2]);
|
$tmparray = explode(' ', $bankorder[$i][2]);
|
||||||
foreach($tmparray as $key => $val)
|
foreach ($tmparray as $key => $val) {
|
||||||
{
|
if ($key > 0)
|
||||||
if ($key > 0) print ', ';
|
print ', ';
|
||||||
print $langs->trans($val);
|
print $langs->trans($val);
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i)
|
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) {
|
||||||
{
|
print '<td align="center">';
|
||||||
print '<td align="center">';
|
print img_picto($langs->trans("Activated"), 'on');
|
||||||
print img_picto($langs->trans("Activated"),'on');
|
print '</td>';
|
||||||
print '</td>';
|
}
|
||||||
}
|
else {
|
||||||
else
|
print '<td align="center"><a href="' . $_SERVER['PHP_SELF'] . '?action=setbankorder&value=' . $i . '">';
|
||||||
{
|
print img_picto($langs->trans("Disabled"), 'off');
|
||||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbankorder&value='.$i.'">';
|
print '</a></td>';
|
||||||
print img_picto($langs->trans("Disabled"),'off');
|
}
|
||||||
print '</a></td>';
|
print '<td> </td>';
|
||||||
}
|
print '</tr>' . "\n";
|
||||||
print '<td> </td>';
|
$i++;
|
||||||
print '</tr>'."\n";
|
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>' . "\n";
|
||||||
|
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
@ -257,7 +264,8 @@ if ($resql) {
|
|||||||
array_push($def, $array[0]);
|
array_push($def, $array[0]);
|
||||||
$i ++;
|
$i ++;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +281,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir) {
|
||||||
{
|
|
||||||
foreach (array('', '/doc') as $valdir) {
|
foreach (array('', '/doc') as $valdir) {
|
||||||
$dir = dol_buildpath($reldir . "core/modules/bank" . $valdir);
|
$dir = dol_buildpath($reldir . "core/modules/bank" . $valdir);
|
||||||
|
|
||||||
@ -288,7 +295,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
arsort($filelist);
|
arsort($filelist);
|
||||||
|
|
||||||
foreach ($filelist as $file) {
|
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)) {
|
if (file_exists($dir . '/' . $file)) {
|
||||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||||
@ -298,9 +306,11 @@ foreach ($dirmodels as $reldir)
|
|||||||
$module = new $classname($db);
|
$module = new $classname($db);
|
||||||
|
|
||||||
$modulequalified = 1;
|
$modulequalified = 1;
|
||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2)
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL
|
||||||
|
< 2)
|
||||||
$modulequalified = 0;
|
$modulequalified = 0;
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1)
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL
|
||||||
|
< 1)
|
||||||
$modulequalified = 0;
|
$modulequalified = 0;
|
||||||
|
|
||||||
if ($modulequalified) {
|
if ($modulequalified) {
|
||||||
@ -317,21 +327,27 @@ foreach ($dirmodels as $reldir)
|
|||||||
if (in_array($name, $def)) {
|
if (in_array($name, $def)) {
|
||||||
print '<td align="center">' . "\n";
|
print '<td align="center">' . "\n";
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&value=' . $name . '">';
|
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 '</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
print '<td align="center">' . "\n";
|
print '<td align="center">' . "\n";
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"),
|
||||||
|
'switch_off') . '</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($conf->global->BANKADDON_PDF == $name) {
|
if ($conf->global->BANKADDON_PDF == $name) {
|
||||||
print img_picto($langs->trans("Default"), 'on');
|
print img_picto($langs->trans("Default"),
|
||||||
} else {
|
'on');
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
}
|
||||||
|
else {
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"),
|
||||||
|
'off') . '</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -342,24 +358,30 @@ foreach ($dirmodels as $reldir)
|
|||||||
$htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
|
$htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
|
||||||
}
|
}
|
||||||
$htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
|
$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("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
|
||||||
//$htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 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("Discounts").': '.yn($module->option_escompte,1,1);
|
||||||
// $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,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);
|
//$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
|
||||||
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
print $form->textwithpicto('', $htmltooltip, 1,
|
||||||
|
0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Preview
|
// Preview
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($module->type == 'pdf') {
|
if ($module->type == 'pdf') {
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'bill') . '</a>';
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"),
|
||||||
} else {
|
'bill') . '</a>';
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
}
|
||||||
|
else {
|
||||||
|
print img_object($langs->trans("PreviewNotAvailable"),
|
||||||
|
'generic');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -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();
|
dol_fiche_end();
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?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) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@ -103,6 +103,7 @@ else if ($action == 'delete')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -605,7 +605,7 @@ if ($resql)
|
|||||||
// print '<td>';
|
// print '<td>';
|
||||||
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
|
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
|
||||||
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
|
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>';
|
print '</div>';
|
||||||
if ($options) {
|
if ($options) {
|
||||||
print $langs->trans("EventualyAddCategory").': ';
|
print $langs->trans("EventualyAddCategory").': ';
|
||||||
@ -649,6 +649,16 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
dol_print_error($db);
|
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 '<br><br>';
|
||||||
// print '</td></tr></table>';
|
// print '</td></tr></table>';
|
||||||
}
|
}
|
||||||
@ -1117,7 +1127,16 @@ if ($resql)
|
|||||||
// Date ope
|
// Date ope
|
||||||
if (! empty($arrayfields['b.dateo']['checked']))
|
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 ' ';
|
||||||
|
print '<span class="inline-block">';
|
||||||
|
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=doprev&account='.$objp->bankid.'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_remove() . "</a> ";
|
||||||
|
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=donext&account='.$objp->bankid.'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_add() ."</a>";
|
||||||
|
print '</span>';
|
||||||
|
print "</td>\n";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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"
|
* Load miscellaneous information for tab "Info"
|
||||||
*
|
*
|
||||||
|
|||||||
@ -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 = new AccountLine($db);
|
||||||
$al->datev_next($_GET["rowid"]);
|
$al->datev_next($_GET["rowid"]);
|
||||||
}
|
}elseif ($user->rights->banque->consolidate && $action == 'dvprev')
|
||||||
|
|
||||||
if ($user->rights->banque->consolidate && $action == 'dvprev')
|
|
||||||
{
|
{
|
||||||
$al = new AccountLine($db);
|
$al = new AccountLine($db);
|
||||||
$al->datev_previous($_GET["rowid"]);
|
$al->datev_previous($_GET["rowid"]);
|
||||||
@ -479,6 +486,14 @@ if ($result)
|
|||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->select_date($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
|
print $form->select_date($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
|
||||||
|
if (! $objp->rappro)
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=doprev&id='.$id.'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_remove() . "</a> ";
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=donext&id='.$id.'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_add() ."</a>";
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -440,26 +440,26 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
|||||||
$outputlangs->setDefaultLang($newlang);
|
$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
|
// Create output dir if not exists
|
||||||
dol_mkdir($diroutputmassaction);
|
dol_mkdir($diroutputmassaction);
|
||||||
|
|
||||||
// Defined name of merged file
|
// Defined name of merged file
|
||||||
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
|
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
|
||||||
$filename=preg_replace('/\s/','_',$filename);
|
$filename=preg_replace('/\s/','_',$filename);
|
||||||
|
|
||||||
// Save merged file
|
// Save merged file
|
||||||
if ($filter=='paye:0')
|
if ($filter=='paye:0')
|
||||||
{
|
{
|
||||||
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
|
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
|
||||||
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
|
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
|
||||||
}
|
}
|
||||||
if ($year) $filename.='_'.$year;
|
if ($year) $filename.='_'.$year;
|
||||||
if ($month) $filename.='_'.$month;
|
if ($month) $filename.='_'.$month;
|
||||||
|
|
||||||
if (count($files)>0)
|
if (count($files)>0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
|
$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))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
$langs->load("exports");
|
$langs->load("exports");
|
||||||
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
|
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors');
|
setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Create empty PDF
|
// Create empty PDF
|
||||||
@ -519,18 +518,18 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
|||||||
// Save merged file
|
// Save merged file
|
||||||
if ($filter=='paye:0')
|
if ($filter=='paye:0')
|
||||||
{
|
{
|
||||||
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
|
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
|
||||||
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
|
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
|
||||||
}
|
}
|
||||||
if ($year) $filename.='_'.$year;
|
if ($year) $filename.='_'.$year;
|
||||||
if ($month) $filename.='_'.$month;
|
if ($month) $filename.='_'.$month;
|
||||||
if ($pagecount)
|
if ($pagecount)
|
||||||
{
|
{
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
|
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
|
||||||
$pdf->Output($file,'F');
|
$pdf->Output($file,'F');
|
||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
$langs->load("exports");
|
$langs->load("exports");
|
||||||
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
|
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
|
||||||
|
|||||||
@ -71,3 +71,27 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
|
|||||||
exit;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3876,7 +3876,7 @@ abstract class CommonObject
|
|||||||
*
|
*
|
||||||
* @param string $modelspath Relative folder where generators are placed
|
* @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 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 $hidedetails 1 to hide details. 0 by default
|
||||||
* @param int $hidedesc 1 to hide product description. 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
|
* @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)
|
protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
$srctemplatepath='';
|
$srctemplatepath='';
|
||||||
|
|
||||||
@ -3903,7 +3903,6 @@ abstract class CommonObject
|
|||||||
$srctemplatepath=$tmp[1];
|
$srctemplatepath=$tmp[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Search template files
|
// Search template files
|
||||||
$file=''; $classname=''; $filefound=0;
|
$file=''; $classname=''; $filefound=0;
|
||||||
$dirmodels=array('/');
|
$dirmodels=array('/');
|
||||||
@ -3995,7 +3994,10 @@ abstract class CommonObject
|
|||||||
$arrayofrecords = array(); // The write_file of templates of adherent class need this
|
$arrayofrecords = array(); // The write_file of templates of adherent class need this
|
||||||
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, $moreparams);
|
$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)
|
if ($resultwritefile > 0)
|
||||||
{
|
{
|
||||||
@ -4005,6 +4007,58 @@ abstract class CommonObject
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
dol_delete_preview($this);
|
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.
|
// Success in building document. We build meta file.
|
||||||
dol_meta_create($this);
|
dol_meta_create($this);
|
||||||
|
|
||||||
|
|||||||
@ -903,6 +903,7 @@ class FormFile
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Show list of documents in $filearray (may be they are all in same directory but may not)
|
* 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 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 Object $object Object on which document is linked to.
|
||||||
@ -1031,78 +1032,10 @@ class FormFile
|
|||||||
// Get list of files stored into database for same relative directory
|
// Get list of files stored into database for same relative directory
|
||||||
if ($relativedir)
|
if ($relativedir)
|
||||||
{
|
{
|
||||||
$filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC);
|
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
|
||||||
|
|
||||||
//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);*/
|
|
||||||
|
|
||||||
|
/*var_dump($sortfield);
|
||||||
|
var_dump($sortorder);*/
|
||||||
if ($sortfield && $sortorder)
|
if ($sortfield && $sortorder)
|
||||||
{
|
{
|
||||||
$filearray=dol_sort_array($filearray, $sortfield, $sortorder);
|
$filearray=dol_sort_array($filearray, $sortfield, $sortorder);
|
||||||
|
|||||||
@ -90,7 +90,7 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
|||||||
if (arr.length > 0) {
|
if (arr.length > 0) {
|
||||||
var audio = null;
|
var audio = null;
|
||||||
<?php
|
<?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'.'\');';
|
print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -146,7 +146,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
$buf = fgets($fp, 4096);
|
$buf = fgets($fp, 4096);
|
||||||
|
|
||||||
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
|
// 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;
|
$qualified=1;
|
||||||
|
|
||||||
@ -159,20 +159,29 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
// restrict on version
|
// restrict on version
|
||||||
if ($qualified)
|
if ($qualified)
|
||||||
{
|
{
|
||||||
|
if (! empty($reg[2]))
|
||||||
$versionrequest=explode('.',$reg[2]);
|
{
|
||||||
//print var_dump($versionrequest);
|
if (is_numeric($reg[2])) // This is a version
|
||||||
//print var_dump($versionarray);
|
{
|
||||||
if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0)
|
$versionrequest=explode('.',$reg[2]);
|
||||||
{
|
//print var_dump($versionrequest);
|
||||||
$qualified=0;
|
//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)
|
if ($qualified)
|
||||||
{
|
{
|
||||||
// Version qualified, delete SQL comments
|
// 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>';
|
//print "Ligne $i qualifi?e par version: ".$buf.'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -545,10 +554,17 @@ function security_prepare_head()
|
|||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/security_file.php";
|
$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';
|
$head[$h][2] = 'file';
|
||||||
$h++;
|
$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][0] = DOL_URL_ROOT."/admin/proxy.php";
|
||||||
$head[$h][1] = $langs->trans("ExternalAccess");
|
$head[$h][1] = $langs->trans("ExternalAccess");
|
||||||
$head[$h][2] = 'proxy';
|
$head[$h][2] = 'proxy';
|
||||||
|
|||||||
@ -412,6 +412,14 @@ function agenda_prepare_head()
|
|||||||
$head[$h][2] = 'autoactions';
|
$head[$h][2] = 'autoactions';
|
||||||
$h++;
|
$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][0] = DOL_URL_ROOT."/admin/agenda_xcal.php";
|
||||||
$head[$h][1] = $langs->trans("ExportCal");
|
$head[$h][1] = $langs->trans("ExportCal");
|
||||||
$head[$h][2] = 'xcal';
|
$head[$h][2] = 'xcal';
|
||||||
|
|||||||
@ -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
|
* 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.
|
* Move a file into another name.
|
||||||
* Note:
|
* Note:
|
||||||
* - This function differs from dol_move_uploaded_file, because it can be called in any context.
|
* - 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.
|
* - 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)
|
* @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
|
// Rename entry into ecm database
|
||||||
$rel_filetorenamebefore = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $srcfile);
|
$rel_filetorenamebefore = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $srcfile);
|
||||||
$rel_filetorenameafter = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $destfile);
|
$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_filetorenamebefore = preg_replace('/^[\\/]/', '', $rel_filetorenamebefore);
|
||||||
$rel_filetorenameafter = preg_replace('/^[\\/]/', '', $rel_filetorenameafter);
|
$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 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
|
* @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.
|
* Create a meta file with document file into same directory.
|
||||||
* This should allow "grep" search.
|
* This make "grep" search possible.
|
||||||
* This feature is enabled only if option MAIN_DOC_CREATE_METAFILE is set.
|
* This feature to generate the meta file is enabled only if option MAIN_DOC_CREATE_METAFILE is set.
|
||||||
*
|
*
|
||||||
* @param CommonObject $object Object
|
* @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)
|
function dol_meta_create($object)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
// Create meta file
|
||||||
if (empty($conf->global->MAIN_DOC_CREATE_METAFILE)) return 0; // By default, no metafile.
|
if (empty($conf->global->MAIN_DOC_CREATE_METAFILE)) return 0; // By default, no metafile.
|
||||||
|
|
||||||
// Define parent dir of elements
|
// Define parent dir of elements
|
||||||
@ -1266,9 +1352,9 @@ function dol_meta_create($object)
|
|||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$facref = dol_sanitizeFileName($object->ref);
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
$dir = $dir . "/" . $facref;
|
$dir = $dir . "/" . $objectref;
|
||||||
$file = $dir . "/" . $facref . ".meta";
|
$file = $dir . "/" . $objectref . ".meta";
|
||||||
|
|
||||||
if (! is_dir($dir))
|
if (! is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -1283,15 +1369,15 @@ function dol_meta_create($object)
|
|||||||
DATE=\"" . dol_print_date($object->date,'') . "\"
|
DATE=\"" . dol_print_date($object->date,'') . "\"
|
||||||
NB_ITEMS=\"" . $nblignes . "\"
|
NB_ITEMS=\"" . $nblignes . "\"
|
||||||
CLIENT=\"" . $client . "\"
|
CLIENT=\"" . $client . "\"
|
||||||
TOTAL_HT=\"" . $object->total_ht . "\"
|
AMOUNT_WO_TAX=\"" . $object->total_ht . "\"
|
||||||
TOTAL_TTC=\"" . $object->total_ttc . "\"\n";
|
AMOUNT_INC_TAX=\"" . $object->total_ttc . "\"\n";
|
||||||
|
|
||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
{
|
{
|
||||||
//Pour les articles
|
//Pour les articles
|
||||||
$meta .= "ITEM_" . $i . "_QUANTITY=\"" . $object->lines[$i]->qty . "\"
|
$meta .= "ITEM_" . $i . "_QUANTITY=\"" . $object->lines[$i]->qty . "\"
|
||||||
ITEM_" . $i . "_TOTAL_HT=\"" . $object->lines[$i]->total_ht . "\"
|
ITEM_" . $i . "_AMOUNT_WO_TAX=\"" . $object->lines[$i]->total_ht . "\"
|
||||||
ITEM_" . $i . "_TVA=\"" .$object->lines[$i]->tva_tx . "\"
|
ITEM_" . $i . "_VAT=\"" .$object->lines[$i]->tva_tx . "\"
|
||||||
ITEM_" . $i . "_DESCRIPTION=\"" . str_replace("\r\n","",nl2br($object->lines[$i]->desc)) . "\"
|
ITEM_" . $i . "_DESCRIPTION=\"" . str_replace("\r\n","",nl2br($object->lines[$i]->desc)) . "\"
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
@ -1305,6 +1391,10 @@ function dol_meta_create($object)
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_syslog('FailedToDetectDirInDolMetaCreateFor'.$object->element, LOG_WARNING);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
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.
|
* All information used are in db, conf, langs, user and _FILES.
|
||||||
* Note: This function can be used only into a HTML page context.
|
* 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);
|
$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);
|
$filename = basename($destfile);
|
||||||
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
|
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
|
||||||
|
|||||||
@ -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->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($content), 0, 'C', 0);
|
||||||
$pdf->SetXY($curx, $cury + 1);
|
$pdf->SetXY($curx, $cury + 1);
|
||||||
$curx += $tmplength;
|
$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);
|
$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities($val), 0, 'C', 0);
|
||||||
if (empty($onlynumber)) {
|
if (empty($onlynumber)) {
|
||||||
$pdf->line($curx, $cury + 1, $curx, $cury + 7);
|
$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);
|
$pdf->MultiCell(100, 3, $val, 0, 'L', 0);
|
||||||
$tmpy=$pdf->getStringHeight(100, $val);
|
$tmpy=$pdf->getStringHeight(100, $val);
|
||||||
$cury+=$tmpy;
|
$cury+=$tmpy;
|
||||||
|
$cur+=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (! $usedetailedbban) $cury+=1;
|
else if (! $usedetailedbban) $cury+=1;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
|
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
|
||||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* 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 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* 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'];
|
$oldrowid=$assoc['rowid'];
|
||||||
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
|
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
|
||||||
|
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
|
||||||
$list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1'];
|
$list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1'];
|
||||||
$list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2'];
|
$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']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
||||||
$list[$assoc['rate']]['dtype'][] = 'ExpenseReportPayment';
|
$list[$assoc['rate']]['dtype'][] = 'ExpenseReportPayment';
|
||||||
$list[$assoc['rate']]['datef'][] = $assoc['datef'];
|
$list[$assoc['rate']]['datef'][] = $assoc['datef'];
|
||||||
|
|||||||
@ -178,6 +178,8 @@ class CommActionRapport
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -249,6 +249,8 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -396,6 +396,8 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -193,6 +193,8 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
$outputlangs->charset_output=$sav_charset_output;
|
$outputlangs->charset_output=$sav_charset_output;
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
|
|||||||
@ -275,9 +275,9 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
dol_mkdir($conf->commande->dir_temp);
|
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;
|
$usecontact=false;
|
||||||
$arrayidcontact=$object->getIdContact('external','BILLING');
|
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
|
||||||
if (count($arrayidcontact) > 0)
|
if (count($arrayidcontact) > 0)
|
||||||
{
|
{
|
||||||
$usecontact=true;
|
$usecontact=true;
|
||||||
@ -289,7 +289,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
{
|
{
|
||||||
// On peut utiliser le nom de la societe du contact
|
// On peut utiliser le nom de la societe du contact
|
||||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->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
|
else
|
||||||
{
|
{
|
||||||
@ -356,8 +360,12 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
|
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
|
||||||
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
|
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
|
||||||
$array_other=$this->get_substitutionarray_other($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);
|
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||||
// Call the ODTSubstitution hook
|
// Call the ODTSubstitution hook
|
||||||
|
|
||||||
@ -459,6 +467,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -603,6 +603,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -454,6 +454,8 @@ class doc_generic_contract_odt extends ModelePDFContract
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -396,6 +396,8 @@ class pdf_strato extends ModelePDFContract
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -259,6 +259,8 @@ class html_cerfafr extends ModeleDon
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -510,6 +510,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -359,6 +359,8 @@ class pdf_merou extends ModelePdfExpedition
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -567,6 +567,8 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // No error
|
return 1; // No error
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -474,6 +474,8 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -474,6 +474,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -701,6 +701,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // No error
|
return 1; // No error
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -392,6 +392,8 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -566,6 +566,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // pas d'erreur
|
return 1; // pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -418,6 +418,8 @@ class pdf_standard extends CommonStickerGenerator
|
|||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
// Output to http stream
|
// Output to http stream
|
||||||
if (empty($nooutput))
|
if (empty($nooutput))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -326,8 +326,6 @@ class pdf_standardlabel extends CommonStickerGenerator
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Output to http stream
|
// Output to http stream
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
@ -346,6 +344,8 @@ class pdf_standardlabel extends CommonStickerGenerator
|
|||||||
|
|
||||||
readfile($file);
|
readfile($file);
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -367,8 +367,6 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Output to http stream
|
// Output to http stream
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
@ -387,6 +385,8 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
|||||||
|
|
||||||
readfile($file);
|
readfile($file);
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -483,6 +483,8 @@ class doc_generic_product_odt extends ModelePDFProduct
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -542,6 +542,8 @@ class pdf_standard extends ModelePDFProduct
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1066,6 +1066,8 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -329,6 +329,8 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$ this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -503,6 +503,8 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -829,6 +829,8 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -494,6 +494,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -451,8 +451,6 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// Description of product line
|
// Description of product line
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
|
|
||||||
$showpricebeforepagebreak=1;
|
|
||||||
|
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
@ -761,6 +759,8 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -276,6 +276,8 @@ class pdf_paiement
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -274,6 +274,8 @@ class pdf_paiement_fourn
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -459,6 +459,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -539,6 +539,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -110,17 +110,17 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
if ($conf->global->PRODUCT_USE_UNITS)
|
if ($conf->global->PRODUCT_USE_UNITS)
|
||||||
{
|
{
|
||||||
$this->posxtva=99;
|
$this->posxtva=95;
|
||||||
$this->posxup=114;
|
$this->posxup=114;
|
||||||
$this->posxqty=130;
|
$this->posxqty=132;
|
||||||
$this->posxunit=147;
|
$this->posxunit=147;
|
||||||
} else {
|
} else {
|
||||||
$this->posxtva=112;
|
$this->posxtva=110;
|
||||||
$this->posxup=126;
|
$this->posxup=126;
|
||||||
$this->posxqty=145;
|
$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
|
$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
|
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("products");
|
||||||
$outputlangs->load("orders");
|
$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')
|
if ($conf->fournisseur->dir_output.'/commande')
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$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->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
$pdf->SetTextColor(0,0,0);
|
$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->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$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
|
// Description of product line
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
$showpricebeforepagebreak=1;
|
$showpricebeforepagebreak=1;
|
||||||
|
|
||||||
$pdf->startTransaction();
|
$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();
|
$pageposafter=$pdf->getPage();
|
||||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
{
|
{
|
||||||
@ -355,7 +429,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pageposafter=$pageposbefore;
|
$pageposafter=$pageposbefore;
|
||||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
$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();
|
$posyafter=$pdf->GetY();
|
||||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
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;
|
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
|
||||||
$this->tva[$vatrate] += $tvaligne;
|
$this->tva[$vatrate] += $tvaligne;
|
||||||
|
|
||||||
|
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
|
||||||
|
|
||||||
// Add line
|
// Add line
|
||||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
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))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -924,7 +1001,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
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))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxtva-3, $tab_top+1);
|
$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))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxup-1, $tab_top+1);
|
$pdf->SetXY($this->posxup-1, $tab_top+1);
|
||||||
|
|||||||
@ -442,6 +442,8 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -486,6 +486,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -108,7 +108,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$this->posxqty=145;
|
$this->posxqty=145;
|
||||||
$this->posxdiscount=162;
|
$this->posxdiscount=162;
|
||||||
$this->postotalht=174;
|
$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
|
$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
|
if ($this->page_largeur < 210) // To work with US executive format
|
||||||
{
|
{
|
||||||
@ -357,7 +357,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$posYAfterDescription=0;
|
$posYAfterDescription=0;
|
||||||
|
|
||||||
// We start with Photo of product line
|
// 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);
|
$pdf->AddPage('','',true);
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
@ -368,7 +368,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$showpricebeforepagebreak=0;
|
$showpricebeforepagebreak=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($imglinesize['width']) && isset($imglinesize['height']))
|
if (!empty($imglinesize['width']) && !empty($imglinesize['height']))
|
||||||
{
|
{
|
||||||
$curX = $this->posxpicture-1;
|
$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($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;
|
$curX = $this->posxdesc-1;
|
||||||
|
|
||||||
$pdf->startTransaction();
|
$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();
|
$pageposafter=$pdf->getPage();
|
||||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
@ -389,7 +397,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$pageposafter=$pageposbefore;
|
$pageposafter=$pageposbefore;
|
||||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
$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();
|
$pageposafter=$pdf->getPage();
|
||||||
$posyafter=$pdf->GetY();
|
$posyafter=$pdf->GetY();
|
||||||
@ -597,6 +605,8 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Pas d'erreur
|
return 1; // Pas d'erreur
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1131,20 +1141,10 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
|
$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))
|
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);
|
||||||
$pdf->line($this->posxtva-2, $tab_top, $this->posxtva-2, $tab_top + $tab_height);
|
//$pdf->line($this->posxtva-2, $tab_top, $this->posxtva-2, $tab_top + $tab_height);
|
||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxtva-5, $tab_top+1);
|
$pdf->SetXY($this->posxtva-5, $tab_top+1);
|
||||||
|
|||||||
@ -408,6 +408,8 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -485,6 +485,8 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
|
|
||||||
$odfHandler=null; // Destroy object
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -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.
|
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%';
|
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-->
|
<!-- END PHP TEMPLATE NOTES-->
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,16 +19,20 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE originproductline.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE originproductline.tpl.php -->
|
||||||
<tr <?php echo $bc[$var]; ?>>
|
<?php
|
||||||
<td><?php echo $this->tpl['label']; ?></td>
|
print '<tr'.$bc[$var].'>';
|
||||||
<td><?php echo $this->tpl['description']; ?></td>
|
print '<td>'.$this->tpl['label'].'</td>';
|
||||||
<td align="right"><?php echo $this->tpl['vat_rate']; ?></td>
|
print '<td>'.$this->tpl['description'].'</td>';
|
||||||
<td align="right"><?php echo $this->tpl['price']; ?></td>
|
print '<td align="right">'.$this->tpl['vat_rate'].'</td>';
|
||||||
<?php if (!empty($conf->multicurrency->enabled)) { ?><td align="right"><?php echo $this->tpl['multicurrency_price']; ?></td><?php } ?>
|
print '<td align="right">'.$this->tpl['price'].'</td>';
|
||||||
<td align="right"><?php echo $this->tpl['qty']; ?></td>
|
if (!empty($conf->multicurrency->enabled))
|
||||||
<?php
|
print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>';
|
||||||
if($conf->global->PRODUCT_USE_UNITS) echo '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>';
|
|
||||||
?>
|
print '<td align="right">'.$this->tpl['qty'].'</td>';
|
||||||
<td align="right"><?php echo $this->tpl['remise_percent']; ?></td>
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
</tr>
|
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 -->
|
<!-- END PHP TEMPLATE originproductline.tpl.php -->
|
||||||
|
|||||||
@ -231,12 +231,12 @@ class EcmFiles //extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Load object in memory from the database
|
* Load object in memory from the database
|
||||||
*
|
*
|
||||||
* @param int $id Id object
|
* @param int $id Id object
|
||||||
* @param string $ref Not used yet. Will contains a hash id from filename+filepath
|
* @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)
|
* @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
|
* @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);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
@ -265,8 +265,8 @@ class EcmFiles //extends CommonObject
|
|||||||
if (! empty($conf->multicompany->enabled)) {
|
if (! empty($conf->multicompany->enabled)) {
|
||||||
$sql .= " AND entity IN (" . getEntity('ecmfiles') . ")";
|
$sql .= " AND entity IN (" . getEntity('ecmfiles') . ")";
|
||||||
}*/
|
}*/
|
||||||
if ($fullpath) {
|
if ($relativepath) {
|
||||||
$sql .= " AND t.filepath = '" . $this->db->escape(dirname($fullpath)) . "' AND t.filename = '".$this->db->escape(basename($fullpath))."'";
|
$sql .= " AND t.filepath = '" . $this->db->escape(dirname($relativepath)) . "' AND t.filename = '".$this->db->escape(basename($relativepath))."'";
|
||||||
}
|
}
|
||||||
elseif (null !== $ref) {
|
elseif (null !== $ref) {
|
||||||
$sql .= " AND t.ref = '".$this->db->escape($ref)."'";
|
$sql .= " AND t.ref = '".$this->db->escape($ref)."'";
|
||||||
|
|||||||
@ -571,7 +571,7 @@ if ($object->id > 0)
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierOrders",($num<$MAXLIST?"":$MAXLIST)).'</td>';
|
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 '<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 '</tr></table>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -288,6 +288,7 @@ if (empty($reshook))
|
|||||||
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
|
$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_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'));
|
$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')
|
if ($prod_entry_mode == 'free')
|
||||||
{
|
{
|
||||||
$idprod=0;
|
$idprod=0;
|
||||||
|
|||||||
@ -274,7 +274,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set supplier ref
|
// 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');
|
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
|
||||||
|
|
||||||
@ -302,13 +302,13 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// payments conditions
|
// 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'));
|
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// payment mode
|
// 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'));
|
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
|
||||||
}
|
}
|
||||||
@ -1996,8 +1996,8 @@ else
|
|||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
// Ref supplier
|
// Ref supplier
|
||||||
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 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->commande->creer, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||||
// Project
|
// Project
|
||||||
@ -2005,7 +2005,7 @@ else
|
|||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
if ($user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
|||||||
@ -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);
|
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)
|
-- 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 (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 (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 (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 (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 (1177, 117, 'SGST' , 0, 0, '0', 16, '1', 0, 'SGST', 1);
|
||||||
|
|
||||||
-- IRELAND (id country=8)
|
-- 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);
|
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '0','0','VAT Rate 0',1);
|
||||||
|
|||||||
@ -27,12 +27,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- VMYSQLUTF8UNICODE ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
|
-- VMYSQLUTF8UNICODECI 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;
|
-- VMYSQLUTF8UNICODECI 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;
|
-- VMYSQLUTF8UNICODECI 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;
|
-- VMYSQLUTF8UNICODECI 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;
|
-- VMYSQLUTF8UNICODECI 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_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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -18,3 +18,5 @@ RejectCheck=Cheque returned
|
|||||||
RejectCheckDate=Date the cheque was returned
|
RejectCheckDate=Date the cheque was returned
|
||||||
CheckRejected=Cheque returned
|
CheckRejected=Cheque returned
|
||||||
CheckRejectedAndInvoicesReopened=Cheque returned and invoices reopened
|
CheckRejectedAndInvoicesReopened=Cheque returned and invoices reopened
|
||||||
|
AutoReportLastAccountStatement=Use automatically last account statement to reconcile
|
||||||
|
BankAccountReleveModule=Bank Statement
|
||||||
@ -526,7 +526,7 @@ Module510Name=Payment of employee wages
|
|||||||
Module510Desc=Record and follow payment of your employee wages
|
Module510Desc=Record and follow payment of your employee wages
|
||||||
Module520Name=Loan
|
Module520Name=Loan
|
||||||
Module520Desc=Management of loans
|
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
|
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.
|
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
|
Module700Name=Donations
|
||||||
@ -1516,13 +1516,14 @@ AccountancyCodeBuy=Purchase account. code
|
|||||||
AgendaSetup=Events and agenda module setup
|
AgendaSetup=Events and agenda module setup
|
||||||
PasswordTogetVCalExport=Key to authorize export link
|
PasswordTogetVCalExport=Key to authorize export link
|
||||||
PastDelayVCalExport=Do not export event older than
|
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_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_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_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_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_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_NOTIFICATION_SOUND=Enable sound notification
|
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
|
AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view
|
||||||
##### Clicktodial #####
|
##### Clicktodial #####
|
||||||
ClickToDialSetup=Click To Dial module setup
|
ClickToDialSetup=Click To Dial module setup
|
||||||
|
|||||||
@ -38,6 +38,9 @@ AccountStatement=Relevé
|
|||||||
AccountStatementShort=Relevé
|
AccountStatementShort=Relevé
|
||||||
AccountStatements=Relevés
|
AccountStatements=Relevés
|
||||||
LastAccountStatements=Derniers relevés bancaires
|
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
|
IOMonthlyReporting=Rapport mensuel E/S
|
||||||
BankAccountDomiciliation=Domiciliation du compte
|
BankAccountDomiciliation=Domiciliation du compte
|
||||||
BankAccountCountry=Pays du compte
|
BankAccountCountry=Pays du compte
|
||||||
|
|||||||
@ -1311,7 +1311,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
if (! defined('DISABLE_BROWSER_NOTIF'))
|
if (! defined('DISABLE_BROWSER_NOTIF'))
|
||||||
{
|
{
|
||||||
$enablebrowsernotif=false;
|
$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 ($conf->browser->layout == 'phone') $enablebrowsernotif=false;
|
||||||
if ($enablebrowsernotif)
|
if ($enablebrowsernotif)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if (! empty($canvas))
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
$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);
|
$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
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
|||||||
@ -4022,31 +4022,7 @@ class Product extends CommonObject
|
|||||||
$filearray=array_merge($filearray, $filearrayold);
|
$filearray=array_merge($filearray, $filearrayold);
|
||||||
}
|
}
|
||||||
|
|
||||||
$filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC);
|
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
|
||||||
|
|
||||||
//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 (count($filearray))
|
if (count($filearray))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1175,6 +1175,9 @@ if ($action == 'edit_price' && $object->getRights()->creer)
|
|||||||
$parameters=array('colspan' => 2);
|
$parameters=array('colspan' => 2);
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
$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
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
@ -66,64 +66,72 @@ $extrafields = new ExtraFields($db);
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$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');
|
if ($action == 'confirm_add_resource')
|
||||||
$description=GETPOST('description','alpha');
|
{
|
||||||
$fk_code_type_resource=GETPOST('fk_code_type_resource','alpha');
|
if (! $cancel)
|
||||||
|
{
|
||||||
|
$error='';
|
||||||
|
|
||||||
if (empty($ref))
|
$ref=GETPOST('ref','alpha');
|
||||||
{
|
$description=GETPOST('description','alpha');
|
||||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
|
$fk_code_type_resource=GETPOST('fk_code_type_resource','alpha');
|
||||||
setEventMessages($mesg, null, 'errors');
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $error)
|
if (empty($ref))
|
||||||
{
|
{
|
||||||
$object=new Dolresource($db);
|
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
|
||||||
$object->ref=$ref;
|
setEventMessages($mesg, null, 'errors');
|
||||||
$object->description=$description;
|
$error++;
|
||||||
$object->fk_code_type_resource=$fk_code_type_resource;
|
}
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
if (! $error)
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
{
|
||||||
if ($ret < 0) {
|
$object=new Dolresource($db);
|
||||||
$error ++;
|
$object->ref=$ref;
|
||||||
}
|
$object->description=$description;
|
||||||
|
$object->fk_code_type_resource=$fk_code_type_resource;
|
||||||
|
|
||||||
$result=$object->create($user);
|
// Fill array 'array_options' with data from add form
|
||||||
if ($result > 0)
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||||
{
|
if ($ret < 0) {
|
||||||
// Creation OK
|
$error ++;
|
||||||
$db->commit();
|
}
|
||||||
setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs');
|
|
||||||
Header("Location: card.php?id=" . $object->id);
|
$result=$object->create($user);
|
||||||
return;
|
if ($result > 0)
|
||||||
}
|
{
|
||||||
else
|
// Creation OK
|
||||||
{
|
$db->commit();
|
||||||
// Creation KO
|
setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs');
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
Header("Location: card.php?id=" . $object->id);
|
||||||
$action = '';
|
return;
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
// Creation KO
|
||||||
$action = '';
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
$action = '';
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
Header("Location: list.php");
|
{
|
||||||
}
|
$action = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Header("Location: list.php");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -54,10 +54,13 @@ if ($user->societe_id > 0)
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! $user->rights->resource->read)
|
if (! $user->rights->resource->read)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$object = new Dolresource($db);
|
$object = new Dolresource($db);
|
||||||
|
$objectFetchRes = $object->fetch($id);
|
||||||
|
if (! ($objectFetchRes > 0)) dol_print_error($db, $object->error);
|
||||||
|
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
@ -162,7 +165,7 @@ llxHeader('',$pagetitle,'');
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formresource = new FormResource($db);
|
$formresource = new FormResource($db);
|
||||||
|
|
||||||
if ( $object->fetch($id) > 0 )
|
if ( $objectFetchRes > 0 )
|
||||||
{
|
{
|
||||||
$head=resource_prepare_head($object);
|
$head=resource_prepare_head($object);
|
||||||
|
|
||||||
|
|||||||
@ -70,12 +70,12 @@ print '<table class="login tablesupport" width="100%">';
|
|||||||
print '<tr class="title" valign="top">';
|
print '<tr class="title" valign="top">';
|
||||||
print '<td width="100%" align="left" valign="middle">';
|
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 '<font style="'.$style1.'">'.$langs->trans("CommunitySupport").'</font>';
|
||||||
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommunauty").'</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 '<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></tr></table>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -107,88 +107,17 @@ print "\n";
|
|||||||
|
|
||||||
print '</div><div class="inline-block">';
|
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
|
// EMail support
|
||||||
print '<table class="login tablesupport" width="100%">';
|
print '<table class="login tablesupport" width="100%">';
|
||||||
print '<tr class="title" valign="top">';
|
print '<tr class="title" valign="top">';
|
||||||
print '<td width="100%" align="left" valign="middle">';
|
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 '<font style="'.$style1.'">'.$langs->trans("EMailSupport").'</font>';
|
||||||
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</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 '<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>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
@ -216,7 +145,7 @@ print '<table class="login tablesupport" width="100%">';
|
|||||||
print '<tr class="title">';
|
print '<tr class="title">';
|
||||||
print '<td width="100%" align="left" valign="middle">';
|
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 '<font style="'.$style1.'">'.$langs->trans("OtherSupport").'</font>';
|
||||||
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';
|
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user