Merge branch 'develop' of github.com:atm-maxime/dolibarr into new_bom_cost
This commit is contained in:
commit
0512b3a7a7
2
.github/workflows/stale-issues-safe.yml
vendored
2
.github/workflows/stale-issues-safe.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 15 days (you should still be able to re-open it if required).'
|
||||
stale-label: 'Issue Stale (automatic label)'
|
||||
exempt-labels: 'Priority High / Blocking,Priority Top Strategic,Priority Medium,Hacktoberfest,good first issue,Bug Security (CVE)'
|
||||
exempt-labels: 'Priority High / Blocking,Priority Top Strategic,Priority Medium,Hacktoberfest,good first issue,Bug Security (CVE),Analysis of PR in progres'
|
||||
days-before-stale: 365
|
||||
days-before-close: 15
|
||||
operations-per-run: 100
|
||||
|
||||
@ -282,7 +282,7 @@ script:
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
#parallel-lint --exclude htdocs/includes --blame .
|
||||
parallel-lint --exclude dev/namespacemig --exclude dev/initdata/dbf/includes --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/composer/autoload_static.php --blame .
|
||||
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/myclabs --exclude htdocs/includes/webmozart --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/composer/autoload_static.php --blame .
|
||||
set +e
|
||||
echo
|
||||
|
||||
|
||||
@ -102,10 +102,13 @@ Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversi
|
||||
; Put here path of Wampserver applications
|
||||
; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45
|
||||
; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45
|
||||
; Value OK: apache 2.4.19, php 5.5.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe)
|
||||
; Value OK: apache 2.4.9, php 5.5.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe)
|
||||
; Value To test: apache 2.4.41, php 7.3.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe)
|
||||
Source: "C:\Program Files\Wamp\apps\phpmyadmin4.1.14\*.*"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log,darkblue_orange"
|
||||
Source: "C:\Program Files\Wamp\bin\apache\apache2.4.9\*.*"; DestDir: "{app}\bin\apache\apache2.4.9"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\Program Files\Wamp\bin\php\php5.5.12\*.*"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
|
||||
;Source: "C:\Program Files\Wamp\bin\apache\apache2.4.9\*.*"; DestDir: "{app}\bin\apache\apache2.4.9"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\wamp64\bin\apache\apache2.4.41\*.*"; DestDir: "{app}\bin\apache\apache2.4.41"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
|
||||
;Source: "C:\Program Files\Wamp\bin\php\php5.5.12\*.*"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\wamp64\bin\php\php7.3.12\*.*"; DestDir: "{app}\bin\php\php7.3.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe"
|
||||
; Mysql data files (does not overwrite if exists)
|
||||
Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
|
||||
@ -119,9 +122,11 @@ Source: "*.*"; DestDir: "{app}\www\dolibarr"; Flags: ignoreversion; Excludes: ".
|
||||
Source: "build\exe\doliwamp\phpmyadmin.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\config.inc.php.install"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.9\conf"; Flags: ignoreversion;
|
||||
;Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.9\conf"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.41\conf"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion;
|
||||
;Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php7.3.12"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion;
|
||||
@ -227,8 +232,10 @@ procedure InitializeWizard();
|
||||
begin
|
||||
|
||||
//version des applis, a modifier pour chaque version de WampServer 2
|
||||
apacheVersion := '2.4.9';
|
||||
phpVersion := '5.5.12' ;
|
||||
//apacheVersion := '2.4.9';
|
||||
//phpVersion := '5.5.12' ;
|
||||
apacheVersion := '2.4.41';
|
||||
phpVersion := '7.3.12' ;
|
||||
mysqlVersion := '5.0.45';
|
||||
phpmyadminVersion := '4.1.14';
|
||||
|
||||
@ -392,40 +399,42 @@ begin
|
||||
//----------------------------------------------
|
||||
// TODO Update this list when changing PHP/Apache versions
|
||||
|
||||
phpDllCopy := 'fdftk.dll';
|
||||
// phpDllCopy := 'fdftk.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'fribidi.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'gds32.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'libeay32.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'libmhash.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'libmysql.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'libpq.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'msql.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'libmcrypt.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'libmysqli.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'ntwdblib.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
|
||||
// phpDllCopy := 'php5activescript.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'php5nsapi.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'php7apache2_4.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'fribidi.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'gds32.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'libeay32.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'libmhash.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'libmysql.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'libpq.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'msql.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'libmcrypt.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'libmysqli.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'ntwdblib.dll';
|
||||
phpDllCopy := 'php7ts.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
|
||||
phpDllCopy := 'php5activescript.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'php5nsapi.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'php5ts.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
|
||||
phpDllCopy := 'ssleay32.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
phpDllCopy := 'yaz.dll';
|
||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'ssleay32.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
// phpDllCopy := 'yaz.dll';
|
||||
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||
|
||||
|
||||
// Remove lock file
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# \file build/makepack-dolibarr.pl
|
||||
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
||||
# \author (c)2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
# \author (c)2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
#
|
||||
# This is list of constant you can set to have generated packages moved into a specific dir:
|
||||
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
|
||||
@ -430,12 +430,14 @@ if ($nboftargetok) {
|
||||
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
||||
print 'Run git push -f --tags'."\n";
|
||||
$ret=`git push -f --tags`;
|
||||
#$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'Run git push --tags'."\n";
|
||||
$ret=`git push --tags`;
|
||||
#$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`;
|
||||
}
|
||||
chdir("$olddir");
|
||||
}
|
||||
|
||||
@ -622,7 +622,7 @@ if ($action == 'delbookkeepingyear') {
|
||||
'default' => $deljournal
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 300);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
|
||||
@ -197,7 +197,7 @@ if ($resql) {
|
||||
|
||||
$param="&socid=".$socid;
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
||||
|
||||
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
|
||||
|
||||
@ -195,7 +195,7 @@ if ($resql) {
|
||||
|
||||
$param="&socid=".$socid;
|
||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
||||
|
||||
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
|
||||
|
||||
@ -230,7 +230,7 @@ class Lettering extends BookKeeping
|
||||
*
|
||||
* @param array $ids ids array
|
||||
* @param boolean $notrigger no trigger
|
||||
* @return number
|
||||
* @return number
|
||||
*/
|
||||
public function updateLettering($ids = array(), $notrigger = false)
|
||||
{
|
||||
|
||||
@ -332,7 +332,7 @@ if ($result) {
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
$clickpicto = $form->showCheckAddButtons();
|
||||
print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center ');
|
||||
print "</tr>\n";
|
||||
@ -341,7 +341,7 @@ if ($result) {
|
||||
$product_static = new Product($db);
|
||||
|
||||
while ($objp = $db->fetch_object($result)) {
|
||||
$codecompta = length_accountg($objp->account_number).' - '.$objp->label_compte;
|
||||
$codecompta = length_accountg($objp->account_number).' - <span class="opacitymedium">'.$objp->label_compte.'</span>';
|
||||
|
||||
$facture_static->ref = $objp->ref;
|
||||
$facture_static->id = $objp->facid;
|
||||
@ -390,7 +390,7 @@ if ($result) {
|
||||
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<td>';
|
||||
print $codecompta.' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
|
||||
@ -287,7 +287,7 @@ if ($result) {
|
||||
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$codeCompta = length_accountg($objp->account_number).' - '.$objp->label;
|
||||
$codeCompta = length_accountg($objp->account_number).' - <span class="opacitymedium">'.$objp->label.'</span>';
|
||||
|
||||
$expensereport_static->ref = $objp->ref;
|
||||
$expensereport_static->id = $objp->erid;
|
||||
@ -315,7 +315,7 @@ if ($result) {
|
||||
|
||||
print '<td>'.$codeCompta.'</td>';
|
||||
|
||||
print '<td class="left"><a href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||
print '<td class="left"><a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
|
||||
|
||||
@ -336,7 +336,7 @@ if ($result) {
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
$checkpicto = $form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
||||
print "</tr>\n";
|
||||
@ -347,7 +347,7 @@ if ($result) {
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$codecompta = length_accountg($objp->account_number).' - '.$objp->label;
|
||||
$codecompta = length_accountg($objp->account_number).' - <span class="opacitymedium">'.$objp->label.'</span>';
|
||||
|
||||
$facturefournisseur_static->ref = $objp->ref;
|
||||
$facturefournisseur_static->id = $objp->facid;
|
||||
@ -399,7 +399,7 @@ if ($result) {
|
||||
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<td>';
|
||||
print $codecompta.' <a href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
|
||||
@ -100,7 +100,7 @@ if ($action == 'create')
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -113,7 +113,7 @@ if ($action == 'edit' && ! empty($attrname))
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -259,7 +259,7 @@ print '<br>';
|
||||
|
||||
print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="foruserid" value="all">';
|
||||
print '<input type="hidden" name="mode" value="card">';
|
||||
print '<input type="hidden" name="action" value="builddoc">';
|
||||
@ -279,7 +279,7 @@ print '<br><br>';
|
||||
|
||||
print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="mode" value="cardlogin">';
|
||||
print '<input type="hidden" name="action" value="builddoc">';
|
||||
print $langs->trans("DescADHERENT_CARD_TYPE").' ';
|
||||
@ -299,7 +299,7 @@ print '<br><br>';
|
||||
|
||||
print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' ';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="mode" value="label">';
|
||||
print '<input type="hidden" name="action" value="builddoc">';
|
||||
print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").' ';
|
||||
|
||||
@ -297,7 +297,7 @@ if (!$rowid && $action != 'create' && $action != 'edit')
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||
if ($user->rights->adherent->configurer)
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
else
|
||||
print '<td class="right"> </td>';
|
||||
print "</tr>";
|
||||
@ -607,7 +607,7 @@ if ($rowid > 0)
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input class="flat" type="hidden" name="rowid" value="'.$object->id.'" size="12"></td>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -110,56 +110,60 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="oddeven liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
|
||||
// Name
|
||||
print '<tr><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_NAME?$conf->global->MAIN_INFO_ACCOUNTANT_NAME: GETPOST("nom", 'nohtml')) . '"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
|
||||
// Address
|
||||
print '<tr><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS?$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS: GETPOST("address", 'nohtml')) . '</textarea></td></tr>'."\n";
|
||||
|
||||
print '<tr><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_ZIP?$conf->global->MAIN_INFO_ACCOUNTANT_ZIP: GETPOST("zipcode", 'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
print '<tr><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_TOWN?$conf->global->MAIN_INFO_ACCOUNTANT_TOWN: GETPOST("town", 'nohtml')) . '"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
print '<tr><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization
|
||||
print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||
$formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="tel" id="phone" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_PHONE . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="fax" id="fax" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_FAX . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_MAIL . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
print '<tr><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="web" id="web" class="minwidth300" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_WEB . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Code
|
||||
print '<tr><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
|
||||
print '<input name="code" id="code" class="minwidth100" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_CODE?$conf->global->MAIN_INFO_ACCOUNTANT_CODE: GETPOST("code", 'nohtml')) . '"></td></tr>'."\n";
|
||||
|
||||
// Note
|
||||
print '<tr><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note', 'none') ? GETPOST('note', 'none') : $conf->global->MAIN_INFO_ACCOUNTANT_NOTE).'</textarea></td></tr>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -324,7 +324,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="action" value="set">';
|
||||
|
||||
print '<table class="noborder allwidth">'."\n";
|
||||
|
||||
@ -180,7 +180,7 @@ $head=agenda_prepare_head();
|
||||
dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="action" value="set">';
|
||||
|
||||
print '<table class="noborder allwidth">'."\n";
|
||||
|
||||
@ -76,18 +76,18 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
|
||||
{
|
||||
$freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
||||
|
||||
$res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -258,13 +258,13 @@ print $form->textwithpicto($langs->trans("FreeLegalTextOnChequeReceipts"), $lang
|
||||
$variablename='BANK_CHEQUERECEIPT_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||
{
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
|
||||
@ -119,7 +119,7 @@ if (! empty($conf->global->CLICKTODIAL_URL))
|
||||
if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print $langs->trans("LinkToTestClickToDial", $user->login).' : ';
|
||||
print '<input class="flat" type="text" name="phonefortest" value="'.dol_escape_htmltag($phonefortest).'">';
|
||||
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';
|
||||
|
||||
@ -89,9 +89,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -103,10 +103,10 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -116,10 +116,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -451,27 +451,33 @@ print '</td></tr>'."\n";
|
||||
|
||||
// Phone
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="tel" id="phone" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Fax
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="fax" id="fax" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FAX).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Email
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Barcode
|
||||
if (!empty($conf->barcode->enabled)) {
|
||||
print '<tr class="oddeven"><td><label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
||||
print '<span class="fa paddingright fa-barcode"></span>';
|
||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GENCOD).'"></td></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -480,15 +486,16 @@ if (!empty($conf->barcode->enabled)) {
|
||||
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("Logo"), 'png, jpg').'</label></td><td>';
|
||||
print '<div class="centpertent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth200" name="logo" id="logo" accept="image/*">';
|
||||
print '</div><div class="inline-block valignmiddle marginrightonly">';
|
||||
print '</div>';
|
||||
if (!empty($mysoc->logo_mini)) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
|
||||
print '</div><div class="inline-block valignmiddle">';
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a></div>';
|
||||
} else {
|
||||
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
}
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
@ -497,15 +504,16 @@ print '</td></tr>';
|
||||
print '<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans("LogoSquarred"), 'png, jpg').'</label></td><td>';
|
||||
print '<div class="centpertent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth200" name="logo_squarred" id="logo_squarred" accept="image/*">';
|
||||
print '</div><div class="inline-block valignmiddle marginrightonly">';
|
||||
print '</div>';
|
||||
if (!empty($mysoc->logo_squarred_mini)) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete")).'</a>';
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
|
||||
print '</div><div class="inline-block valignmiddle marginrightonly">';
|
||||
print '<div class="inline-block valignmiddle marginrightonly">';
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini).'">';
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete")).'</a></div>';
|
||||
} else {
|
||||
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
}
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
@ -524,35 +532,15 @@ print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Facebook
|
||||
print '<tr class="oddeven"><td><label for="facebookurl">'.$langs->trans("SocialNetworksFacebookURL").'</label></td><td>';
|
||||
print '<input name="facebookurl" id="facebookurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FACEBOOK_URL).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Twitter
|
||||
print '<tr class="oddeven"><td><label for="twitterurl">'.$langs->trans("SocialNetworksTwitterURL").'</label></td><td>';
|
||||
print '<input name="twitterurl" id="twitterurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TWITTER_URL).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// LinkedIn
|
||||
print '<tr class="oddeven"><td><label for="linkedinurl">'.$langs->trans("SocialNetworksLinkedinURL").'</label></td><td>';
|
||||
print '<input name="linkedinurl" id="linkedinurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_LINKEDIN_URL).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Instagram
|
||||
print '<tr class="oddeven"><td><label for="instagramurl">'.$langs->trans("SocialNetworksInstagramURL").'</label></td><td>';
|
||||
print '<input name="instagramurl" id="instagramurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Youtube
|
||||
print '<tr class="oddeven"><td><label for="youtubeurl">'.$langs->trans("SocialNetworksYoutubeURL").'</label></td><td>';
|
||||
print '<input name="youtubeurl" id="youtubeurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Github
|
||||
print '<tr class="oddeven"><td><label for="githuburl">'.$langs->trans("SocialNetworksGithubURL").'</label></td><td>';
|
||||
print '<input name="githuburl" id="githuburl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GITHUB_URL).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
$listofnetworks = array('facebook'=>'facebook', 'twitter'=>'twitter', 'linkedin'=>'linkedin', 'instagram'=>'instagram', 'youtube'=>'youtube', 'github'=>'github');
|
||||
foreach($listofnetworks as $networkkey => $networkicon) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<label for="'.$networkkey.'url">'.$langs->trans("SocialNetworks".ucfirst($networkkey)."URL").'</label></td><td>';
|
||||
$networkconst = 'MAIN_INFO_SOCIETE_'.strtoupper($networkkey).'_URL';
|
||||
print '<span class="fa paddingright fa-'.($networkicon ? $networkicon : 'link').'"></span>';
|
||||
print '<input name="'.$networkkey.'url" id="'.$networkkey.'url" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconst).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -707,26 +695,24 @@ print "</table>";
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="140">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td width="25%">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"use_vat\" value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION) ? "" : " checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"use_vat\">".$langs->trans("VATIsUsedDesc")."</label></td></tr>";
|
||||
if ($mysoc->country_code == 'FR') print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i></td></tr>\n";
|
||||
print "</table>";
|
||||
$tooltiphelp = '';
|
||||
if ($mysoc->country_code == 'FR') $tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>";
|
||||
print "<label for=\"use_vat\">".$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"no_vat\" value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION) ? " checked" : "")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"no_vat\">".$langs->trans("VATIsNotUsedDesc")."</label></td></tr>";
|
||||
if ($mysoc->country_code == 'FR') print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i></td></tr>\n";
|
||||
print "</table>";
|
||||
$tooltiphelp = '';
|
||||
if ($mysoc->country_code == 'FR') $tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n";
|
||||
print "<label for=\"no_vat\">".$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "</table>";
|
||||
@ -740,40 +726,35 @@ if ($mysoc->useLocalTax(1))
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="140">'.$langs->transcountry("LocalTax1Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td width="25%">'.$langs->transcountry("LocalTax1Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
|
||||
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print '<table class="nobordernopadding">';
|
||||
print "<tr><td><label for=\"lt1\">".$langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)."</label></td></tr>";
|
||||
$example = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
|
||||
print ($example != "LocalTax1IsUsedExample" ? "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i></td></tr>\n" : "");
|
||||
print '<div class="nobordernopadding">';
|
||||
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
|
||||
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||
print "<label for=\"lt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||
if (!isOnlyOneLocalTax(1))
|
||||
{
|
||||
print '<tr><td class="left"><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
|
||||
print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
|
||||
$formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
$opcions = array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"), $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"), $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"));
|
||||
|
||||
print '<tr><td class="left"></label for="clt1">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||
print '<br><label for="clt1">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||
print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1);
|
||||
print '</td></tr>';
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"nolt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code)."</label></td></tr>";
|
||||
$example = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
|
||||
print ($example != "LocalTax1IsNotUsedExample" ? "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i></td></tr>\n" : "");
|
||||
print "</table>";
|
||||
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
|
||||
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||
print "<label for=\"nolt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||
print "</td></tr>\n";
|
||||
print "</table>";
|
||||
}
|
||||
@ -783,38 +764,34 @@ if ($mysoc->useLocalTax(2))
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->transcountry("LocalTax2Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td width="25%">'.$langs->transcountry("LocalTax2Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
||||
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print '<table class="nobordernopadding">';
|
||||
print "<tr><td><label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label></td></tr>";
|
||||
$example = $langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code);
|
||||
print ($example != "LocalTax2IsUsedExample" ? "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."</i></td></tr>\n" : "");
|
||||
print '<div class="nobordernopadding">';
|
||||
print "<label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
|
||||
$tooltiphelp = $langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code);
|
||||
$tooltiphelp = ($tooltiphelp != "LocalTax2IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||
if (!isOnlyOneLocalTax(2))
|
||||
{
|
||||
print '<tr><td class="left"><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
|
||||
print '<br><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
|
||||
$formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '<tr><td class="left"><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||
print '<br><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||
print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2);
|
||||
print '</td></tr>';
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"nolt2\">".$langs->transcountry("LocalTax2IsNotUsedDesc", $mysoc->country_code)."</label></td></tr>";
|
||||
$example = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
|
||||
print ($example != "LocalTax2IsNotUsedExample" ? "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."</i></td></tr>\n" : "");
|
||||
print "</table>";
|
||||
print "<div>";
|
||||
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
|
||||
$tooltiphelp = ($tooltiphelp != "LocalTax2IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||
print "<label for=\"nolt2\">".$form->textwithpicto($langs->transcountry("LocalTax2IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
@ -45,8 +45,8 @@ $action=GETPOST('action', 'alpha');
|
||||
// Shipment note
|
||||
if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
||||
{
|
||||
// This option should always be set to on when module is on.
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity);
|
||||
// This option should always be set to on when module is on.
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
/*
|
||||
if ($action == 'activate_sending')
|
||||
@ -66,16 +66,16 @@ if ($action == 'disable_sending')
|
||||
// Delivery note
|
||||
if ($action == 'activate_delivery')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity);
|
||||
header("Location: confexped.php");
|
||||
exit;
|
||||
}
|
||||
elseif ($action == 'disable_delivery')
|
||||
{
|
||||
dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity);
|
||||
header("Location: confexped.php");
|
||||
exit;
|
||||
header("Location: confexped.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -207,7 +207,7 @@ llxHeader();
|
||||
|
||||
print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"), '', 'title_setup');
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->transnoentities("DelaysOfToleranceDesc", img_warning());
|
||||
print '<span class="opacitymedium">'.$langs->transnoentities("DelaysOfToleranceDesc", img_warning('default', '', 'pictowarning nopaddingleft'));
|
||||
print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
@ -40,19 +40,19 @@ $id_image = GETPOST('id_image', 'int');
|
||||
$quality = GETPOST('quality', 'alpha');
|
||||
|
||||
try {
|
||||
$url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality;
|
||||
$api = new PrestaShopWebservice(
|
||||
$conf->global->MAIN_MODULE_DOLISTORE_API_SRV,
|
||||
$conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api
|
||||
);
|
||||
//echo $url;
|
||||
$request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
|
||||
header('Content-type:image');
|
||||
print $request['response'];
|
||||
$url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality;
|
||||
$api = new PrestaShopWebservice(
|
||||
$conf->global->MAIN_MODULE_DOLISTORE_API_SRV,
|
||||
$conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api
|
||||
);
|
||||
//echo $url;
|
||||
$request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
|
||||
header('Content-type:image');
|
||||
print $request['response'];
|
||||
} catch (PrestaShopWebserviceException $e) {
|
||||
// Here we are dealing with errors
|
||||
$trace = $e->getTrace();
|
||||
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
||||
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||
else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
||||
// Here we are dealing with errors
|
||||
$trace = $e->getTrace();
|
||||
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
||||
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||
else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
||||
}
|
||||
|
||||
@ -36,30 +36,30 @@ if (! $user->admin) accessforbidden();
|
||||
*/
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -86,9 +86,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit')
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -113,10 +113,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -80,9 +80,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -95,9 +95,9 @@ if ($action != 'create' && $action != 'edit')
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -107,10 +107,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -185,7 +185,7 @@ else
|
||||
print '<br>'."\n";
|
||||
|
||||
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
|
||||
// Skins
|
||||
show_skin(null, 1);
|
||||
|
||||
@ -68,22 +68,22 @@ if ($action == 'setvalue' && $user->admin)
|
||||
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++;
|
||||
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++;
|
||||
|
||||
// This one must be after the others
|
||||
$valkey='';
|
||||
$key=GETPOST("key");
|
||||
if ($key) $valkey=$conf->global->$key;
|
||||
if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++;
|
||||
// This one must be after the others
|
||||
$valkey='';
|
||||
$key=GETPOST("key");
|
||||
if ($key) $valkey=$conf->global->$key;
|
||||
if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -207,29 +207,29 @@ if (empty($mysoc->country_code))
|
||||
else
|
||||
{
|
||||
// Show examples
|
||||
print '<b>'.$langs->trans("ExamplesWithCurrentSetup").":</b><br>\n";
|
||||
print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', '');
|
||||
|
||||
// Always show vat rates with vat 0
|
||||
$s=2/7;$qty=1;$vat=0;
|
||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
||||
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
|
||||
$s=10/3;$qty=1;$vat=0;
|
||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
||||
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
|
||||
$s=10/3;$qty=2;$vat=0;
|
||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
||||
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
|
||||
// Add vat rates examples specific to country
|
||||
$vat_rates=array();
|
||||
@ -261,10 +261,10 @@ else
|
||||
{
|
||||
$s=10/3;
|
||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
||||
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -276,17 +276,17 @@ else
|
||||
|
||||
$s=10/3;$qty=1;$vat=10;
|
||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
||||
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
|
||||
$s=10/3;$qty=2;$vat=10;
|
||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
||||
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
}
|
||||
|
||||
// Important: can debug rounding, to simulate the rounded total
|
||||
|
||||
@ -86,9 +86,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit')
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -113,10 +113,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -48,7 +48,7 @@ if ($action == 'setvalue')
|
||||
$mailerror = GETPOST('MAILING_EMAIL_ERRORSTO', 'alpha');
|
||||
$checkread = GETPOST('value', 'alpha');
|
||||
$checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha');
|
||||
$mailingdelay = GETPOST('MAILING_DELAY', 'int');
|
||||
$mailingdelay = GETPOST('MAILING_DELAY', 'int');
|
||||
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
@ -61,16 +61,16 @@ if ($action == 'setvalue')
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -41,8 +41,8 @@ $dirsmartphone = array();
|
||||
$dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']);
|
||||
foreach($dirmenus as $dirmenu)
|
||||
{
|
||||
$dirstandard[]=$dirmenu.'standard';
|
||||
$dirsmartphone[]=$dirmenu.'smartphone';
|
||||
$dirstandard[]=$dirmenu.'standard';
|
||||
$dirsmartphone[]=$dirmenu.'smartphone';
|
||||
}
|
||||
|
||||
$error=0;
|
||||
@ -85,8 +85,8 @@ if ($action == 'update' && ! $cancel)
|
||||
foreach($dirmenus as $dirmenu)
|
||||
{
|
||||
$file='init_menu_'.$key.'.sql';
|
||||
$fullpath=dol_buildpath($dirmenu.$file);
|
||||
//print 'action='.$action.' Search menu into fullpath='.$fullpath.'<br>';exit;
|
||||
$fullpath=dol_buildpath($dirmenu.$file);
|
||||
//print 'action='.$action.' Search menu into fullpath='.$fullpath.'<br>';exit;
|
||||
|
||||
if (file_exists($fullpath))
|
||||
{
|
||||
|
||||
@ -290,7 +290,7 @@ $text='';
|
||||
|
||||
if ($mode == 'desc')
|
||||
{
|
||||
if ($moduledesc) $text.=$moduledesc.'<br><br>';
|
||||
if ($moduledesc) $text .= '<br>'.$moduledesc.'<br><br><br>';
|
||||
|
||||
$text.='<strong>'.$langs->trans("Version").':</strong> '.$version;
|
||||
|
||||
|
||||
@ -552,7 +552,7 @@ if ($mode == 'common')
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
// Show list of modules
|
||||
|
||||
//$conf->global->MAIN_USE_KANBAN_FOR_MODULES=1;
|
||||
$oldfamily = '';
|
||||
|
||||
foreach ($orders as $key => $value)
|
||||
@ -637,8 +637,12 @@ if ($mode == 'common')
|
||||
$familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label'];
|
||||
print load_fiche_titre($familytext, '', '');
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
|
||||
if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) {
|
||||
print '<div class="box-flex-container">';
|
||||
} else {
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
|
||||
}
|
||||
|
||||
$atleastoneforfamily = 0;
|
||||
}
|
||||
@ -651,9 +655,6 @@ if ($mode == 'common')
|
||||
$oldfamily = $familykey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Version (with picto warning or not)
|
||||
$version = $objMod->getVersion(0);
|
||||
$versiontrans = '';
|
||||
@ -669,212 +670,221 @@ if ($mode == 'common')
|
||||
$imginfo = "info_black";
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">'."\n";
|
||||
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print '<td width="20px">'.++$linenum.'</td>';
|
||||
if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) {
|
||||
// Output Kanban
|
||||
print $objMod->getKanbanView();
|
||||
} else {
|
||||
print '<tr class="oddeven">'."\n";
|
||||
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print '<td width="20px">'.++$linenum.'</td>';
|
||||
|
||||
// Picto + Name of module
|
||||
print ' <td width="200px">';
|
||||
$alttext = '';
|
||||
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
||||
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
|
||||
if (!empty($objMod->picto))
|
||||
{
|
||||
if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule"', 1);
|
||||
else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule"');
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_object($alttext, 'generic', 'class="valignmiddle"');
|
||||
}
|
||||
print ' <span class="valignmiddle">'.$objMod->getName().'</span>';
|
||||
print "</td>\n";
|
||||
|
||||
// Desc
|
||||
print '<td class="valignmiddle tdoverflowmax300">';
|
||||
print nl2br($objMod->getDesc());
|
||||
print "</td>\n";
|
||||
|
||||
// Help
|
||||
print '<td class="center nowrap" style="width: 82px;">';
|
||||
//print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1);
|
||||
print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
||||
print '</td>';
|
||||
|
||||
// Version
|
||||
print '<td class="center nowrap" width="120px">';
|
||||
print $versiontrans;
|
||||
if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
if (!empty($objMod->url_last_version)) {
|
||||
$newversion = getURLContent($objMod->url_last_version);
|
||||
if (isset($newversion['content'])) {
|
||||
if (version_compare($newversion['content'], $versiontrans) > 0) {
|
||||
print " <span class='butAction' title='".$langs->trans('LastStableVersion')."'>".$newversion['content']."</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Activate/Disable and Setup (2 columns)
|
||||
if (!empty($conf->global->$const_name)) // If module is already activated
|
||||
{
|
||||
$disableSetup = 0;
|
||||
|
||||
// Link enable/disabme
|
||||
print '<td class="center valignmiddle" width="60px">';
|
||||
if (!empty($arrayofwarnings[$modName]))
|
||||
// Picto + Name of module
|
||||
print ' <td width="200px">';
|
||||
$alttext = '';
|
||||
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
||||
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
|
||||
if (!empty($objMod->picto))
|
||||
{
|
||||
print '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||
if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule"', 1);
|
||||
else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule"');
|
||||
}
|
||||
if (!empty($objMod->disabled))
|
||||
{
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1)))
|
||||
{
|
||||
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
|
||||
else {
|
||||
print img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium');
|
||||
//print $langs->trans("Required");
|
||||
}
|
||||
if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset_confirm&confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset&value='.$modName.'&mode='.$mode.'&confirm=yes'.$param.'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
}
|
||||
print '</td>'."\n";
|
||||
else
|
||||
{
|
||||
print img_object($alttext, 'generic', 'class="valignmiddle"');
|
||||
}
|
||||
print ' <span class="valignmiddle">'.$objMod->getName().'</span>';
|
||||
print "</td>\n";
|
||||
|
||||
// Link config
|
||||
if (!empty($objMod->config_page_url) && !$disableSetup)
|
||||
{
|
||||
$backtourlparam = '';
|
||||
if ($search_keyword != '') $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later
|
||||
if ($search_nature > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature;
|
||||
if ($search_version > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version;
|
||||
if ($search_status > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status;
|
||||
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
|
||||
// Desc
|
||||
print '<td class="valignmiddle tdoverflowmax300">';
|
||||
print nl2br($objMod->getDesc());
|
||||
print "</td>\n";
|
||||
|
||||
if (is_array($objMod->config_page_url))
|
||||
{
|
||||
print '<td class="tdsetuppicto right" width="60px">';
|
||||
$i = 0;
|
||||
foreach ($objMod->config_page_url as $page)
|
||||
{
|
||||
$urlpage = $page;
|
||||
if ($i++)
|
||||
{
|
||||
print '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
|
||||
// print '<a href="'.$page.'">'.ucfirst($page).'</a> ';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
|
||||
{
|
||||
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
|
||||
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$urltouse = $urlpage;
|
||||
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
}
|
||||
elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
|
||||
{
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.$objMod->config_page_url.'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a></td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
||||
}
|
||||
}
|
||||
else // Module not yet activated
|
||||
{
|
||||
// Link enable/disable
|
||||
print '<td class="center valignmiddle" width="60px">';
|
||||
if (!empty($objMod->always_enabled))
|
||||
{
|
||||
// Should never happened
|
||||
}
|
||||
elseif (!empty($objMod->disabled))
|
||||
{
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Module qualified for activation
|
||||
$warningmessage = '';
|
||||
// Help
|
||||
print '<td class="center nowrap" style="width: 82px;">';
|
||||
//print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1);
|
||||
print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
||||
print '</td>';
|
||||
|
||||
// Version
|
||||
print '<td class="center nowrap" width="120px">';
|
||||
print $versiontrans;
|
||||
if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
if (!empty($objMod->url_last_version)) {
|
||||
$newversion = getURLContent($objMod->url_last_version);
|
||||
if (isset($newversion['content'])) {
|
||||
if (version_compare($newversion['content'], $versiontrans) > 0) {
|
||||
print " <span class='butAction' title='".$langs->trans('LastStableVersion')."'>".$newversion['content']."</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Activate/Disable and Setup (2 columns)
|
||||
if (!empty($conf->global->$const_name)) // If module is already activated
|
||||
{
|
||||
$disableSetup = 0;
|
||||
|
||||
// Link enable/disabme
|
||||
print '<td class="center valignmiddle" width="60px">';
|
||||
if (!empty($arrayofwarnings[$modName]))
|
||||
{
|
||||
print '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||
}
|
||||
if (!empty($objMod->disabled))
|
||||
{
|
||||
print '<!-- This module is a core module and it may have a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||
foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
|
||||
{
|
||||
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
|
||||
{
|
||||
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
|
||||
}
|
||||
}
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext))
|
||||
elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1)))
|
||||
{
|
||||
print '<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||
foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry)
|
||||
{
|
||||
$keymodulelowercase = strtolower(preg_replace('/^mod/', '', $keymodule));
|
||||
if (in_array($keymodulelowercase, $conf->modules)) // If module that request warning is on
|
||||
{
|
||||
foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage)
|
||||
{
|
||||
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
|
||||
{
|
||||
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
|
||||
$warningmessage .= ($warningmessage ? "\n" : "").($warningmessage ? "\n" : "").$langs->trans("Module").' : '.$objMod->getName();
|
||||
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("Publisher").' : '.$objMod->editor_name;
|
||||
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("ModuleTriggeringThisWarning").' : '.$modules[$keymodule]->getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
|
||||
else {
|
||||
print img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium');
|
||||
//print $langs->trans("Required");
|
||||
}
|
||||
if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
||||
}
|
||||
print '<!-- Message to show: '.$warningmessage.' -->'."\n";
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=set&value='.$modName.'&mode='.$mode.$param.'"';
|
||||
if ($warningmessage) print ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
|
||||
print '>';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print "</a>\n";
|
||||
}
|
||||
print "</td>\n";
|
||||
else
|
||||
{
|
||||
if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset_confirm&confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset&value='.$modName.'&mode='.$mode.'&confirm=yes'.$param.'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
// Link config
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
||||
// Link config
|
||||
if (!empty($objMod->config_page_url) && !$disableSetup)
|
||||
{
|
||||
$backtourlparam = '';
|
||||
if ($search_keyword != '') $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later
|
||||
if ($search_nature > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature;
|
||||
if ($search_version > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version;
|
||||
if ($search_status > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status;
|
||||
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
|
||||
|
||||
if (is_array($objMod->config_page_url))
|
||||
{
|
||||
print '<td class="tdsetuppicto right" width="60px">';
|
||||
$i = 0;
|
||||
foreach ($objMod->config_page_url as $page)
|
||||
{
|
||||
$urlpage = $page;
|
||||
if ($i++)
|
||||
{
|
||||
print '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
|
||||
// print '<a href="'.$page.'">'.ucfirst($page).'</a> ';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
|
||||
{
|
||||
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
|
||||
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$urltouse = $urlpage;
|
||||
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
}
|
||||
elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
|
||||
{
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.$objMod->config_page_url.'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a></td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
||||
}
|
||||
}
|
||||
else // Module not yet activated
|
||||
{
|
||||
// Link enable/disable
|
||||
print '<td class="center valignmiddle" width="60px">';
|
||||
if (!empty($objMod->always_enabled))
|
||||
{
|
||||
// Should never happened
|
||||
}
|
||||
elseif (!empty($objMod->disabled))
|
||||
{
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Module qualified for activation
|
||||
$warningmessage = '';
|
||||
if (!empty($arrayofwarnings[$modName]))
|
||||
{
|
||||
print '<!-- This module is a core module and it may have a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||
foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
|
||||
{
|
||||
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
|
||||
{
|
||||
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext))
|
||||
{
|
||||
print '<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||
foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry)
|
||||
{
|
||||
$keymodulelowercase = strtolower(preg_replace('/^mod/', '', $keymodule));
|
||||
if (in_array($keymodulelowercase, $conf->modules)) // If module that request warning is on
|
||||
{
|
||||
foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage)
|
||||
{
|
||||
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
|
||||
{
|
||||
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
|
||||
$warningmessage .= ($warningmessage ? "\n" : "").($warningmessage ? "\n" : "").$langs->trans("Module").' : '.$objMod->getName();
|
||||
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("Publisher").' : '.$objMod->editor_name;
|
||||
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("ModuleTriggeringThisWarning").' : '.$modules[$keymodule]->getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print '<!-- Message to show: '.$warningmessage.' -->'."\n";
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=set&value='.$modName.'&mode='.$mode.$param.'"';
|
||||
if ($warningmessage) print ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
|
||||
print '>';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print "</a>\n";
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Link config
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if ($oldfamily)
|
||||
{
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) {
|
||||
print '</div>';
|
||||
} else {
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@ -148,7 +148,10 @@ elseif ($action == 'setapilayer')
|
||||
}
|
||||
else
|
||||
{
|
||||
MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID);
|
||||
$result = MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("CurrencyRateSyncSucceed"), null, "mesgs");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -46,15 +46,15 @@ $type = 'paymentorder';
|
||||
|
||||
if ($action == "set")
|
||||
{
|
||||
$db->begin();
|
||||
$db->begin();
|
||||
|
||||
$id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int');
|
||||
$account = new Account($db);
|
||||
if($account->fetch($id)>0)
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
/*
|
||||
$id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int');
|
||||
$account = new Account($db);
|
||||
if($account->fetch($id)>0)
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
/*
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_CODE_GUICHET", $account->code_guichet,'chaine',0,'',$conf->entity);
|
||||
@ -70,33 +70,33 @@ if ($action == "set")
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
*/
|
||||
}
|
||||
else $error++;
|
||||
}
|
||||
else $error++;
|
||||
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (GETPOST("PRELEVEMENT_USER") > 0)
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_USER") > 0)
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
|
||||
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
} elseif (! $error)
|
||||
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
} elseif (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
@ -110,20 +110,20 @@ if ($action == "set")
|
||||
|
||||
if ($action == "addnotif")
|
||||
{
|
||||
$bon = new BonPrelevement($db);
|
||||
$bon->AddNotification($db, GETPOST('user', 'int'), $action);
|
||||
$bon = new BonPrelevement($db);
|
||||
$bon->AddNotification($db, GETPOST('user', 'int'), $action);
|
||||
|
||||
header("Location: prelevement.php");
|
||||
exit;
|
||||
header("Location: prelevement.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action == "deletenotif")
|
||||
{
|
||||
$bon = new BonPrelevement($db);
|
||||
$bon->DeleteNotificationById(GETPOST('notif', 'int'));
|
||||
$bon = new BonPrelevement($db);
|
||||
$bon->DeleteNotificationById(GETPOST('notif', 'int'));
|
||||
|
||||
header("Location: prelevement.php");
|
||||
exit;
|
||||
header("Location: prelevement.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -40,34 +40,34 @@ $upload_dir=$conf->admin->dir_temp;
|
||||
|
||||
if (GETPOST('action', 'aZ09') == 'set_proxy')
|
||||
{
|
||||
if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT")))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT")))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT")))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT")))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result=0;
|
||||
$result+=dolibarr_set_const($db, 'MAIN_USE_CONNECT_TIMEOUT', GETPOST("MAIN_USE_CONNECT_TIMEOUT"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_USE_RESPONSE_TIMEOUT', GETPOST("MAIN_USE_RESPONSE_TIMEOUT"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_USE', GETPOST("MAIN_PROXY_USE"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_HOST', GETPOST("MAIN_PROXY_HOST"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_PORT', GETPOST("MAIN_PROXY_PORT"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_USER', GETPOST("MAIN_PROXY_USER"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_PASS', GETPOST("MAIN_PROXY_PASS"), 'chaine', 0, '', $conf->entity);
|
||||
if ($result < 5) dol_print_error($db);
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$result=0;
|
||||
$result+=dolibarr_set_const($db, 'MAIN_USE_CONNECT_TIMEOUT', GETPOST("MAIN_USE_CONNECT_TIMEOUT"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_USE_RESPONSE_TIMEOUT', GETPOST("MAIN_USE_RESPONSE_TIMEOUT"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_USE', GETPOST("MAIN_PROXY_USE"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_HOST', GETPOST("MAIN_PROXY_HOST"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_PORT', GETPOST("MAIN_PROXY_PORT"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_USER', GETPOST("MAIN_PROXY_USER"), 'chaine', 0, '', $conf->entity);
|
||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_PASS', GETPOST("MAIN_PROXY_PASS"), 'chaine', 0, '', $conf->entity);
|
||||
if ($result < 5) dol_print_error($db);
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -99,8 +99,8 @@ dol_fiche_head($head, 'proxy', $langs->trans("Security"), -1);
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print 'jQuery(document).ready(function () {
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print 'jQuery(document).ready(function () {
|
||||
function initfields()
|
||||
{
|
||||
if (jQuery("#MAIN_PROXY_USE").val()==\'1\')
|
||||
@ -117,7 +117,7 @@ if ($conf->use_javascript_ajax)
|
||||
initfields();
|
||||
});
|
||||
})';
|
||||
print '</script>'."\n";
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -89,9 +89,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -103,10 +103,10 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -116,10 +116,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -35,7 +35,7 @@ $langs->loadLangs(array("admin","resource"));
|
||||
|
||||
// Security check
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
|
||||
@ -86,9 +86,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit')
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -113,10 +113,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -84,9 +84,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -99,9 +99,9 @@ if ($action != 'create' && $action != 'edit')
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -111,10 +111,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -70,27 +70,27 @@ $configfileparameters=array(
|
||||
'?dolibarr_main_auth_ldap_admin_login',
|
||||
'?dolibarr_main_auth_ldap_admin_pass',
|
||||
'?dolibarr_main_auth_ldap_debug',
|
||||
'separator',
|
||||
'?dolibarr_lib_ADODB_PATH',
|
||||
'separator',
|
||||
'?dolibarr_lib_ADODB_PATH',
|
||||
'?dolibarr_lib_FPDF_PATH',
|
||||
'?dolibarr_lib_TCPDF_PATH',
|
||||
'?dolibarr_lib_TCPDF_PATH',
|
||||
'?dolibarr_lib_FPDI_PATH',
|
||||
'?dolibarr_lib_TCPDI_PATH',
|
||||
'?dolibarr_lib_TCPDI_PATH',
|
||||
'?dolibarr_lib_NUSOAP_PATH',
|
||||
'?dolibarr_lib_PHPEXCEL_PATH',
|
||||
'?dolibarr_lib_GEOIP_PATH',
|
||||
'?dolibarr_lib_PHPEXCEL_PATH',
|
||||
'?dolibarr_lib_GEOIP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
'?dolibarr_js_CKEDITOR',
|
||||
'?dolibarr_js_JQUERY',
|
||||
'?dolibarr_js_JQUERY_UI',
|
||||
'?dolibarr_js_JQUERY_FLOT',
|
||||
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
'?dolibarr_js_CKEDITOR',
|
||||
'?dolibarr_js_JQUERY',
|
||||
'?dolibarr_js_JQUERY_UI',
|
||||
'?dolibarr_js_JQUERY_FLOT',
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF',
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||
'separator',
|
||||
'?dolibarr_mailing_limit_sendbyweb',
|
||||
'?dolibarr_mailing_limit_sendbycli',
|
||||
'?dolibarr_strict_mode'
|
||||
'?dolibarr_strict_mode'
|
||||
);
|
||||
$configfilelib=array(
|
||||
// 'separator',
|
||||
@ -121,20 +121,20 @@ $configfilelib=array(
|
||||
'dolibarr_main_auth_ldap_admin_pass',
|
||||
'dolibarr_main_auth_ldap_debug',
|
||||
'separator',
|
||||
'dolibarr_lib_ADODB_PATH',
|
||||
'dolibarr_lib_TCPDF_PATH',
|
||||
'dolibarr_lib_FPDI_PATH',
|
||||
'dolibarr_lib_ADODB_PATH',
|
||||
'dolibarr_lib_TCPDF_PATH',
|
||||
'dolibarr_lib_FPDI_PATH',
|
||||
'dolibarr_lib_NUSOAP_PATH',
|
||||
'dolibarr_lib_PHPEXCEL_PATH',
|
||||
'dolibarr_lib_GEOIP_PATH',
|
||||
'dolibarr_lib_PHPEXCEL_PATH',
|
||||
'dolibarr_lib_GEOIP_PATH',
|
||||
'dolibarr_lib_ODTPHP_PATH',
|
||||
'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
'dolibarr_js_CKEDITOR',
|
||||
'dolibarr_js_JQUERY',
|
||||
'dolibarr_js_JQUERY_UI',
|
||||
'dolibarr_js_JQUERY_FLOT',
|
||||
'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
'dolibarr_js_CKEDITOR',
|
||||
'dolibarr_js_JQUERY',
|
||||
'dolibarr_js_JQUERY_UI',
|
||||
'dolibarr_js_JQUERY_FLOT',
|
||||
'dolibarr_font_DOL_DEFAULT_TTF',
|
||||
'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||
'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||
'separator',
|
||||
'Limit nb of email sent by page',
|
||||
'Strict mode is on/off'
|
||||
@ -155,19 +155,19 @@ foreach($configfileparameters as $key)
|
||||
|
||||
if (empty($ignore))
|
||||
{
|
||||
$newkey = preg_replace('/^\?/', '', $key);
|
||||
$newkey = preg_replace('/^\?/', '', $key);
|
||||
|
||||
if (preg_match('/^\?/', $key) && empty(${$newkey}))
|
||||
{
|
||||
$i++;
|
||||
continue; // We discard parametes starting with ?
|
||||
}
|
||||
if (preg_match('/^\?/', $key) && empty(${$newkey}))
|
||||
{
|
||||
$i++;
|
||||
continue; // We discard parametes starting with ?
|
||||
}
|
||||
|
||||
if ($newkey == 'separator' && $lastkeyshown == 'separator')
|
||||
{
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
if ($newkey == 'separator' && $lastkeyshown == 'separator')
|
||||
{
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
if ($newkey == 'separator')
|
||||
@ -233,17 +233,17 @@ if ($resql)
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$obj->name.'</td>'."\n";
|
||||
print '<td>'.$obj->value.'</td>'."\n";
|
||||
if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
|
||||
print "</tr>\n";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$obj->name.'</td>'."\n";
|
||||
print '<td>'.$obj->value.'</td>'."\n";
|
||||
if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -54,17 +54,17 @@ $i=0;
|
||||
foreach($modulesdir as $dir)
|
||||
{
|
||||
$handle=@opendir(dol_osencode($dir));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
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);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
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);
|
||||
|
||||
if ($modName)
|
||||
{
|
||||
//print 'xx'.$dir.$file.'<br>';
|
||||
if ($modName)
|
||||
{
|
||||
//print 'xx'.$dir.$file.'<br>';
|
||||
if (in_array($file, $modules_files))
|
||||
{
|
||||
// File duplicate
|
||||
@ -77,13 +77,13 @@ foreach($modulesdir as $dir)
|
||||
if (class_exists($modName))
|
||||
{
|
||||
try {
|
||||
$objMod = new $modName($db);
|
||||
$objMod = new $modName($db);
|
||||
|
||||
$modules[$objMod->numero]=$objMod;
|
||||
$modules_names[$objMod->numero]=$objMod->name;
|
||||
$modules_files[$objMod->numero]=$file;
|
||||
$modules_fullpath[$file]=$dir.$file;
|
||||
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
||||
$modules[$objMod->numero]=$objMod;
|
||||
$modules_names[$objMod->numero]=$objMod->name;
|
||||
$modules_files[$objMod->numero]=$file;
|
||||
$modules_fullpath[$file]=$dir.$file;
|
||||
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
@ -95,11 +95,11 @@ foreach($modulesdir as $dir)
|
||||
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -120,15 +120,15 @@ foreach($sortorder as $numero=>$name)
|
||||
// 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"');
|
||||
}
|
||||
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();
|
||||
print "</td>";
|
||||
// Version
|
||||
|
||||
@ -41,54 +41,54 @@ print "<br>\n";
|
||||
|
||||
if (!function_exists('xdebug_is_enabled'))
|
||||
{
|
||||
print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.';
|
||||
llxFooter();
|
||||
exit;
|
||||
print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if (function_exists('socket_create'))
|
||||
{
|
||||
$address = ini_get('xdebug.remote_host')?ini_get('xdebug.remote_host'):'127.0.0.1';
|
||||
$port = ini_get('xdebug.remote_port')?ini_get('xdebug.remote_port'):9000;
|
||||
$address = ini_get('xdebug.remote_host')?ini_get('xdebug.remote_host'):'127.0.0.1';
|
||||
$port = ini_get('xdebug.remote_port')?ini_get('xdebug.remote_port'):9000;
|
||||
|
||||
print "<strong>Current xdebug setup:</strong><br>\n";
|
||||
print "* Remote debug setup:<br>\n";
|
||||
print 'xdebug.remote_enable = '.ini_get('xdebug.remote_enable')."<br>\n";
|
||||
print 'xdebug.remote_host = '.$address."<br>\n";
|
||||
print 'xdebug.remote_port = '.$port."<br>\n";
|
||||
print "* Profiler setup ";
|
||||
if (function_exists('xdebug_get_profiler_filename')) print xdebug_get_profiler_filename()?"(currently on into file ".xdebug_get_profiler_filename().")":"(currently off)";
|
||||
else print "(currenlty not available)";
|
||||
print ":<br>\n";
|
||||
print 'xdebug.profiler_enable = '.ini_get('xdebug.profiler_enable')."<br>\n";
|
||||
print 'xdebug.profiler_enable_trigger = '.ini_get('xdebug.profiler_enable_trigger')."<br>\n";
|
||||
print 'xdebug.profiler_output_dir = '.ini_get('xdebug.profiler_output_dir')."<br>\n";
|
||||
print 'xdebug.profiler_output_name = '.ini_get('xdebug.profiler_output_name')."<br>\n";
|
||||
print 'xdebug.profiler_append = '.ini_get('xdebug.profiler_append')."<br>\n";
|
||||
print "<br>\n";
|
||||
print "<strong>Current xdebug setup:</strong><br>\n";
|
||||
print "* Remote debug setup:<br>\n";
|
||||
print 'xdebug.remote_enable = '.ini_get('xdebug.remote_enable')."<br>\n";
|
||||
print 'xdebug.remote_host = '.$address."<br>\n";
|
||||
print 'xdebug.remote_port = '.$port."<br>\n";
|
||||
print "* Profiler setup ";
|
||||
if (function_exists('xdebug_get_profiler_filename')) print xdebug_get_profiler_filename()?"(currently on into file ".xdebug_get_profiler_filename().")":"(currently off)";
|
||||
else print "(currenlty not available)";
|
||||
print ":<br>\n";
|
||||
print 'xdebug.profiler_enable = '.ini_get('xdebug.profiler_enable')."<br>\n";
|
||||
print 'xdebug.profiler_enable_trigger = '.ini_get('xdebug.profiler_enable_trigger')."<br>\n";
|
||||
print 'xdebug.profiler_output_dir = '.ini_get('xdebug.profiler_output_dir')."<br>\n";
|
||||
print 'xdebug.profiler_output_name = '.ini_get('xdebug.profiler_output_name')."<br>\n";
|
||||
print 'xdebug.profiler_append = '.ini_get('xdebug.profiler_append')."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
echo "To run a debug session, add parameter<br>";
|
||||
echo "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.<br>\n";
|
||||
echo "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter<br>\n";
|
||||
echo "* XDEBUG_PROFILE=aname on each URL.<br>";
|
||||
print "<br>";
|
||||
echo "To run a debug session, add parameter<br>";
|
||||
echo "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.<br>\n";
|
||||
echo "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter<br>\n";
|
||||
echo "* XDEBUG_PROFILE=aname on each URL.<br>";
|
||||
print "<br>";
|
||||
|
||||
print "<strong>Test debugger server (Eclipse for example):</strong><br>\n";
|
||||
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
if (empty($socket)) die('Unable to prepare a socket');
|
||||
//socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port);
|
||||
//socket_listen($sock);
|
||||
//$client = socket_accept($sock);
|
||||
$client=socket_connect($socket, $address, $port);
|
||||
if ($client)
|
||||
{
|
||||
echo "Connection established: ".$client." - address=".$address." port=".$port."<br>\n";
|
||||
echo "There is a Remote debug server at this address.<br>\n";
|
||||
echo "<br>\n";
|
||||
echo "To be sure this debugger accepts input from your PHP server and xdebug, be sure to have\n";
|
||||
echo "your php.ini file with this :<br>\n";
|
||||
echo '<textarea cols="80" rows="16">'."xdebug.remote_enable=on
|
||||
print "<strong>Test debugger server (Eclipse for example):</strong><br>\n";
|
||||
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
if (empty($socket)) die('Unable to prepare a socket');
|
||||
//socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port);
|
||||
//socket_listen($sock);
|
||||
//$client = socket_accept($sock);
|
||||
$client=socket_connect($socket, $address, $port);
|
||||
if ($client)
|
||||
{
|
||||
echo "Connection established: ".$client." - address=".$address." port=".$port."<br>\n";
|
||||
echo "There is a Remote debug server at this address.<br>\n";
|
||||
echo "<br>\n";
|
||||
echo "To be sure this debugger accepts input from your PHP server and xdebug, be sure to have\n";
|
||||
echo "your php.ini file with this :<br>\n";
|
||||
echo '<textarea cols="80" rows="16">'."xdebug.remote_enable=on
|
||||
xdebug.remote_handle=dbgp
|
||||
xdebug.remote_host=localhost
|
||||
xdebug.remote_port=9000
|
||||
@ -103,23 +103,23 @@ xdebug.show_mem_delta=1
|
||||
xdebug.trace_output_dir=/tmp/trace
|
||||
xdebug.auto_trace=0
|
||||
</textarea>\n";
|
||||
print "<br><br>\n";
|
||||
echo 'Then check in your debug server (Eclipse), you have setup:<br>
|
||||
print "<br><br>\n";
|
||||
echo 'Then check in your debug server (Eclipse), you have setup:<br>
|
||||
XDebug with same port than in php.ini<br>
|
||||
Allow Remote debug=yes or prompt<br>'."\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print socket_strerror(socket_last_error());
|
||||
echo "Failed to connect to address=".$address." port=".$port."<br>\n";
|
||||
echo "There is no Remote debug server at this address.\n";
|
||||
}
|
||||
socket_close($socket);
|
||||
print "<br>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print socket_strerror(socket_last_error());
|
||||
echo "Failed to connect to address=".$address." port=".$port."<br>\n";
|
||||
echo "There is no Remote debug server at this address.\n";
|
||||
}
|
||||
socket_close($socket);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Can't test if PHPDebug is OK as PHP socket functions are not enabled.";
|
||||
print "Can't test if PHPDebug is OK as PHP socket functions are not enabled.";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ $form = new Form($db);
|
||||
$tmptype2label = ExtraFields::$type2label;
|
||||
$type2label = array('');
|
||||
foreach ($tmptype2label as $key => $val) {
|
||||
$type2label[$key] = $langs->trans($val);
|
||||
$type2label[$key] = $langs->trans($val);
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
@ -44,7 +44,7 @@ $attrname = GETPOST('attrname', 'alpha');
|
||||
$elementtype = 'ticket'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -79,9 +79,9 @@ dol_fiche_end();
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?action=create\">" . $langs->trans("NewAttribute") . '</a></div>';
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?action=create\">" . $langs->trans("NewAttribute") . '</a></div>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -91,10 +91,10 @@ if ($action != 'create' && $action != 'edit') {
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create') {
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -103,10 +103,10 @@ if ($action == 'create') {
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -167,7 +167,7 @@ if ($savehandler == 'files')
|
||||
|
||||
if (count($listofsessions) == 0)
|
||||
{
|
||||
print '<tr '.$bc[false].'><td colspan="6">'.$langs->trans("NoSessionFound", $savepath, $openbasedir).'</td></tr>';
|
||||
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoSessionFound", $savepath, $openbasedir).'</td></tr>';
|
||||
}
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
@ -54,9 +54,9 @@ $version='0.0';
|
||||
|
||||
if ($action == 'getlastversion')
|
||||
{
|
||||
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content']);
|
||||
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content']);
|
||||
}
|
||||
|
||||
|
||||
@ -75,39 +75,39 @@ print $langs->trans("CurrentVersion").' : <strong>'.DOL_VERSION.'</strong><br>';
|
||||
|
||||
if (function_exists('curl_init'))
|
||||
{
|
||||
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||
|
||||
if ($action == 'getlastversion')
|
||||
{
|
||||
if ($sfurl)
|
||||
{
|
||||
$i=0;
|
||||
while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
|
||||
{
|
||||
$title=$sfurl->channel[0]->item[$i]->title;
|
||||
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
|
||||
{
|
||||
$newversion=$reg[1];
|
||||
$newversionarray=explode('.', $newversion);
|
||||
$versionarray=explode('.', $version);
|
||||
//var_dump($newversionarray);var_dump($versionarray);
|
||||
if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($action == 'getlastversion')
|
||||
{
|
||||
if ($sfurl)
|
||||
{
|
||||
$i=0;
|
||||
while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
|
||||
{
|
||||
$title=$sfurl->channel[0]->item[$i]->title;
|
||||
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
|
||||
{
|
||||
$newversion=$reg[1];
|
||||
$newversionarray=explode('.', $newversion);
|
||||
$versionarray=explode('.', $version);
|
||||
//var_dump($newversionarray);var_dump($versionarray);
|
||||
if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Show version
|
||||
print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="button">' .$langs->trans("Check").'</a><br>';
|
||||
}
|
||||
// Show version
|
||||
print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="button">' .$langs->trans("Check").'</a><br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -56,6 +56,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
|
||||
$url = $_SERVER['PHP_SELF'];
|
||||
if (preg_match('/api\/index\.php$/', $url)) { // sometimes $_SERVER['PHP_SELF'] is 'api\/index\.php' instead of 'api\/index\.php/explorer.php' or 'api\/index\.php/method'
|
||||
$url = $_SERVER['PHP_SELF'].$_SERVER['PATH_INFO'];
|
||||
}
|
||||
// Fix for some NGINX setups (this should not be required even with NGINX, however setup of NGINX are often mysterious and this may help is such cases)
|
||||
if (! empty($conf->global->MAIN_NGINX_FIX))
|
||||
{
|
||||
|
||||
@ -76,9 +76,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a></div>';
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a></div>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -90,10 +90,10 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -103,10 +103,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -203,7 +203,7 @@ if (($id || $ref) && $action == 'edit')
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||
{
|
||||
$res = $object->fetch_optionals($object->id);
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = asset_prepare_head($object);
|
||||
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic');
|
||||
|
||||
@ -61,28 +61,28 @@ if (! empty($conf->global->BARCODE_PRODUCT_ADDON_NUM))
|
||||
$dir = dol_buildpath($dirroot, 0);
|
||||
|
||||
$handle = @opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (preg_match('/^mod_barcode_product_.*php$/', $file))
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (preg_match('/^mod_barcode_product_.*php$/', $file))
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
|
||||
try {
|
||||
dol_include_once($dirroot.$file.'.php');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
dol_syslog($e->getMessage(), LOG_ERR);
|
||||
}
|
||||
try {
|
||||
dol_include_once($dirroot.$file.'.php');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
dol_syslog($e->getMessage(), LOG_ERR);
|
||||
}
|
||||
|
||||
$modBarCodeProduct = new $file();
|
||||
break;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
$modBarCodeProduct = new $file();
|
||||
break;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,8 +37,8 @@ $element = GETPOST('element', 'alpha');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
if ($element === 'facture') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
$facture = new Facture($db);
|
||||
if($facture->fetch($id)>0) {
|
||||
|
||||
@ -53,13 +53,13 @@ function blockedlogadmin_prepare_head()
|
||||
|
||||
$object=new stdClass();
|
||||
|
||||
// Show more tabs from modules
|
||||
// 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); to remove a tab
|
||||
// Show more tabs from modules
|
||||
// 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); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog', 'remove');
|
||||
|
||||
return $head;
|
||||
return $head;
|
||||
}
|
||||
|
||||
@ -549,7 +549,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$result = $object->getLinesArray();
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id.'">
|
||||
|
||||
@ -482,7 +482,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
|
||||
// Fields title search
|
||||
@ -502,7 +502,7 @@ foreach ($object->fields as $key => $val)
|
||||
elseif (strpos($val['type'], 'integer:') === 0) {
|
||||
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
||||
}
|
||||
elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||
elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
@ -582,6 +582,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
||||
elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
||||
|
||||
if (!empty($arrayfields['t.'.$key]['checked']))
|
||||
{
|
||||
|
||||
@ -60,10 +60,9 @@ function printDropdownBookmarksList()
|
||||
}
|
||||
|
||||
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
||||
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action="" onsubmit="return false" >';
|
||||
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action=""'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'onsubmit="return false"':'').'>';
|
||||
$searchForm .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
||||
$searchForm .= '</form>';
|
||||
|
||||
|
||||
// Url to list bookmark
|
||||
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
|
||||
@ -79,7 +78,6 @@ function printDropdownBookmarksList()
|
||||
$newbtn .= img_picto('', 'bookmark', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
|
||||
}
|
||||
|
||||
$bookmarkList = '<div id="dropdown-bookmarks-list" >';
|
||||
// Menu with list of bookmarks
|
||||
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
||||
$sql .= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)";
|
||||
@ -87,59 +85,126 @@ function printDropdownBookmarksList()
|
||||
$sql .= " ORDER BY position";
|
||||
if ($resql = $db->query($sql))
|
||||
{
|
||||
$i = 0;
|
||||
while (($conf->global->BOOKMARKS_SHOW_IN_MENU == 0 || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql))
|
||||
{
|
||||
$bookmarkList .= '<a class="dropdown-item bookmark-item" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
|
||||
$bookmarkList .= dol_escape_htmltag($obj->title);
|
||||
$bookmarkList .= '</a>';
|
||||
$i++;
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$bookmarkList = '<div id="dropdown-bookmarks-list" >';
|
||||
$i = 0;
|
||||
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql))
|
||||
{
|
||||
$bookmarkList .= '<a class="dropdown-item bookmark-item" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
|
||||
$bookmarkList .= dol_escape_htmltag($obj->title);
|
||||
$bookmarkList .= '</a>';
|
||||
$i++;
|
||||
}
|
||||
$bookmarkList .= '</div>';
|
||||
|
||||
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
||||
} else {
|
||||
$searchForm .= '<select name"=bookmark" id="boxbookmark" class="topmenu-bookmark-dropdown .dropdown-toggle">';
|
||||
//$searchForm .= '<option>--'.$langs->trans("Bookmarks").'--</option>';
|
||||
$searchForm .= '<option hidden value="listbookmarks" class="optiongrey" selected rel="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans('Bookmarks').'</option>';
|
||||
$searchForm .= '<option value="listbookmark" class="optionblue" rel="'.dol_escape_htmltag(DOL_URL_ROOT.'/bookmarks/list.php').'" ';
|
||||
$searchForm .= ' data-html="'.dol_escape_htmltag(img_picto('', 'bookmark').' '.($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...').'">';
|
||||
$searchForm .= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...</option>';
|
||||
// Url to go on create new bookmark page
|
||||
if (! empty($user->rights->bookmark->creer))
|
||||
{
|
||||
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
||||
$searchForm .= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"';
|
||||
$searchForm .= ' data-html="'.dol_escape_htmltag(img_picto('', 'bookmark').' '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
|
||||
}
|
||||
$i = 0;
|
||||
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql))
|
||||
{
|
||||
$searchForm .= '<option name="bookmark'.$obj->rowid.'" value="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' rel="'.dol_escape_htmltag($obj->url).'" >';
|
||||
$searchForm .= dol_escape_htmltag($obj->title);
|
||||
$searchForm .= '</option>';
|
||||
$i++;
|
||||
}
|
||||
$searchForm .= '</select>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$bookmarkList .= '</div>';
|
||||
|
||||
$html = '
|
||||
<!-- search input -->
|
||||
<div class="dropdown-header bookmark-header">
|
||||
' . $searchForm.'
|
||||
</div>
|
||||
';
|
||||
$searchForm .= '</form>';
|
||||
|
||||
$html .= '
|
||||
<!-- Menu Body -->
|
||||
<div class="bookmark-body dropdown-body">
|
||||
'.$bookmarkList.'
|
||||
</div>
|
||||
';
|
||||
// Generate the return string
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$html = $searchForm;
|
||||
|
||||
$html .= '
|
||||
<!-- Menu Footer-->
|
||||
<div class="bookmark-footer">
|
||||
'.$newbtn.$listbtn.'
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
';
|
||||
$html.='<!-- script to open selected choice -->
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
jQuery("#boxbookmark").change(function() {
|
||||
var urlselected = jQuery("#boxbookmark option:selected").attr("rel");
|
||||
if (! urlselected) console.log("Error, failed to get the URL to jump to from the rel attribute");
|
||||
var urltarget = jQuery("#boxbookmark option:selected").attr("target");
|
||||
if (! urltarget) { urltarget=""; }
|
||||
jQuery("form#top-menu-action-bookmark").attr("target",urltarget);
|
||||
jQuery("form#top-menu-action-bookmark").attr("action",urlselected);
|
||||
|
||||
$html .= '<script>
|
||||
$( document ).on("keyup", "#top-bookmark-search-input", function () {
|
||||
console.log("We change select bookmark. We choose urlselected="+urlselected+" with target="+urltarget);
|
||||
|
||||
var filter = $(this).val(), count = 0;
|
||||
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
|
||||
// Method is POST for internal link, GET for external
|
||||
if (urlselected.startsWith(\'http\'))
|
||||
{
|
||||
var newmethod=\'GET\';
|
||||
jQuery("form#top-menu-action-bookmark").attr("method", newmethod);
|
||||
console.log("We change method to newmethod="+newmethod);
|
||||
jQuery("form#top-menu-action-bookmark").submit();
|
||||
console.log("We restore method to POST");
|
||||
jQuery("form#top-menu-action-bookmark").attr("method", \'POST\');
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery("form#top-menu-action-bookmark").submit();
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>';
|
||||
} else {
|
||||
$html = '
|
||||
<!-- search input -->
|
||||
<div class="dropdown-header bookmark-header">
|
||||
' . $searchForm.'
|
||||
</div>
|
||||
';
|
||||
|
||||
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
|
||||
$(this).addClass("hidden-search-result");
|
||||
} else {
|
||||
$(this).removeClass("hidden-search-result");
|
||||
count++;
|
||||
}
|
||||
});
|
||||
$("#top-bookmark-search-filter-count").text(count);
|
||||
});
|
||||
</script>';
|
||||
$html .= '
|
||||
<!-- Menu Body -->
|
||||
<div class="bookmark-body dropdown-body">
|
||||
'.$bookmarkList.'
|
||||
</div>
|
||||
';
|
||||
|
||||
$html .= '
|
||||
<!-- Menu Footer-->
|
||||
<div class="bookmark-footer">
|
||||
'.$newbtn.$listbtn.'
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
';
|
||||
|
||||
$html .= '<!-- script to open/close the popup -->
|
||||
<script>
|
||||
$( document ).on("keyup", "#top-bookmark-search-input", function () {
|
||||
|
||||
var filter = $(this).val(), count = 0;
|
||||
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
|
||||
|
||||
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
|
||||
$(this).addClass("hidden-search-result");
|
||||
} else {
|
||||
$(this).removeClass("hidden-search-result");
|
||||
count++;
|
||||
}
|
||||
});
|
||||
$("#top-bookmark-search-filter-count").text(count);
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
@ -74,11 +74,11 @@ if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
||||
<?php
|
||||
if (! empty($mysoc->logo_small))
|
||||
{
|
||||
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
|
||||
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="logopos">'.$mysoc->name.'</div>';
|
||||
print '<div class="logopos">'.$mysoc->name.'</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@ -243,7 +243,49 @@ class Categorie extends CommonObject
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
global $hookmanager;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
if (is_object($hookmanager)) {
|
||||
$hookmanager->initHooks(array('category'));
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('constructCategory', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook >= 0 && !empty($hookmanager->resArray)) {
|
||||
$mapList = $hookmanager->resArray;
|
||||
$mapId = $mapList['id'];
|
||||
$mapCode = $mapList['code'];
|
||||
self::$MAP_ID_TO_CODE[$mapId] = $mapCode;
|
||||
$this->MAP_ID[$mapCode] = $mapId;
|
||||
$this->MAP_CAT_FK[$mapCode] = $mapList['cat_fk'];
|
||||
$this->MAP_CAT_TABLE[$mapCode] = $mapList['cat_table'];
|
||||
$this->MAP_OBJ_CLASS[$mapCode] = $mapList['obj_class'];
|
||||
$this->MAP_OBJ_TABLE[$mapCode] = $mapList['obj_table'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get map list
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMapList()
|
||||
{
|
||||
$mapList = array();
|
||||
|
||||
foreach ($this->MAP_ID as $mapCode => $mapId) {
|
||||
$mapList[] = array(
|
||||
'id' => $mapId,
|
||||
'code' => $mapCode,
|
||||
'cat_fk' => $this->MAP_CAT_FK[$mapCode],
|
||||
'cat_table' => $this->MAP_CAT_TABLE[$mapCode],
|
||||
'obj_class' => $this->MAP_OBJ_CLASS[$mapCode],
|
||||
'obj_table' => $this->MAP_OBJ_TABLE[$mapCode]
|
||||
);
|
||||
}
|
||||
|
||||
return $mapList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -40,6 +40,7 @@ $id = GETPOST('id', 'int');
|
||||
$type = (GETPOST('type', 'aZ09') ? GETPOST('type', 'aZ09') : Categorie::TYPE_PRODUCT);
|
||||
$catname = GETPOST('catname', 'alpha');
|
||||
|
||||
$categstatic = new Categorie($db);
|
||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
|
||||
@ -47,25 +48,13 @@ if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backwar
|
||||
* View
|
||||
*/
|
||||
|
||||
$categstatic = new Categorie($db);
|
||||
$form = new Form($db);
|
||||
|
||||
if ($type == Categorie::TYPE_PRODUCT) { $title=$langs->trans("ProductsCategoriesArea"); $typetext='product'; }
|
||||
elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCategoriesArea"); $typetext='supplier'; }
|
||||
elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; }
|
||||
elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; }
|
||||
elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; }
|
||||
elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='bank_account'; }
|
||||
elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
|
||||
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
|
||||
elseif ($type == Categorie::TYPE_WAREHOUSE) { $title=$langs->trans("StocksCategoriesArea"); $typetext='warehouse'; }
|
||||
elseif ($type == Categorie::TYPE_ACTIONCOMM) {
|
||||
$title = $langs->trans("ActionCommCategoriesArea");
|
||||
$typetext = 'actioncomm';
|
||||
} else {
|
||||
$title = $langs->trans("CategoriesArea");
|
||||
$typetext = 'unknown';
|
||||
}
|
||||
$typetext = $type;
|
||||
if ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans('AccountsCategoriesArea');
|
||||
elseif ($type == Categorie::TYPE_WAREHOUSE) $title = $langs->trans('StocksCategoriesArea');
|
||||
elseif ($type == Categorie::TYPE_ACTIONCOMM) $title = $langs->trans('ActionCommCategoriesArea');
|
||||
else $title = $langs->trans(ucfirst($type). 'sCategoriesArea');
|
||||
|
||||
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
|
||||
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
|
||||
|
||||
@ -36,15 +36,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php';
|
||||
$langs->loadlangs(array('categories', 'bills'));
|
||||
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref');
|
||||
$type = GETPOST('type');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$id = GETPOST('id', 'int');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$type = GETPOST('type');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm');
|
||||
|
||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
if ($id == "")
|
||||
if ($id == '' && $label == '')
|
||||
{
|
||||
dol_print_error('', 'Missing parameter id');
|
||||
exit();
|
||||
@ -54,13 +52,17 @@ if ($id == "")
|
||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||
|
||||
$object = new Categorie($db);
|
||||
if ($id > 0)
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$upload_dir = $conf->categorie->multidir_output[$object->entity];
|
||||
$result = $object->fetch($id, $label, $type);
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $object->error); exit;
|
||||
}
|
||||
$object->fetch_optionals();
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $object->error); exit;
|
||||
}
|
||||
$upload_dir = $conf->categorie->multidir_output[$object->entity];
|
||||
|
||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -126,7 +128,7 @@ if ($object->id)
|
||||
dol_fiche_head($head, 'photos', $title, -1, 'category');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$object->next_prev_filter = ' type = ' . $object->type;
|
||||
$object->ref = $object->label;
|
||||
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||
@ -136,7 +138,7 @@ if ($object->id)
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->socid?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '&type=' . $type, 0, '', '', 1);
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression de photo
|
||||
|
||||
@ -36,18 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
$langs->loadLangs(array('categories', 'languages'));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$type = GETPOST('type', 'aZ09');
|
||||
|
||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
// Security check
|
||||
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
||||
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
||||
|
||||
if ($id == "")
|
||||
if ($id == '' && $label == '')
|
||||
{
|
||||
dol_print_error('', 'Missing parameter id');
|
||||
exit();
|
||||
@ -57,7 +51,16 @@ if ($id == "")
|
||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||
|
||||
$object = new Categorie($db);
|
||||
$result = $object->fetch($id, $label, $type);
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $object->error); exit;
|
||||
}
|
||||
$object->fetch_optionals();
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $object->error); exit;
|
||||
}
|
||||
|
||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -159,8 +162,6 @@ $cancel != $langs->trans("Cancel") &&
|
||||
}
|
||||
}
|
||||
|
||||
$result = $object->fetch($id, $ref);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -197,7 +198,7 @@ if (!empty($object->multilangs))
|
||||
dol_fiche_head($head, 'translation', $title, -1, 'category');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$object->next_prev_filter = ' type = ' . $object->type;
|
||||
$object->ref = $object->label;
|
||||
$morehtmlref = '<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||
@ -207,7 +208,7 @@ foreach ($ways as $way)
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type=' . $type, 0, '', '', 1);
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -71,7 +72,7 @@ if ($id == "" && $label == "")
|
||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||
|
||||
$object = new Categorie($db);
|
||||
$result = $object->fetch($id, $label);
|
||||
$result = $object->fetch($id, $label, $type);
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $object->error); exit;
|
||||
}
|
||||
@ -80,7 +81,6 @@ if ($result <= 0) {
|
||||
dol_print_error($db, $object->error); exit;
|
||||
}
|
||||
|
||||
$type = $object->type;
|
||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
@ -222,8 +222,8 @@ $head = categories_prepare_head($object, $type);
|
||||
|
||||
dol_fiche_head($head, 'card', $title, -1, 'category');
|
||||
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
|
||||
$linkback = '<a href="'.$backtolist.'\">'.$langs->trans("BackToList").'</a>';
|
||||
$object->next_prev_filter=" type = ".$object->type;
|
||||
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
|
||||
$object->next_prev_filter = ' type = ' . $object->type;
|
||||
$object->ref = $object->label;
|
||||
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||
@ -233,7 +233,7 @@ foreach ($ways as $way)
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '', 0, '', '', 1);
|
||||
dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '&type=' . $type, 0, '', '', 1);
|
||||
|
||||
|
||||
/*
|
||||
@ -291,8 +291,18 @@ if ($user->rights->categorie->supprimer)
|
||||
|
||||
print "</div>";
|
||||
|
||||
if (! empty($user->rights->categorie->creer))
|
||||
{
|
||||
$link = DOL_URL_ROOT.'/categories/card.php';
|
||||
$link .= '?action=create';
|
||||
$link .= '&type='.$type;
|
||||
$link .= '&catorigin='.$object->id;
|
||||
$link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id);
|
||||
|
||||
|
||||
print '<div class="right">';
|
||||
print dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', $link);
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
$cats = $object->get_filles();
|
||||
if ($cats < 0)
|
||||
|
||||
@ -143,19 +143,19 @@ if ($object->id > 0)
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
$morehtmlref.=$langs->trans('Project') . ': ';
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
$morehtmlref.=$proj->ref;
|
||||
$morehtmlref.='</a>';
|
||||
if ($proj->title) $morehtmlref.=' - '.$proj->title;
|
||||
} else {
|
||||
$morehtmlref.='';
|
||||
}
|
||||
$langs->load("projects");
|
||||
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
$morehtmlref.=$langs->trans('Project') . ': ';
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
$morehtmlref.=$proj->ref;
|
||||
$morehtmlref.='</a>';
|
||||
if ($proj->title) $morehtmlref.=' - '.$proj->title;
|
||||
} else {
|
||||
$morehtmlref.='';
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
@ -253,9 +253,9 @@ if ($object->id > 0)
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$modulepart = 'actions';
|
||||
|
||||
@ -248,7 +248,7 @@ $nav .= " (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day="
|
||||
$picto = 'calendarweek';
|
||||
|
||||
$nav .= ' <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||
$nav .= '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
$nav .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$nav .= '<input type="hidden" name="action" value="'.$action.'">';
|
||||
$nav .= '<input type="hidden" name="filtert" value="'.$filtert.'">';
|
||||
$nav .= '<input type="hidden" name="usergroup" value="'.$usergroup.'">';
|
||||
|
||||
@ -289,7 +289,7 @@ $nav .= " <a href=\"?year=".$next_year."&month=".$next_month."&da
|
||||
$nav .= " (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
||||
|
||||
/*$nav.=' <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||
$nav.='<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
$nav.='<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
$nav.='<input type="hidden" name="action" value="' . $action . '">';
|
||||
$nav.='<input type="hidden" name="filtert" value="' . $filtert . '">';
|
||||
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';
|
||||
|
||||
@ -85,9 +85,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -100,9 +100,9 @@ if ($action != 'create' && $action != 'edit')
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -112,10 +112,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -992,7 +992,7 @@ else
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=settodraft&id='.$object->id.'">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
|
||||
if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer)
|
||||
if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer)
|
||||
{
|
||||
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING))
|
||||
{
|
||||
|
||||
@ -726,7 +726,7 @@ if (empty($reshook))
|
||||
$originLine = new $lineClassName($db);
|
||||
if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
|
||||
{
|
||||
$originLine->fetch_optionals($lineId);
|
||||
$originLine->fetch_optionals();
|
||||
$desc = $originLine->desc;
|
||||
$pu_ht = $originLine->subprice;
|
||||
$qty = $originLine->qty;
|
||||
@ -1523,7 +1523,7 @@ if ($action == 'create')
|
||||
$dateinvoice = (empty($dateinvoice) ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $dateinvoice);
|
||||
|
||||
// Replicate extrafields
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$objectsrc->fetch_optionals();
|
||||
$object->array_options = $objectsrc->array_options;
|
||||
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
@ -1541,7 +1541,7 @@ if ($action == 'create')
|
||||
$object = new Propal($db);
|
||||
|
||||
print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
if ($origin != 'project' && $originid) {
|
||||
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
||||
@ -1675,7 +1675,7 @@ if ($action == 'create')
|
||||
$langs->load("projects");
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Project").'</td><td>';
|
||||
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
|
||||
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -2052,7 +2052,7 @@ if ($action == 'create')
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) {
|
||||
print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setdate">';
|
||||
print $form->selectDate($object->date, 're', '', '', 0, "editdate");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
@ -2078,7 +2078,7 @@ if ($action == 'create')
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) {
|
||||
print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setecheance">';
|
||||
print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
@ -2412,7 +2412,7 @@ if ($action == 'create')
|
||||
$result = $object->getLinesArray();
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id.'">
|
||||
|
||||
@ -302,7 +302,8 @@ if ($resql)
|
||||
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||
|
||||
print '<td>'.dol_print_date($db->jdate($obj->datec), 'day').'</td>';
|
||||
print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
|
||||
print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@ -314,7 +315,7 @@ else dol_print_error($db);
|
||||
|
||||
|
||||
/*
|
||||
* Opened proposals
|
||||
* Open proposals
|
||||
*/
|
||||
if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||
{
|
||||
@ -381,9 +382,10 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
print '<td class="left">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>'."\n";
|
||||
|
||||
print '<td class="right">';
|
||||
print dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
|
||||
print '<td class="right">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
|
||||
|
||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||
|
||||
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>'."\n";
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
|
||||
@ -56,7 +56,7 @@ if (GETPOST('cancel', 'alpha') && !empty($backtopage))
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
||||
if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes')
|
||||
{
|
||||
//if ($user->rights->societe->creer)
|
||||
//if ($user->rights->facture->creer)
|
||||
@ -122,6 +122,8 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
||||
$newdiscount2->datec = $discount->datec;
|
||||
$newdiscount1->tva_tx = $discount->tva_tx;
|
||||
$newdiscount2->tva_tx = $discount->tva_tx;
|
||||
$newdiscount1->vat_src_code = $discount->vat_src_code;
|
||||
$newdiscount2->vat_src_code = $discount->vat_src_code;
|
||||
$newdiscount1->amount_ttc = $amount_ttc_1;
|
||||
$newdiscount2->amount_ttc = price2num($discount->amount_ttc - $newdiscount1->amount_ttc);
|
||||
$newdiscount1->amount_ht = price2num($newdiscount1->amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT');
|
||||
@ -129,6 +131,13 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
||||
$newdiscount1->amount_tva = price2num($newdiscount1->amount_ttc - $newdiscount1->amount_ht);
|
||||
$newdiscount2->amount_tva = price2num($newdiscount2->amount_ttc - $newdiscount2->amount_ht);
|
||||
|
||||
$newdiscount1->multicurrency_amount_ttc = $amount_ttc_1 * ($discount->multicurrency_amount_ttc / $discount->amount_ttc);
|
||||
$newdiscount2->multicurrency_amount_ttc = price2num($discount->multicurrency_amount_ttc - $newdiscount1->multicurrency_amount_ttc);
|
||||
$newdiscount1->multicurrency_amount_ht = price2num($newdiscount1->multicurrency_amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT');
|
||||
$newdiscount2->multicurrency_amount_ht = price2num($newdiscount2->multicurrency_amount_ttc / (1 + $newdiscount2->tva_tx / 100), 'MT');
|
||||
$newdiscount1->multicurrency_amount_tva = price2num($newdiscount1->multicurrency_amount_ttc - $newdiscount1->multicurrency_amount_ht);
|
||||
$newdiscount2->multicurrency_amount_tva = price2num($newdiscount2->multicurrency_amount_ttc - $newdiscount2->multicurrency_amount_ht);
|
||||
|
||||
$db->begin();
|
||||
$discount->fk_facture_source = 0; // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_facture_source
|
||||
// This is to delete only the require record (that we will recreate with two records) and not all family with same fk_invoice_supplier_source
|
||||
@ -154,12 +163,12 @@ if ($action == 'setremise' && $user->rights->societe->creer)
|
||||
//if ($user->rights->societe->creer)
|
||||
//if ($user->rights->facture->creer)
|
||||
|
||||
$amount_ht = GETPOST('amount_ht');
|
||||
$amount_ht = price2num(GETPOST('amount_ht', 'alpha'));
|
||||
$desc = GETPOST('desc', 'alpha');
|
||||
$tva_tx = GETPOST('tva_tx', 'alpha');
|
||||
$discount_type = !empty($_POST['discount_type']) ?GETPOST('discount_type', 'alpha') : 0;
|
||||
|
||||
if (price2num($amount_ht) > 0)
|
||||
if ($amount_ht > 0)
|
||||
{
|
||||
$error = 0;
|
||||
if (empty($desc))
|
||||
@ -196,7 +205,7 @@ if ($action == 'setremise' && $user->rights->societe->creer)
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldFormat", $langs->transnoentitiesnoconv("NewGlobalDiscount")), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldFormat", $langs->transnoentitiesnoconv("AmountHT")), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,10 +384,10 @@ if ($socid > 0)
|
||||
print '<span class="hideonsmartphone"> '.$langs->trans("Currency".$conf->currency).'</span></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("VAT").'</td>';
|
||||
print '<td>';
|
||||
print $form->load_tva('tva_tx', GETPOST('tva_tx'), $mysoc, $object);
|
||||
print $form->load_tva('tva_tx', GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : 0, $mysoc, $object, 0, 0, '', 0, 1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="fieldrequired" >'.$langs->trans("NoteReason").'</td>';
|
||||
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc', 'none').'"></td></tr>';
|
||||
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc', 'alphanohtml').'"></td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -409,7 +418,7 @@ if ($socid > 0)
|
||||
|
||||
|
||||
/*
|
||||
* List remises fixes client restant en cours (= liees a aucune facture ni ligne de facture)
|
||||
* List not consumed available credits (= linked to no invoice and no invoice line)
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("DiscountStillRemaining"));
|
||||
@ -421,7 +430,8 @@ if ($socid > 0)
|
||||
print load_fiche_titre($langs->trans("CustomerDiscounts"), '', '');
|
||||
}
|
||||
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||
$sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql .= " rc.datec as dc, rc.description,";
|
||||
$sql .= " rc.fk_facture_source,";
|
||||
$sql .= " u.login, u.rowid as user_id,";
|
||||
@ -510,7 +520,7 @@ if ($socid > 0)
|
||||
{
|
||||
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td class="right">'.vatrate($obj->tva_tx, true).'</td>';
|
||||
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
@ -577,7 +587,8 @@ if ($socid > 0)
|
||||
/*
|
||||
* Liste remises fixes fournisseur restant en cours (= liees a aucune facture ni ligne de facture)
|
||||
*/
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||
$sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql .= " rc.datec as dc, rc.description,";
|
||||
$sql .= " rc.fk_invoice_supplier_source,";
|
||||
$sql .= " u.login, u.rowid as user_id,";
|
||||
@ -666,7 +677,7 @@ if ($socid > 0)
|
||||
{
|
||||
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td class="right">'.vatrate($obj->tva_tx, true).'</td>';
|
||||
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
@ -744,7 +755,8 @@ if ($socid > 0)
|
||||
}
|
||||
|
||||
// Discount linked to invoice lines
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||
$sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture_source,";
|
||||
$sql .= " u.login, u.rowid as user_id,";
|
||||
$sql .= " f.rowid as invoiceid, f.ref,";
|
||||
@ -762,7 +774,7 @@ if ($socid > 0)
|
||||
$sql .= " ORDER BY dc DESC";
|
||||
//$sql.= " UNION ";
|
||||
// Discount linked to invoices
|
||||
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
|
||||
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||
$sql2 .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
|
||||
$sql2 .= " rc.fk_facture_source,";
|
||||
$sql2 .= " u.login, u.rowid as user_id,";
|
||||
@ -881,7 +893,7 @@ if ($socid > 0)
|
||||
{
|
||||
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td class="right">'.vatrate($obj->tva_tx, true).'</td>';
|
||||
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
@ -920,7 +932,8 @@ if ($socid > 0)
|
||||
}
|
||||
|
||||
// Discount linked to invoice lines
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||
$sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||
$sql .= " rc.fk_invoice_supplier_source,";
|
||||
$sql .= " u.login, u.rowid as user_id,";
|
||||
@ -939,7 +952,7 @@ if ($socid > 0)
|
||||
$sql .= " ORDER BY dc DESC";
|
||||
//$sql.= " UNION ";
|
||||
// Discount linked to invoices
|
||||
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
|
||||
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||
$sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||
$sql2 .= " rc.fk_invoice_supplier_source,";
|
||||
$sql2 .= " u.login, u.rowid as user_id,";
|
||||
@ -1057,7 +1070,7 @@ if ($socid > 0)
|
||||
{
|
||||
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td class="right">'.vatrate($obj->tva_tx, true).'</td>';
|
||||
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
|
||||
@ -385,7 +385,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used
|
||||
{
|
||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||
$lines[$i]->fetch_optionals();
|
||||
$array_options = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
@ -1362,7 +1362,7 @@ if (empty($reshook))
|
||||
$originLine = new $lineClassName($db);
|
||||
if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
|
||||
{
|
||||
$originLine->fetch_optionals($lineId);
|
||||
$originLine->fetch_optionals();
|
||||
$desc = $originLine->desc;
|
||||
$pu_ht = $originLine->subprice;
|
||||
$qty = $originLine->qty;
|
||||
@ -1549,7 +1549,7 @@ if ($action == 'create' && $usercancreate)
|
||||
$objectsrc->fetch_thirdparty();
|
||||
|
||||
// Replicate extrafields
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$objectsrc->fetch_optionals();
|
||||
$object->array_options = $objectsrc->array_options;
|
||||
|
||||
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
||||
@ -1602,7 +1602,7 @@ if ($action == 'create' && $usercancreate)
|
||||
}
|
||||
|
||||
print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
||||
print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
|
||||
@ -1741,7 +1741,7 @@ if ($action == 'create' && $usercancreate)
|
||||
$langs->load("projects");
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Project").'</td><td>';
|
||||
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0);
|
||||
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -2107,7 +2107,7 @@ if ($action == 'create' && $usercancreate)
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
@ -2184,7 +2184,7 @@ if ($action == 'create' && $usercancreate)
|
||||
print '</td><td>';
|
||||
if ($action == 'editdate') {
|
||||
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setdate">';
|
||||
print $form->selectDate($object->date, 'order_', '', '', '', "setdate");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
@ -2205,7 +2205,7 @@ if ($action == 'create' && $usercancreate)
|
||||
print '</td><td>';
|
||||
if ($action == 'editdate_livraison') {
|
||||
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setdate_livraison">';
|
||||
print $form->selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
@ -2499,7 +2499,7 @@ if ($action == 'create' && $usercancreate)
|
||||
$result = $object->getLinesArray();
|
||||
|
||||
print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id.'">';
|
||||
|
||||
@ -1381,7 +1381,7 @@ class Commande extends CommonOrder
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
// get extrafields from original line
|
||||
$object->fetch_optionals($object->id);
|
||||
$object->fetch_optionals();
|
||||
|
||||
$e = new ExtraFields($this->db);
|
||||
$element_extrafields = $e->fetch_name_optionals_label($this->table_element);
|
||||
@ -3613,7 +3613,7 @@ class Commande extends CommonOrder
|
||||
if ($status == self::STATUS_CANCELED) {
|
||||
$labelStatus = $langs->trans('StatusOrderCanceled');
|
||||
$labelStatusShort = $langs->trans('StatusOrderCanceledShort');
|
||||
$statusType = 'status5';
|
||||
$statusType = 'status9';
|
||||
}
|
||||
elseif ($status == self::STATUS_DRAFT) {
|
||||
$labelStatus = $langs->trans('StatusOrderDraft');
|
||||
@ -3628,7 +3628,7 @@ class Commande extends CommonOrder
|
||||
elseif ($status == self::STATUS_SHIPMENTONPROCESS) {
|
||||
$labelStatus = $langs->trans('StatusOrderSentShort').$billedtext;
|
||||
$labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext;
|
||||
$statusType = 'status3';
|
||||
$statusType = 'status4';
|
||||
}
|
||||
elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
|
||||
$labelStatus = $langs->trans('StatusOrderToBill');
|
||||
|
||||
@ -162,13 +162,13 @@ if ($resql)
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
|
||||
$result='';
|
||||
$link=$linkend='';
|
||||
$link = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php', 1).'?socid='.$obj->rowid.'">';
|
||||
$linkend='</a>';
|
||||
$name=$obj->name;
|
||||
$result.=($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend);
|
||||
$result.=$link.(dol_trunc($name, $maxlen)).$linkend;
|
||||
$result='';
|
||||
$link=$linkend='';
|
||||
$link = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php', 1).'?socid='.$obj->rowid.'">';
|
||||
$linkend='</a>';
|
||||
$name=$obj->name;
|
||||
$result.=($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend);
|
||||
$result.=$link.(dol_trunc($name, $maxlen)).$linkend;
|
||||
|
||||
print $result;
|
||||
print '</td>';
|
||||
|
||||
@ -72,7 +72,6 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
||||
{
|
||||
// Search customer orders
|
||||
$var = false;
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -88,7 +87,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
|
||||
* Statistics
|
||||
*/
|
||||
|
||||
$sql = "SELECT count(c.rowid), c.fk_statut";
|
||||
$sql = "SELECT count(c.rowid) as nb, c.fk_statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."commande as c";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -117,7 +116,7 @@ if ($resql)
|
||||
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
||||
{
|
||||
if (! isset($vals[$row[1]])) $vals[$row[1]]=0;
|
||||
$vals[$row[1].$bool]+=$row[0];
|
||||
$vals[$row[1]]+=$row[0];
|
||||
$totalinprocess+=$row[0];
|
||||
}
|
||||
$total+=$row[0];
|
||||
@ -125,13 +124,32 @@ if ($resql)
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</th></tr>'."\n";
|
||||
$listofstatus=array(0,1,2,3,-1);
|
||||
foreach ($listofstatus as $status)
|
||||
{
|
||||
$dataseries[]=array($commandestatic->LibStatut($status, $bool, 1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
|
||||
$dataseries[] = array($commandestatic->LibStatut($status, 0, 1, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||
if ($status == Commande::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
||||
if ($status == Commande::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
|
||||
if ($status == Commande::STATUS_SHIPMENTONPROCESS) $colorseries[$status] = $badgeStatus4;
|
||||
if ($status == Commande::STATUS_CLOSED && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) $colorseries[$status] = $badgeStatus6;
|
||||
if ($status == Commande::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) $colorseries[$status] = $badgeStatus6;
|
||||
if ($status == Commande::STATUS_CANCELED) $colorseries[$status] = $badgeStatus9;
|
||||
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$commandestatic->LibStatut($status, 0, 0, 1).'</td>';
|
||||
print '<td class="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status]) ? $vals[$status] : 0).' ';
|
||||
print $commandestatic->LibStatut($status, 0, 3, 1);
|
||||
print '</a></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
@ -140,6 +158,7 @@ if ($resql)
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$dolgraph = new DolGraph();
|
||||
$dolgraph->SetData($dataseries);
|
||||
$dolgraph->SetDataColor(array_values($colorseries));
|
||||
$dolgraph->setShowLegend(2);
|
||||
$dolgraph->setShowPercent(1);
|
||||
$dolgraph->SetType(array('pie'));
|
||||
@ -149,19 +168,6 @@ if ($resql)
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($listofstatus as $status)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$commandestatic->LibStatut($status, $bool, 0).'</td>';
|
||||
print '<td class="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool]) ? $vals[$status.$bool] : 0).' ';
|
||||
print $commandestatic->LibStatut($status, $bool, 3);
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
|
||||
print "</table></div><br>";
|
||||
@ -202,7 +208,6 @@ if (!empty($conf->commande->enabled))
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
@ -241,7 +246,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
$max = 5;
|
||||
|
||||
/*
|
||||
* Last modified orders
|
||||
* Lattest modified orders
|
||||
*/
|
||||
|
||||
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,";
|
||||
@ -272,7 +277,6 @@ if ($resql)
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
@ -311,7 +315,7 @@ if ($resql)
|
||||
print $companystatic->getNomUrl(1, 'company', 16);
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).'</td>';
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@ -320,13 +324,14 @@ if ($resql)
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
$max = 10;
|
||||
|
||||
/*
|
||||
* Orders to process
|
||||
*/
|
||||
if (!empty($conf->commande->enabled))
|
||||
{
|
||||
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
|
||||
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
|
||||
$sql .= ", s.client";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.canvas";
|
||||
@ -335,7 +340,7 @@ if (!empty($conf->commande->enabled))
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.entity IN (".getEntity('commande').")";
|
||||
$sql .= " AND c.fk_statut = 1";
|
||||
$sql .= " AND c.fk_statut = ".Commande::STATUS_VALIDATED;
|
||||
if ($socid) $sql .= " AND c.fk_soc = ".$socid;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " ORDER BY c.rowid DESC";
|
||||
@ -344,16 +349,16 @@ if (!empty($conf->commande->enabled))
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></th></tr>';
|
||||
print '<th colspan="4">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_VALIDATED.'"><span class="badge">'.$num.'</span></a></th></tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
while ($i < $num && $i < $max)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
@ -390,11 +395,16 @@ if (!empty($conf->commande->enabled))
|
||||
print $companystatic->getNomUrl(1, 'company', 24);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).'</td>';
|
||||
print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n";
|
||||
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
if ($i < $num) {
|
||||
print '<tr><td><span class="opacitymedium">'.$langs->trans("More").'...</span></td><td></td><td></td><td></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print "</table></div><br>";
|
||||
@ -403,11 +413,11 @@ if (!empty($conf->commande->enabled))
|
||||
}
|
||||
|
||||
/*
|
||||
* Orders thar are in a shipping process
|
||||
* Orders that are in process
|
||||
*/
|
||||
if (!empty($conf->commande->enabled))
|
||||
{
|
||||
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
|
||||
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
|
||||
$sql .= ", s.client";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.canvas";
|
||||
@ -416,7 +426,7 @@ if (!empty($conf->commande->enabled))
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.entity IN (".getEntity('commande').")";
|
||||
$sql .= " AND c.fk_statut = 2 ";
|
||||
$sql .= " AND c.fk_statut = ".Commande::STATUS_ACCEPTED;
|
||||
if ($socid) $sql .= " AND c.fk_soc = ".$socid;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " ORDER BY c.rowid DESC";
|
||||
@ -429,13 +439,12 @@ if (!empty($conf->commande->enabled))
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2"><span class="badge">'.$num.'</span></a></th></tr>';
|
||||
print '<th colspan="4">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_ACCEPTED.'"><span class="badge">'.$num.'</span></a></th></tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
while ($i < $num && $i < $max)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
@ -472,11 +481,16 @@ if (!empty($conf->commande->enabled))
|
||||
print $companystatic->getNomUrl(1, 'company');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).'</td>';
|
||||
print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n";
|
||||
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
if ($i < $num) {
|
||||
print '<tr><td><span class="opacitymedium">'.$langs->trans("More").'...</span></td><td></td><td></td><td></td></tr>';
|
||||
}
|
||||
}
|
||||
print "</table></div><br>";
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
|
||||
// Extrafields
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||
$lines[$i]->fetch_optionals();
|
||||
$array_options = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
|
||||
@ -363,7 +363,7 @@ if ($action == "create" || $action == "start" || $action == 'close')
|
||||
print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register');
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
||||
{
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
@ -680,7 +680,7 @@ if (empty($action) || $action == "view" || $action == "close")
|
||||
print '<center><iframe src="report.php?id='.$id.'" width="60%" height="800"></iframe></center>';
|
||||
} else {
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formclose">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
||||
{
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
@ -1680,7 +1680,7 @@ else
|
||||
|
||||
// Lines
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id.'">
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
@ -302,10 +302,12 @@ if (empty($reshook))
|
||||
$array_of_total_ht_per_vat_rate = array();
|
||||
$array_of_total_ht_devise_per_vat_rate = array();
|
||||
foreach ($object->lines as $line) {
|
||||
if (empty($array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
|
||||
if (empty($array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
|
||||
$array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->total_ht;
|
||||
$array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->multicurrency_total_ht;
|
||||
//$vat_src_code_for_line = $line->vat_src_code; // TODO We chek sign of total per vat without taking into account the vat code because for the moment the vat code is lost/unknown when we add a down payment.
|
||||
$vat_src_code_for_line = '';
|
||||
if (empty($array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line])) $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] = 0;
|
||||
if (empty($array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line])) $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] = 0;
|
||||
$array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] += $line->total_ht;
|
||||
$array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] += $line->multicurrency_total_ht;
|
||||
}
|
||||
|
||||
//var_dump($array_of_total_ht_per_vat_rate);exit;
|
||||
@ -485,10 +487,10 @@ if (empty($reshook))
|
||||
// POST[remise_id] or POST[remise_id_for_payment]
|
||||
|
||||
// We use the credit to reduce amount of invoice
|
||||
if (!empty($_POST["remise_id"])) {
|
||||
if (GETPOST("remise_id", 'int') > 0) {
|
||||
$ret = $object->fetch($id);
|
||||
if ($ret > 0) {
|
||||
$result = $object->insert_discount($_POST["remise_id"]);
|
||||
$result = $object->insert_discount(GETPOST("remise_id", 'int'));
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@ -497,11 +499,11 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
// We use the credit to reduce remain to pay
|
||||
if (!empty($_POST["remise_id_for_payment"]))
|
||||
if (GETPOST("remise_id_for_payment", 'int') > 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
$discount = new DiscountAbsolute($db);
|
||||
$discount->fetch($_POST["remise_id_for_payment"]);
|
||||
$discount->fetch(GETPOST("remise_id_for_payment", 'int'));
|
||||
|
||||
//var_dump($object->getRemainToPay(0));
|
||||
//var_dump($discount->amount_ttc);exit;
|
||||
@ -809,14 +811,16 @@ if (empty($reshook))
|
||||
$i = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9
|
||||
{ // no need to create discount if amount is null
|
||||
$amount_ht[$line->tva_tx] += $line->total_ht;
|
||||
$amount_tva[$line->tva_tx] += $line->total_tva;
|
||||
$amount_ttc[$line->tva_tx] += $line->total_ttc;
|
||||
$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
|
||||
$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
|
||||
$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
|
||||
if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9 and no need to create discount if amount is null
|
||||
{
|
||||
$keyforvatrate = $line->tva_tx.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : '');
|
||||
|
||||
$amount_ht[$keyforvatrate] += $line->total_ht;
|
||||
$amount_tva[$keyforvatrate] += $line->total_tva;
|
||||
$amount_ttc[$keyforvatrate] += $line->total_ttc;
|
||||
$multicurrency_amount_ht[$keyforvatrate] += $line->multicurrency_total_ht;
|
||||
$multicurrency_amount_tva[$keyforvatrate] += $line->multicurrency_total_tva;
|
||||
$multicurrency_amount_ttc[$keyforvatrate] += $line->multicurrency_total_ttc;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -830,9 +834,9 @@ if (empty($reshook))
|
||||
$amount_ht[$vatrate] = price2num($amount_ht[$vatrate] * $ratio, 'MU');
|
||||
$amount_tva[$vatrate] = price2num($amount_tva[$vatrate] * $ratio, 'MU');
|
||||
$amount_ttc[$vatrate] = price2num($amount_ttc[$vatrate] * $ratio, 'MU');
|
||||
$multicurrency_amount_ht[$line->tva_tx] = price2num($multicurrency_amount_ht[$vatrate] * $ratio, 'MU');
|
||||
$multicurrency_amount_tva[$line->tva_tx] = price2num($multicurrency_amount_tva[$vatrate] * $ratio, 'MU');
|
||||
$multicurrency_amount_ttc[$line->tva_tx] = price2num($multicurrency_amount_ttc[$vatrate] * $ratio, 'MU');
|
||||
$multicurrency_amount_ht[$vatrate] = price2num($multicurrency_amount_ht[$vatrate] * $ratio, 'MU');
|
||||
$multicurrency_amount_tva[$vatrate] = price2num($multicurrency_amount_tva[$vatrate] * $ratio, 'MU');
|
||||
$multicurrency_amount_ttc[$vatrate] = price2num($multicurrency_amount_ttc[$vatrate] * $ratio, 'MU');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -887,6 +891,7 @@ if (empty($reshook))
|
||||
$discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
|
||||
$discount->amount_tva = 0;
|
||||
$discount->tva_tx = 0;
|
||||
$discount->vat_src_code = '';
|
||||
|
||||
$result = $discount->create($user);
|
||||
if ($result < 0)
|
||||
@ -904,7 +909,18 @@ if (empty($reshook))
|
||||
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
|
||||
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
|
||||
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
|
||||
|
||||
// Clean vat code
|
||||
$reg = array();
|
||||
$vat_src_code = '';
|
||||
if (preg_match('/\((.*)\)/', $tva_tx, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
$tva_tx = preg_replace('/\s*\(.*\)/', '', $tva_tx); // Remove code into vatrate.
|
||||
}
|
||||
|
||||
$discount->tva_tx = abs($tva_tx);
|
||||
$discount->vat_src_code =$vat_src_code;
|
||||
|
||||
$result = $discount->create($user);
|
||||
if ($result < 0)
|
||||
@ -1592,7 +1608,7 @@ if (empty($reshook))
|
||||
|
||||
// Extrafields
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||
$lines[$i]->fetch_optionals();
|
||||
$array_options = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
@ -1733,7 +1749,7 @@ if (empty($reshook))
|
||||
$line->origin = $object->origin;
|
||||
$line->origin_id = $line->id;
|
||||
$line->fk_prev_id = $line->id;
|
||||
$line->fetch_optionals($line->id);
|
||||
$line->fetch_optionals();
|
||||
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
|
||||
|
||||
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
|
||||
@ -2539,7 +2555,7 @@ if (empty($reshook))
|
||||
$originLine = new $lineClassName($db);
|
||||
if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
|
||||
{
|
||||
$originLine->fetch_optionals($lineId);
|
||||
$originLine->fetch_optionals();
|
||||
$desc = $originLine->desc;
|
||||
$pu_ht = $originLine->subprice;
|
||||
$qty = $originLine->qty;
|
||||
@ -2794,7 +2810,7 @@ if ($action == 'create')
|
||||
$remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
|
||||
|
||||
//Replicate extrafields
|
||||
$expesrc->fetch_optionals($expeoriginid);
|
||||
$expesrc->fetch_optionals();
|
||||
$object->array_options = $expesrc->array_options;
|
||||
}
|
||||
else
|
||||
@ -2812,7 +2828,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Replicate extrafields
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$objectsrc->fetch_optionals();
|
||||
$object->array_options = $objectsrc->array_options;
|
||||
}
|
||||
}
|
||||
@ -2854,7 +2870,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
if ($soc->id > 0) print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
||||
print '<input name="ref" type="hidden" value="provisoire">';
|
||||
@ -3397,7 +3413,7 @@ if ($action == 'create')
|
||||
{
|
||||
$langs->load('projects');
|
||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
||||
$numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1);
|
||||
$numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -4459,7 +4475,7 @@ elseif ($id > 0 || !empty($ref))
|
||||
print '</td><td>';
|
||||
if ($action == 'editrevenuestamp') {
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setrevenuestamp">';
|
||||
print '<input type="hidden" name="revenuestamp" id="revenuestamp_val" value="'.price2num($object->revenuestamp).'">';
|
||||
print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code);
|
||||
@ -4963,7 +4979,7 @@ elseif ($id > 0 || !empty($ref))
|
||||
}
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id.'">
|
||||
|
||||
@ -677,7 +677,7 @@ class FactureRec extends CommonInvoice
|
||||
$line->price = $objp->price;
|
||||
$line->remise = $objp->remise;
|
||||
|
||||
$line->fetch_optionals($line->id);
|
||||
$line->fetch_optionals();
|
||||
|
||||
// Multicurrency
|
||||
$line->fk_multicurrency = $objp->fk_multicurrency;
|
||||
|
||||
@ -1317,7 +1317,7 @@ class Facture extends CommonInvoice
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
// get extrafields from original line
|
||||
$object->fetch_optionals($object->id);
|
||||
$object->fetch_optionals();
|
||||
foreach ($object->array_options as $options_key => $value)
|
||||
$this->array_options[$options_key] = $value;
|
||||
|
||||
@ -1652,8 +1652,8 @@ class Facture extends CommonInvoice
|
||||
$this->lines = array();
|
||||
|
||||
$sql = 'SELECT l.rowid, l.fk_facture, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,';
|
||||
$sql .= ' l.situation_percent, l.fk_prev_id,';
|
||||
$sql .= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,';
|
||||
$sql .= ' l.situation_percent, l.fk_prev_id,';
|
||||
$sql .= ' l.rang, l.special_code,';
|
||||
$sql .= ' l.date_start as date_start, l.date_end as date_end,';
|
||||
$sql .= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,';
|
||||
@ -3076,6 +3076,7 @@ class Facture extends CommonInvoice
|
||||
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
||||
|
||||
// Clean vat code
|
||||
$reg = array();
|
||||
$vat_src_code = '';
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
|
||||
@ -348,7 +348,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$sql .= " GROUP BY f.rowid, f.ref, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
|
||||
$sql .= " s.nom, s.rowid, s.code_client, s.code_compta, s.email,";
|
||||
$sql .= " cc.rowid, cc.code";
|
||||
$sql .= " ORDER BY f.tms DESC ";
|
||||
$sql .= " ORDER BY f.tms DESC";
|
||||
$sql .= $db->plimit($max, 0);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -54,15 +54,15 @@ $sql.= " AND pb.entity = ".$conf->entity;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ( $num > 0 )
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
$total = $row[0];
|
||||
$nbtotal = $row[1];
|
||||
}
|
||||
if ( $num > 0 )
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
$total = $row[0];
|
||||
$nbtotal = $row[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -150,15 +150,15 @@ $sql.= " AND pl.statut = 3";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ( $num > 0 )
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
$total = $row[0];
|
||||
$nbtotal = $row[1];
|
||||
}
|
||||
if ( $num > 0 )
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
$total = $row[0];
|
||||
$nbtotal = $row[1];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -51,10 +51,10 @@ $object = new ChargeSociales($db);
|
||||
|
||||
if ($action == 'setlib' && $user->rights->tax->charges->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$object->fetch($id);
|
||||
$result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
@ -84,17 +84,17 @@ $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' : ';
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
$morehtmlref.=$proj->ref;
|
||||
$morehtmlref.='</a>';
|
||||
} else {
|
||||
$morehtmlref.='';
|
||||
}
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' : ';
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
$morehtmlref.=$proj->ref;
|
||||
$morehtmlref.='</a>';
|
||||
} else {
|
||||
$morehtmlref.='';
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
@ -80,9 +80,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -95,9 +95,9 @@ if ($action != 'create' && $action != 'edit')
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<br><div name="topofform" id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -108,9 +108,9 @@ if ($action == 'create')
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print '<div name="topofform"></div><br>';
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -80,9 +80,9 @@ dol_fiche_end();
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ if ($action == 'create')
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -107,10 +107,10 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -317,7 +317,7 @@ if (empty($reshook))
|
||||
$array_options = array();
|
||||
// For avoid conflicts if trigger used
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||
$lines[$i]->fetch_optionals();
|
||||
$array_options = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
@ -1128,12 +1128,12 @@ if ($action == 'create')
|
||||
|
||||
$classname = ucfirst($subelement);
|
||||
$objectsrc = new $classname($db);
|
||||
$objectsrc->fetch(GETPOST('originid'));
|
||||
$objectsrc->fetch($originid);
|
||||
if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) $objectsrc->fetch_lines();
|
||||
$objectsrc->fetch_thirdparty();
|
||||
|
||||
// Replicate extrafields
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$objectsrc->fetch_optionals();
|
||||
$object->array_options = $objectsrc->array_options;
|
||||
|
||||
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
||||
@ -1703,7 +1703,8 @@ else
|
||||
// Display lines extrafields
|
||||
if (is_array($extralabelslines) && count($extralabelslines) > 0) {
|
||||
$line = new ContratLigne($db);
|
||||
$line->fetch_optionals($objp->rowid);
|
||||
$line->id = $objp->rowid;
|
||||
$line->fetch_optionals();
|
||||
print $line->showOptionals($extrafields, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1);
|
||||
}
|
||||
}
|
||||
@ -1793,7 +1794,8 @@ else
|
||||
|
||||
if (is_array($extralabelslines) && count($extralabelslines) > 0) {
|
||||
$line = new ContratLigne($db);
|
||||
$line->fetch_optionals($objp->rowid);
|
||||
$line->id = $objp->rowid;
|
||||
$line->fetch_optionals();
|
||||
print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2785,7 +2785,7 @@ class ContratLigne extends CommonObjectLine
|
||||
elseif ($status == self::STATUS_CLOSED) { $labelStatus = $langs->trans("ServiceStatusClosed"); $labelStatusShort = $langs->trans("ServiceStatusClosed"); }
|
||||
|
||||
$statusType = 'status'.$status;
|
||||
if ($status == self::STATUS_OPEN && $expired == 1) $statusType = 'status3';
|
||||
if ($status == self::STATUS_OPEN && $expired == 1) $statusType = 'status1';
|
||||
if ($status == self::STATUS_CLOSED) $statusType = 'status6';
|
||||
|
||||
$params = array(); $reg = array();
|
||||
|
||||
@ -109,7 +109,7 @@ $dataseries = array();
|
||||
$vals = array();
|
||||
|
||||
// Search by status (except expired)
|
||||
$sql = "SELECT count(cd.rowid), cd.statut";
|
||||
$sql = "SELECT count(cd.rowid) as nb, cd.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -126,16 +126,16 @@ if ($resql)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row)
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
$nb[$row[1]] = $row[0];
|
||||
if ($row[1] != 5)
|
||||
$nb[$obj->status] = $obj->nb;
|
||||
if ($obj->status != 5)
|
||||
{
|
||||
$vals[$row[1]] = $row[0];
|
||||
$totalinprocess += $row[0];
|
||||
$vals[$obj->status] = $obj->nb;
|
||||
$totalinprocess += $obj->nb;
|
||||
}
|
||||
$total += $row[0];
|
||||
$total += $obj->nb;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@ -146,7 +146,7 @@ else
|
||||
dol_print_error($db);
|
||||
}
|
||||
// Search by status (only expired)
|
||||
$sql = "SELECT count(cd.rowid), cd.statut";
|
||||
$sql = "SELECT count(cd.rowid) as nb, cd.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -165,16 +165,16 @@ if ($resql)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row)
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
$nb[$row[1].true] = $row[0];
|
||||
if ($row[1] != 5)
|
||||
$nb[$obj->status.true] = $obj->nb;
|
||||
if ($obj->status != 5)
|
||||
{
|
||||
$vals[$row[1]] = $row[0];
|
||||
$totalinprocess += $row[0];
|
||||
$vals[$obj->status.true] = $obj->nb;
|
||||
$totalinprocess += $obj->nb;
|
||||
}
|
||||
$total += $row[0];
|
||||
$total += $obj->nb;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@ -185,6 +185,10 @@ else
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$colorseries = array();
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Services").'</th></tr>'."\n";
|
||||
@ -192,6 +196,11 @@ $listofstatus = array(0, 4, 4, 5); $bool = false;
|
||||
foreach ($listofstatus as $status)
|
||||
{
|
||||
$dataseries[] = array($staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)), (isset($nb[$status.$bool]) ? (int) $nb[$status.$bool] : 0));
|
||||
if ($status == ContratLigne::STATUS_INITIAL) $colorseries[$status.$bool] = '-'.$badgeStatus0;
|
||||
if ($status == ContratLigne::STATUS_OPEN && !$bool) $colorseries[$status.$bool] = $badgeStatus4;
|
||||
if ($status == ContratLigne::STATUS_OPEN && $bool) $colorseries[$status.$bool] = $badgeStatus1;
|
||||
if ($status == ContratLigne::STATUS_CLOSED) $colorseries[$status.$bool] = $badgeStatus6;
|
||||
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
@ -209,6 +218,7 @@ if (!empty($conf->use_javascript_ajax))
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$dolgraph = new DolGraph();
|
||||
$dolgraph->SetData($dataseries);
|
||||
$dolgraph->SetDataColor(array_values($colorseries));
|
||||
$dolgraph->setShowLegend(2);
|
||||
$dolgraph->setShowPercent(1);
|
||||
$dolgraph->SetType(array('pie'));
|
||||
|
||||
@ -32,9 +32,9 @@ $addlinkid = GETPOST('idtolinkto', 'int');
|
||||
// Link invoice to order
|
||||
if ($action == 'addlink' && ! empty($permissiondellink) && ! GETPOST('cancel', 'alpha') && $id > 0 && $addlinkid > 0)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
$result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid);
|
||||
$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
$result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid);
|
||||
}
|
||||
|
||||
// Delete link
|
||||
|
||||
@ -744,7 +744,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
|
||||
|
||||
// Extrafields
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||
$lines[$i]->fetch_optionals();
|
||||
$array_options = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
|
||||
@ -29,63 +29,63 @@
|
||||
|
||||
// Print file
|
||||
if ($action == 'print_file' && $user->rights->printing->read) {
|
||||
$langs->load("printing");
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php';
|
||||
$objectprint = new PrintingDriver($db);
|
||||
$list = $objectprint->listDrivers($db, 10);
|
||||
if (! empty($list)) {
|
||||
$errorprint=0;
|
||||
$printerfound=0;
|
||||
foreach ($list as $driver) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
|
||||
$langs->load($driver);
|
||||
$classname = 'printing_'.$driver;
|
||||
$printer = new $classname($db);
|
||||
//print '<pre>'.print_r($printer, true).'</pre>';
|
||||
$langs->load("printing");
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php';
|
||||
$objectprint = new PrintingDriver($db);
|
||||
$list = $objectprint->listDrivers($db, 10);
|
||||
if (! empty($list)) {
|
||||
$errorprint=0;
|
||||
$printerfound=0;
|
||||
foreach ($list as $driver) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
|
||||
$langs->load($driver);
|
||||
$classname = 'printing_'.$driver;
|
||||
$printer = new $classname($db);
|
||||
//print '<pre>'.print_r($printer, true).'</pre>';
|
||||
|
||||
if (! empty($conf->global->{$printer->active}))
|
||||
{
|
||||
$printerfound++;
|
||||
if (! empty($conf->global->{$printer->active}))
|
||||
{
|
||||
$printerfound++;
|
||||
|
||||
$subdir='';
|
||||
$module = GETPOST('printer', 'alpha');
|
||||
switch ($module )
|
||||
{
|
||||
case 'livraison' :
|
||||
$subdir = 'receipt';
|
||||
$module = 'expedition';
|
||||
break;
|
||||
case 'expedition' :
|
||||
$subdir = 'sending';
|
||||
break;
|
||||
case 'commande_fournisseur' :
|
||||
$module = 'fournisseur';
|
||||
$subdir = 'commande';
|
||||
break;
|
||||
}
|
||||
try {
|
||||
$ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir);
|
||||
if ($ret > 0) {
|
||||
//print '<pre>'.print_r($printer->errors, true).'</pre>';
|
||||
setEventMessages($printer->error, $printer->errors, 'errors');
|
||||
}
|
||||
if ($ret==0)
|
||||
{
|
||||
//print '<pre>'.print_r($printer->errors, true).'</pre>';
|
||||
setEventMessages($printer->error, $printer->errors);
|
||||
setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null);
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
$ret = 1;
|
||||
setEventMessages($e->getMessage(), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings');
|
||||
} else {
|
||||
setEventMessages($langs->trans("NoModuleFound"), null, 'warnings');
|
||||
}
|
||||
$action = '';
|
||||
$subdir='';
|
||||
$module = GETPOST('printer', 'alpha');
|
||||
switch ($module )
|
||||
{
|
||||
case 'livraison' :
|
||||
$subdir = 'receipt';
|
||||
$module = 'expedition';
|
||||
break;
|
||||
case 'expedition' :
|
||||
$subdir = 'sending';
|
||||
break;
|
||||
case 'commande_fournisseur' :
|
||||
$module = 'fournisseur';
|
||||
$subdir = 'commande';
|
||||
break;
|
||||
}
|
||||
try {
|
||||
$ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir);
|
||||
if ($ret > 0) {
|
||||
//print '<pre>'.print_r($printer->errors, true).'</pre>';
|
||||
setEventMessages($printer->error, $printer->errors, 'errors');
|
||||
}
|
||||
if ($ret==0)
|
||||
{
|
||||
//print '<pre>'.print_r($printer->errors, true).'</pre>';
|
||||
setEventMessages($printer->error, $printer->errors);
|
||||
setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null);
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
$ret = 1;
|
||||
setEventMessages($e->getMessage(), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings');
|
||||
} else {
|
||||
setEventMessages($langs->trans("NoModuleFound"), null, 'warnings');
|
||||
}
|
||||
$action = '';
|
||||
}
|
||||
|
||||
@ -60,8 +60,8 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel', 'alpha')) {
|
||||
// Set public note
|
||||
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
|
||||
// Set public note
|
||||
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
|
||||
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES), '_private');
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
||||
@ -51,46 +51,46 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
|
||||
{
|
||||
// Increase date
|
||||
$al = new AccountLine($db);
|
||||
$al->datev_next(GETPOST('rowid', 'int'));
|
||||
$al->fetch(GETPOST('rowid', 'int'));
|
||||
$al->datev_next(GETPOST('rowid', 'int'));
|
||||
$al->fetch(GETPOST('rowid', 'int'));
|
||||
|
||||
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
|
||||
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
|
||||
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
|
||||
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev')
|
||||
{
|
||||
// Decrease date
|
||||
$al =new AccountLine($db);
|
||||
$al->datev_previous(GETPOST('rowid', 'int'));
|
||||
$al->fetch(GETPOST('rowid', 'int'));
|
||||
$al->datev_previous(GETPOST('rowid', 'int'));
|
||||
$al->fetch(GETPOST('rowid', 'int'));
|
||||
|
||||
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
|
||||
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
|
||||
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
|
||||
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext')
|
||||
{
|
||||
// Increase date
|
||||
$al = new AccountLine($db);
|
||||
$al->dateo_next(GETPOST('rowid', 'int'));
|
||||
$al->fetch(GETPOST('rowid', 'int'));
|
||||
$al->dateo_next(GETPOST('rowid', 'int'));
|
||||
$al->fetch(GETPOST('rowid', 'int'));
|
||||
|
||||
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
|
||||
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
|
||||
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
|
||||
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev')
|
||||
{
|
||||
// Decrease date
|
||||
$al =new AccountLine($db);
|
||||
$al->dateo_previous(GETPOST('rowid', 'int'));
|
||||
$al->fetch(GETPOST('rowid', 'int'));
|
||||
$al->dateo_previous(GETPOST('rowid', 'int'));
|
||||
$al->fetch(GETPOST('rowid', 'int'));
|
||||
|
||||
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
|
||||
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
|
||||
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -53,23 +53,23 @@ header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');
|
||||
switch ($_SERVER['REQUEST_METHOD']) {
|
||||
case 'OPTIONS':
|
||||
break;
|
||||
case 'HEAD':
|
||||
case 'GET':
|
||||
$upload_handler->get();
|
||||
break;
|
||||
case 'POST':
|
||||
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
|
||||
$upload_handler->delete();
|
||||
} else {
|
||||
$upload_handler->post();
|
||||
}
|
||||
break;
|
||||
case 'DELETE':
|
||||
$upload_handler->delete();
|
||||
break;
|
||||
default:
|
||||
header('HTTP/1.0 405 Method Not Allowed');
|
||||
exit;
|
||||
case 'HEAD':
|
||||
case 'GET':
|
||||
$upload_handler->get();
|
||||
break;
|
||||
case 'POST':
|
||||
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
|
||||
$upload_handler->delete();
|
||||
} else {
|
||||
$upload_handler->post();
|
||||
}
|
||||
break;
|
||||
case 'DELETE':
|
||||
$upload_handler->delete();
|
||||
break;
|
||||
default:
|
||||
header('HTTP/1.0 405 Method Not Allowed');
|
||||
exit;
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -68,4 +68,4 @@ else
|
||||
|
||||
// Registering new values
|
||||
if (($action == 'set') && ! empty($id))
|
||||
$object->setValueFrom($field, $value, $element, $id);
|
||||
$object->setValueFrom($field, $value, $element, $id);
|
||||
|
||||
@ -44,8 +44,8 @@ if (isset($_GET['action']) && ! empty($_GET['action']))
|
||||
{
|
||||
if ($_GET['action'] == 'getrandompassword' && $user->admin)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
$generic = $_GET['generic'] ? true : false;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
$generic = $_GET['generic'] ? true : false;
|
||||
echo getRandomPassword($generic);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,36 +62,36 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
|
||||
|
||||
if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table
|
||||
{
|
||||
$sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country";
|
||||
$sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country";
|
||||
$sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."c_country as c";
|
||||
$sql.= " WHERE z.fk_pays = c.rowid";
|
||||
$sql.= " AND z.active = 1 AND c.active = 1";
|
||||
if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'";
|
||||
if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'";
|
||||
$sql.= " ORDER BY z.zip, z.town";
|
||||
$sql.= $db->plimit(100); // Avoid pb with bad criteria
|
||||
$sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country";
|
||||
$sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country";
|
||||
$sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."c_country as c";
|
||||
$sql.= " WHERE z.fk_pays = c.rowid";
|
||||
$sql.= " AND z.active = 1 AND c.active = 1";
|
||||
if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'";
|
||||
if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'";
|
||||
$sql.= " ORDER BY z.zip, z.town";
|
||||
$sql.= $db->plimit(100); // Avoid pb with bad criteria
|
||||
}
|
||||
else // Use table of third parties
|
||||
{
|
||||
$sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country";
|
||||
$sql.= ", c.code as country_code, c.label as country";
|
||||
$sql.= ", d.code_departement as county_code , d.nom as county";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'societe as s';
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
|
||||
$sql.= " WHERE";
|
||||
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
|
||||
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";
|
||||
$sql.= " ORDER BY s.fk_pays, s.zip, s.town";
|
||||
$sql.= $db->plimit(100); // Avoid pb with bad criteria
|
||||
$sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country";
|
||||
$sql.= ", c.code as country_code, c.label as country";
|
||||
$sql.= ", d.code_departement as county_code , d.nom as county";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'societe as s';
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
|
||||
$sql.= " WHERE";
|
||||
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
|
||||
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";
|
||||
$sql.= " ORDER BY s.fk_pays, s.zip, s.town";
|
||||
$sql.= $db->plimit(100); // Avoid pb with bad criteria
|
||||
}
|
||||
|
||||
//print $sql;
|
||||
//print $sql;
|
||||
$resql=$db->query($sql);
|
||||
//var_dump($db);
|
||||
if ($resql)
|
||||
@ -103,11 +103,11 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
|
||||
|
||||
$row_array['label'] = $row['zip'].' '.$row['town'];
|
||||
$row_array['label'] .= ($county || $country)?' (':'';
|
||||
$row_array['label'] .= $county;
|
||||
$row_array['label'] .= $county;
|
||||
$row_array['label'] .= ($county && $country?' - ':'');
|
||||
$row_array['label'] .= $country;
|
||||
$row_array['label'] .= ($county || $country)?')':'';
|
||||
if ($zipcode)
|
||||
$row_array['label'] .= $country;
|
||||
$row_array['label'] .= ($county || $country)?')':'';
|
||||
if ($zipcode)
|
||||
{
|
||||
$row_array['value'] = $row['zip'];
|
||||
$row_array['town'] = $row['town'];
|
||||
|
||||
@ -43,7 +43,7 @@ $number = strlen($letters);
|
||||
$string = '';
|
||||
for($i = 0; $i < $length; $i++)
|
||||
{
|
||||
$string .= $letters{mt_rand(0, $number - 1)};
|
||||
$string .= $letters{mt_rand(0, $number - 1)};
|
||||
}
|
||||
//print $string;
|
||||
|
||||
@ -54,8 +54,8 @@ $_SESSION[$sessionkey]=$string;
|
||||
$img = imagecreate(80, 32);
|
||||
if (empty($img))
|
||||
{
|
||||
dol_print_error('', "Problem with GD creation");
|
||||
exit;
|
||||
dol_print_error('', "Problem with GD creation");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Define mime type
|
||||
|
||||
@ -95,7 +95,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
* This does not include open direct debit requests.
|
||||
*
|
||||
* @param int $multicurrency Return multicurrency_amount instead of amount
|
||||
* @return double Remain of amount to pay
|
||||
* @return double Remain of amount to pay
|
||||
*/
|
||||
public function getRemainToPay($multicurrency = 0)
|
||||
{
|
||||
@ -104,7 +104,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
$alreadypaid+=$this->getSumDepositsUsed($multicurrency);
|
||||
$alreadypaid+=$this->getSumCreditNotesUsed($multicurrency);
|
||||
|
||||
$remaintopay = ($this->total_ttc - $alreadypaid);
|
||||
$remaintopay = price2num($this->total_ttc - $alreadypaid, 'MT');
|
||||
if ($this->statut == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment
|
||||
$remaintopay = 0;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user