Merge branch 'develop' into 13a11
This commit is contained in:
commit
08ab4855f2
@ -15,6 +15,8 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* Rename property $paiementid in API api_supplier_invoices into $payment_mode_id
|
* Rename property $paiementid in API api_supplier_invoices into $payment_mode_id
|
||||||
* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you still use old syntax in
|
* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you still use old syntax in
|
||||||
your email templates.
|
your email templates.
|
||||||
|
* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom
|
||||||
|
days of holiday.
|
||||||
|
|
||||||
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
||||||
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
||||||
|
|||||||
@ -1,38 +1,50 @@
|
|||||||
FROM php:7.2-apache
|
FROM php:7.3-apache
|
||||||
|
|
||||||
ENV HOST_USER_ID 33
|
|
||||||
ENV PHP_INI_DATE_TIMEZONE 'UTC'
|
ENV PHP_INI_DATE_TIMEZONE 'UTC'
|
||||||
|
ENV PHP_INI_MEMORY_LIMIT 256M
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y libpng16-16 libpng-dev libjpeg62-turbo libjpeg62-turbo-dev libldap2-dev zlib1g-dev libicu-dev g++\
|
RUN apt-get update -y \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libjpeg62-turbo \
|
||||||
|
libpng-dev \
|
||||||
|
libpng16-16 \
|
||||||
|
libldap2-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libzip-dev \
|
||||||
|
zlib1g-dev \
|
||||||
|
libicu-dev \
|
||||||
|
g++ \
|
||||||
|
default-mysql-client \
|
||||||
|
unzip \
|
||||||
|
curl \
|
||||||
|
apt-utils \
|
||||||
|
&& apt-get autoremove -y \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
||||||
&& docker-php-ext-install gd \
|
&& docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \
|
||||||
&& docker-php-ext-install zip \
|
|
||||||
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
|
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
|
||||||
&& docker-php-ext-install ldap \
|
&& docker-php-ext-install -j$(nproc) ldap && \
|
||||||
&& docker-php-ext-install mysqli \
|
mv ${PHP_INI_DIR}/php.ini-development ${PHP_INI_DIR}/php.ini
|
||||||
&& docker-php-ext-install calendar \
|
|
||||||
&& docker-php-ext-configure intl \
|
|
||||||
&& docker-php-ext-install intl \
|
|
||||||
&& apt-get autoremove --purge -y libpng-dev libjpeg62-turbo-dev libldap2-dev zlib1g-dev libicu-dev g++
|
|
||||||
|
|
||||||
RUN mkdir /var/documents
|
RUN mkdir /var/documents
|
||||||
RUN chown www-data /var/documents
|
RUN chown www-data:www-data /var/documents
|
||||||
|
|
||||||
COPY docker-run.sh /usr/local/bin/
|
COPY docker-run.sh /usr/local/bin/
|
||||||
RUN chmod +x /usr/local/bin/docker-run.sh
|
RUN chmod +x /usr/local/bin/docker-run.sh
|
||||||
|
|
||||||
RUN pecl install xdebug && docker-php-ext-enable xdebug
|
RUN pecl install xdebug && docker-php-ext-enable xdebug
|
||||||
RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"' >> /usr/local/etc/php/php.ini
|
RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so"' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.remote_autostart=0' >> /usr/local/etc/php/php.ini
|
RUN echo 'xdebug.remote_autostart=1' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini
|
RUN echo 'xdebug.remote_enable=1' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.default_enable=0' >> /usr/local/etc/php/php.ini
|
RUN echo 'xdebug.default_enable=1' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.remote_host=docker.host' >> /usr/local/etc/php/php.ini
|
#RUN echo 'xdebug.remote_host=docker.host' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.remote_port=9000' >> /usr/local/etc/php/php.ini
|
RUN echo 'xdebug.remote_port=9000' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.remote_connect_back=0' >> /usr/local/etc/php/php.ini
|
RUN echo 'xdebug.remote_connect_back=1' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.profiler_enable=0' >> /usr/local/etc/php/php.ini
|
RUN echo 'xdebug.profiler_enable=0' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> /usr/local/etc/php/php.ini
|
RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo '172.17.0.1 docker.host' >> /etc/hosts
|
#RUN echo '172.17.0.1 docker.host' >> /etc/hosts
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
# How to use it ?
|
# How to use it ?
|
||||||
|
|
||||||
The docker-compose.yml file is used to build and run Dolibarr in the current workspace.
|
The docker-compose.yml file is used to build and run Dolibarr in the current workspace.
|
||||||
|
This docker image intended for developpement usage.
|
||||||
|
For production usage you should consider other contributor reference like https://hub.docker.com/r/tuxgasy/dolibarr
|
||||||
|
|
||||||
Before build/run, define the variable HOST_USER_ID as following:
|
Before build/run, define the variable HOST_USER_ID as following:
|
||||||
|
|
||||||
@ -26,3 +28,4 @@ The URL to go to PhpMyAdmin is (login/password is root/root) :
|
|||||||
|
|
||||||
Setup the database connection during the installation process, please use mariad
|
Setup the database connection during the installation process, please use mariad
|
||||||
b (name of the database container) as database host.
|
b (name of the database container) as database host.
|
||||||
|
Setup documents folder, during the installation process, to /var/documents
|
||||||
|
|||||||
@ -1,29 +1,48 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
networks:
|
||||||
|
internal-pod:
|
||||||
|
internal: true
|
||||||
|
external-pod:
|
||||||
|
internal: false
|
||||||
|
|
||||||
|
services:
|
||||||
mariadb:
|
mariadb:
|
||||||
build: mariadb
|
image: mariadb:latest
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: root
|
MYSQL_ROOT_PASSWORD: root
|
||||||
MYSQL_DATABASE: dolibarr
|
MYSQL_DATABASE: dolibarr
|
||||||
|
networks:
|
||||||
|
- internal-pod
|
||||||
|
|
||||||
phpmyadmin:
|
phpmyadmin:
|
||||||
image: phpmyadmin/phpmyadmin
|
image: phpmyadmin/phpmyadmin
|
||||||
environment:
|
environment:
|
||||||
PMA_HOST: mariadb
|
PMA_HOST: mariadb
|
||||||
links:
|
depends_on:
|
||||||
- mariadb
|
- mariadb
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "8080:80"
|
||||||
|
networks:
|
||||||
|
- internal-pod
|
||||||
|
- external-pod
|
||||||
|
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
environment:
|
environment:
|
||||||
HOST_USER_ID: $HOST_USER_ID
|
HOST_USER_ID: $HOST_USER_ID
|
||||||
volumes:
|
volumes:
|
||||||
- ../../htdocs:/var/www/html
|
- ../../htdocs:/var/www/html/
|
||||||
links:
|
- ../../documents:/var/documents
|
||||||
- mariadb
|
|
||||||
- mail
|
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
- "9000:9000"
|
||||||
|
depends_on:
|
||||||
|
- mariadb
|
||||||
|
- mail
|
||||||
|
networks:
|
||||||
|
- internal-pod
|
||||||
|
- external-pod
|
||||||
|
|
||||||
mail:
|
mail:
|
||||||
image: maildev/maildev
|
image: maildev/maildev
|
||||||
|
|||||||
@ -1,15 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usermod -u $HOST_USER_ID www-data
|
usermod -u ${HOST_USER_ID} www-data
|
||||||
groupmod -g $HOST_USER_ID www-data
|
groupmod -g ${HOST_USER_ID} www-data
|
||||||
|
|
||||||
chgrp -hR www-data /var/www/html
|
chgrp -hR www-data /var/www/html
|
||||||
chmod g+rwx /var/www/html/conf
|
chmod g+rwx /var/www/html/conf
|
||||||
|
|
||||||
|
if [ ! -d /var/documents ]; then
|
||||||
|
echo "[docker-run] => create volume directory /var/documents ..."
|
||||||
|
mkdir -p /var/documents
|
||||||
|
fi
|
||||||
|
echo "[docker-run] => Set Permission to www-data for /var/documents"
|
||||||
|
chown -R www-data:www-data /var/documents
|
||||||
|
|
||||||
if [ ! -f /usr/local/etc/php/php.ini ]; then
|
if [ ! -f /usr/local/etc/php/php.ini ]; then
|
||||||
cat <<EOF > /usr/local/etc/php/php.ini
|
cat <<EOF > /usr/local/etc/php/php.ini
|
||||||
date.timezone = $PHP_INI_DATE_TIMEZONE
|
date.timezone = $PHP_INI_DATE_TIMEZONE
|
||||||
display_errors = On
|
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -35,13 +35,11 @@ $langs->loadLangs(array("admin", "trips", "errors", "other", "dict"));
|
|||||||
|
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) accessforbidden();
|
||||||
|
|
||||||
//Init error
|
$error = 0;
|
||||||
$error = false;
|
|
||||||
$message = false;
|
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$offset = GETPOST('offset', 'int');
|
$ikoffset = GETPOST('ikoffset', 'int');
|
||||||
$coef = GETPOST('coef', 'int');
|
$coef = GETPOST('coef', 'int');
|
||||||
|
|
||||||
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat');
|
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat');
|
||||||
@ -59,10 +57,13 @@ if ($action == 'updateik')
|
|||||||
$expIk->setValues($_POST);
|
$expIk->setValues($_POST);
|
||||||
$result = $expIk->create($user);
|
$result = $expIk->create($user);
|
||||||
|
|
||||||
if ($result > 0) setEventMessages('SetupSaved', null, 'mesgs');
|
if ($result > 0) {
|
||||||
|
setEventMessages('SetupSaved', null, 'mesgs');
|
||||||
header('Location: '.$_SERVER['PHP_SELF']);
|
header('Location: '.$_SERVER['PHP_SELF']);
|
||||||
exit;
|
exit;
|
||||||
|
} else {
|
||||||
|
setEventMessages($expIk->error, $expIk->errors, 'errors');
|
||||||
|
}
|
||||||
} elseif ($action == 'delete') // TODO add confirm
|
} elseif ($action == 'delete') // TODO add confirm
|
||||||
{
|
{
|
||||||
$expIk = new ExpenseReportIk($db);
|
$expIk = new ExpenseReportIk($db);
|
||||||
@ -81,6 +82,7 @@ if ($action == 'updateik')
|
|||||||
|
|
||||||
$rangesbycateg = ExpenseReportIk::getAllRanges();
|
$rangesbycateg = ExpenseReportIk::getAllRanges();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -90,12 +92,13 @@ llxHeader('', $langs->trans("ExpenseReportsSetup"));
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans("ExpenseReportsIkSetup"), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup');
|
||||||
|
|
||||||
$head = expensereport_admin_prepare_head();
|
$head = expensereport_admin_prepare_head();
|
||||||
dol_fiche_head($head, 'expenseik', $langs->trans("ExpenseReportsIk"), -1, 'trip');
|
dol_fiche_head($head, 'expenseik', $langs->trans("ExpenseReportsIk"), -1, 'trip');
|
||||||
|
|
||||||
echo $langs->trans('ExpenseReportIkDesc');
|
echo '<span class="opacitymedium">'.$langs->trans('ExpenseReportIkDesc').'</span>';
|
||||||
|
print '<br><br>';
|
||||||
|
|
||||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
||||||
|
|
||||||
@ -136,21 +139,23 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab)
|
|||||||
echo '<tr class="oddeven">';
|
echo '<tr class="oddeven">';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
echo '<td width="20%"><b>['.$langs->trans('RangeNum', $tranche++).']</b> - '.$label.'</td>';
|
echo '<td class="nowraponall"><b>['.$langs->trans('RangeNum', $tranche++).']</b> - '.$label.'</td>';
|
||||||
|
|
||||||
// Offset
|
// Offset
|
||||||
echo '<td width="20%">';
|
echo '<td class="nowraponall">';
|
||||||
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) echo '<input type="text" name="offset" value="'.$range->ik->offset.'" />';
|
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) echo '<input type="text" class="maxwidth100" name="ikoffset" value="'.$range->ik->ikoffset.'" />';
|
||||||
else echo $range->ik->offset;
|
else {
|
||||||
|
echo $range->ik->ikoffset;
|
||||||
|
}
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
// Coef
|
// Coef
|
||||||
echo '<td width="20%">';
|
echo '<td class="nowraponall">';
|
||||||
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) echo '<input type="text" name="coef" value="'.$range->ik->coef.'" />';
|
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) echo '<input type="text" class="maxwidth100" name="coef" value="'.$range->ik->coef.'" />';
|
||||||
else echo ($range->ik->id > 0 ? $range->ik->coef : $langs->trans('expenseReportCoefUndefined'));
|
else echo ($range->ik->id > 0 ? $range->ik->coef : $langs->trans('expenseReportCoefUndefined'));
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
|
||||||
// Total for one
|
// Total for one
|
||||||
echo '<td width="30%">'.$langs->trans('expenseReportPrintExample', price($range->ik->offset + 5 * $range->ik->coef)).'</td>';
|
echo '<td class="nowraponall">'.$langs->trans('expenseReportPrintExample', price($range->ik->ikoffset + 5 * $range->ik->coef)).'</td>';
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
echo '<td class="right">';
|
echo '<td class="right">';
|
||||||
@ -161,8 +166,8 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab)
|
|||||||
echo '<input id="" class="button" name="save" value="'.$langs->trans('Save').'" type="submit" />';
|
echo '<input id="" class="button" name="save" value="'.$langs->trans('Save').'" type="submit" />';
|
||||||
echo '<input class="button" value="'.$langs->trans('Cancel').'" onclick="javascript:history.go(-1)" type="button" />';
|
echo '<input class="button" value="'.$langs->trans('Cancel').'" onclick="javascript:history.go(-1)" type="button" />';
|
||||||
} else {
|
} else {
|
||||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$range->ik->id.'&fk_c_exp_tax_cat='.$range->fk_c_exp_tax_cat.'&fk_range='.$range->rowid.'">'.img_edit().'</a>';
|
echo '<a class="editfielda marginrightonly paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$range->ik->id.'&fk_c_exp_tax_cat='.$range->fk_c_exp_tax_cat.'&fk_range='.$range->rowid.'">'.img_edit().'</a>';
|
||||||
if (!empty($range->ik->id)) echo '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$range->ik->id.'">'.img_delete().'</a>';
|
if (!empty($range->ik->id)) echo '<a class="paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$range->ik->id.'">'.img_delete().'</a>';
|
||||||
// TODO add delete link
|
// TODO add delete link
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,6 +138,7 @@ $rules = ExpenseReportRule::getAllRule();
|
|||||||
$tab_apply = array('A' => $langs->trans('All'), 'G' => $langs->trans('Group'), 'U' => $langs->trans('User'));
|
$tab_apply = array('A' => $langs->trans('All'), 'G' => $langs->trans('Group'), 'U' => $langs->trans('User'));
|
||||||
$tab_rules_type = array('EX_DAY' => $langs->trans('Day'), 'EX_MON' => $langs->trans('Month'), 'EX_YEA' => $langs->trans('Year'), 'EX_EXP' => $langs->trans('OnExpense'));
|
$tab_rules_type = array('EX_DAY' => $langs->trans('Day'), 'EX_MON' => $langs->trans('Month'), 'EX_YEA' => $langs->trans('Year'), 'EX_EXP' => $langs->trans('OnExpense'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -147,12 +148,13 @@ llxHeader('', $langs->trans("ExpenseReportsSetup"));
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans("ExpenseReportsRulesSetup"), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup');
|
||||||
|
|
||||||
$head = expensereport_admin_prepare_head();
|
$head = expensereport_admin_prepare_head();
|
||||||
dol_fiche_head($head, 'expenserules', $langs->trans("ExpenseReportsRules"), -1, 'trip');
|
dol_fiche_head($head, 'expenserules', $langs->trans("ExpenseReportsRules"), -1, 'trip');
|
||||||
|
|
||||||
echo $langs->trans('ExpenseReportRulesDesc');
|
echo '<span class="opacitymedium">'.$langs->trans('ExpenseReportRulesDesc').'</span>';
|
||||||
|
print '<br><br>';
|
||||||
|
|
||||||
if ($action != 'edit')
|
if ($action != 'edit')
|
||||||
{
|
{
|
||||||
@ -164,7 +166,7 @@ if ($action != 'edit')
|
|||||||
|
|
||||||
echo '<tr class="liste_titre">';
|
echo '<tr class="liste_titre">';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportApplyTo').'</th>';
|
echo '<th>'.$langs->trans('ExpenseReportApplyTo').'</th>';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportDomain').'</th>';
|
echo '<th>'.$langs->trans('Type').'</th>';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportLimitOn').'</th>';
|
echo '<th>'.$langs->trans('ExpenseReportLimitOn').'</th>';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportDateStart').'</th>';
|
echo '<th>'.$langs->trans('ExpenseReportDateStart').'</th>';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportDateEnd').'</th>';
|
echo '<th>'.$langs->trans('ExpenseReportDateEnd').'</th>';
|
||||||
@ -184,7 +186,7 @@ if ($action != 'edit')
|
|||||||
echo '<td>'.$form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0).'</td>';
|
echo '<td>'.$form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0).'</td>';
|
||||||
echo '<td>'.$form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0).'</td>';
|
echo '<td>'.$form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0).'</td>';
|
||||||
echo '<td>'.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0).'</td>';
|
echo '<td>'.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0).'</td>';
|
||||||
echo '<td><input type="text" value="" name="amount" class="amount" />'.$conf->currency.'</td>';
|
echo '<td><input type="text" value="" class="maxwidth100" name="amount" class="amount" /> '.$conf->currency.'</td>';
|
||||||
echo '<td>'.$form->selectyesno('restrictive', 0, 1).'</td>';
|
echo '<td>'.$form->selectyesno('restrictive', 0, 1).'</td>';
|
||||||
echo '<td class="right"><input type="submit" class="button" value="'.$langs->trans('Add').'" /></td>';
|
echo '<td class="right"><input type="submit" class="button" value="'.$langs->trans('Add').'" /></td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
@ -207,7 +209,7 @@ echo '<table class="noborder centpercent">';
|
|||||||
|
|
||||||
echo '<tr class="liste_titre">';
|
echo '<tr class="liste_titre">';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportApplyTo').'</th>';
|
echo '<th>'.$langs->trans('ExpenseReportApplyTo').'</th>';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportDomain').'</th>';
|
echo '<th>'.$langs->trans('Type').'</th>';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportLimitOn').'</th>';
|
echo '<th>'.$langs->trans('ExpenseReportLimitOn').'</th>';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportDateStart').'</th>';
|
echo '<th>'.$langs->trans('ExpenseReportDateStart').'</th>';
|
||||||
echo '<th>'.$langs->trans('ExpenseReportDateEnd').'</th>';
|
echo '<th>'.$langs->trans('ExpenseReportDateEnd').'</th>';
|
||||||
@ -300,11 +302,11 @@ foreach ($rules as $rule)
|
|||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
|
||||||
|
|
||||||
echo '<td>';
|
echo '<td class="center">';
|
||||||
if ($object->id != $rule->id)
|
if ($object->id != $rule->id)
|
||||||
{
|
{
|
||||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$rule->id.'">'.img_edit().'</a> ';
|
echo '<a class="editfielda paddingright paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$rule->id.'">'.img_edit().'</a> ';
|
||||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$rule->id.'">'.img_delete().'</a>';
|
echo '<a class="paddingright paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$rule->id.'">'.img_delete().'</a>';
|
||||||
} else {
|
} else {
|
||||||
echo '<input type="submit" class="button" value="'.$langs->trans('Update').'" /> ';
|
echo '<input type="submit" class="button" value="'.$langs->trans('Update').'" /> ';
|
||||||
echo '<a href="'.$_SERVER['PHP_SELF'].'" class="button">'.$langs->trans('Cancel').'</a>';
|
echo '<a href="'.$_SERVER['PHP_SELF'].'" class="button">'.$langs->trans('Cancel').'</a>';
|
||||||
|
|||||||
@ -25,68 +25,93 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
if (!$user->admin) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("install", "other", "admin"));
|
$langs->loadLangs(array("install", "other", "admin"));
|
||||||
|
|
||||||
if (!$user->admin)
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
accessforbidden();
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'moduleoverview';
|
||||||
|
|
||||||
|
$search_name = GETPOST("search_name", 'alpha');
|
||||||
|
$search_id = GETPOST("search_id", 'alpha');
|
||||||
|
$search_version = GETPOST("search_version", 'alpha');
|
||||||
|
$search_permission = GETPOST("search_permission", 'alpha');
|
||||||
|
|
||||||
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
|
|
||||||
|
if (!$sortfield) $sortfield = "id";
|
||||||
|
if (!$sortorder) $sortorder = "asc";
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
|
||||||
|
$hookmanager->initHooks(array('moduleoverview'));
|
||||||
|
$form = new Form($db);
|
||||||
|
$object = new stdClass();
|
||||||
|
|
||||||
|
// Definition of fields for lists
|
||||||
|
$arrayfields = array(
|
||||||
|
'name'=>array('label'=>$langs->trans("Modules"), 'checked'=>1, 'position'=>10),
|
||||||
|
'version'=>array('label'=>$langs->trans("Version"), 'checked'=>1, 'position'=>20),
|
||||||
|
'id'=>array('label'=>$langs->trans("IdModule"), 'checked'=>1, 'position'=>30),
|
||||||
|
'permission'=>array('label'=>$langs->trans("IdPermissions"), 'checked'=>1, 'position'=>40)
|
||||||
|
);
|
||||||
|
|
||||||
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
$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');
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("AvailableModules"), '', 'title_setup');
|
if (empty($reshook)) {
|
||||||
|
// Selection of new fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
}
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("ToActivateModule").'</span><br>';
|
|
||||||
print "<br>\n";
|
|
||||||
|
|
||||||
|
// Load list of modules
|
||||||
|
$moduleList = array();
|
||||||
$modules = array();
|
$modules = array();
|
||||||
$modules_names = array();
|
|
||||||
$modules_files = array();
|
$modules_files = array();
|
||||||
$modules_fullpath = array();
|
$modules_fullpath = array();
|
||||||
$modulesdir = dolGetModulesDirs();
|
$modulesdir = dolGetModulesDirs();
|
||||||
|
$rights_ids = array();
|
||||||
|
|
||||||
// Load list of modules
|
foreach ($modulesdir as $dir) {
|
||||||
$i = 0;
|
|
||||||
foreach ($modulesdir as $dir)
|
|
||||||
{
|
|
||||||
$handle = @opendir(dol_osencode($dir));
|
$handle = @opendir(dol_osencode($dir));
|
||||||
if (is_resource($handle))
|
if (is_resource($handle)) {
|
||||||
{
|
while (($file = readdir($handle)) !== false) {
|
||||||
while (($file = readdir($handle)) !== false)
|
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
|
||||||
{
|
|
||||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
|
||||||
{
|
|
||||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||||
|
|
||||||
if ($modName)
|
if ($modName) {
|
||||||
{
|
|
||||||
//print 'xx'.$dir.$file.'<br>';
|
//print 'xx'.$dir.$file.'<br>';
|
||||||
if (in_array($file, $modules_files))
|
if (in_array($file, $modules_files)) {
|
||||||
{
|
|
||||||
// File duplicate
|
// File duplicate
|
||||||
print "Warning duplicate file found : ".$file." (Found ".$dir.$file.", already found ".$modules_fullpath[$file].")<br>";
|
print "Warning duplicate file found : ".$file." (Found ".$dir.$file.", already found ".$modules_fullpath[$file].")<br>";
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
// File to load
|
// File to load
|
||||||
$res = include_once $dir.$file;
|
$res = include_once $dir.$file;
|
||||||
if (class_exists($modName))
|
if (class_exists($modName)) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$objMod = new $modName($db);
|
$objMod = new $modName($db);
|
||||||
|
|
||||||
$modules[$objMod->numero] = $objMod;
|
$modules[$objMod->numero] = $objMod;
|
||||||
$modules_names[$objMod->numero] = $objMod->name;
|
|
||||||
$modules_files[$objMod->numero] = $file;
|
$modules_files[$objMod->numero] = $file;
|
||||||
$modules_fullpath[$file] = $dir.$file;
|
$modules_fullpath[$file] = $dir.$file;
|
||||||
$picto[$objMod->numero] = (isset($objMod->picto) && $objMod->picto) ? $objMod->picto : 'generic';
|
}
|
||||||
} catch (Exception $e)
|
catch (Exception $e) {
|
||||||
{
|
|
||||||
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
|
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,60 +122,280 @@ foreach ($modulesdir as $dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
// create pre-filtered list for modules
|
||||||
print '<table class="noborder centpercent">';
|
foreach ($modules as $key=>$module) {
|
||||||
print '<tr class="liste_titre">';
|
$newModule = new stdClass();
|
||||||
print '<td>'.$langs->trans("Modules").'</td>';
|
|
||||||
print '<td>'.$langs->trans("Version").'</td>';
|
$newModule->name = $module->getName();
|
||||||
print '<td class="center">'.$langs->trans("IdModule").'</td>';
|
$newModule->version = $module->getVersion();
|
||||||
print '<td>'.$langs->trans("IdPermissions").'</td>';
|
$newModule->id = $key;
|
||||||
print '</tr>';
|
|
||||||
$var = false;
|
$alt = $module->name.' - '.$modules_files[$key];
|
||||||
$sortorder = $modules_names;
|
|
||||||
ksort($sortorder);
|
if (!empty($module->picto)) {
|
||||||
$rights_ids = array();
|
if (preg_match('/^\//', $module->picto)) $newModule->picto = img_picto($alt, $module->picto, 'width="14px"', 1);
|
||||||
foreach ($sortorder as $numero=>$name)
|
else $newModule->picto = img_object($alt, $module->picto, 'width="14px"');
|
||||||
{
|
|
||||||
$idperms = "";
|
|
||||||
// Module
|
|
||||||
print '<tr class="oddeven"><td width="300" class="nowrap">';
|
|
||||||
$alt = $name.' - '.$modules_files[$numero];
|
|
||||||
if (!empty($picto[$numero]))
|
|
||||||
{
|
|
||||||
if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1);
|
|
||||||
else print img_object($alt, $picto[$numero], 'width="14px"');
|
|
||||||
} else {
|
|
||||||
print img_object($alt, $picto[$numero], 'width="14px"');
|
|
||||||
}
|
}
|
||||||
print ' '.$modules[$numero]->getName();
|
else {
|
||||||
print "</td>";
|
$newModule->picto = img_object($alt, 'generic', 'width="14px"');
|
||||||
// Version
|
}
|
||||||
print '<td>'.$modules[$numero]->getVersion().'</td>';
|
|
||||||
// Id
|
$permission = array();
|
||||||
print '<td class="center">'.$numero.'</td>';
|
if ($module->rights) {
|
||||||
// Permissions
|
foreach ($module->rights as $rights) {
|
||||||
if ($modules[$numero]->rights)
|
if (empty($rights[0])) {
|
||||||
{
|
continue;
|
||||||
foreach ($modules[$numero]->rights as $rights)
|
}
|
||||||
{
|
|
||||||
$idperms .= ($idperms ? ", " : "").$rights[0];
|
$permission[] = $rights[0];
|
||||||
|
|
||||||
array_push($rights_ids, $rights[0]);
|
array_push($rights_ids, $rights[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '<td>'.($idperms ? $idperms : " ").'</td>';
|
|
||||||
print "</tr>\n";
|
$newModule->permission = $permission;
|
||||||
|
|
||||||
|
// pre-filter list
|
||||||
|
if ($search_name && !stristr($newModule->name, $search_name)) continue;
|
||||||
|
if ($search_version && !stristr($newModule->version, $search_version)) continue;
|
||||||
|
if ($search_id && !stristr($newModule->id, $search_id)) continue;
|
||||||
|
|
||||||
|
if ($search_permission) {
|
||||||
|
$found = false;
|
||||||
|
|
||||||
|
foreach ($newModule->permission as $permission) {
|
||||||
|
if (stristr($permission, $search_permission)) {
|
||||||
|
$found = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$found) continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$moduleList[] = $newModule;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
|
||||||
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
|
print '<input type="hidden" name="action" value="list">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
|
print_barre_liste($langs->trans("AvailableModules"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, -1, '', 'title_setup', 0, '', '', 0, 1, 1);
|
||||||
|
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("ToActivateModule").'</span>';
|
||||||
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
|
// Lines with input filters
|
||||||
|
print '<tr class="liste_titre_filter">';
|
||||||
|
|
||||||
|
if ($arrayfields['name']['checked']) {
|
||||||
|
print '<td class="liste_titre left">';
|
||||||
|
print '<input class="flat" type="text" name="search_name" size="8" value="'.$search_name.'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
if ($arrayfields['version']['checked']) {
|
||||||
|
print '<td class="liste_titre left">';
|
||||||
|
print '<input class="flat" type="text" name="search_version" size="8" value="'.$search_version.'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
if ($arrayfields['id']['checked']) {
|
||||||
|
print '<td class="liste_titre left">';
|
||||||
|
print '<input class="flat" type="text" name="search_id" size="8" value="'.$search_id.'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
if ($arrayfields['permission']['checked']) {
|
||||||
|
print '<td class="liste_titre left">';
|
||||||
|
print '<input class="flat" type="text" name="search_permission" size="8" value="'.$search_permission.'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<td class="liste_titre center maxwidthsearch">';
|
||||||
|
$searchpicto = $form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
|
if ($arrayfields['name']['checked']) {
|
||||||
|
print_liste_field_titre($arrayfields['name']['label'], $_SERVER["PHP_SELF"], "name", "", "", "", $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
if ($arrayfields['version']['checked']) {
|
||||||
|
print_liste_field_titre($arrayfields['version']['label'], $_SERVER["PHP_SELF"], "version", "", "", "", $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
if ($arrayfields['id']['checked']) {
|
||||||
|
print_liste_field_titre($arrayfields['id']['label'], $_SERVER["PHP_SELF"], "id", "", "", "", $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
if ($arrayfields['permission']['checked']) {
|
||||||
|
print_liste_field_titre($arrayfields['permission']['label'], $_SERVER["PHP_SELF"], "permission", "", "", "", $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fields from hook
|
||||||
|
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// sort list
|
||||||
|
if ($sortfield == "name" && $sortorder == "asc") usort($moduleList, function (stdClass $a, stdClass $b) {
|
||||||
|
return strcasecmp($a->name, $b->name); });
|
||||||
|
if ($sortfield == "name" && $sortorder == "desc") usort($moduleList, function (stdClass $a, stdClass $b) {
|
||||||
|
return strcasecmp($b->name, $a->name); });
|
||||||
|
if ($sortfield == "version" && $sortorder == "asc") usort($moduleList, function (stdClass $a, stdClass $b) {
|
||||||
|
return strcasecmp($a->version, $b->version); });
|
||||||
|
if ($sortfield == "version" && $sortorder == "desc") usort($moduleList, function (stdClass $a, stdClass $b) {
|
||||||
|
return strcasecmp($b->version, $a->version); });
|
||||||
|
if ($sortfield == "id" && $sortorder == "asc") usort($moduleList, "compareIdAsc");
|
||||||
|
if ($sortfield == "id" && $sortorder == "desc") usort($moduleList, "compareIdDesc");
|
||||||
|
if ($sortfield == "permission" && $sortorder == "asc") usort($moduleList, "comparePermissionIdsAsc");
|
||||||
|
if ($sortfield == "permission" && $sortorder == "desc") usort($moduleList, "comparePermissionIdsDesc");
|
||||||
|
|
||||||
|
foreach ($moduleList as $module) {
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
if ($arrayfields['name']['checked']) {
|
||||||
|
print '<td width="300" class="nowrap">';
|
||||||
|
print $module->picto;
|
||||||
|
print ' '.$module->name;
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($arrayfields['version']['checked']) {
|
||||||
|
print '<td>'.$module->version.'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($arrayfields['id']['checked']) {
|
||||||
|
print '<td class="center">'.$module->id.'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($arrayfields['permission']['checked']) {
|
||||||
|
$idperms = '';
|
||||||
|
|
||||||
|
foreach ($module->permission as $permission) {
|
||||||
|
$idperms .= ($idperms ? ", " : "").$permission;
|
||||||
|
$translationKey = "Permission".$permission;
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_SHOW_PERMISSION)) {
|
||||||
|
if (empty($langs->tab_translate[$translationKey])) {
|
||||||
|
$tooltip = 'Missing translation (key '.$translationkey.' not found in admin.lang)';
|
||||||
|
$idperms .= ' <img src="../../theme/eldy/img/warning.png" alt="Warning" title="'.$tooltip.'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<td>'.($idperms ? $idperms : " ").'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<td></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
sort($rights_ids);
|
sort($rights_ids);
|
||||||
$old = '';
|
$old = '';
|
||||||
foreach ($rights_ids as $right_id)
|
|
||||||
{
|
foreach ($rights_ids as $right_id) {
|
||||||
if ($old == $right_id) print "Warning duplicate id on permission : ".$right_id."<br>";
|
if ($old == $right_id) {
|
||||||
|
print "Warning duplicate id on permission : ".$right_id."<br>";
|
||||||
|
}
|
||||||
|
|
||||||
$old = $right_id;
|
$old = $right_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compare two modules by their ID for a ascending order
|
||||||
|
*
|
||||||
|
* @param stdClass $a First module
|
||||||
|
* @param stdClass $b Second module
|
||||||
|
* @return int Compare result (-1, 0, 1)
|
||||||
|
*/
|
||||||
|
function compareIdAsc(stdClass $a, stdClass $b)
|
||||||
|
{
|
||||||
|
if ($a->id == $b->id) return 0;
|
||||||
|
|
||||||
|
return $a->id > $b->id ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compare two modules by their ID for a descending order
|
||||||
|
*
|
||||||
|
* @param stdClass $a First module
|
||||||
|
* @param stdClass $b Second module
|
||||||
|
* @return int Compare result (-1, 0, 1)
|
||||||
|
*/
|
||||||
|
function compareIdDesc(stdClass $a, stdClass $b)
|
||||||
|
{
|
||||||
|
if ($a->id == $b->id) return 0;
|
||||||
|
|
||||||
|
return $b->id > $a->id ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compare two modules by their ID for a ascending order
|
||||||
|
*
|
||||||
|
* @param stdClass $a First module
|
||||||
|
* @param stdClass $b Second module
|
||||||
|
* @return int Compare result (-1, 0, 1)
|
||||||
|
*/
|
||||||
|
function comparePermissionIdsAsc(stdClass $a, stdClass $b)
|
||||||
|
{
|
||||||
|
if (empty($a->permission) && empty($b->permission)) return compareIdAsc($a, $b);
|
||||||
|
|
||||||
|
if (empty($a->permission)) return 1;
|
||||||
|
if (empty($b->permission)) return -1;
|
||||||
|
|
||||||
|
if ($a->permission[0] == $b->permission[0]) return 0;
|
||||||
|
|
||||||
|
return $a->permission[0] > $b->permission[0] ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compare two modules by their permissions for a descending order
|
||||||
|
*
|
||||||
|
* @param stdClass $a First module
|
||||||
|
* @param stdClass $b Second module
|
||||||
|
* @return int Compare result (-1, 0, 1)
|
||||||
|
*/
|
||||||
|
function comparePermissionIdsDesc(stdClass $a, stdClass $b)
|
||||||
|
{
|
||||||
|
if (empty($a->permission) && empty($b->permission)) return compareIdDesc($a, $b);
|
||||||
|
|
||||||
|
if (empty($a->permission)) return -1;
|
||||||
|
if (empty($b->permission)) return 1;
|
||||||
|
|
||||||
|
if ($a->permission[0] == $b->permission[0]) return 0;
|
||||||
|
|
||||||
|
return $a->permission[0] > $b->permission[0] ? 1 : -1;
|
||||||
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
/* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.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
|
||||||
@ -29,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("compta", "banks", "bills", "accountancy"));
|
$langs->loadLangs(array("compta", "banks", "bills", "accountancy"));
|
||||||
@ -44,11 +46,14 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
|||||||
$search_ref = GETPOST('search_ref', 'int');
|
$search_ref = GETPOST('search_ref', 'int');
|
||||||
$search_user = GETPOST('search_user', 'alpha');
|
$search_user = GETPOST('search_user', 'alpha');
|
||||||
$search_label = GETPOST('search_label', 'alpha');
|
$search_label = GETPOST('search_label', 'alpha');
|
||||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
$search_datep_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
$search_datep_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||||
|
$search_datev_start = dol_mktime(0, 0, 0, GETPOST('search_date_value_startmonth', 'int'), GETPOST('search_date_value_startday', 'int'), GETPOST('search_date_value_startyear', 'int'));
|
||||||
|
$search_datev_end = dol_mktime(23, 59, 59, GETPOST('search_date_value_endmonth', 'int'), GETPOST('search_date_value_endday', 'int'), GETPOST('search_date_value_endyear', 'int'));
|
||||||
$search_amount_deb = GETPOST('search_amount_deb', 'alpha');
|
$search_amount_deb = GETPOST('search_amount_deb', 'alpha');
|
||||||
$search_amount_cred = GETPOST('search_amount_cred', 'alpha');
|
$search_amount_cred = GETPOST('search_amount_cred', 'alpha');
|
||||||
$search_account = GETPOST('search_account', 'int');
|
$search_bank_account = GETPOST('search_account', 'int');
|
||||||
|
$search_bank_entry = GETPOST('search_bank_entry', 'int');
|
||||||
$search_accountancy_account = GETPOST("search_accountancy_account");
|
$search_accountancy_account = GETPOST("search_accountancy_account");
|
||||||
if ($search_accountancy_account == - 1) $search_accountancy_account = '';
|
if ($search_accountancy_account == - 1) $search_accountancy_account = '';
|
||||||
$search_accountancy_subledger = GETPOST("search_accountancy_subledger");
|
$search_accountancy_subledger = GETPOST("search_accountancy_subledger");
|
||||||
@ -81,18 +86,51 @@ if (!GETPOST('typeid'))
|
|||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$search_ref = "";
|
$search_ref = '';
|
||||||
$search_label = "";
|
$search_label = '';
|
||||||
$search_date_start = '';
|
$search_datep_start = '';
|
||||||
$search_date_end = '';
|
$search_datep_end = '';
|
||||||
$search_amount_deb = "";
|
$search_datev_start = '';
|
||||||
$search_amount_cred = "";
|
$search_datev_end = '';
|
||||||
$search_account = '';
|
$search_amount_deb = '';
|
||||||
|
$search_amount_cred = '';
|
||||||
|
$search_bank_account = '';
|
||||||
|
$search_bank_entry = '';
|
||||||
$search_accountancy_account = '';
|
$search_accountancy_account = '';
|
||||||
$search_accountancy_subledger = '';
|
$search_accountancy_subledger = '';
|
||||||
$typeid = "";
|
$typeid = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Definition of fields for lists
|
||||||
|
$arrayfields = array(
|
||||||
|
'ref' =>array('label'=>"Ref", 'checked'=>1, 'position'=>100),
|
||||||
|
'label' =>array('label'=>"Label", 'checked'=>1, 'position'=>110),
|
||||||
|
'datep' =>array('label'=>"DatePayment", 'checked'=>1, 'position'=>120),
|
||||||
|
'datev' =>array('label'=>"DateValue", 'checked'=>1, 'position'=>130),
|
||||||
|
'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140),
|
||||||
|
'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->projet->enabled)),
|
||||||
|
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>!empty($conf->banque->enabled)),
|
||||||
|
'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>!empty($conf->banque->enabled)),
|
||||||
|
'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)),
|
||||||
|
'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>!empty($conf->accounting->enabled)),
|
||||||
|
'debit' =>array('label'=>"Debit", 'checked'=>1, 'position'=>500),
|
||||||
|
'credit' =>array('label'=>"Credit", 'checked'=>1, 'position'=>510),
|
||||||
|
);
|
||||||
|
|
||||||
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
$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)) {
|
||||||
|
// Selection of new fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -101,11 +139,15 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formaccounting = new FormAccounting($db);
|
if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) $formaccounting = new FormAccounting($db);
|
||||||
$variousstatic = new PaymentVarious($db);
|
if ($arrayfields['bank']['checked'] && !empty($conf->accounting->enabled)) $accountingjournal = new AccountingJournal($db);
|
||||||
$accountstatic = new Account($db);
|
if ($arrayfields['ref']['checked']) $variousstatic = new PaymentVarious($db);
|
||||||
|
if ($arrayfields['bank']['checked']) $accountstatic = new Account($db);
|
||||||
|
if ($arrayfields['project']['checked']) $proj = new Project($db);
|
||||||
|
if ($arrayfields['entry']['checked']) $bankline = new AccountLine($db);
|
||||||
|
if ($arrayfields['account']['checked']) $accountingaccount = new AccountingAccount($db);
|
||||||
|
|
||||||
$sql = "SELECT v.rowid, v.sens, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code, v.subledger_account,";
|
$sql = "SELECT v.rowid, v.sens, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code, v.subledger_account, v.fk_projet as fk_project,";
|
||||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number as bank_account_number, ba.fk_accountancy_journal as accountancy_journal, ba.label as blabel,";
|
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number as bank_account_number, ba.fk_accountancy_journal as accountancy_journal, ba.label as blabel,";
|
||||||
$sql .= " pst.code as payment_code";
|
$sql .= " pst.code as payment_code";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
||||||
@ -117,11 +159,14 @@ $sql .= " WHERE v.entity IN (".getEntity('payment_various').")";
|
|||||||
// Search criteria
|
// Search criteria
|
||||||
if ($search_ref) $sql .= " AND v.rowid=".$db->escape($search_ref);
|
if ($search_ref) $sql .= " AND v.rowid=".$db->escape($search_ref);
|
||||||
if ($search_label) $sql .= natural_search(array('v.label'), $search_label);
|
if ($search_label) $sql .= natural_search(array('v.label'), $search_label);
|
||||||
if ($search_date_start) $sql .= " AND v.datep >= '".$db->idate($search_date_start)."'";
|
if ($search_datep_start) $sql .= " AND v.datep >= '".$db->idate($search_datep_start)."'";
|
||||||
if ($search_date_end) $sql .= " AND v.datep <= '".$db->idate($search_date_end)."'";
|
if ($search_datep_end) $sql .= " AND v.datep <= '".$db->idate($search_datep_end)."'";
|
||||||
|
if ($search_datev_start) $sql .= " AND v.datev >= '".$db->idate($search_datev_start)."'";
|
||||||
|
if ($search_datev_end) $sql .= " AND v.datev <= '".$db->idate($search_datev_end)."'";
|
||||||
if ($search_amount_deb) $sql .= natural_search("v.amount", $search_amount_deb, 1);
|
if ($search_amount_deb) $sql .= natural_search("v.amount", $search_amount_deb, 1);
|
||||||
if ($search_amount_cred) $sql .= natural_search("v.amount", $search_amount_cred, 1);
|
if ($search_amount_cred) $sql .= natural_search("v.amount", $search_amount_cred, 1);
|
||||||
if ($search_account > 0) $sql .= " AND b.fk_account=".$db->escape($search_account);
|
if ($search_bank_account > 0) $sql .= " AND b.fk_account=".$db->escape($search_bank_account);
|
||||||
|
if ($search_bank_entry > 0) $sql .= " AND b.fk_account=".$db->escape($search_bank_account);
|
||||||
if ($search_accountancy_account > 0) $sql .= " AND v.accountancy_code=".$db->escape($search_accountancy_account);
|
if ($search_accountancy_account > 0) $sql .= " AND v.accountancy_code=".$db->escape($search_accountancy_account);
|
||||||
if ($search_accountancy_subledger > 0) $sql .= " AND v.subledger_account=".$db->escape($search_accountancy_subledger);
|
if ($search_accountancy_subledger > 0) $sql .= " AND v.subledger_account=".$db->escape($search_accountancy_subledger);
|
||||||
if ($typeid > 0) $sql .= " AND v.fk_typepayment=".$typeid;
|
if ($typeid > 0) $sql .= " AND v.fk_typepayment=".$typeid;
|
||||||
@ -157,7 +202,7 @@ if ($result)
|
|||||||
if ($typeid > 0) $param .= '&typeid='.urlencode($typeid);
|
if ($typeid > 0) $param .= '&typeid='.urlencode($typeid);
|
||||||
if ($search_amount_deb) $param .= '&search_amount_deb='.urlencode($search_amount_deb);
|
if ($search_amount_deb) $param .= '&search_amount_deb='.urlencode($search_amount_deb);
|
||||||
if ($search_amount_cred) $param .= '&search_amount_cred='.urlencode($search_amount_cred);
|
if ($search_amount_cred) $param .= '&search_amount_cred='.urlencode($search_amount_cred);
|
||||||
if ($search_account > 0) $param .= '&search_amount='.urlencode($search_account);
|
if ($search_bank_account > 0) $param .= '&search_amount='.urlencode($search_bank_account);
|
||||||
if ($search_accountancy_account > 0) $param .= '&search_accountancy_account='.urlencode($search_accountancy_account);
|
if ($search_accountancy_account > 0) $param .= '&search_accountancy_account='.urlencode($search_accountancy_account);
|
||||||
if ($search_accountancy_subledger > 0) $param .= '&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
|
if ($search_accountancy_subledger > 0) $param .= '&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
|
||||||
|
|
||||||
@ -177,59 +222,104 @@ if ($result)
|
|||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("MenuVariousPayment"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($langs->trans("MenuVariousPayment"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
|
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
|
if ($arrayfields['ref']['checked']) {
|
||||||
print '<td class="liste_titre left">';
|
print '<td class="liste_titre left">';
|
||||||
print '<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
print '<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
if ($arrayfields['label']['checked']) {
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Date
|
// Payment date
|
||||||
|
if ($arrayfields['datep']['checked']) {
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From').' ';
|
print $langs->trans('From').' ';
|
||||||
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1);
|
print $form->selectDate($search_datep_start ? $search_datep_start : -1, 'search_date_start', 0, 0, 1);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to').' ';
|
print $langs->trans('to').' ';
|
||||||
print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1);
|
print $form->selectDate($search_datep_end ? $search_datep_end : -1, 'search_date_end', 0, 0, 1);
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Type
|
// Value date
|
||||||
|
if ($arrayfields['datev']['checked']) {
|
||||||
|
print '<td class="liste_titre center">';
|
||||||
|
print '<div class="nowrap">';
|
||||||
|
print $langs->trans('From').' ';
|
||||||
|
print $form->selectDate($search_datev_start ? $search_datev_start : -1, 'search_date_value_start', 0, 0, 1);
|
||||||
|
print '</div>';
|
||||||
|
print '<div class="nowrap">';
|
||||||
|
print $langs->trans('to').' ';
|
||||||
|
print $form->selectDate($search_datev_end ? $search_datev_end : -1, 'search_date_value_end', 0, 0, 1);
|
||||||
|
print '</div>';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Payment type
|
||||||
|
if ($arrayfields['type']['checked']) {
|
||||||
print '<td class="liste_titre left">';
|
print '<td class="liste_titre left">';
|
||||||
$form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16);
|
$form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Account
|
// Project
|
||||||
if (!empty($conf->banque->enabled))
|
if ($arrayfields['project']['checked']) {
|
||||||
{
|
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
$form->select_comptes($search_account, 'search_account', 0, '', 1);
|
// TODO
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bank account
|
||||||
|
if ($arrayfields['bank']['checked']) {
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
$form->select_comptes($search_bank_account, 'search_account', 0, '', 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bank entry
|
||||||
|
if ($arrayfields['entry']['checked']) {
|
||||||
|
print '<td class="liste_titre right">';
|
||||||
|
print '<input name="search_bank_entry" class="flat" type="text" size="8" value="'.$search_bank_entry.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accounting account
|
// Accounting account
|
||||||
if (!empty($conf->accounting->enabled))
|
if ($arrayfields['account']['checked']) {
|
||||||
{
|
|
||||||
// Accounting account
|
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $formaccounting->select_account($search_accountancy_account, 'search_accountancy_account', 1, array(), 1, 1, 'maxwidth200');
|
print $formaccounting->select_account($search_accountancy_account, 'search_accountancy_account', 1, array(), 1, 1, 'maxwidth200');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Subledger account
|
// Subledger account
|
||||||
|
if ($arrayfields['subledger']['checked']) {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $formaccounting->select_auxaccount($search_accountancy_subledger, 'search_accountancy_subledger', 1, 'maxwidth200');
|
print $formaccounting->select_auxaccount($search_accountancy_subledger, 'search_accountancy_subledger', 1, 'maxwidth200');
|
||||||
@ -238,31 +328,50 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Debit
|
// Debit
|
||||||
print '<td class="liste_titre right"><input name="search_amount_deb" class="flat" type="text" size="8" value="'.$search_amount_deb.'"></td>';
|
if ($arrayfields['debit']['checked']) {
|
||||||
|
print '<td class="liste_titre right">';
|
||||||
|
print '<input name="search_amount_deb" class="flat" type="text" size="8" value="'.$search_amount_deb.'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Credit
|
// Credit
|
||||||
print '<td class="liste_titre right"><input name="search_amount_cred" class="flat" type="text" size="8" value="'.$search_amount_cred.'"></td>';
|
if ($arrayfields['credit']['checked']) {
|
||||||
|
print '<td class="liste_titre right">';
|
||||||
|
print '<input name="search_amount_cred" class="flat" type="text" size="8" value="'.$search_amount_cred.'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "v.rowid", "", $param, "", $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "v.label", "", $param, '', $sortfield, $sortorder, 'left ');
|
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "v.datep,v.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
|
||||||
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'left ');
|
if ($arrayfields['ref']['checked']) print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], 'v.rowid', '', $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
|
if ($arrayfields['label']['checked']) print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], 'v.label', '', $param, '', $sortfield, $sortorder, 'left ');
|
||||||
if (!empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccountingShort", $_SERVER["PHP_SELF"], "v.accountancy_code", "", $param, '', $sortfield, $sortorder, 'left ');
|
if ($arrayfields['datep']['checked']) print_liste_field_titre($arrayfields['datep']['label'], $_SERVER["PHP_SELF"], 'v.datep,v.rowid', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||||
if (!empty($conf->accounting->enabled)) print_liste_field_titre("SubledgerAccount", $_SERVER["PHP_SELF"], "v.subledger_account", "", $param, '', $sortfield, $sortorder, 'left ');
|
if ($arrayfields['datev']['checked']) print_liste_field_titre($arrayfields['datev']['label'], $_SERVER["PHP_SELF"], 'v.datev,v.rowid', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right ');
|
if ($arrayfields['type']['checked']) print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], 'type', '', $param, '', $sortfield, $sortorder, 'left ');
|
||||||
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right ');
|
if ($arrayfields['project']['checked']) print_liste_field_titre($arrayfields['project']['label'], $_SERVER["PHP_SELF"], 'fk_project', '', $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
if ($arrayfields['bank']['checked']) print_liste_field_titre($arrayfields['bank']['label'], $_SERVER["PHP_SELF"], 'ba.label', '', $param, '', $sortfield, $sortorder);
|
||||||
print "</tr>\n";
|
if ($arrayfields['entry']['checked']) print_liste_field_titre($arrayfields['entry']['label'], $_SERVER["PHP_SELF"], 'ba.label', '', $param, '', $sortfield, $sortorder);
|
||||||
|
if ($arrayfields['account']['checked']) print_liste_field_titre($arrayfields['account']['label'], $_SERVER["PHP_SELF"], 'v.accountancy_code', '', $param, '', $sortfield, $sortorder, 'left ');
|
||||||
|
if ($arrayfields['subledger']['checked']) print_liste_field_titre($arrayfields['subledger']['label'], $_SERVER["PHP_SELF"], 'v.subledger_account', '', $param, '', $sortfield, $sortorder, 'left ');
|
||||||
|
if ($arrayfields['debit']['checked']) print_liste_field_titre($arrayfields['debit']['label'], $_SERVER["PHP_SELF"], 'v.amount', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if ($arrayfields['credit']['checked']) print_liste_field_titre($arrayfields['credit']['label'], $_SERVER["PHP_SELF"], 'v.amount', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
|
||||||
|
// Fields from hook
|
||||||
|
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
@ -272,28 +381,53 @@ if ($result)
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
$variousstatic->id = $obj->rowid;
|
// No
|
||||||
$variousstatic->ref = $obj->rowid;
|
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||||
|
print '<td>'.(($offset * $limit) + $i).'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print "<td>".$variousstatic->getNomUrl(1)."</td>\n";
|
if ($arrayfields['ref']['checked']) {
|
||||||
|
$variousstatic->id = $obj->rowid;
|
||||||
|
$variousstatic->ref = $obj->rowid;
|
||||||
|
print "<td>".$variousstatic->getNomUrl(1)."</td>";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Label payment
|
// Label payment
|
||||||
print "<td>".dol_trunc($obj->label, 40)."</td>\n";
|
if ($arrayfields['label']['checked']) {
|
||||||
|
print "<td>".dol_trunc($obj->label, 40)."</td>";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Date payment
|
// Date payment
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day')."</td>\n";
|
if ($arrayfields['datep']['checked']) {
|
||||||
|
print '<td class="center">'.dol_print_date($obj->datep, 'day')."</td>";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Date value
|
||||||
|
if ($arrayfields['datev']['checked']) {
|
||||||
|
print '<td class="center">'.dol_print_date($obj->datev, 'day')."</td>";
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
|
if ($arrayfields['type']['checked']) {
|
||||||
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Account
|
// Project
|
||||||
if (!empty($conf->banque->enabled))
|
if ($arrayfields['project']['checked']) {
|
||||||
{
|
$proj->fetch($obj->fk_project);
|
||||||
|
print '<td>'.$proj->getNomUrl(1).'</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bank account
|
||||||
|
if ($arrayfields['bank']['checked']) {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($obj->bid > 0)
|
if ($obj->bid > 0)
|
||||||
{
|
{
|
||||||
@ -303,22 +437,28 @@ if ($result)
|
|||||||
|
|
||||||
if (!empty($conf->accounting->enabled)) {
|
if (!empty($conf->accounting->enabled)) {
|
||||||
$accountstatic->account_number = $obj->bank_account_number;
|
$accountstatic->account_number = $obj->bank_account_number;
|
||||||
|
|
||||||
$accountingjournal = new AccountingJournal($db);
|
|
||||||
$accountingjournal->fetch($obj->accountancy_journal);
|
$accountingjournal->fetch($obj->accountancy_journal);
|
||||||
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
|
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$accountstatic->label = $obj->blabel;
|
$accountstatic->label = $obj->blabel;
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
} else print ' ';
|
} else {
|
||||||
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bank entry
|
||||||
|
if ($arrayfields['entry']['checked']) {
|
||||||
|
$bankline->fetch($obj->fk_bank);
|
||||||
|
print '<td>'.$bankline->getNomUrl(1).'</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Accounting account
|
// Accounting account
|
||||||
if (!empty($conf->accounting->enabled)) {
|
if ($arrayfields['account']['checked']) {
|
||||||
$accountingaccount = new AccountingAccount($db);
|
|
||||||
$accountingaccount->fetch('', $obj->accountancy_code, 1);
|
$accountingaccount->fetch('', $obj->accountancy_code, 1);
|
||||||
|
|
||||||
print '<td>'.$accountingaccount->getNomUrl(0, 1, 1, '', 1).'</td>';
|
print '<td>'.$accountingaccount->getNomUrl(0, 1, 1, '', 1).'</td>';
|
||||||
@ -326,13 +466,13 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Accounting subledger account
|
// Accounting subledger account
|
||||||
if (!empty($conf->accounting->enabled))
|
if ($arrayfields['subledger']['checked']) {
|
||||||
{
|
|
||||||
print '<td>'.length_accounta($obj->subledger_account).'</td>';
|
print '<td>'.length_accounta($obj->subledger_account).'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debit
|
// Debit
|
||||||
|
if ($arrayfields['debit']['checked']) {
|
||||||
print '<td class="nowrap right">';
|
print '<td class="nowrap right">';
|
||||||
if ($obj->sens == 0)
|
if ($obj->sens == 0)
|
||||||
{
|
{
|
||||||
@ -342,8 +482,10 @@ if ($result)
|
|||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'total_deb';
|
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'total_deb';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Credit
|
// Credit
|
||||||
|
if ($arrayfields['credit']['checked']) {
|
||||||
print '<td class="nowrap right">';
|
print '<td class="nowrap right">';
|
||||||
if ($obj->sens == 1)
|
if ($obj->sens == 1)
|
||||||
{
|
{
|
||||||
@ -353,11 +495,13 @@ if ($result)
|
|||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'total_cred';
|
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'total_cred';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -415,7 +415,9 @@ class Invoices extends DolibarrApi
|
|||||||
$request_data->array_options,
|
$request_data->array_options,
|
||||||
$request_data->situation_percent,
|
$request_data->situation_percent,
|
||||||
$request_data->fk_unit,
|
$request_data->fk_unit,
|
||||||
$request_data->multicurrency_subprice
|
$request_data->multicurrency_subprice,
|
||||||
|
0,
|
||||||
|
$request_data->ref_ext
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($updateRes > 0) {
|
if ($updateRes > 0) {
|
||||||
@ -704,7 +706,9 @@ class Invoices extends DolibarrApi
|
|||||||
$request_data->array_options,
|
$request_data->array_options,
|
||||||
$request_data->situation_percent,
|
$request_data->situation_percent,
|
||||||
$request_data->fk_prev_id,
|
$request_data->fk_prev_id,
|
||||||
$request_data->fk_unit
|
$request_data->fk_unit,
|
||||||
|
0,
|
||||||
|
$request_data->ref_ext
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($updateRes < 0) {
|
if ($updateRes < 0) {
|
||||||
|
|||||||
@ -5157,10 +5157,10 @@ class FactureLigne extends CommonInvoiceLine
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Mise a jour ligne en base
|
// Update line in database
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET";
|
||||||
$sql .= " description='".$this->db->escape($this->desc)."'";
|
$sql .= " description='".$this->db->escape($this->desc)."'";
|
||||||
$sql .= " ref_ext='".$this->db->escape($this->ref_ext)."'";
|
$sql .= ", ref_ext='".$this->db->escape($this->ref_ext)."'";
|
||||||
$sql .= ", label=".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null");
|
$sql .= ", label=".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null");
|
||||||
$sql .= ", subprice=".price2num($this->subprice)."";
|
$sql .= ", subprice=".price2num($this->subprice)."";
|
||||||
$sql .= ", remise_percent=".price2num($this->remise_percent)."";
|
$sql .= ", remise_percent=".price2num($this->remise_percent)."";
|
||||||
|
|||||||
@ -3893,6 +3893,7 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
$this->label_incoterms = '';
|
$this->label_incoterms = '';
|
||||||
if (!empty($this->fk_incoterms))
|
if (!empty($this->fk_incoterms))
|
||||||
{
|
{
|
||||||
@ -3905,7 +3906,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$out .= (($res->code && $this->location_incoterms) ? ' - ' : '').$this->location_incoterms;
|
$out .= (($out && $this->location_incoterms) ? ' - ' : '').$this->location_incoterms;
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -269,10 +269,10 @@ class CoreObject extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Function to create object in database
|
* Function to create object in database
|
||||||
*
|
*
|
||||||
* @param User $user user object
|
* @param User $user User object
|
||||||
* @return int < 0 if KO, > 0 if OK
|
* @return int < 0 if KO, > 0 if OK
|
||||||
*/
|
*/
|
||||||
public function create(User &$user)
|
public function create(User $user)
|
||||||
{
|
{
|
||||||
if ($this->id > 0) return $this->update($user);
|
if ($this->id > 0) return $this->update($user);
|
||||||
|
|
||||||
|
|||||||
@ -7606,9 +7606,10 @@ class Form
|
|||||||
* @param string $target htmlname of target select to bind event
|
* @param string $target htmlname of target select to bind event
|
||||||
* @param int $default_selected default category to select if fk_c_type_fees change = EX_KME
|
* @param int $default_selected default category to select if fk_c_type_fees change = EX_KME
|
||||||
* @param array $params param to give
|
* @param array $params param to give
|
||||||
|
* @param int $info_admin Show the tooltip help picto to setup list
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function selectExpenseCategories($selected = '', $htmlname = 'fk_c_exp_tax_cat', $useempty = 0, $excludeid = array(), $target = '', $default_selected = 0, $params = array())
|
public function selectExpenseCategories($selected = '', $htmlname = 'fk_c_exp_tax_cat', $useempty = 0, $excludeid = array(), $target = '', $default_selected = 0, $params = array(), $info_admin = 1)
|
||||||
{
|
{
|
||||||
global $db, $langs, $user;
|
global $db, $langs, $user;
|
||||||
|
|
||||||
@ -7621,7 +7622,7 @@ class Form
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
|
$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
|
||||||
if ($useempty) $out .= '<option value="0"> </option>';
|
if ($useempty) $out .= '<option value="0"> </option>';
|
||||||
|
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
@ -7629,7 +7630,9 @@ class Form
|
|||||||
$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
|
$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
|
||||||
}
|
}
|
||||||
$out .= '</select>';
|
$out .= '</select>';
|
||||||
if (!empty($htmlname) && $user->admin) $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
$out .= ajax_combobox('select_'.$htmlname);
|
||||||
|
|
||||||
|
if (!empty($htmlname) && $user->admin && $info_admin) $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
|
|
||||||
if (!empty($target))
|
if (!empty($target))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -517,12 +517,21 @@ class Translate
|
|||||||
|
|
||||||
if ($fileread) $this->_tab_loaded[$newdomain] = 1; // Set domain file as loaded
|
if ($fileread) $this->_tab_loaded[$newdomain] = 1; // Set domain file as loaded
|
||||||
|
|
||||||
if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain] = 2; // Marque ce cas comme non trouve (no lines found for language)
|
if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain] = 2; // Mark this case as not found (no lines found for language)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get information with result of loading data for domain
|
||||||
|
*
|
||||||
|
* @param string $domain Domain to check
|
||||||
|
* @return int 0, 1, 2...
|
||||||
|
*/
|
||||||
|
public function isLoaded($domain)
|
||||||
|
{
|
||||||
|
return $this->_tab_loaded[$domain];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return translated value of key for special keys ("Currency...", "Civility...", ...).
|
* Return translated value of key for special keys ("Currency...", "Civility...", ...).
|
||||||
|
|||||||
@ -615,23 +615,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '',
|
|||||||
$mois = date("m", $timestampStart);
|
$mois = date("m", $timestampStart);
|
||||||
$annee = date("Y", $timestampStart);
|
$annee = date("Y", $timestampStart);
|
||||||
|
|
||||||
// Check into var $conf->global->HOLIDAY_MORE_DAYS MM-DD,YYYY-MM-DD, ...
|
|
||||||
// Do not use this anymore, use instead the dictionary of public holidays.
|
|
||||||
if (!empty($conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS))
|
|
||||||
{
|
|
||||||
$arrayofdaystring = explode(',', $conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS);
|
|
||||||
foreach ($arrayofdaystring as $daystring)
|
|
||||||
{
|
|
||||||
$tmp = explode('-', $daystring);
|
|
||||||
if ($tmp[2])
|
|
||||||
{
|
|
||||||
if ($tmp[0] == $annee && $tmp[1] == $mois && $tmp[2] == $jour) $ferie = true;
|
|
||||||
} else {
|
|
||||||
if ($tmp[0] == $mois && $tmp[1] == $jour) $ferie = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$country_id = dol_getIdFromCode($db, $country_code, 'c_country', 'code', 'rowid');
|
$country_id = dol_getIdFromCode($db, $country_code, 'c_country', 'code', 'rowid');
|
||||||
|
|
||||||
// Loop on public holiday defined into hrm_public_holiday
|
// Loop on public holiday defined into hrm_public_holiday
|
||||||
|
|||||||
@ -133,14 +133,6 @@ function expensereport_admin_prepare_head()
|
|||||||
$head[$h][2] = 'expensereport';
|
$head[$h][2] = 'expensereport';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_ik.php";
|
|
||||||
$head[$h][1] = $langs->trans("ExpenseReportsIk");
|
|
||||||
$head[$h][2] = 'expenseik';
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_RULE))
|
if (!empty($conf->global->MAIN_USE_EXPENSE_RULE))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php";
|
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php";
|
||||||
@ -149,6 +141,14 @@ function expensereport_admin_prepare_head()
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_ik.php";
|
||||||
|
$head[$h][1] = $langs->trans("ExpenseReportsIk");
|
||||||
|
$head[$h][2] = 'expenseik';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
|
|||||||
@ -1087,16 +1087,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Taxes and social contributions
|
// Taxes and social contributions
|
||||||
if (!empty($conf->tax->enabled) || !empty($conf->salaries->enabled) || !empty($conf->loan->enabled) || !empty($conf->banque->enabled))
|
|
||||||
{
|
|
||||||
global $mysoc;
|
|
||||||
|
|
||||||
$permtoshowmenu = ((!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) || (!empty($conf->loan->enabled) && $user->rights->loan->read) || (!empty($conf->banque->enabled) && $user->rights->banque->lire));
|
|
||||||
$newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax');
|
|
||||||
|
|
||||||
// Social contributions
|
|
||||||
if (!empty($conf->tax->enabled))
|
if (!empty($conf->tax->enabled))
|
||||||
{
|
{
|
||||||
|
$newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->rights->tax->charges->lire, '', $mainmenu, 'tax');
|
||||||
|
|
||||||
$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire);
|
$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire);
|
||||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) {
|
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) {
|
||||||
$newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
|
$newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
|
||||||
@ -1106,6 +1100,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
// VAT
|
// VAT
|
||||||
if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
|
if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
|
||||||
{
|
{
|
||||||
|
global $mysoc;
|
||||||
|
|
||||||
$newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
$newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
||||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) {
|
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) {
|
||||||
$newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->rights->tax->charges->creer);
|
$newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->rights->tax->charges->creer);
|
||||||
@ -1114,7 +1110,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
$newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
|
$newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
|
||||||
$newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
|
$newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
|
||||||
}
|
}
|
||||||
global $mysoc;
|
|
||||||
|
|
||||||
//Local Taxes 1
|
//Local Taxes 1
|
||||||
if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1"))
|
if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1"))
|
||||||
@ -1177,7 +1172,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Menu COMPTA-FINANCIAL
|
* Menu COMPTA-FINANCIAL
|
||||||
@ -1481,7 +1475,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
{
|
{
|
||||||
$langs->load("categories");
|
$langs->load("categories");
|
||||||
$newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags');
|
$newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags');
|
||||||
$newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags');
|
$newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->rights->banque->configurer, '', $mainmenu, 'tags');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Direct debit order
|
// Direct debit order
|
||||||
|
|||||||
@ -251,6 +251,11 @@ class pdf_standard extends CommonStickerGenerator
|
|||||||
{
|
{
|
||||||
if ($object->country == '-') $object->country = '';
|
if ($object->country == '-') $object->country = '';
|
||||||
|
|
||||||
|
$now = dol_now();
|
||||||
|
$year = dol_print_date($now, '%Y');
|
||||||
|
$month = dol_print_date($now, '%m');
|
||||||
|
$day = dol_print_date($now, '%d');
|
||||||
|
|
||||||
// List of values to scan for a replacement
|
// List of values to scan for a replacement
|
||||||
$substitutionarray = array(
|
$substitutionarray = array(
|
||||||
'__ID__' => $object->id,
|
'__ID__' => $object->id,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
@ -1835,7 +1835,7 @@ if ($action == 'create')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->fk_statut == 6)
|
if ($object->fk_statut == $object::STATUS_CLOSED)
|
||||||
{
|
{
|
||||||
/* TODO this fields are not yet filled
|
/* TODO this fields are not yet filled
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
@ -2029,8 +2029,8 @@ if ($action == 'create')
|
|||||||
//print '<td class="center">'.$langs->trans('Piece').'</td>';
|
//print '<td class="center">'.$langs->trans('Piece').'</td>';
|
||||||
print '<td class="center">'.$langs->trans('Date').'</td>';
|
print '<td class="center">'.$langs->trans('Date').'</td>';
|
||||||
if (!empty($conf->projet->enabled)) print '<td class="minwidth100imp">'.$langs->trans('Project').'</td>';
|
if (!empty($conf->projet->enabled)) print '<td class="minwidth100imp">'.$langs->trans('Project').'</td>';
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print '<td>'.$langs->trans('CarCategory').'</td>';
|
|
||||||
print '<td class="center">'.$langs->trans('Type').'</td>';
|
print '<td class="center">'.$langs->trans('Type').'</td>';
|
||||||
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print '<td>'.$langs->trans('CarCategory').'</td>';
|
||||||
print '<td>'.$langs->trans('Description').'</td>';
|
print '<td>'.$langs->trans('Description').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('VAT').'</td>';
|
print '<td class="right">'.$langs->trans('VAT').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
||||||
@ -2080,6 +2080,13 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Type of fee
|
||||||
|
print '<td class="center">';
|
||||||
|
$labeltype = ($langs->trans(($line->type_fees_code)) == $line->type_fees_code ? $line->type_fees_libelle : $langs->trans($line->type_fees_code));
|
||||||
|
print $labeltype;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// IK
|
// IK
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||||
{
|
{
|
||||||
@ -2087,11 +2094,7 @@ if ($action == 'create')
|
|||||||
print dol_getIdFromCode($db, $line->fk_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label');
|
print dol_getIdFromCode($db, $line->fk_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Type of fee
|
|
||||||
print '<td class="center">';
|
|
||||||
$labeltype = ($langs->trans(($line->type_fees_code)) == $line->type_fees_code ? $line->type_fees_libelle : $langs->trans($line->type_fees_code));
|
|
||||||
print $labeltype;
|
|
||||||
print '</td>';
|
|
||||||
// Comment
|
// Comment
|
||||||
print '<td class="left">'.dol_nl2br($line->comments).'</td>';
|
print '<td class="left">'.dol_nl2br($line->comments).'</td>';
|
||||||
// VAT rate
|
// VAT rate
|
||||||
@ -2285,6 +2288,11 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Select type
|
||||||
|
print '<td class="center">';
|
||||||
|
print select_type_fees_id($line->fk_c_type_fees, 'fk_c_type_fees');
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||||
{
|
{
|
||||||
print '<td class="fk_c_exp_tax_cat">';
|
print '<td class="fk_c_exp_tax_cat">';
|
||||||
@ -2293,11 +2301,6 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select type
|
|
||||||
print '<td class="center">';
|
|
||||||
select_type_fees_id($line->fk_c_type_fees, 'fk_c_type_fees');
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Add comments
|
// Add comments
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<textarea name="comments" class="flat_ndf centpercent">'.dol_escape_htmltag($line->comments, 0, 1).'</textarea>';
|
print '<textarea name="comments" class="flat_ndf centpercent">'.dol_escape_htmltag($line->comments, 0, 1).'</textarea>';
|
||||||
@ -2344,7 +2347,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a line
|
// Add a new line
|
||||||
if (($object->fk_statut == ExpenseReport::STATUS_DRAFT || $object->fk_statut == ExpenseReport::STATUS_REFUSED)
|
if (($object->fk_statut == ExpenseReport::STATUS_DRAFT || $object->fk_statut == ExpenseReport::STATUS_REFUSED)
|
||||||
&& $action != 'editline'
|
&& $action != 'editline'
|
||||||
&& $user->rights->expensereport->creer)
|
&& $user->rights->expensereport->creer)
|
||||||
@ -2408,9 +2411,13 @@ if ($action == 'create')
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '<td class="center">'.$langs->trans('Date').'</td>';
|
print '<td class="center">'.$langs->trans('Date').'</td>';
|
||||||
if (!empty($conf->projet->enabled)) print '<td class="minwidth100imp">'.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).'</td>';
|
if (!empty($conf->projet->enabled)) {
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print '<td>'.$langs->trans('CarCategory').'</td>';
|
print '<td class="minwidth100imp">'.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).'</td>';
|
||||||
|
}
|
||||||
print '<td class="center">'.$langs->trans('Type').'</td>';
|
print '<td class="center">'.$langs->trans('Type').'</td>';
|
||||||
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
||||||
|
print '<td>'.$langs->trans('CarCategory').'</td>';
|
||||||
|
}
|
||||||
print '<td>'.$langs->trans('Description').'</td>';
|
print '<td>'.$langs->trans('Description').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('VAT').'</td>';
|
print '<td class="right">'.$langs->trans('VAT').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
||||||
@ -2440,19 +2447,19 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Select type
|
||||||
|
print '<td class="center">';
|
||||||
|
print select_type_fees_id($fk_c_type_fees, 'fk_c_type_fees', 1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||||
{
|
{
|
||||||
print '<td class="fk_c_exp_tax_cat">';
|
print '<td class="fk_c_exp_tax_cat">';
|
||||||
$params = array('fk_expense' => $object->id);
|
$params = array('fk_expense' => $object->id);
|
||||||
print $form->selectExpenseCategories('', 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params);
|
print $form->selectExpenseCategories('', 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select type
|
|
||||||
print '<td class="center">';
|
|
||||||
select_type_fees_id($fk_c_type_fees, 'fk_c_type_fees', 1);
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Add comments
|
// Add comments
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<textarea class="flat_ndf centpercent" name="comments" rows="'.ROWS_2.'">'.dol_escape_htmltag($comments, 0, 1).'</textarea>';
|
print '<textarea class="flat_ndf centpercent" name="comments" rows="'.ROWS_2.'">'.dol_escape_htmltag($comments, 0, 1).'</textarea>';
|
||||||
|
|||||||
@ -2774,12 +2774,14 @@ function select_type_fees_id($selected = '', $htmlname = 'type', $showempty = 0,
|
|||||||
global $db, $langs, $user;
|
global $db, $langs, $user;
|
||||||
$langs->load("trips");
|
$langs->load("trips");
|
||||||
|
|
||||||
print '<select class="flat" name="'.$htmlname.'">';
|
$out = '';
|
||||||
|
|
||||||
|
$out .= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||||
if ($showempty)
|
if ($showempty)
|
||||||
{
|
{
|
||||||
print '<option value="-1"';
|
$out .= '<option value="-1"';
|
||||||
if ($selected == -1) print ' selected';
|
if ($selected == -1) $out .= ' selected';
|
||||||
print '> </option>';
|
$out .= '> </option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT c.id, c.code, c.label as type FROM ".MAIN_DB_PREFIX."c_type_fees as c";
|
$sql = "SELECT c.id, c.code, c.label as type FROM ".MAIN_DB_PREFIX."c_type_fees as c";
|
||||||
@ -2794,13 +2796,16 @@ function select_type_fees_id($selected = '', $htmlname = 'type', $showempty = 0,
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<option value="'.$obj->id.'"';
|
$out .= '<option value="'.$obj->id.'"';
|
||||||
if ($obj->code == $selected || $obj->id == $selected) print ' selected';
|
if ($obj->code == $selected || $obj->id == $selected) $out .= ' selected';
|
||||||
print '>';
|
$out .= '>';
|
||||||
if ($obj->code != $langs->trans($obj->code)) print $langs->trans($obj->code);
|
if ($obj->code != $langs->trans($obj->code)) $out .= $langs->trans($obj->code);
|
||||||
else print $langs->trans($obj->type);
|
else $out .= $langs->trans($obj->type);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</select>';
|
$out .= '</select>';
|
||||||
|
$out .= ajax_combobox($htmlname);
|
||||||
|
|
||||||
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,7 +127,7 @@ if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions =
|
|||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity,";
|
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity, tosell, tobuy,";
|
||||||
$sql .= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,";
|
$sql .= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name";
|
$sql .= " s.rowid as socid, s.nom as name";
|
||||||
// Add fields to SELECT from hooks
|
// Add fields to SELECT from hooks
|
||||||
@ -296,6 +296,8 @@ if ($resql)
|
|||||||
$productstatic->ref = $objp->ref;
|
$productstatic->ref = $objp->ref;
|
||||||
$productstatic->type = $objp->fk_product_type;
|
$productstatic->type = $objp->fk_product_type;
|
||||||
$productstatic->entity = $objp->entity;
|
$productstatic->entity = $objp->entity;
|
||||||
|
$productstatic->status = $objp->tosell;
|
||||||
|
$productstatic->status_buy = $objp->tobuy;
|
||||||
print $productstatic->getNomUrl(1, 'supplier');
|
print $productstatic->getNomUrl(1, 'supplier');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -318,3 +318,5 @@ ALTER TABLE llx_facturedet ADD COLUMN ref_ext varchar(255) AFTER multicurrency_t
|
|||||||
ALTER TABLE llx_c_ticket_category ADD COLUMN fk_parent integer DEFAULT 0 NOT NULL;
|
ALTER TABLE llx_c_ticket_category ADD COLUMN fk_parent integer DEFAULT 0 NOT NULL;
|
||||||
ALTER TABLE llx_c_ticket_category ADD COLUMN force_severity varchar(32) NULL;
|
ALTER TABLE llx_c_ticket_category ADD COLUMN force_severity varchar(32) NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_expensereport_ik ADD COLUMN ikoffset double DEFAULT 0 NOT NULL;
|
||||||
|
|
||||||
|
|||||||
@ -671,7 +671,7 @@ Module63000Name=Resources
|
|||||||
Module63000Desc=Manage resources (printers, cars, rooms, ...) for allocating to events
|
Module63000Desc=Manage resources (printers, cars, rooms, ...) for allocating to events
|
||||||
Permission11=Read customer invoices
|
Permission11=Read customer invoices
|
||||||
Permission12=Create/modify customer invoices
|
Permission12=Create/modify customer invoices
|
||||||
Permission13=Unvalidate customer invoices
|
Permission13=Invalidate customer invoices
|
||||||
Permission14=Validate customer invoices
|
Permission14=Validate customer invoices
|
||||||
Permission15=Send customer invoices by email
|
Permission15=Send customer invoices by email
|
||||||
Permission16=Create payments for customer invoices
|
Permission16=Create payments for customer invoices
|
||||||
@ -688,6 +688,7 @@ Permission32=Create/modify products
|
|||||||
Permission34=Delete products
|
Permission34=Delete products
|
||||||
Permission36=See/manage hidden products
|
Permission36=See/manage hidden products
|
||||||
Permission38=Export products
|
Permission38=Export products
|
||||||
|
Permission39=Ignore minimum price
|
||||||
Permission41=Read projects and tasks (shared project and projects I'm contact for). Can also enter time consumed, for me or my hierarchy, on assigned tasks (Timesheet)
|
Permission41=Read projects and tasks (shared project and projects I'm contact for). Can also enter time consumed, for me or my hierarchy, on assigned tasks (Timesheet)
|
||||||
Permission42=Create/modify projects (shared project and projects I'm contact for). Can also create tasks and assign users to project and tasks
|
Permission42=Create/modify projects (shared project and projects I'm contact for). Can also create tasks and assign users to project and tasks
|
||||||
Permission44=Delete projects (shared project and projects I'm contact for)
|
Permission44=Delete projects (shared project and projects I'm contact for)
|
||||||
@ -696,6 +697,9 @@ Permission61=Read interventions
|
|||||||
Permission62=Create/modify interventions
|
Permission62=Create/modify interventions
|
||||||
Permission64=Delete interventions
|
Permission64=Delete interventions
|
||||||
Permission67=Export interventions
|
Permission67=Export interventions
|
||||||
|
Permission68=Send interventions by email
|
||||||
|
Permission69=Validate interventions
|
||||||
|
Permission70=Invalidate interventions
|
||||||
Permission71=Read members
|
Permission71=Read members
|
||||||
Permission72=Create/modify members
|
Permission72=Create/modify members
|
||||||
Permission74=Delete members
|
Permission74=Delete members
|
||||||
@ -718,6 +722,7 @@ Permission95=Read reports
|
|||||||
Permission101=Read sendings
|
Permission101=Read sendings
|
||||||
Permission102=Create/modify sendings
|
Permission102=Create/modify sendings
|
||||||
Permission104=Validate sendings
|
Permission104=Validate sendings
|
||||||
|
Permission105=Send sendings by email
|
||||||
Permission106=Export sendings
|
Permission106=Export sendings
|
||||||
Permission109=Delete sendings
|
Permission109=Delete sendings
|
||||||
Permission111=Read financial accounts
|
Permission111=Read financial accounts
|
||||||
@ -843,6 +848,9 @@ Permission561=Read payment orders by credit transfer
|
|||||||
Permission562=Create/modify payment order by credit transfer
|
Permission562=Create/modify payment order by credit transfer
|
||||||
Permission563=Send/Transmit payment order by credit transfer
|
Permission563=Send/Transmit payment order by credit transfer
|
||||||
Permission564=Record Debits/Rejections of credit transfer
|
Permission564=Record Debits/Rejections of credit transfer
|
||||||
|
Permission601=Read stickers
|
||||||
|
Permission602=Create/modify stickers
|
||||||
|
Permission609=Delete stickers
|
||||||
Permission650=Read Bills of Materials
|
Permission650=Read Bills of Materials
|
||||||
Permission651=Create/Update Bills of Materials
|
Permission651=Create/Update Bills of Materials
|
||||||
Permission652=Delete Bills of Materials
|
Permission652=Delete Bills of Materials
|
||||||
@ -884,7 +892,9 @@ Permission1185=Approve purchase orders
|
|||||||
Permission1186=Order purchase orders
|
Permission1186=Order purchase orders
|
||||||
Permission1187=Acknowledge receipt of purchase orders
|
Permission1187=Acknowledge receipt of purchase orders
|
||||||
Permission1188=Delete purchase orders
|
Permission1188=Delete purchase orders
|
||||||
|
Permission1189=Check/Uncheck a supplier order reception
|
||||||
Permission1190=Approve (second approval) purchase orders
|
Permission1190=Approve (second approval) purchase orders
|
||||||
|
Permission1191=Export supplier orders and their attributes
|
||||||
Permission1201=Get result of an export
|
Permission1201=Get result of an export
|
||||||
Permission1202=Create/Modify an export
|
Permission1202=Create/Modify an export
|
||||||
Permission1231=Read vendor invoices
|
Permission1231=Read vendor invoices
|
||||||
@ -898,6 +908,8 @@ Permission1251=Run mass imports of external data into database (data load)
|
|||||||
Permission1321=Export customer invoices, attributes and payments
|
Permission1321=Export customer invoices, attributes and payments
|
||||||
Permission1322=Reopen a paid bill
|
Permission1322=Reopen a paid bill
|
||||||
Permission1421=Export sales orders and attributes
|
Permission1421=Export sales orders and attributes
|
||||||
|
Permission1521=Read documents
|
||||||
|
Permission1522=Delete documents
|
||||||
Permission2401=Read actions (events or tasks) linked to his user account (if owner of event or just assigned to)
|
Permission2401=Read actions (events or tasks) linked to his user account (if owner of event or just assigned to)
|
||||||
Permission2402=Create/modify actions (events or tasks) linked to his user account (if owner of event)
|
Permission2402=Create/modify actions (events or tasks) linked to his user account (if owner of event)
|
||||||
Permission2403=Delete actions (events or tasks) linked to his user account (if owner of event)
|
Permission2403=Delete actions (events or tasks) linked to his user account (if owner of event)
|
||||||
@ -932,9 +944,13 @@ Permission23001=Read Scheduled job
|
|||||||
Permission23002=Create/update Scheduled job
|
Permission23002=Create/update Scheduled job
|
||||||
Permission23003=Delete Scheduled job
|
Permission23003=Delete Scheduled job
|
||||||
Permission23004=Execute Scheduled job
|
Permission23004=Execute Scheduled job
|
||||||
Permission50101=Use Point of Sale
|
Permission50101=Use Point of Sale (SimplePOS)
|
||||||
|
Permission50151=Use Point of Sale (TakePOS)
|
||||||
Permission50201=Read transactions
|
Permission50201=Read transactions
|
||||||
Permission50202=Import transactions
|
Permission50202=Import transactions
|
||||||
|
Permission50330=Read objects of Zapier
|
||||||
|
Permission50331=Create/Update objects of Zapier
|
||||||
|
Permission50332=Delete objects of Zapier
|
||||||
Permission50401=Bind products and invoices with accounting accounts
|
Permission50401=Bind products and invoices with accounting accounts
|
||||||
Permission50411=Read operations in ledger
|
Permission50411=Read operations in ledger
|
||||||
Permission50412=Write/Edit operations in ledger
|
Permission50412=Write/Edit operations in ledger
|
||||||
@ -958,6 +974,14 @@ Permission63001=Read resources
|
|||||||
Permission63002=Create/modify resources
|
Permission63002=Create/modify resources
|
||||||
Permission63003=Delete resources
|
Permission63003=Delete resources
|
||||||
Permission63004=Link resources to agenda events
|
Permission63004=Link resources to agenda events
|
||||||
|
Permission64001=Allow direct printing
|
||||||
|
Permission67000=Allow printing of receipts
|
||||||
|
Permission941601=Read receipts
|
||||||
|
Permission941602=Create and modify receipts
|
||||||
|
Permission941603=Validate receipts
|
||||||
|
Permission941604=Send receipts by email
|
||||||
|
Permission941605=Export receipts
|
||||||
|
Permission941606=Delete receipts
|
||||||
DictionaryCompanyType=Third-party types
|
DictionaryCompanyType=Third-party types
|
||||||
DictionaryCompanyJuridicalType=Third-party legal entities
|
DictionaryCompanyJuridicalType=Third-party legal entities
|
||||||
DictionaryProspectLevel=Prospect potential level for companies
|
DictionaryProspectLevel=Prospect potential level for companies
|
||||||
@ -1794,7 +1818,6 @@ TypePaymentDesc=0:Customer payment type, 1:Vendor payment type, 2:Both customers
|
|||||||
IncludePath=Include path (defined into variable %s)
|
IncludePath=Include path (defined into variable %s)
|
||||||
ExpenseReportsSetup=Setup of module Expense Reports
|
ExpenseReportsSetup=Setup of module Expense Reports
|
||||||
TemplatePDFExpenseReports=Document templates to generate expense report document
|
TemplatePDFExpenseReports=Document templates to generate expense report document
|
||||||
ExpenseReportsIkSetup=Setup of module Expense Reports - Milles index
|
|
||||||
ExpenseReportsRulesSetup=Setup of module Expense Reports - Rules
|
ExpenseReportsRulesSetup=Setup of module Expense Reports - Rules
|
||||||
ExpenseReportNumberingModules=Expense reports numbering module
|
ExpenseReportNumberingModules=Expense reports numbering module
|
||||||
NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only.
|
NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only.
|
||||||
|
|||||||
@ -110,7 +110,7 @@ ExpenseReportPayment=Expense report payment
|
|||||||
ExpenseReportsToApprove=Expense reports to approve
|
ExpenseReportsToApprove=Expense reports to approve
|
||||||
ExpenseReportsToPay=Expense reports to pay
|
ExpenseReportsToPay=Expense reports to pay
|
||||||
ConfirmCloneExpenseReport=Are you sure you want to clone this expense report ?
|
ConfirmCloneExpenseReport=Are you sure you want to clone this expense report ?
|
||||||
ExpenseReportsIk=Expense report milles index
|
ExpenseReportsIk=Configuration of mileage charges
|
||||||
ExpenseReportsRules=Expense report rules
|
ExpenseReportsRules=Expense report rules
|
||||||
ExpenseReportIkDesc=You can modify the calculation of kilometers expense by category and range who they are previously defined. <b>d</b> is the distance in kilometers
|
ExpenseReportIkDesc=You can modify the calculation of kilometers expense by category and range who they are previously defined. <b>d</b> is the distance in kilometers
|
||||||
ExpenseReportRulesDesc=You can create or update any rules of calculation. This part will be used when user will create a new expense report
|
ExpenseReportRulesDesc=You can create or update any rules of calculation. This part will be used when user will create a new expense report
|
||||||
@ -145,7 +145,7 @@ nolimitbyEX_DAY=by day (no limitation)
|
|||||||
nolimitbyEX_MON=by month (no limitation)
|
nolimitbyEX_MON=by month (no limitation)
|
||||||
nolimitbyEX_YEA=by year (no limitation)
|
nolimitbyEX_YEA=by year (no limitation)
|
||||||
nolimitbyEX_EXP=by line (no limitation)
|
nolimitbyEX_EXP=by line (no limitation)
|
||||||
CarCategory=Category of car
|
CarCategory=Vehicle category
|
||||||
ExpenseRangeOffset=Offset amount: %s
|
ExpenseRangeOffset=Offset amount: %s
|
||||||
RangeIk=Mileage range
|
RangeIk=Mileage range
|
||||||
AttachTheNewLineToTheDocument=Attach the line to an uploaded document
|
AttachTheNewLineToTheDocument=Attach the line to an uploaded document
|
||||||
|
|||||||
@ -858,41 +858,27 @@ SCRIPT;
|
|||||||
|
|
||||||
print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1);
|
print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1);
|
||||||
|
|
||||||
// Suppliers list title
|
// Definition of fields for lists
|
||||||
print '<div class="div-table-responsive">';
|
// Some fields are missing because they are not included in the database query
|
||||||
print '<table class="liste centpercent">';
|
$arrayfields = array(
|
||||||
|
'pfp.datec'=>array('label'=>$langs->trans("AppliedPricesFrom"), 'checked'=>1, 'position'=>1),
|
||||||
$param = "&id=".$object->id;
|
's.nom'=>array('label'=>$langs->trans("Suppliers"), 'checked'=>1, 'position'=>2),
|
||||||
|
'pfp.fk_availability'=>array('label'=>$langs->trans("Availability"), 'enabled' => !empty($conf->global->FOURN_PRODUCT_AVAILABILITY), 'checked'=>0, 'position'=>4),
|
||||||
print '<tr class="liste_titre">';
|
'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5),
|
||||||
print_liste_field_titre("AppliedPricesFrom", $_SERVER["PHP_SELF"], "pfp.datec", "", $param, "", $sortfield, $sortorder);
|
'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9),
|
||||||
print_liste_field_titre("Suppliers", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
|
'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => $conf->multicurrency->enabled, 'checked'=>0, 'position'=>10),
|
||||||
print_liste_field_titre("SupplierRef", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
|
'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13),
|
||||||
if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) print_liste_field_titre("Availability", $_SERVER["PHP_SELF"], "pfp.fk_availability", "", $param, "", $sortfield, $sortorder);
|
'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14),
|
||||||
print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "pfp.quantity", "", $param, '', $sortfield, $sortorder, 'right ');
|
'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>15),
|
||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>16),
|
||||||
print_liste_field_titre("PriceQtyMinHT", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => !empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING), 'checked'=>0, 'position'=>17),
|
||||||
if ($conf->multicurrency->enabled) {
|
'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => $conf->barcode->enabled, 'checked'=>1, 'position'=>18),
|
||||||
print_liste_field_titre("PriceQtyMinHTCurrency", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
);
|
||||||
}
|
|
||||||
print_liste_field_titre("UnitPriceHT", $_SERVER["PHP_SELF"], "pfp.unitprice", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
||||||
if ($conf->multicurrency->enabled) {
|
|
||||||
print_liste_field_titre("UnitPriceHTCurrency", $_SERVER["PHP_SELF"], "pfp.multicurrency_unitprice", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
||||||
print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
||||||
}
|
|
||||||
print_liste_field_titre("DiscountQtyMin", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
|
||||||
print_liste_field_titre("NbDaysToDelivery", $_SERVER["PHP_SELF"], "pfp.delivery_time_days", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
||||||
print_liste_field_titre("ReputationForThisProduct", $_SERVER["PHP_SELF"], "pfp.supplier_reputation", "", $param, '', $sortfield, $sortorder, 'center ');
|
|
||||||
if ($conf->barcode->enabled) {
|
|
||||||
print_liste_field_titre("BarcodeValue", $_SERVER["PHP_SELF"], "pfp.barcode", "", $param, '', $sortfield, $sortorder, 'center ');
|
|
||||||
print_liste_field_titre("BarcodeType", $_SERVER["PHP_SELF"], "pfp.fk_barcode_type", "", $param, '', $sortfield, $sortorder, 'center ');
|
|
||||||
}
|
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) print_liste_field_titre("PackagingForThisProduct", $_SERVER["PHP_SELF"], "pfp.packaging", "", $param, 'align="center"', $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre("DateModification", $_SERVER["PHP_SELF"], "pfp.tms", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label("product_fournisseur_price");
|
$extrafields->fetch_name_optionals_label("product_fournisseur_price");
|
||||||
$extralabels = $extrafields->attributes["product_fournisseur_price"]['label'];
|
$extralabels = $extrafields->attributes["product_fournisseur_price"]['label'];
|
||||||
|
|
||||||
if (!empty($extralabels)) {
|
if (!empty($extralabels)) {
|
||||||
foreach ($extralabels as $key => $value) {
|
foreach ($extralabels as $key => $value) {
|
||||||
// Show field if not hidden
|
// Show field if not hidden
|
||||||
@ -900,7 +886,62 @@ SCRIPT;
|
|||||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]);
|
if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]);
|
||||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) $extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key]));
|
if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) $extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key]));
|
||||||
else $extratitle = $langs->trans($value);
|
else $extratitle = $langs->trans($value);
|
||||||
print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
$arrayfields['ef.'.$key] = array('label'=>$extratitle, 'checked'=>0, 'position'=>(end($arrayfields)['position']+1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Selection of new fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" name="formulaire">';
|
||||||
|
print '<input type="hidden" name="token" value="'. newToken() . '">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
|
print '<input type="hidden" name="action" value="list">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
|
// Suppliers list title
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
|
print '<table class="liste centpercent">';
|
||||||
|
|
||||||
|
$param = "&id=".$object->id;
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
if (!empty($arrayfields['pfp.datec']['checked'])) print_liste_field_titre("AppliedPricesFrom", $_SERVER["PHP_SELF"], "pfp.datec", "", $param, "", $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre("Suppliers", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
|
||||||
|
print_liste_field_titre("SupplierRef", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['pfp.fk_availability']['checked'])) print_liste_field_titre("Availability", $_SERVER["PHP_SELF"], "pfp.fk_availability", "", $param, "", $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['pfp.quantity']['checked'])) print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "pfp.quantity", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
print_liste_field_titre("PriceQtyMinHT", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if ($conf->multicurrency->enabled) print_liste_field_titre("PriceQtyMinHTCurrency", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if (!empty($arrayfields['pfp.unitprice']['checked'])) print_liste_field_titre("UnitPriceHT", $_SERVER["PHP_SELF"], "pfp.unitprice", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) print_liste_field_titre("UnitPriceHTCurrency", $_SERVER["PHP_SELF"], "pfp.multicurrency_unitprice", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if ($conf->multicurrency->enabled) print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
print_liste_field_titre("DiscountQtyMin", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if (!empty($arrayfields['pfp.delivery_time_days']['checked'])) print_liste_field_titre("NbDaysToDelivery", $_SERVER["PHP_SELF"], "pfp.delivery_time_days", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if (!empty($arrayfields['pfp.supplier_reputation']['checked'])) print_liste_field_titre("ReputationForThisProduct", $_SERVER["PHP_SELF"], "pfp.supplier_reputation", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
if (!empty($arrayfields['pfp.barcode']['checked'])) print_liste_field_titre("BarcodeValue", $_SERVER["PHP_SELF"], "pfp.barcode", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) print_liste_field_titre("BarcodeType", $_SERVER["PHP_SELF"], "pfp.fk_barcode_type", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
if (!empty($arrayfields['pfp.packaging']['checked'])) print_liste_field_titre("PackagingForThisProduct", $_SERVER["PHP_SELF"], "pfp.packaging", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['pfp.tms']['checked'])) print_liste_field_titre("DateModification", $_SERVER["PHP_SELF"], "pfp.tms", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
|
||||||
|
// fetch optionals attributes and labels
|
||||||
|
$extrafields->fetch_name_optionals_label("product_fournisseur_price");
|
||||||
|
$extralabels = $extrafields->attributes["product_fournisseur_price"]['label'];
|
||||||
|
|
||||||
|
if (!empty($extralabels)) {
|
||||||
|
foreach ($extralabels as $key => $value) {
|
||||||
|
// Show field if not hidden
|
||||||
|
if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
|
||||||
|
if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]);
|
||||||
|
if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) $extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key]));
|
||||||
|
else $extratitle = $langs->trans($value);
|
||||||
|
if (!empty($arrayfields['ef.'.$key]['checked'])) print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.'.$key, '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -910,7 +951,7 @@ SCRIPT;
|
|||||||
$parameters = array('id_fourn'=>$id_fourn, 'prod_id'=>$object->id);
|
$parameters = array('id_fourn'=>$id_fourn, 'prod_id'=>$object->id);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action);
|
||||||
}
|
}
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
if (is_array($product_fourn_list))
|
if (is_array($product_fourn_list))
|
||||||
@ -920,10 +961,14 @@ SCRIPT;
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Date from
|
// Date from
|
||||||
|
if (!empty($arrayfields['pfp.datec']['checked'])) {
|
||||||
print '<td>'.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour').'</td>';
|
print '<td>'.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour').'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Supplier
|
// Supplier
|
||||||
|
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||||
print '<td>'.$productfourn->getSocNomUrl(1, 'supplier').'</td>';
|
print '<td>'.$productfourn->getSocNomUrl(1, 'supplier').'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Supplier ref
|
// Supplier ref
|
||||||
if ($usercancreate) // change required right here
|
if ($usercancreate) // change required right here
|
||||||
@ -934,7 +979,7 @@ SCRIPT;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Availability
|
// Availability
|
||||||
if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY))
|
if (!empty($arrayfields['pfp.fk_availability']['checked']))
|
||||||
{
|
{
|
||||||
$form->load_cache_availability();
|
$form->load_cache_availability();
|
||||||
$availability = $form->cache_availability[$productfourn->fk_availability]['label'];
|
$availability = $form->cache_availability[$productfourn->fk_availability]['label'];
|
||||||
@ -942,6 +987,7 @@ SCRIPT;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Quantity
|
// Quantity
|
||||||
|
if (!empty($arrayfields['pfp.quantity']['checked'])) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print $productfourn->fourn_qty;
|
print $productfourn->fourn_qty;
|
||||||
// Units
|
// Units
|
||||||
@ -952,6 +998,7 @@ SCRIPT;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// VAT rate
|
// VAT rate
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
@ -971,18 +1018,21 @@ SCRIPT;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Unit price
|
// Unit price
|
||||||
|
if (!empty($arrayfields['pfp.unitprice']['checked'])) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print price($productfourn->fourn_unitprice);
|
print price($productfourn->fourn_unitprice);
|
||||||
//print $objp->unitprice? price($objp->unitprice) : ($objp->quantity?price($objp->price/$objp->quantity):" ");
|
//print $objp->unitprice? price($objp->unitprice) : ($objp->quantity?price($objp->price/$objp->quantity):" ");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($conf->multicurrency->enabled) {
|
|
||||||
// Unit price in currency
|
// Unit price in currency
|
||||||
|
if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print price($productfourn->fourn_multicurrency_unitprice);
|
print price($productfourn->fourn_multicurrency_unitprice);
|
||||||
print '</td>';
|
print '</td>';}
|
||||||
|
|
||||||
// Currency
|
// Currency
|
||||||
|
if ($conf->multicurrency->enabled) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print $productfourn->fourn_multicurrency_code ? currency_name($productfourn->fourn_multicurrency_code) : '';
|
print $productfourn->fourn_multicurrency_code ? currency_name($productfourn->fourn_multicurrency_code) : '';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -994,24 +1044,30 @@ SCRIPT;
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Delivery delay
|
// Delivery delay
|
||||||
|
if (!empty($arrayfields['pfp.delivery_time_days']['checked'])) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print $productfourn->delivery_time_days;
|
print $productfourn->delivery_time_days;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Reputation
|
// Reputation
|
||||||
|
if (!empty($arrayfields['pfp.supplier_reputation']['checked'])) {
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) {
|
if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) {
|
||||||
print $object->reputations[$productfourn->supplier_reputation];
|
print $object->reputations[$productfourn->supplier_reputation];
|
||||||
}
|
}
|
||||||
print'</td>';
|
print'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($conf->barcode->enabled) {
|
|
||||||
// Barcode
|
// Barcode
|
||||||
|
if (!empty($arrayfields['pfp.barcode']['checked'])) {
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print $productfourn->barcode;
|
print $productfourn->barcode;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Barcode type
|
// Barcode type
|
||||||
|
if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) {
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$productfourn->barcode_type = !empty($productfourn->fk_barcode_type) ? $productfourn->fk_barcode_type : 0;
|
$productfourn->barcode_type = !empty($productfourn->fk_barcode_type) ? $productfourn->fk_barcode_type : 0;
|
||||||
$productfourn->fetch_barcode();
|
$productfourn->fetch_barcode();
|
||||||
@ -1020,17 +1076,18 @@ SCRIPT;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Packaging
|
// Packaging
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
|
if (!empty($arrayfields['pfp.packaging']['checked'])) {
|
||||||
{
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print price2num($productfourn->packaging);
|
print price2num($productfourn->packaging);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
|
if (!empty($arrayfields['pfp.tms']['checked'])) {
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print dol_print_date(($productfourn->fourn_date_modification ? $productfourn->fourn_date_modification : $productfourn->date_modification), "dayhour");
|
print dol_print_date(($productfourn->fourn_date_modification ? $productfourn->fourn_date_modification : $productfourn->date_modification), "dayhour");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (!empty($extralabels)) {
|
if (!empty($extralabels)) {
|
||||||
@ -1045,14 +1102,14 @@ SCRIPT;
|
|||||||
if ($resql) {
|
if ($resql) {
|
||||||
if ($db->num_rows($resql) != 1) {
|
if ($db->num_rows($resql) != 1) {
|
||||||
foreach ($extralabels as $key => $value) {
|
foreach ($extralabels as $key => $value) {
|
||||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
|
if (!empty($arrayfields['ef.'.$key]['checked']) && !empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
|
||||||
print "<td></td>";
|
print "<td></td>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
foreach ($extralabels as $key => $value) {
|
foreach ($extralabels as $key => $value) {
|
||||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
|
if (!empty($arrayfields['ef.'.$key]['checked']) && !empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
|
||||||
print '<td align="right">'.$extrafields->showOutputField($key, $obj->{$key})."</td>";
|
print '<td align="right">'.$extrafields->showOutputField($key, $obj->{$key})."</td>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1087,6 +1144,7 @@ SCRIPT;
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
print '</form>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -268,53 +268,55 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'edit' && $user->rights->ticket->write) {
|
if ($action == 'update' && $user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if ($object->fetch(GETPOST('id', 'int')) < 0) {
|
$ret = $object->fetch(GETPOST('id', 'int'), GETPOST('ref', 'alpha'), GETPOST('track_id', 'alpha'));
|
||||||
$error++;
|
|
||||||
array_push($object->errors, $langs->trans("ErrorTicketIsNotValid"));
|
|
||||||
$_GET["action"] = $_POST["action"] = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GETPOST('update', 'alpha') && GETPOST('id', 'int') && $user->rights->ticket->write) {
|
|
||||||
$error = 0;
|
|
||||||
|
|
||||||
$ret = $object->fetch(GETPOST('id', 'int'));
|
|
||||||
if ($ret < 0) {
|
if ($ret < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
array_push($object->errors, $langs->trans("ErrorTicketIsNotValid"));
|
array_push($object->errors, $langs->trans('ErrorTicketIsNotValid'));
|
||||||
$action = '';
|
}
|
||||||
} elseif (!GETPOST("label")) {
|
|
||||||
|
// check fields
|
||||||
|
if (!$error) {
|
||||||
|
if (!GETPOST('subject', 'alpha')) {
|
||||||
$error++;
|
$error++;
|
||||||
array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")));
|
array_push($object->errors, $langs->trans('ErrorFieldRequired', $langs->transnoentities('Subject')));
|
||||||
$action = 'edit';
|
}
|
||||||
} elseif (!GETPOST("subject", 'alphanohtml')) {
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
$error++;
|
if ($ret < 0) $error++;
|
||||||
array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")));
|
|
||||||
$action = 'edit';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$object->label = GETPOST("label", 'alphanohtml');
|
$object->subject = GETPOST('subject', 'alpha');
|
||||||
$object->description = GETPOST("description", 'restricthtml');
|
$object->type_code = GETPOST('type_code', 'alpha');
|
||||||
|
$object->category_code = GETPOST('category_code', 'alpha');
|
||||||
|
$object->severity_code = GETPOST('severity_code', 'alpha');
|
||||||
|
|
||||||
//...
|
|
||||||
$ret = $object->update($user);
|
$ret = $object->update($user);
|
||||||
if ($ret <= 0) {
|
if ($ret <= 0) $error++;
|
||||||
$error++;
|
|
||||||
|
if ($error) {
|
||||||
|
$db->rollback();
|
||||||
|
} else {
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$action = 'edit';
|
$action = 'edit';
|
||||||
|
} else {
|
||||||
|
if (!empty($backtopage)) {
|
||||||
|
$url = $backtopage;
|
||||||
|
} else {
|
||||||
|
$url = 'card.php?track_id=' . $object->track_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && $ret > 0) {
|
header('Location: ' . $url);
|
||||||
$db->commit();
|
exit();
|
||||||
} else {
|
|
||||||
$db->rollback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -650,9 +652,63 @@ if ($action == 'create' || $action == 'presend')
|
|||||||
}
|
}
|
||||||
|
|
||||||
$formticket->showForm(1, 'create');
|
$formticket->showForm(1, 'create');
|
||||||
|
} elseif ($action == 'edit' && $user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) {
|
||||||
|
$formticket = new FormTicket($db);
|
||||||
|
|
||||||
|
$head = ticket_prepare_head($object);
|
||||||
|
|
||||||
|
print '<form method="POST" name="form_ticket" id="form_edit_ticket" action="' . $_SERVER['PHP_SELF'] . '?track_id=' . $object->track_id . '">';
|
||||||
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
print '<input type="hidden" name="tack_id" value="' . $object->track_id . '">';
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'card', $langs->trans('Ticket'), 0, 'ticket');
|
||||||
|
|
||||||
|
print '<div class="fichecenter2">';
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
// Type
|
||||||
|
print '<tr><td class="titlefield"><span class="fieldrequired"><label for="selecttype_code">' . $langs->trans("TicketTypeRequest") . '</span></label></td><td>';
|
||||||
|
$formticket->selectTypesTickets((GETPOST('type_code') ? GETPOST('type_code') : $object->type_code), 'type_code', '', '2');
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Severity
|
||||||
|
print '<tr><td><span class="fieldrequired"><label for="selectseverity_code">' . $langs->trans("TicketSeverity") . '</span></label></td><td>';
|
||||||
|
$formticket->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $object->severity_code), 'severity_code', '', '2');
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Group
|
||||||
|
print '<tr><td><span class="fieldrequired"><label for="selectcategory_code">' . $langs->trans("TicketGroup") . '</span></label></td><td>';
|
||||||
|
$formticket->selectGroupTickets((GETPOST('category_code') ? GETPOST('category_code') : $object->category_code), 'category_code', '', '2');
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Subject
|
||||||
|
print '<tr><td><label for="subject"><span class="fieldrequired">' . $langs->trans("Subject") . '</span></label></td><td>';
|
||||||
|
print '<input class="text" size="50" id="subject" name="subject" value="' . (GETPOST('subject', 'alpha') ? GETPOST('subject', 'alpha') : $object->subject) . '" />';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
$parameters = array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||||
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
if (empty($reshook)) {
|
||||||
|
print $object->showOptionals($extrafields, 'edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" class="button" name="save" value="' . $langs->trans('Save') . '">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
|
elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|
||||||
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink')
|
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink')
|
||||||
{
|
{
|
||||||
if ($res > 0)
|
if ($res > 0)
|
||||||
@ -1193,6 +1249,10 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
|||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.dol_buildpath('/fichinter/card.php', 1).'?action=create&socid='.$object->fk_soc.'&origin=ticket_ticket&originid='.$object->id.'">'.$langs->trans('TicketAddIntervention').'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.dol_buildpath('/fichinter/card.php', 1).'?action=create&socid='.$object->fk_soc.'&origin=ticket_ticket&originid='.$object->id.'">'.$langs->trans('TicketAddIntervention').'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) {
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?track_id=' . $object->track_id . '&action=edit">' . $langs->trans('Modify') . '</a></div>';
|
||||||
|
}
|
||||||
|
|
||||||
// Close ticket if statut is read
|
// Close ticket if statut is read
|
||||||
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id='.$object->track_id.'&action=close">'.$langs->trans('CloseTicket').'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id='.$object->track_id.'&action=close">'.$langs->trans('CloseTicket').'</a></div>';
|
||||||
|
|||||||
@ -242,29 +242,6 @@ class DateLibTest extends PHPUnit\Framework\TestCase
|
|||||||
$result=num_public_holiday($date1, $date2, 'XX', 1);
|
$result=num_public_holiday($date1, $date2, 'XX', 1);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals(2, $result, 'NumPublicHoliday for XX'); // 1 opened day, 2 closed days (even if country unknown)
|
$this->assertEquals(2, $result, 'NumPublicHoliday for XX'); // 1 opened day, 2 closed days (even if country unknown)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Add more holiday with constant HOLIDAY_MORE_PUBLIC_HOLIDAYS
|
|
||||||
$conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS='12-13,2019-12-14';
|
|
||||||
|
|
||||||
$date1=dol_mktime(0, 0, 0, 12, 13, 2018);
|
|
||||||
$date2=dol_mktime(0, 0, 0, 12, 13, 2018);
|
|
||||||
$result=num_public_holiday($date1, $date2, 'YY', 1);
|
|
||||||
print __METHOD__." result=".$result."\n";
|
|
||||||
$this->assertEquals(1, $result, 'NumPublicHoliday for YY the 2018-12-13'); // 0 opened day, 1 closed days (even if country unknown)
|
|
||||||
|
|
||||||
$date1=dol_mktime(0, 0, 0, 12, 14, 2018);
|
|
||||||
$date2=dol_mktime(0, 0, 0, 12, 14, 2018);
|
|
||||||
$result=num_public_holiday($date1, $date2, 'YY', 1);
|
|
||||||
print __METHOD__." result=".$result."\n";
|
|
||||||
$this->assertEquals(0, $result, 'NumPublicHoliday for YY the 2018-12-14'); // 1 opened day, 0 closed days (even if country unknown)
|
|
||||||
|
|
||||||
$date1=dol_mktime(0, 0, 0, 12, 14, 2019);
|
|
||||||
$date2=dol_mktime(0, 0, 0, 12, 14, 2019);
|
|
||||||
$result=num_public_holiday($date1, $date2, 'YY', 1);
|
|
||||||
print __METHOD__." result=".$result."\n";
|
|
||||||
$this->assertEquals(1, $result, 'NumPublicHoliday for YY the 2019-12-14'); // 0 opened day, 1 closed days (even if country unknown)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use Sabre\VObject\Property\Boolean;
|
||||||
|
|
||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
@ -130,7 +132,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
|
|||||||
/**
|
/**
|
||||||
* testDolBasename
|
* testDolBasename
|
||||||
*
|
*
|
||||||
* @return int
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testDolBasename()
|
public function testDolBasename()
|
||||||
{
|
{
|
||||||
@ -239,7 +241,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
|
|||||||
/**
|
/**
|
||||||
* testDolMimeType
|
* testDolMimeType
|
||||||
*
|
*
|
||||||
* @return string
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testDolMimeType()
|
public function testDolMimeType()
|
||||||
{
|
{
|
||||||
@ -285,7 +287,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
|
|||||||
/**
|
/**
|
||||||
* testDolDeleteDir
|
* testDolDeleteDir
|
||||||
*
|
*
|
||||||
* @return int
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testDolDeleteDir()
|
public function testDolDeleteDir()
|
||||||
{
|
{
|
||||||
@ -323,10 +325,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
|
|||||||
/**
|
/**
|
||||||
* testDolCopyMoveDelete
|
* testDolCopyMoveDelete
|
||||||
*
|
*
|
||||||
* @return int
|
* @return void
|
||||||
*
|
|
||||||
* @depends testDolDeleteDir
|
|
||||||
* The depends says test is run only if previous is ok
|
|
||||||
*/
|
*/
|
||||||
public function testDolCopyMoveDelete()
|
public function testDolCopyMoveDelete()
|
||||||
{
|
{
|
||||||
@ -362,14 +361,17 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
|
|||||||
$this->assertTrue($result, 'move with default mask');
|
$this->assertTrue($result, 'move with default mask');
|
||||||
|
|
||||||
// To test a move that should work with forced mask
|
// To test a move that should work with forced mask
|
||||||
$result=dol_move($conf->admin->dir_temp.'/file2.csv', $conf->admin->dir_temp.'/file3.csv', '0754', 1); // file shoutld be rwxr-wr--
|
$result=dol_move($conf->admin->dir_temp.'/file2.csv', $conf->admin->dir_temp.'/file3.csv', '0754', 1); // file should be rwxr-wr--
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertTrue($result, 'move with forced mask');
|
$this->assertTrue($result, 'move with forced mask');
|
||||||
|
|
||||||
|
$conf->global->MAIN_ENABLE_LOG_TO_HTML=1; $conf->syslog->enabled=1; $_REQUEST['logtohtml']=1;
|
||||||
|
$conf->logbuffer=array();
|
||||||
|
|
||||||
// To test a delete that should success
|
// To test a delete that should success
|
||||||
$result=dol_delete_file($conf->admin->dir_temp.'/file3.csv');
|
$result=dol_delete_file($conf->admin->dir_temp.'/file3.csv');
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result delete=".var_export($result, true)."\n";
|
||||||
$this->assertTrue($result, 'delete file');
|
$this->assertTrue($result, 'delete file '.join("\n", $conf->logbuffer));
|
||||||
|
|
||||||
// Again to test there is error when deleting a non existing file with option disableglob
|
// Again to test there is error when deleting a non existing file with option disableglob
|
||||||
$result=dol_delete_file($conf->admin->dir_temp.'/file3.csv', 1, 1);
|
$result=dol_delete_file($conf->admin->dir_temp.'/file3.csv', 1, 1);
|
||||||
@ -395,10 +397,8 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
|
|||||||
/**
|
/**
|
||||||
* testDolCompressUnCompress
|
* testDolCompressUnCompress
|
||||||
*
|
*
|
||||||
* @return string
|
* @return void
|
||||||
*
|
|
||||||
* @depends testDolCopyMoveDelete
|
* @depends testDolCopyMoveDelete
|
||||||
* The depends says test is run only if previous is ok
|
|
||||||
*/
|
*/
|
||||||
public function testDolCompressUnCompress()
|
public function testDolCompressUnCompress()
|
||||||
{
|
{
|
||||||
@ -431,7 +431,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
|
|||||||
/**
|
/**
|
||||||
* testDolDirList
|
* testDolDirList
|
||||||
*
|
*
|
||||||
* @return string
|
* @return void
|
||||||
*
|
*
|
||||||
* @depends testDolCompressUnCompress
|
* @depends testDolCompressUnCompress
|
||||||
* The depends says test is run only if previous is ok
|
* The depends says test is run only if previous is ok
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user