forked from Wavyzz/dolibarr
Merge branch 'develop' into commercial-name
Conflicts: htdocs/categories/categorie.php htdocs/comm/prospect/list.php
This commit is contained in:
30
ChangeLog
30
ChangeLog
@@ -6,7 +6,7 @@ WARNING: Do not try to make any Dolibarr upgrade if you are running Mysql versio
|
||||
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
|
||||
You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
|
||||
Upgrading to any other version or any other database system is abolutely required BEFORE trying
|
||||
to make a migration.
|
||||
make a Dolibarr upgrade.
|
||||
|
||||
|
||||
***** ChangeLog for 3.8 compared to 3.7.* *****
|
||||
@@ -48,6 +48,18 @@ Dolibarr better:
|
||||
- Fix: [ Bug #2714 ] Members -> Memberxy-> Agenda -> technical Error
|
||||
- Fix: [ Bug #2713 ] 3.7.0 mailing-unsubscribe.php not unsubscribe
|
||||
|
||||
- Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose
|
||||
your photo on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to
|
||||
restore old path.
|
||||
|
||||
WARNING:
|
||||
|
||||
Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
|
||||
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
|
||||
You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
|
||||
Upgrading to any other version or database system is abolutely required BEFORE trying to
|
||||
make a Dolibarr upgrade.
|
||||
|
||||
***** ChangeLog for 3.7 compared to 3.6.* *****
|
||||
For users:
|
||||
- New: Match other auth system: Login can be done entering login or user
|
||||
@@ -203,9 +215,19 @@ For developers:
|
||||
- Qual: Replace all constants ACCOUNTINGEX_* by ACCOUNTING_* to simplify migration of the module
|
||||
- Fix: [ bug #1724 ] Can't add a submenu to projects
|
||||
|
||||
WARNING:
|
||||
|
||||
Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
|
||||
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
|
||||
You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
|
||||
Upgrading to any other version or database system is abolutely required BEFORE trying to
|
||||
make a Dolibarr upgrade.
|
||||
|
||||
WARNING: Following changes may create regression for some external modules, but was necessary to make
|
||||
Dolibarr better:
|
||||
|
||||
- Path to save photos of products was moved to match path of other attached files. If you had loose your photo
|
||||
on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to restore old path.
|
||||
- If you can't see trips and expenses records, check that you have the new permission "read all
|
||||
trips and expenses".
|
||||
- Deprecated module "oscommerce" were removed.
|
||||
@@ -217,8 +239,9 @@ Dolibarr better:
|
||||
- A lot of pages called fiche.php were renamed into card.php
|
||||
- A lot of pages called liste.php were renamed into list.php
|
||||
- If you used warehouse/stock module, recheck setup of stock increase/decrease rules of the
|
||||
warehouse module and your Point Of Sale module if you use one.
|
||||
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook
|
||||
warehouse module and your Point Of Sale module setup if you use one.
|
||||
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
|
||||
|
||||
|
||||
***** ChangeLog for 3.6.3 compared to 3.6.2 *****
|
||||
- Fix: ref_ext was not saved when recording a customer order from web service
|
||||
@@ -429,6 +452,7 @@ Fix: [ bug #2583 ] Unable to create a bank transfer with localized numbers
|
||||
Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a project
|
||||
Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref
|
||||
Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null
|
||||
Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error
|
||||
|
||||
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
|
||||
Fix: Avoid missing class error for fetch_thirdparty method #1973
|
||||
|
||||
@@ -3,4 +3,4 @@ dolibarr (3.8.0-3) UNRELEASED; urgency=low
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* New upstream release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Sun, 21 March 2015 12:00:00 +0100
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 12 May 2015 12:00:00 +0100
|
||||
|
||||
@@ -32,7 +32,7 @@ AppPublisherURL=http://www.nltechno.com
|
||||
AppSupportURL=http://www.dolibarr.org
|
||||
AppUpdatesURL=http://www.dolibarr.org
|
||||
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
|
||||
AppCopyright=Copyright (C) 2008-2014 Laurent Destailleur, NLTechno
|
||||
AppCopyright=Copyright (C) 2008-2015 Laurent Destailleur, NLTechno
|
||||
DefaultDirName=c:\dolibarr
|
||||
DefaultGroupName=Dolibarr
|
||||
;LicenseFile=COPYING
|
||||
@@ -108,7 +108,7 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m
|
||||
; 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"
|
||||
; Dolibarr
|
||||
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,nltechno*\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
|
||||
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
|
||||
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
|
||||
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
|
||||
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"
|
||||
|
||||
@@ -676,6 +676,11 @@ if ($nboftargetok) {
|
||||
if ($target =~ /MAND/i) { $BUILDFICSRC="${FILENAME}_mandriva.spec"; }
|
||||
if ($target =~ /OPEN/i) { $BUILDFICSRC="${FILENAME}_opensuse.spec"; }
|
||||
|
||||
use Date::Language;
|
||||
$lang=Date::Language->new('English');
|
||||
$datestring = $lang->time2str("%a %b %e %Y", time);
|
||||
$changelogstring="* ".$datestring." Laurent Destailleur $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n- Upstream release\n";
|
||||
|
||||
print "Generate file $BUILDROOT/$BUILDFIC from $SOURCE/build/rpm/${BUILDFICSRC}\n";
|
||||
open (SPECFROM,"<$SOURCE/build/rpm/${BUILDFICSRC}") || die "Error";
|
||||
open (SPECTO,">$BUILDROOT/$BUILDFIC") || die "Error";
|
||||
@@ -683,6 +688,7 @@ if ($nboftargetok) {
|
||||
$_ =~ s/__FILENAMETGZ__/$FILENAMETGZ/;
|
||||
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/;
|
||||
$_ =~ s/__RELEASE__/$RPMSUBVERSION/;
|
||||
$_ =~ s/__CHANGELOGSTRING__/$changelogstring/;
|
||||
print SPECTO $_;
|
||||
}
|
||||
close SPECFROM;
|
||||
|
||||
@@ -11,7 +11,6 @@ beta version of Dolibarr, step by step.
|
||||
- Update version/info in ChangeLog. To generate a changelog, you can do "git log `git merge-base x.y origin/develop`..x.y --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -i -e '^FIX\|NEW'"
|
||||
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
|
||||
- Update version number with x.y.z-w in build/debian/changelog
|
||||
- Update version number with x.y.z-w in build/rpm/*.spec
|
||||
- Commit all changes.
|
||||
- Add a Tag (x.y.betaz_YYYYMMDD) and push it: git push --tags
|
||||
- Create a branch (x.y).
|
||||
@@ -33,7 +32,6 @@ complete release of Dolibarr, step by step.
|
||||
- Update version/info in ChangeLog. To generate a changelog, you can do "git log `git merge-base x.y origin/develop`..x.y --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -i -e '^FIX\|NEW'"
|
||||
- Update version number with x.y.z in htdocs/filefunc.inc.php
|
||||
- Update version number with x.y.z in build/debian/changelog
|
||||
- Update version number with x.y.z in build/rpm/*.spec
|
||||
- Commit all changes.
|
||||
|
||||
- Run makepack-dolibarr.pl to generate all packages.
|
||||
|
||||
@@ -335,5 +335,4 @@ fi
|
||||
|
||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||
%changelog
|
||||
* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3
|
||||
- Upstream release
|
||||
__CHANGELOGSTRING__
|
||||
|
||||
@@ -571,7 +571,4 @@ fi
|
||||
|
||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||
%changelog
|
||||
* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3
|
||||
- Upstream release
|
||||
|
||||
|
||||
__CHANGELOGSTRING__
|
||||
|
||||
@@ -340,7 +340,4 @@ fi
|
||||
|
||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||
%changelog
|
||||
* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3
|
||||
- Upstream release
|
||||
|
||||
|
||||
__CHANGELOGSTRING__
|
||||
|
||||
@@ -351,7 +351,4 @@ fi
|
||||
|
||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||
%changelog
|
||||
* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3
|
||||
- Upstream release
|
||||
|
||||
|
||||
__CHANGELOGSTRING__
|
||||
|
||||
24
dev/ansible/deployplaybook/deploydev.yml
Normal file
24
dev/ansible/deployplaybook/deploydev.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env ansible-playbook
|
||||
|
||||
# Run script with ansible-playbook deploydev.yml
|
||||
# or ./deploydev.yml
|
||||
|
||||
- name: Configure webserver with apache
|
||||
hosts: webservers
|
||||
sudo: True
|
||||
tasks:
|
||||
- name: install apache
|
||||
apt: name=apache update_cache=yes
|
||||
- name: copy apache config file
|
||||
copy: src=files/apachealias.conf dest=/etc/apache/conf.d/dolibarr_dev
|
||||
#- name: enable configuration
|
||||
# file: >
|
||||
# dest=/etc/apache/sites-enabled/default
|
||||
# src=/etc/apache/sites-available/default
|
||||
# state=link
|
||||
- name: copy info.html
|
||||
template: src=templates/info.html.j2 dest=/var/www/dolibarr_dev/info.html
|
||||
mode=0644
|
||||
- name: restart apache
|
||||
service: name=apache state=restarted
|
||||
|
||||
2
dev/ansible/deployplaybook/files/apachealias.conf
Normal file
2
dev/ansible/deployplaybook/files/apachealias.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
Alias /dolibarr_dev /var/www/dolibarr
|
||||
2
dev/ansible/deployplaybook/hosts
Normal file
2
dev/ansible/deployplaybook/hosts
Normal file
@@ -0,0 +1,2 @@
|
||||
[webservers]
|
||||
testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=22
|
||||
10
dev/ansible/deployplaybook/templates/info.html.j2
Normal file
10
dev/ansible/deployplaybook/templates/info.html.j2
Normal file
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Page info ansible</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Apache, configured by Ansible</h1>
|
||||
<p>If you can see this, Ansible successfully installed apache.</p>
|
||||
<p>{{ ansible_managed }}</p>
|
||||
</body>
|
||||
</html>
|
||||
57
dev/ical/event_recu.txt
Normal file
57
dev/ical/event_recu.txt
Normal file
@@ -0,0 +1,57 @@
|
||||
Example fo recurring event, 1 week, no end, exported by Google
|
||||
|
||||
# The recurring event were recorded every monday the 20150518. This is the Recurrence-id, but then
|
||||
# first occurence was moved on tuesday. So this record were added.
|
||||
BEGIN:VEVENT
|
||||
DTSTART;TZID=Europe/Paris:20150519T100000
|
||||
DTEND;TZID=Europe/Paris:20150519T110000
|
||||
DTSTAMP:20150517T175754Z
|
||||
UID:9026chuafli29ns5soshvckamc@google.com
|
||||
RECURRENCE-ID;TZID=Europe/Paris:20150518T100000
|
||||
CREATED:20150517T174404Z
|
||||
DESCRIPTION:
|
||||
LAST-MODIFIED:20150517T175008Z
|
||||
LOCATION:
|
||||
SEQUENCE:1
|
||||
STATUS:CONFIRMED
|
||||
SUMMARY:aaa
|
||||
TRANSP:OPAQUE
|
||||
END:VEVENT
|
||||
|
||||
# The recurring event were recorded every monday the 20150518.
|
||||
BEGIN:VEVENT
|
||||
DTSTART;TZID=Europe/Paris:20150518T100000
|
||||
DTEND;TZID=Europe/Paris:20150518T110000
|
||||
RRULE:FREQ=WEEKLY;BYDAY=MO
|
||||
DTSTAMP:20150517T175754Z
|
||||
UID:9026chuafli29ns5soshvckamc@google.com
|
||||
CREATED:20150517T174404Z
|
||||
DESCRIPTION:
|
||||
LAST-MODIFIED:20150517T174404Z
|
||||
LOCATION:
|
||||
SEQUENCE:0
|
||||
STATUS:CONFIRMED
|
||||
SUMMARY:aaa
|
||||
TRANSP:OPAQUE
|
||||
END:VEVENT
|
||||
|
||||
|
||||
|
||||
|
||||
Example fo recurring event, every 2 month, no end, exported by Google
|
||||
|
||||
BEGIN:VEVENT
|
||||
DTSTART;TZID=Europe/Paris:20150519T080000
|
||||
DTEND;TZID=Europe/Paris:20150519T090000
|
||||
RRULE:FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=19
|
||||
DTSTAMP:20150517T175754Z
|
||||
UID:urkq3ih1mlaqeu4dbkpdh4i61s@google.com
|
||||
CREATED:20150517T175658Z
|
||||
DESCRIPTION:
|
||||
LAST-MODIFIED:20150517T175658Z
|
||||
LOCATION:
|
||||
SEQUENCE:0
|
||||
STATUS:CONFIRMED
|
||||
SUMMARY:bbbbb
|
||||
TRANSP:OPAQUE
|
||||
END:VEVENT
|
||||
@@ -1,6 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -128,7 +128,6 @@ else if ($action == 'delete')
|
||||
|
||||
/*
|
||||
* View
|
||||
*
|
||||
*/
|
||||
llxheader('', $langs->trans('AccountAccounting'));
|
||||
|
||||
@@ -142,7 +141,9 @@ if ($action == 'create')
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
|
||||
@@ -163,8 +164,10 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
@@ -216,16 +219,16 @@ else if ($id)
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="cancel" class="button" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -268,8 +271,8 @@ else if ($id)
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
@@ -297,6 +300,6 @@ else if ($id)
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
llxFooter();
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
/* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -176,6 +176,8 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Label
|
||||
@@ -199,8 +201,10 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<div class="center">';
|
||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
|
||||
@@ -70,7 +70,7 @@ print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Members"), 0, 'title_user');
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Members"), 0, 'user');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ llxHeader('',$langs->trans("MembersSetup"),$help_url);
|
||||
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup_title');
|
||||
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
|
||||
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -85,6 +84,11 @@ print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'public', $langs->trans("Members"), 0, 'user');
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
@@ -130,8 +134,6 @@ if ($conf->use_javascript_ajax)
|
||||
|
||||
print $langs->trans("BlankSubscriptionFormDesc").'<br><br>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@@ -198,19 +200,20 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
|
||||
print '<tr '.$bc[$var].' id="tremail"><td>';
|
||||
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
|
||||
print '</td><td align="right">';
|
||||
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
|
||||
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';;
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</div>';
|
||||
print '</center>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -45,6 +46,7 @@ $langs->load("users");
|
||||
$langs->load('other');
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$cancel=GETPOST('cancel');
|
||||
$backtopage=GETPOST('backtopage','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$rowid=GETPOST('rowid','int');
|
||||
@@ -113,7 +115,8 @@ $hookmanager->initHooks(array('membercard','globalcard'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
*/
|
||||
if ($cancel) $action='';
|
||||
|
||||
$parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
@@ -236,7 +239,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
if ($action == 'update' && $cancel='' && $user->rights->adherent->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
@@ -322,15 +325,15 @@ if (empty($reshook))
|
||||
if ($result >= 0 && ! count($object->errors))
|
||||
{
|
||||
// Logo/Photo save
|
||||
$dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1).'/photos';
|
||||
$dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1,$object,'member').'/photos';
|
||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||
if ($file_OK)
|
||||
{
|
||||
if (GETPOST('deletephoto'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
$fileimg=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/'.$object->photo;
|
||||
$dirthumbs=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/thumbs';
|
||||
$fileimg=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1,$object,'member').'/photos/'.$object->photo;
|
||||
$dirthumbs=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1,$object,'member').'/photos/thumbs';
|
||||
dol_delete_file($fileimg);
|
||||
dol_delete_dir_recursive($dirthumbs);
|
||||
}
|
||||
@@ -725,7 +728,7 @@ else
|
||||
{
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation card */
|
||||
/* Creation mode */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
$object->canvas=$canvas;
|
||||
@@ -779,7 +782,10 @@ else
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tbody>';
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
@@ -868,13 +874,13 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Tel pro
|
||||
// Pro phone
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(GETPOST('phone','alpha')?GETPOST('phone','alpha'):$object->phone).'"></td></tr>';
|
||||
|
||||
// Tel perso
|
||||
// Personal phone
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(GETPOST('phone_perso','alpha')?GETPOST('phone_perso','alpha'):$object->phone_perso).'"></td></tr>';
|
||||
|
||||
// Tel mobile
|
||||
// Mobile phone
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile','alpha')?GETPOST('phone_mobile','alpha'):$object->phone_mobile).'"></td></tr>';
|
||||
|
||||
// Skype
|
||||
@@ -888,7 +894,7 @@ else
|
||||
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Profil public
|
||||
// Public profil
|
||||
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
|
||||
print $form->selectyesno("public",$object->public,1);
|
||||
print "</td></tr>\n";
|
||||
@@ -915,21 +921,25 @@ else
|
||||
print $form->select_dolusers($object->user_id,'userid',1);
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
print '<tbody>';
|
||||
print "</table>\n";
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("AddMember").'"></div>';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("AddMember").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
}
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
/********************************************
|
||||
*
|
||||
* Fiche en mode edition
|
||||
*
|
||||
* Edition mode
|
||||
*
|
||||
********************************************/
|
||||
|
||||
@@ -1027,6 +1037,7 @@ else
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Nature").'</span></td><td>';
|
||||
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
|
||||
print "</td>";
|
||||
|
||||
// Photo
|
||||
print '<td align="center" class="hideonsmartphone" valign="middle" width="25%" rowspan="'.$rowspan.'">';
|
||||
print $form->showphoto('memberphoto',$object)."\n";
|
||||
@@ -1107,13 +1118,13 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Tel
|
||||
// Pro phone
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(isset($_POST["phone"])?$_POST["phone"]:$object->phone).'"></td></tr>';
|
||||
|
||||
// Tel perso
|
||||
// Personal phone
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
|
||||
|
||||
// Tel mobile
|
||||
// Mobile phone
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td></tr>';
|
||||
|
||||
// Skype
|
||||
@@ -1127,7 +1138,7 @@ else
|
||||
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Profil public
|
||||
// Public profil
|
||||
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
|
||||
print $form->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1);
|
||||
print "</td></tr>\n";
|
||||
@@ -1171,7 +1182,7 @@ else
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
@@ -1183,7 +1194,7 @@ else
|
||||
{
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Mode affichage */
|
||||
/* View mode */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -1204,8 +1215,8 @@ else
|
||||
|
||||
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
* Show tabs
|
||||
*/
|
||||
$head = member_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
|
||||
@@ -1296,7 +1307,7 @@ else
|
||||
print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
|
||||
}
|
||||
|
||||
// Confirm resiliate
|
||||
// Confirm terminate
|
||||
if ($action == 'resign')
|
||||
{
|
||||
$langs->load("mails");
|
||||
@@ -1536,9 +1547,8 @@ else
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*
|
||||
*/
|
||||
* Hotbar
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty')
|
||||
@@ -1553,7 +1563,7 @@ else
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</font></div>';
|
||||
}
|
||||
|
||||
// Valider
|
||||
// Validate
|
||||
if ($object->statut == -1)
|
||||
{
|
||||
if ($user->rights->adherent->creer)
|
||||
@@ -1566,7 +1576,7 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
// Reactiver
|
||||
// Reactivate
|
||||
if ($object->statut == 0)
|
||||
{
|
||||
if ($user->rights->adherent->creer)
|
||||
@@ -1597,7 +1607,7 @@ else
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
}
|
||||
|
||||
// Resilier
|
||||
// Terminate
|
||||
if ($object->statut >= 1)
|
||||
{
|
||||
if ($user->rights->adherent->supprimer)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -707,7 +708,7 @@ if ($rowid > 0)
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
* Hotbar
|
||||
*/
|
||||
|
||||
// Lien nouvelle cotisation si non brouillon et non resilie
|
||||
@@ -908,9 +909,13 @@ if ($rowid > 0)
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">';
|
||||
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->societe).'">';
|
||||
print "<table class=\"border\" width=\"100%\">\n";
|
||||
|
||||
$today=dol_now();
|
||||
dol_fiche_head('');
|
||||
|
||||
print "<table class=\"border\" width=\"100%\">\n";
|
||||
print '<tbody>';
|
||||
|
||||
$today=dol_now();
|
||||
$datefrom=0;
|
||||
$dateto=0;
|
||||
$paymentdate=-1;
|
||||
@@ -1102,8 +1107,10 @@ if ($rowid > 0)
|
||||
print $form->textwithpicto($tmp,$helpcontent,1,'help');
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</tbody>';
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans("AddSubscription").'">';
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -31,6 +32,7 @@
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
|
||||
|
||||
/**
|
||||
@@ -1584,7 +1586,8 @@ class Adherent extends CommonObject
|
||||
}
|
||||
if ($option == 'category')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3'.$linkclose;
|
||||
$type = Categorie::TYPE_MEMBER;
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type='.$type.$linkclose;
|
||||
$linkend='</a>';
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
|
||||
|
||||
$upload_dir = $conf->adherent->dir_output . "/" . get_exdir($id,2,0,1) . '/' . $id;
|
||||
$form = new Form($db);
|
||||
$object=new Adherent($db);
|
||||
$membert=new AdherentType($db);
|
||||
@@ -70,6 +69,9 @@ if ($result < 0)
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
$upload_dir = $conf->adherent->dir_output . "/" . get_exdir($object->id,2,0,1,$object,'member') . '/' . dol_sanitizeFileName($object->ref);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
@@ -157,7 +157,7 @@ print "</table></form>";
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td align="center" colspan="2">';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -209,8 +209,9 @@ if ($resql)
|
||||
$moreforfilter='';
|
||||
if (! empty($conf->categorie->enabled))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$moreforfilter.=$langs->trans('Categories'). ': ';
|
||||
$moreforfilter.=$formother->select_categories(3,$search_categ,'search_categ',1);
|
||||
$moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1);
|
||||
$moreforfilter.=' ';
|
||||
}
|
||||
if ($moreforfilter)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -26,6 +27,7 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
@@ -59,7 +61,7 @@ $extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('adherent_type');
|
||||
|
||||
if (GETPOST('button_removefilter'))
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_lastname="";
|
||||
$search_login="";
|
||||
@@ -79,21 +81,21 @@ if ($action == 'add' && $user->rights->adherent->configurer)
|
||||
{
|
||||
if ($_POST["button"] != $langs->trans("Cancel"))
|
||||
{
|
||||
$adht = new AdherentType($db);
|
||||
$object = new AdherentType($db);
|
||||
|
||||
$adht->libelle = trim($_POST["libelle"]);
|
||||
$adht->cotisation = trim($_POST["cotisation"]);
|
||||
$adht->note = trim($_POST["comment"]);
|
||||
$adht->mail_valid = trim($_POST["mail_valid"]);
|
||||
$adht->vote = trim($_POST["vote"]);
|
||||
$object->libelle = trim($_POST["libelle"]);
|
||||
$object->cotisation = trim($_POST["cotisation"]);
|
||||
$object->note = trim($_POST["comment"]);
|
||||
$object->mail_valid = trim($_POST["mail_valid"]);
|
||||
$object->vote = trim($_POST["vote"]);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if ($adht->libelle)
|
||||
if ($object->libelle)
|
||||
{
|
||||
$id=$adht->create($user);
|
||||
$id=$object->create($user);
|
||||
if ($id > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
@@ -101,7 +103,7 @@ if ($action == 'add' && $user->rights->adherent->configurer)
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg=$adht->error;
|
||||
$mesg=$object->error;
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
@@ -117,19 +119,19 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
||||
{
|
||||
if ($_POST["button"] != $langs->trans("Cancel"))
|
||||
{
|
||||
$adht = new AdherentType($db);
|
||||
$adht->id = $_POST["rowid"];
|
||||
$adht->libelle = trim($_POST["libelle"]);
|
||||
$adht->cotisation = trim($_POST["cotisation"]);
|
||||
$adht->note = trim($_POST["comment"]);
|
||||
$adht->mail_valid = trim($_POST["mail_valid"]);
|
||||
$adht->vote = trim($_POST["vote"]);
|
||||
$object = new AdherentType($db);
|
||||
$object->id = $_POST["rowid"];
|
||||
$object->libelle = trim($_POST["libelle"]);
|
||||
$object->cotisation = trim($_POST["cotisation"]);
|
||||
$object->note = trim($_POST["comment"]);
|
||||
$object->mail_valid = trim($_POST["mail_valid"]);
|
||||
$object->vote = trim($_POST["vote"]);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
$adht->update($user);
|
||||
$object->update($user);
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$_POST["rowid"]);
|
||||
exit;
|
||||
@@ -138,8 +140,8 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
||||
|
||||
if ($action == 'delete' && $user->rights->adherent->configurer)
|
||||
{
|
||||
$adht = new AdherentType($db);
|
||||
$adht->delete($rowid);
|
||||
$object = new AdherentType($db);
|
||||
$object->delete($rowid);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
@@ -161,8 +163,7 @@ llxHeader('',$langs->trans("MembersTypeSetup"),'EN:Module_Foundations|FR:Module_
|
||||
$form=new Form($db);
|
||||
|
||||
|
||||
// Liste of members type
|
||||
|
||||
// List of members type
|
||||
if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
{
|
||||
|
||||
@@ -212,8 +213,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*
|
||||
* Hotbar
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
@@ -230,19 +230,23 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un type adherent */
|
||||
/* Creation mode */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'create')
|
||||
{
|
||||
$adht = new AdherentType($db);
|
||||
$object = new AdherentType($db);
|
||||
|
||||
print_fiche_titre($langs->trans("NewMemberType"));
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tbody>';
|
||||
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
|
||||
@@ -260,7 +264,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('mail_valid',$adht->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90);
|
||||
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -269,11 +273,14 @@ if ($action == 'create')
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $adht->showOptionals($extrafields,'edit');
|
||||
print $object->showOptionals($extrafields,'edit');
|
||||
}
|
||||
print '<tbody>';
|
||||
print "</table>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
@@ -284,27 +291,21 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition de la fiche */
|
||||
/* View mode */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($rowid > 0)
|
||||
{
|
||||
if ($action != 'edit')
|
||||
{
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($rowid);
|
||||
$adht->fetch_optionals($rowid,$extralabels);
|
||||
$object = new AdherentType($db);
|
||||
$object->fetch($rowid);
|
||||
$object->fetch_optionals($rowid,$extralabels);
|
||||
|
||||
$h=0;
|
||||
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].'?rowid='.$adht->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
$head = member_type_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php">'.$langs->trans("BackToList").'</a>';
|
||||
@@ -312,25 +313,25 @@ if ($rowid > 0)
|
||||
// Ref
|
||||
print '<tr><td width="15%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td>';
|
||||
print $form->showrefnav($adht, 'rowid', $linkback);
|
||||
print $form->showrefnav($object, 'rowid', $linkback);
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td width="15%">'.$langs->trans("Label").'</td><td>'.$adht->libelle.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Label").'</td><td>'.$object->libelle.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print yn($adht->cotisation);
|
||||
print yn($object->cotisation);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
print yn($adht->vote);
|
||||
print yn($object->vote);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($adht->note)."</td></tr>";
|
||||
print nl2br($object->note)."</td></tr>";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
print nl2br($adht->mail_valid)."</td></tr>";
|
||||
print nl2br($object->mail_valid)."</td></tr>";
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
@@ -338,31 +339,30 @@ if ($rowid > 0)
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
// View extrafields
|
||||
print $adht->showOptionals($extrafields);
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*
|
||||
* Hotbar
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
// Edit
|
||||
if ($user->rights->adherent->configurer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&rowid='.$adht->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&rowid='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
|
||||
// Add
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$adht->id.'">'.$langs->trans("AddMember").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$object->id.'">'.$langs->trans("AddMember").'</a></div>';
|
||||
|
||||
// Delete
|
||||
if ($user->rights->adherent->configurer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$adht->id.'">'.$langs->trans("DeleteType").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$object->id.'">'.$langs->trans("DeleteType").'</a></div>';
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
@@ -381,7 +381,7 @@ if ($rowid > 0)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql.= " WHERE d.fk_adherent_type = t.rowid ";
|
||||
$sql.= " AND d.entity IN (".getEntity().")";
|
||||
$sql.= " AND t.rowid = ".$adht->id;
|
||||
$sql.= " AND t.rowid = ".$object->id;
|
||||
if ($sall)
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
@@ -479,7 +479,7 @@ if ($rowid > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Nature"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
@@ -619,19 +619,20 @@ if ($rowid > 0)
|
||||
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition mode */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
$adht = new AdherentType($db);
|
||||
$adht->id = $rowid;
|
||||
$adht->fetch($rowid);
|
||||
$adht->fetch_optionals($rowid,$extralabels);
|
||||
$object = new AdherentType($db);
|
||||
$object->id = $rowid;
|
||||
$object->fetch($rowid);
|
||||
$object->fetch_optionals($rowid,$extralabels);
|
||||
|
||||
$h=0;
|
||||
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].'?rowid='.$adht->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
$head = member_type_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
|
||||
|
||||
@@ -641,24 +642,24 @@ if ($rowid > 0)
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Ref").'</td><td>'.$adht->id.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.$adht->libelle.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.$object->libelle.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print $form->selectyesno("cotisation",$adht->cotisation,1);
|
||||
print $form->selectyesno("cotisation",$object->cotisation,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
print $form->selectyesno("vote",$adht->vote,1);
|
||||
print $form->selectyesno("vote",$object->vote,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
print '<textarea name="comment" wrap="soft" cols="90" rows="3">'.$adht->note.'</textarea></td></tr>';
|
||||
print '<textarea name="comment" wrap="soft" cols="90" rows="3">'.$object->note.'</textarea></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('mail_valid',$adht->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90);
|
||||
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90);
|
||||
$doleditor->Create();
|
||||
print "</td></tr>";
|
||||
|
||||
@@ -668,13 +669,13 @@ if ($rowid > 0)
|
||||
|
||||
print '</table>';
|
||||
|
||||
//Extra field
|
||||
// Extra field
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print '<br><br><table class="border" width="100%">';
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($adht->array_options['options_'.$key])?$adht->array_options['options_'.$key]:''));
|
||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:''));
|
||||
print '<tr><td width="30%">'.$label.'</td><td>';
|
||||
print $extrafields->showInputField($key,$value);
|
||||
print "</td></tr>\n";
|
||||
|
||||
@@ -283,7 +283,7 @@ if ($action == 'edit') // Edit
|
||||
{
|
||||
// Show bugtrack link
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
||||
print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
@@ -469,7 +469,7 @@ else // Show
|
||||
{
|
||||
// Show bugtrack link
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
|
||||
print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
||||
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
|
||||
print '<td width="20"> </td>';
|
||||
print "</tr>";
|
||||
|
||||
@@ -439,6 +439,26 @@ print "\n";
|
||||
<div align="center"><input type="submit" class="button"
|
||||
value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo" /><br>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
if (! empty($_SESSION["commandbackuplastdone"]))
|
||||
{
|
||||
print '<br><b>'.$langs->trans("RunCommandSummary").':</b><br>'."\n";
|
||||
print '<textarea rows="'.ROWS_2.'" class="centpercent">'.$_SESSION["commandbackuplastdone"].'</textarea><br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
//print $paramclear;
|
||||
|
||||
// Now run command and show result
|
||||
print '<b>'.$langs->trans("BackupResult").':</b> ';
|
||||
print $_SESSION["commandbackupresult"];
|
||||
|
||||
$_SESSION["commandbackuplastdone"]='';
|
||||
$_SESSION["commandbackuptorun"]='';
|
||||
$_SESSION["commandbackupresult"]='';
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -70,6 +70,10 @@ if ($action == 'delete')
|
||||
* View
|
||||
*/
|
||||
|
||||
$_SESSION["commandbackuplastdone"]='';
|
||||
$_SESSION["commandbackuptorun"]='';
|
||||
$_SESSION["commandbackupresult"]='';
|
||||
|
||||
// Increase limit of time. Works only if we are not in safe mode
|
||||
$ExecTimeLimit=600;
|
||||
if (!empty($ExecTimeLimit))
|
||||
@@ -354,21 +358,24 @@ if ($what == 'postgresql')
|
||||
if ($errormsg)
|
||||
{
|
||||
setEventMessage($langs->trans("Error")." : ".$errormsg, 'errors');
|
||||
/*
|
||||
print '<div class="error">'.$langs->trans("Error")." : ".$errormsg.'</div>';
|
||||
print '<br>';
|
||||
print '<br>';*/
|
||||
|
||||
$resultstring='';
|
||||
$resultstring.='<div class="error">'.$langs->trans("Error")." : ".$errormsg.'</div>';
|
||||
|
||||
$_SESSION["commandbackupresult"]=$resultstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($what)
|
||||
{
|
||||
setEventMessage($langs->trans("BackupFileSuccessfullyCreated").'.<br>'.$langs->trans("YouCanDownloadBackupFile"));
|
||||
/*print '<div class="ok">';
|
||||
print $langs->trans("BackupFileSuccessfullyCreated").'.<br>';
|
||||
print $langs->trans("YouCanDownloadBackupFile");
|
||||
print '</div>';
|
||||
print '<br>';*/
|
||||
|
||||
$resultstring='<div class="ok">';
|
||||
$resultstring.=$langs->trans("BackupFileSuccessfullyCreated").'.<br>';
|
||||
$resultstring.=$langs->trans("YouCanDownloadBackupFile");
|
||||
$resultstring.='<div>';
|
||||
|
||||
$_SESSION["commandbackupresult"]=$resultstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.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
|
||||
@@ -24,6 +25,7 @@
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
@@ -59,6 +61,32 @@ $search_user = GETPOST("search_user");
|
||||
$search_desc = GETPOST("search_desc");
|
||||
$search_ua = GETPOST("search_ua");
|
||||
|
||||
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]);
|
||||
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
|
||||
|
||||
// checks:if date_start>date_end then date_end=date_start + 24 hours
|
||||
if ($date_start > $date_end) $date_end=$date_start+86400;
|
||||
|
||||
$now = dol_now();
|
||||
$nowarray = dol_getdate($now);
|
||||
|
||||
$params = "&search_code=$search_code&search_ip=$search_ip&search_user=$search_user&search_desc=$search_desc&search_ua=$search_ua";
|
||||
$params.= "&date_startmonth=".$_REQUEST["date_startmonth"];
|
||||
$params.= "&date_startday=".$_REQUEST["date_startday"];
|
||||
$params.= "&date_startyear=".$_REQUEST["date_startyear"];
|
||||
$params.= "&date_endmonth=".$_REQUEST["date_endmonth"];
|
||||
$params.= "&date_endday=".$_REQUEST["date_endday"];
|
||||
$params.= "&date_endyear=".$_REQUEST["date_endyear"];
|
||||
|
||||
if (empty($date_start)) // We define date_start and date_end
|
||||
{
|
||||
$date_start=dol_get_first_day($nowarray['year'],$nowarray['mon'],false);
|
||||
}
|
||||
if (empty($date_end))
|
||||
{
|
||||
$date_end=dol_mktime(23,59,59,$nowarray['mon'],$nowarray['mday'],$nowarray['year']);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -124,6 +152,7 @@ $sql.= " u.login";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."events as e";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = e.fk_user";
|
||||
$sql.= " WHERE e.entity IN (".getEntity('actioncomm', 1).")";
|
||||
$sql.= " AND e.dateevent >= '".$db->idate($date_start)."' AND e.dateevent <= '".$db->idate($date_end)."'";
|
||||
if ($search_code) { $usefilter++; $sql.=" AND e.type LIKE '%".$db->escape($search_code)."%'"; }
|
||||
if ($search_ip) { $usefilter++; $sql.=" AND e.ip LIKE '%".$db->escape($search_ip)."%'"; }
|
||||
if ($search_user) { $usefilter++; $sql.=" AND u.login LIKE '%".$db->escape($search_user)."%'"; }
|
||||
@@ -145,7 +174,8 @@ if ($result)
|
||||
if ($search_desc) $param.='&search_desc='.$search_desc;
|
||||
if ($search_ua) $param.='&search_ua='.$search_ua;
|
||||
|
||||
print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, 0, 'setup');
|
||||
$langs->load('withdrawals');
|
||||
print_barre_liste($langs->trans("ListOfSecurityEvents").' : '.$num.' '.strtolower($langs->trans("Lines")), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, 0, 'setup');
|
||||
|
||||
if ($action == 'purge')
|
||||
{
|
||||
@@ -168,7 +198,7 @@ if ($result)
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" width="15%">'.$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).$form->select_date($date_end,'date_end',0,0,0,'',1,0,1).'</td>';
|
||||
|
||||
print '<td align="left" class="liste_titre">';
|
||||
print '<input class="flat" type="text" size="10" name="search_code" value="'.$search_code.'">';
|
||||
|
||||
@@ -174,7 +174,7 @@ if ($savehandler == 'files')
|
||||
|
||||
if (count($listofsessions) == 0)
|
||||
{
|
||||
print '<tr><td colspan="6">'.$langs->trans("NoSessionFound",$savepath,$openbasedir).'</td></tr>';
|
||||
print '<tr '.$bc[false].'><td colspan="6">'.$langs->trans("NoSessionFound",$savepath,$openbasedir).'</td></tr>';
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
|
||||
@@ -17,27 +17,25 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/asterisk/cidlookup.php
|
||||
* \brief Script to search companies names based on incoming calls
|
||||
* \brief Script to search companies names based on incoming calls, from caller phone number
|
||||
* \remarks To use this script, your Asterisk must be compiled with CURL,
|
||||
* and your dialplan must be something like this:
|
||||
*
|
||||
* exten => s,1,Set(CALLERID(name)=${CURL(http://IP-DOLIBARR:80/asterisk/cidlookup.php?phone=${CALLERID(num)})})
|
||||
*
|
||||
* Change IP-DOLIBARR to the IP address of your dolibarr
|
||||
* server
|
||||
* exten => s,1,Set(CALLERID(name)=${CURL(http://IP-DOLIBARR:80/asterisk/cidlookup.php?phone=${CALLERID(num)})})
|
||||
*
|
||||
* Change IP-DOLIBARR to the IP address of your dolibarr server
|
||||
*/
|
||||
|
||||
|
||||
include '../master.inc.php';
|
||||
|
||||
$phone = GETPOST('phone');
|
||||
$notfound = "Not found";
|
||||
$error = "Error"
|
||||
|
||||
$notfound = $langs->trans("Unknown");
|
||||
|
||||
// Security check
|
||||
if (empty($conf->clicktodial->enabled)) {
|
||||
print "Error: Module Click to dial not active\n";
|
||||
if (empty($conf->clicktodial->enabled))
|
||||
{
|
||||
print "Error: Module Click to dial is not enabled.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -73,7 +71,7 @@ if ($resql)
|
||||
else
|
||||
{
|
||||
dol_print_error($db,'Error');
|
||||
$found = $error;
|
||||
$found = 'Error';
|
||||
}
|
||||
|
||||
echo $found;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -50,14 +51,14 @@ $parent=GETPOST('parent');
|
||||
|
||||
if ($origin)
|
||||
{
|
||||
if ($type == 0) $idProdOrigin = $origin;
|
||||
if ($type == 1) $idSupplierOrigin = $origin;
|
||||
if ($type == 2) $idCompanyOrigin = $origin;
|
||||
if ($type == 3) $idMemberOrigin = $origin;
|
||||
if ($type == 4) $idContactOrigin = $origin;
|
||||
if ($type == Categorie::TYPE_PRODUCT) $idProdOrigin = $origin;
|
||||
if ($type == Categorie::TYPE_SUPPLIER) $idSupplierOrigin = $origin;
|
||||
if ($type == Categorie::TYPE_CUSTOMER) $idCompanyOrigin = $origin;
|
||||
if ($type == Categorie::TYPE_MEMBER) $idMemberOrigin = $origin;
|
||||
if ($type == Categorie::TYPE_CONTACT) $idContactOrigin = $origin;
|
||||
}
|
||||
|
||||
if ($catorigin && $type == 0) $idCatOrigin = $catorigin;
|
||||
if ($catorigin && $type == Categorie::TYPE_PRODUCT) $idCatOrigin = $catorigin;
|
||||
|
||||
$object = new Categorie($db);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -47,40 +48,40 @@ $dbtablename = '';
|
||||
|
||||
// For categories on third parties
|
||||
if (! empty($socid)) $id = $socid;
|
||||
if (! isset($type)) $type = 0;
|
||||
if ($type == 1 || $type == 2) $socid = $id;
|
||||
if (! isset($type)) $type = Categorie::TYPE_PRODUCT;
|
||||
if ($type == Categorie::TYPE_SUPPLIER || $type == Categorie::TYPE_CUSTOMER) $socid = $id;
|
||||
|
||||
if ($id || $ref)
|
||||
{
|
||||
if ($type == 0) {
|
||||
if ($type == Categorie::TYPE_PRODUCT) {
|
||||
$elementtype = 'product';
|
||||
$objecttype = 'produit|service&categorie';
|
||||
$objectid = isset($id)?$id:(isset($ref)?$ref:'');
|
||||
$dbtablename = 'product';
|
||||
$fieldid = isset($ref)?'ref':'rowid';
|
||||
}
|
||||
elseif ($type == 1) {
|
||||
elseif ($type == Categorie::TYPE_SUPPLIER) {
|
||||
$elementtype = 'fournisseur';
|
||||
$objecttype = 'societe&categorie';
|
||||
$objectid = isset($id)?$id:(isset($socid)?$socid:'');
|
||||
$dbtablename = '&societe';
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
elseif ($type == 2) {
|
||||
elseif ($type == Categorie::TYPE_CUSTOMER) {
|
||||
$elementtype = 'societe';
|
||||
$objecttype = 'societe&categorie';
|
||||
$objectid = isset($id)?$id:(isset($socid)?$socid:'');
|
||||
$dbtablename = '&societe';
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
elseif ($type == 3) {
|
||||
elseif ($type == Categorie::TYPE_MEMBER) {
|
||||
$elementtype = 'member';
|
||||
$objecttype = 'adherent&categorie';
|
||||
$objectid = isset($id)?$id:(isset($ref)?$ref:'');
|
||||
$dbtablename = 'adherent';
|
||||
$fieldid = ! empty($ref)?'ref':'rowid';
|
||||
}
|
||||
elseif ($type == 4) {
|
||||
elseif ($type == Categorie::TYPE_CONTACT) {
|
||||
$elementtype = 'societe';
|
||||
$objecttype = 'contact';
|
||||
$objectid = isset($id)?$id:(isset($ref)?$ref:'');
|
||||
@@ -110,34 +111,34 @@ if (empty($reshook))
|
||||
// Remove element from category
|
||||
if ($removecat > 0)
|
||||
{
|
||||
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$object = new Product($db);
|
||||
$result = $object->fetch($id, $ref);
|
||||
$elementtype = 'product';
|
||||
}
|
||||
if ($type==1 && $user->rights->societe->creer)
|
||||
if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
$object = new Fournisseur($db);
|
||||
$result = $object->fetch($objectid);
|
||||
$elementtype = 'fournisseur';
|
||||
}
|
||||
if ($type==2 && $user->rights->societe->creer)
|
||||
if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
|
||||
{
|
||||
$object = new Societe($db);
|
||||
$result = $object->fetch($objectid);
|
||||
$elementtype = 'societe';
|
||||
}
|
||||
if ($type == 3 && $user->rights->adherent->creer)
|
||||
if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$object = new Adherent($db);
|
||||
$result = $object->fetch($objectid);
|
||||
$elementtype = 'member';
|
||||
}
|
||||
if ($type == 4 && $user->rights->societe->creer)
|
||||
if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
$object = new Contact($db);
|
||||
@@ -158,34 +159,34 @@ if (empty($reshook))
|
||||
// Add object into a category
|
||||
if ($parent > 0)
|
||||
{
|
||||
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$object = new Product($db);
|
||||
$result = $object->fetch($id, $ref);
|
||||
$elementtype = 'product';
|
||||
}
|
||||
if ($type==1 && $user->rights->societe->creer)
|
||||
if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
$object = new Fournisseur($db);
|
||||
$result = $object->fetch($objectid);
|
||||
$elementtype = 'fournisseur';
|
||||
}
|
||||
if ($type==2 && $user->rights->societe->creer)
|
||||
if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
|
||||
{
|
||||
$object = new Societe($db);
|
||||
$result = $object->fetch($objectid);
|
||||
$elementtype = 'societe';
|
||||
}
|
||||
if ($type==3 && $user->rights->adherent->creer)
|
||||
if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$object = new Adherent($db);
|
||||
$result = $object->fetch($objectid);
|
||||
$elementtype = 'member';
|
||||
}
|
||||
if ($type == 4 && $user->rights->societe->creer)
|
||||
if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
$object = new Contact($db);
|
||||
@@ -330,7 +331,7 @@ if ($socid)
|
||||
}
|
||||
else if ($id || $ref)
|
||||
{
|
||||
if ($type == 0)
|
||||
if ($type == Categorie::TYPE_PRODUCT)
|
||||
{
|
||||
$langs->load("products");
|
||||
|
||||
@@ -383,7 +384,7 @@ else if ($id || $ref)
|
||||
formCategory($db,$product,0,$socid,($user->rights->produit->creer || $user->rights->service->creer));
|
||||
}
|
||||
|
||||
if ($type == 3)
|
||||
if ($type == Categorie::TYPE_MEMBER)
|
||||
{
|
||||
$langs->load("members");
|
||||
|
||||
@@ -461,7 +462,7 @@ else if ($id || $ref)
|
||||
|
||||
formCategory($db,$member,3,0,$user->rights->adherent->creer);
|
||||
}
|
||||
if ($type == 4)
|
||||
if ($type == Categorie::TYPE_CONTACT)
|
||||
{
|
||||
$langs->load("contact");
|
||||
|
||||
@@ -624,16 +625,16 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
||||
{
|
||||
global $user,$langs,$form,$bc;
|
||||
|
||||
if ($typeid == 0) $title = $langs->trans("ProductsCategoriesShort");
|
||||
if ($typeid == 1) $title = $langs->trans("SuppliersCategoriesShort");
|
||||
if ($typeid == 2) $title = $langs->trans("CustomersProspectsCategoriesShort");
|
||||
if ($typeid == 3) $title = $langs->trans("MembersCategoriesShort");
|
||||
if ($typeid == 4) $title = $langs->trans("ContactCategoriesShort");
|
||||
if ($typeid == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoriesShort");
|
||||
if ($typeid == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoriesShort");
|
||||
if ($typeid == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersProspectsCategoriesShort");
|
||||
if ($typeid == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoriesShort");
|
||||
if ($typeid == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort");
|
||||
|
||||
$linktocreate='';
|
||||
if ($showclassifyform && $user->rights->categorie->creer)
|
||||
{
|
||||
$linktocreate='<a href="'.DOL_URL_ROOT.'/categories/card.php?action=create&origin='.$object->id.'&type='.$typeid.'&urlfrom='.urlencode($_SERVER["PHP_SELF"].'?'.(($typeid==1||$typeid==2)?'socid':'id').'='.$object->id.'&type='.$typeid).'">';
|
||||
$linktocreate='<a href="'.DOL_URL_ROOT.'/categories/card.php?action=create&origin='.$object->id.'&type='.$typeid.'&urlfrom='.urlencode($_SERVER["PHP_SELF"].'?'.(($typeid==Categorie::TYPE_SUPPLIER||$typeid==Categorie::TYPE_CUSTOMER)?'socid':'id').'='.$object->id.'&type='.$typeid).'">';
|
||||
$linktocreate.=$langs->trans("CreateCat").' ';
|
||||
$linktocreate.=img_picto($langs->trans("Create"),'filenew');
|
||||
$linktocreate.="</a>";
|
||||
@@ -668,11 +669,11 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
||||
|
||||
if (count($cats) > 0)
|
||||
{
|
||||
if ($typeid == 0) $title=$langs->trans("ProductIsInCategories");
|
||||
if ($typeid == 1) $title=$langs->trans("CompanyIsInSuppliersCategories");
|
||||
if ($typeid == 2) $title=$langs->trans("CompanyIsInCustomersCategories");
|
||||
if ($typeid == 3) $title=$langs->trans("MemberIsInCategories");
|
||||
if ($typeid == 4) $title=$langs->trans("ContactIsInCategories");
|
||||
if ($typeid == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductIsInCategories");
|
||||
if ($typeid == Categorie::TYPE_SUPPLIER) $title=$langs->trans("CompanyIsInSuppliersCategories");
|
||||
if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyIsInCustomersCategories");
|
||||
if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberIsInCategories");
|
||||
if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactIsInCategories");
|
||||
print "\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$title.':</td></tr>';
|
||||
@@ -693,11 +694,11 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($typeid == 4) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||
if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removecat=".$cat->id."'>";
|
||||
@@ -721,18 +722,17 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($typeid == 0) $title=$langs->trans("ProductHasNoCategory");
|
||||
if ($typeid == 1) $title=$langs->trans("CompanyHasNoCategory");
|
||||
if ($typeid == 2) $title=$langs->trans("CompanyHasNoCategory");
|
||||
if ($typeid == 3) $title=$langs->trans("MemberHasNoCategory");
|
||||
if ($typeid == 4) $title=$langs->trans("ContactHasNoCategory");
|
||||
if ($typeid == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductHasNoCategory");
|
||||
if ($typeid == Categorie::TYPE_SUPPLIER) $title=$langs->trans("CompanyHasNoCategory");
|
||||
if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyHasNoCategory");
|
||||
if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberHasNoCategory");
|
||||
if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactHasNoCategory");
|
||||
print $title;
|
||||
print "<br/>";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2005 Davoleau Brice <brice.davoleau@gmail.com>
|
||||
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2005 Davoleau Brice <brice.davoleau@gmail.com>
|
||||
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -40,6 +41,13 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
*/
|
||||
class Categorie extends CommonObject
|
||||
{
|
||||
// Categories types
|
||||
const TYPE_PRODUCT = 0;
|
||||
const TYPE_SUPPLIER = 1;
|
||||
const TYPE_CUSTOMER = 2;
|
||||
const TYPE_MEMBER = 3;
|
||||
const TYPE_CONTACT = 4;
|
||||
|
||||
public $element='category';
|
||||
public $table_element='categories';
|
||||
|
||||
@@ -1166,11 +1174,17 @@ class Categorie extends CommonObject
|
||||
$cats = array();
|
||||
|
||||
$typeid=-1; $table='';
|
||||
if ($type == '0' || $type == 'product') { $typeid=0; $table='product'; $type='product'; }
|
||||
else if ($type == '1' || $type == 'supplier') { $typeid=1; $table='soc'; $type='fournisseur'; }
|
||||
else if ($type == '2' || $type == 'customer') { $typeid=2; $table='soc'; $type='societe'; }
|
||||
else if ($type == '3' || $type == 'member') { $typeid=3; $table='member'; $type='member'; }
|
||||
else if ($type == '4' || $type == 'contact') { $typeid=4; $table='socpeople'; $type='contact'; }
|
||||
if ($type == '0' || $type == 'product') {
|
||||
$typeid=self::TYPE_PRODUCT; $table='product'; $type='product';
|
||||
} else if ($type == '1' || $type == 'supplier') {
|
||||
$typeid=self::TYPE_SUPPLIER; $table='soc'; $type='fournisseur';
|
||||
} else if ($type == '2' || $type == 'customer') {
|
||||
$typeid=self::TYPE_CUSTOMER; $table='soc'; $type='societe';
|
||||
} else if ($type == '3' || $type == 'member') {
|
||||
$typeid=self::TYPE_MEMBER; $table='member'; $type='member';
|
||||
} else if ($type == '4' || $type == 'contact') {
|
||||
$typeid=self::TYPE_CONTACT; $table='socpeople'; $type='contact';
|
||||
}
|
||||
|
||||
$sql = "SELECT ct.fk_categorie, c.label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c";
|
||||
@@ -1220,11 +1234,11 @@ class Categorie extends CommonObject
|
||||
$cats = array();
|
||||
|
||||
$typeid=-1;
|
||||
if ($type == 0 || $type == 'product') { $typeid=0; }
|
||||
else if ($type == 1 || $type == 'supplier') { $typeid=1; }
|
||||
else if ($type == 2 || $type == 'customer') { $typeid=2; }
|
||||
else if ($type == 3 || $type == 'member') { $typeid=3; }
|
||||
else if ($type == 4 || $type == 'contact') { $typeid=4; }
|
||||
if ($type == 0 || $type == 'product') { $typeid=self::TYPE_PRODUCT; }
|
||||
else if ($type == 1 || $type == 'supplier') { $typeid=self::TYPE_SUPPLIER; }
|
||||
else if ($type == 2 || $type == 'customer') { $typeid=self::TYPE_CUSTOMER; }
|
||||
else if ($type == 3 || $type == 'member') { $typeid=self::TYPE_MEMBER; }
|
||||
else if ($type == 4 || $type == 'contact') { $typeid=self::TYPE_CONTACT; }
|
||||
|
||||
// Generation requete recherche
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
||||
@@ -1302,7 +1316,7 @@ class Categorie extends CommonObject
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$dir = $sdir .'/'. get_exdir($this->id,2) . $this->id ."/";
|
||||
$dir = $sdir .'/'. get_exdir($this->id,2,0,0,$this,'category') . $this->id ."/";
|
||||
$dir .= "photos/";
|
||||
|
||||
if (! file_exists($dir))
|
||||
@@ -1550,7 +1564,7 @@ class Categorie extends CommonObject
|
||||
$this->specimen=1;
|
||||
$this->description = 'This is a description';
|
||||
$this->socid = 1;
|
||||
$this->type = 0;
|
||||
$this->type = self::TYPE_PRODUCT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -28,13 +29,14 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$langs->load("categories");
|
||||
|
||||
if (! $user->rights->categorie->lire) accessforbidden();
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$type=(GETPOST('type') ? GETPOST('type') : 0);
|
||||
$type=(GETPOST('type') ? GETPOST('type') : Categorie::TYPE_PRODUCT);
|
||||
$catname=GETPOST('catname','alpha');
|
||||
$section=(GETPOST('section')?GETPOST('section'):0);
|
||||
|
||||
@@ -46,12 +48,12 @@ $section=(GETPOST('section')?GETPOST('section'):0);
|
||||
$categstatic = new Categorie($db);
|
||||
$form = new Form($db);
|
||||
|
||||
if ($type == 0) $title=$langs->trans("ProductsCategoriesArea");
|
||||
elseif ($type == 1) $title=$langs->trans("SuppliersCategoriesArea");
|
||||
elseif ($type == 2) $title=$langs->trans("CustomersCategoriesArea");
|
||||
elseif ($type == 3) $title=$langs->trans("MembersCategoriesArea");
|
||||
elseif ($type == 4) $title=$langs->trans("ContactsCategoriesArea");
|
||||
else $title=$langs->trans("CategoriesArea");
|
||||
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoriesArea");
|
||||
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoriesArea");
|
||||
elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoriesArea");
|
||||
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoriesArea");
|
||||
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactsCategoriesArea");
|
||||
else $title=$langs->trans("CategoriesArea");
|
||||
|
||||
$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');
|
||||
@@ -151,8 +153,7 @@ foreach($fulltree as $key => $val)
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_parent'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.$li.
|
||||
'</td><td width="50%">'.
|
||||
' '.$val['description'].'</td>'.
|
||||
'</td><td width="50%">'.dolGetFirstLineOfText($val['description']).'</td>'.
|
||||
'<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'.
|
||||
'</tr></table>'
|
||||
);
|
||||
@@ -160,7 +161,7 @@ foreach($fulltree as $key => $val)
|
||||
|
||||
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Categories").'</td><td>'.$langs->trans("Description").'</td><td align="right">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Categories").'</td><td></td><td align="right">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '<div id="iddivjstreecontrol"><a href="#">'.img_picto('','object_category').' '.$langs->trans("UndoExpandAll").'</a> | <a href="#">'.img_picto('','object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div>';
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -93,11 +94,11 @@ $form = new Form($db);
|
||||
if ($object->id)
|
||||
{
|
||||
$title=$langs->trans("ProductsCategoryShort");
|
||||
if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
|
||||
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
|
||||
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
|
||||
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
|
||||
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort");
|
||||
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
|
||||
|
||||
$head = categories_prepare_head($object,$type);
|
||||
dol_fiche_head($head, 'photos', $title, 0, 'category');
|
||||
@@ -224,7 +225,7 @@ if ($object->id)
|
||||
$maxWidth = 160;
|
||||
$maxHeight = 120;
|
||||
|
||||
$pdir = get_exdir($object->id,2) . $object->id ."/photos/";
|
||||
$pdir = get_exdir($object->id,2,0,0,$object,'category') . $object->id ."/photos/";
|
||||
$dir = $upload_dir.'/'.$pdir;
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -143,12 +144,12 @@ llxHeader("","",$langs->trans("Translation"));
|
||||
$form = new Form($db);
|
||||
$formadmin=new FormAdmin($db);
|
||||
|
||||
if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
|
||||
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
|
||||
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
|
||||
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
|
||||
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort");
|
||||
else $title=$langs->trans("Category");
|
||||
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
|
||||
else $title=$langs->trans("Category");
|
||||
|
||||
$head = categories_prepare_head($object,$type);
|
||||
dol_fiche_head($head, 'translation', $title, 0, 'category');
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -70,33 +71,33 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Remove element from category
|
||||
if ($id > 0 && $removeelem > 0)
|
||||
{
|
||||
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$tmpobject = new Product($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'product';
|
||||
}
|
||||
else if ($type==1 && $user->rights->societe->creer)
|
||||
else if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
|
||||
{
|
||||
$tmpobject = new Societe($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'fournisseur';
|
||||
}
|
||||
else if ($type==2 && $user->rights->societe->creer)
|
||||
else if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
|
||||
{
|
||||
$tmpobject = new Societe($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'societe';
|
||||
}
|
||||
else if ($type == 3 && $user->rights->adherent->creer)
|
||||
else if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$tmpobject = new Adherent($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'member';
|
||||
}
|
||||
else if ($type == 4 && $user->rights->societe->creer) {
|
||||
else if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
$tmpobject = new Contact($db);
|
||||
@@ -121,7 +122,7 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi
|
||||
}
|
||||
}
|
||||
|
||||
if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$newobject = new Product($db);
|
||||
@@ -158,12 +159,12 @@ $form = new Form($db);
|
||||
|
||||
llxHeader("","",$langs->trans("Categories"));
|
||||
|
||||
if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
|
||||
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
|
||||
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
|
||||
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
|
||||
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort");
|
||||
else $title=$langs->trans("Category");
|
||||
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
|
||||
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
|
||||
else $title=$langs->trans("Category");
|
||||
|
||||
$head = categories_prepare_head($object,$type);
|
||||
|
||||
@@ -283,7 +284,7 @@ else
|
||||
}
|
||||
|
||||
// List of products or services (type is type of category)
|
||||
if ($object->type == 0)
|
||||
if ($object->type == Categorie::TYPE_PRODUCT)
|
||||
{
|
||||
$prods = $object->getObjectsInCateg("product");
|
||||
if ($prods < 0)
|
||||
@@ -292,7 +293,7 @@ if ($object->type == 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
$showclassifyform=1; $typeid=0;
|
||||
$showclassifyform=1; $typeid=Categorie::TYPE_PRODUCT;
|
||||
|
||||
// Form to add record into a category
|
||||
if ($showclassifyform)
|
||||
@@ -334,10 +335,10 @@ if ($object->type == 0)
|
||||
print '<td align="right">';
|
||||
$typeid=$object->type;
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$prod->id."'>";
|
||||
@@ -356,7 +357,7 @@ if ($object->type == 0)
|
||||
}
|
||||
}
|
||||
|
||||
if ($object->type == 1)
|
||||
if ($object->type == Categorie::TYPE_SUPPLIER)
|
||||
{
|
||||
$socs = $object->getObjectsInCateg("supplier");
|
||||
if ($socs < 0)
|
||||
@@ -384,10 +385,10 @@ if ($object->type == 1)
|
||||
print '<td align="right">';
|
||||
$typeid=$object->type;
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
||||
@@ -407,7 +408,7 @@ if ($object->type == 1)
|
||||
}
|
||||
}
|
||||
|
||||
if($object->type == 2)
|
||||
if($object->type == Categorie::TYPE_CUSTOMER)
|
||||
{
|
||||
$socs = $object->getObjectsInCateg("customer");
|
||||
if ($socs < 0)
|
||||
@@ -438,10 +439,10 @@ if($object->type == 2)
|
||||
print '<td align="right">';
|
||||
$typeid=$object->type;
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
||||
@@ -461,7 +462,7 @@ if($object->type == 2)
|
||||
}
|
||||
|
||||
// List of members
|
||||
if ($object->type == 3)
|
||||
if ($object->type == Categorie::TYPE_MEMBER)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
@@ -493,10 +494,10 @@ if ($object->type == 3)
|
||||
print '<td align="right">';
|
||||
$typeid=$object->type;
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$member->id."'>";
|
||||
@@ -515,7 +516,7 @@ if ($object->type == 3)
|
||||
}
|
||||
|
||||
//Categorie contact
|
||||
if($object->type == 4)
|
||||
if($object->type == Categorie::TYPE_CONTACT)
|
||||
{
|
||||
$contacts = $object->getObjectsInCateg("contact");
|
||||
if ($contacts < 0)
|
||||
@@ -544,11 +545,11 @@ if($object->type == 4)
|
||||
print '<td align="right">';
|
||||
$typeid=$object->type;
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($typeid == 4) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
|
||||
if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$contact->id."'>";
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -609,6 +610,8 @@ if ($action == 'create')
|
||||
if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous"));
|
||||
else print_fiche_titre($langs->trans("AddAnAction"));
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Type of event
|
||||
@@ -784,7 +787,9 @@ if ($action == 'create')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
|
||||
@@ -685,6 +685,10 @@ class ActionComm extends CommonObject
|
||||
|
||||
foreach($this->userassigned as $key => $val)
|
||||
{
|
||||
if (! is_array($val)) // For backward compatibility when val=id
|
||||
{
|
||||
$val=array('id'=>$val);
|
||||
}
|
||||
$sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
||||
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['manadatory'])?'0':$val['manadatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -133,7 +133,7 @@ $form=new Form($db);
|
||||
$userstatic=new User($db);
|
||||
|
||||
$nav='';
|
||||
$nav.=' <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||
$nav.='<form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
|
||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.='<input type="hidden" name="status" value="'.$status.'">';
|
||||
if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
|
||||
|
||||
@@ -847,13 +847,10 @@ if (empty($reshook))
|
||||
}
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $result);
|
||||
exit();
|
||||
} else {
|
||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc'));
|
||||
exit();
|
||||
if ($result <= 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1760,7 +1757,8 @@ if ($action == 'create')
|
||||
// Build document if it not exists
|
||||
if (! $file || ! is_readable($file)) {
|
||||
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0) {
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db, $result);
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1,$object,'mailing');
|
||||
|
||||
if ($object->statut == 0)
|
||||
{
|
||||
@@ -398,7 +398,7 @@ if (empty($reshook))
|
||||
{
|
||||
$error=0;
|
||||
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1,$object,'mailing');
|
||||
|
||||
$object->sendto = $_POST["sendto"];
|
||||
if (! $object->sendto)
|
||||
@@ -495,7 +495,7 @@ if (empty($reshook))
|
||||
// Action update description of emailing
|
||||
if ($action == 'settitre' || $action == 'setemail_from' || $action == 'setreplyto' || $action == 'setemail_errorsto')
|
||||
{
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1,$object,'mailing');
|
||||
|
||||
if ($action == 'settitre') $object->titre = trim(GETPOST('titre','alpha'));
|
||||
else if ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from','alpha'));
|
||||
@@ -527,7 +527,7 @@ if (empty($reshook))
|
||||
*/
|
||||
if (! empty($_POST['addfile']))
|
||||
{
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1,$object,'mailing');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
@@ -540,7 +540,7 @@ if (empty($reshook))
|
||||
// Action remove file
|
||||
if (! empty($_POST["removedfile"]))
|
||||
{
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1,$object,'mailing');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
@@ -675,6 +675,8 @@ if ($action == 'create')
|
||||
|
||||
print_fiche_titre($langs->trans("NewMailing"));
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>';
|
||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||
@@ -706,12 +708,14 @@ if ($action == 'create')
|
||||
print '<td>';
|
||||
// Editeur wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('body',$_POST['body'],'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,70);
|
||||
$doleditor=new DolEditor('body',$_POST['body'],'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></div>';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
@@ -719,7 +723,7 @@ else
|
||||
{
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1,$object,'mailing');
|
||||
|
||||
$head = emailing_prepare_head($object);
|
||||
|
||||
|
||||
@@ -1065,13 +1065,10 @@ if (empty($reshook))
|
||||
}
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $result);
|
||||
exit();
|
||||
} else {
|
||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc'));
|
||||
exit();
|
||||
if ($result <= 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ if ($resql)
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td></tr>'."\n";
|
||||
$var=true;
|
||||
$listofstatus=array(0,1,2,3,4);
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.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
|
||||
@@ -220,11 +221,11 @@ $sql.= " AND s.client IN (2, 3)";
|
||||
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
|
||||
if ($socid) $sql.= " AND s.rowid = " .$socid;
|
||||
if ($search_stcomm != '') $sql.= " AND s.fk_stcomm=".$search_stcomm;
|
||||
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
|
||||
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_stcomm != '') $sql.= natural_search("s.fk_stcomm",$search_stcomm,2);
|
||||
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
|
||||
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_nom) {
|
||||
$sql .= natural_search(
|
||||
array(
|
||||
@@ -235,25 +236,16 @@ if ($search_nom) {
|
||||
);
|
||||
}
|
||||
if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'";
|
||||
if ($search_town) {
|
||||
$sql .= natural_search('s.town', $search_town);
|
||||
}
|
||||
if ($search_state) {
|
||||
$sql .= natural_search('d.nom', $search_state);
|
||||
}
|
||||
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
|
||||
if ($search_town) $sql .= natural_search('s.town', $search_town);
|
||||
if ($search_state) $sql .= natural_search('d.nom', $search_state);
|
||||
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
|
||||
if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status);
|
||||
// Insert levels filters
|
||||
if ($search_levels)
|
||||
{
|
||||
$sql .= " AND s.fk_prospectlevel IN (".$search_levels.')';
|
||||
}
|
||||
if ($search_levels) $sql .= " AND s.fk_prospectlevel IN (".$search_levels.')';
|
||||
// Insert sale filter
|
||||
if ($search_sale > 0)
|
||||
if ($search_sale > 0) $sql .= " AND sc.fk_user = ".$db->escape($search_sale);
|
||||
if ($socname)
|
||||
{
|
||||
$sql .= " AND sc.fk_user = ".$db->escape($search_sale);
|
||||
}
|
||||
if ($socname) {
|
||||
$sql .= natural_search('s.nom', $search_nom);
|
||||
$sortfield = "s.nom";
|
||||
$sortorder = "ASC";
|
||||
@@ -316,8 +308,9 @@ if ($resql)
|
||||
$moreforfilter='';
|
||||
if (! empty($conf->categorie->enabled))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$moreforfilter.=$langs->trans('Categories'). ': ';
|
||||
$moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1);
|
||||
$moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1);
|
||||
$moreforfilter.=' ';
|
||||
}
|
||||
// If the user can view prospects other than his'
|
||||
@@ -369,22 +362,17 @@ if ($resql)
|
||||
print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">';
|
||||
print '</td>';
|
||||
|
||||
// Added by Matelli
|
||||
// Prospect levelt
|
||||
print '<td class="liste_titre" align="center">';
|
||||
// Generate in $options_from the list of each option sorted
|
||||
$options_from = '<option value=""> </option>';
|
||||
$options_from = '<option value=""> </option>'; // Generate in $options_from the list of each option sorted
|
||||
foreach ($tab_level as $tab_level_sortorder => $tab_level_label)
|
||||
{
|
||||
$options_from .= '<option value="'.$tab_level_sortorder.'"'.($search_level_from == $tab_level_sortorder ? ' selected':'').'>';
|
||||
$options_from .= $langs->trans($tab_level_label);
|
||||
$options_from .= '</option>';
|
||||
}
|
||||
|
||||
// Reverse the list
|
||||
array_reverse($tab_level, true);
|
||||
|
||||
// Generate in $options_to the list of each option sorted in the reversed order
|
||||
$options_to = '<option value=""> </option>';
|
||||
array_reverse($tab_level, true); // Reverse the list
|
||||
$options_to = '<option value=""> </option>'; // Generate in $options_to the list of each option sorted in the reversed order
|
||||
foreach ($tab_level as $tab_level_sortorder => $tab_level_label)
|
||||
{
|
||||
$options_to .= '<option value="'.$tab_level_sortorder.'"'.($search_level_to == $tab_level_sortorder ? ' selected':'').'>';
|
||||
@@ -399,8 +387,11 @@ if ($resql)
|
||||
|
||||
print '</td>';
|
||||
|
||||
// Prospect status
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print ' ';
|
||||
// TODO Add here a list of prospect status
|
||||
//print $form->selectarray($htmlname, $array, $search_stcomm);
|
||||
//print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre" align="center">';
|
||||
|
||||
@@ -1091,10 +1091,10 @@ if (empty($reshook))
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $result);
|
||||
exit();
|
||||
if ($result <= 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1316,7 +1316,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '<input type="hidden" name="originid" value="' . $originid . '">';
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
@@ -1548,7 +1548,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Button "Create Draft"
|
||||
print '<div class="center"><input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '"></div>';
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ if ($resql)
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</td></tr>'."\n";
|
||||
$listofstatus=array(0,1,2,3,3,-1);
|
||||
$bool=false;
|
||||
|
||||
@@ -503,9 +503,8 @@ if ($action == 'create' && !$error)
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
|
||||
//Mode liste
|
||||
if (($action != 'create' && $action != 'add') || !$error)
|
||||
if (($action != 'create' && $action != 'add') && !$error)
|
||||
{
|
||||
llxHeader();
|
||||
?>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
|
||||
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2011-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* 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
|
||||
@@ -68,6 +69,15 @@ $req_desc=GETPOST("req_desc",'',3);
|
||||
$req_debit=GETPOST("req_debit",'',3);
|
||||
$req_credit=GETPOST("req_credit",'',3);
|
||||
|
||||
$req_stdtmonth=GETPOST('req_stdtmonth', 'int');
|
||||
$req_stdtday=GETPOST('req_stdtday', 'int');
|
||||
$req_stdtyear=GETPOST('req_stdtyear', 'int');
|
||||
$req_stdt = dol_mktime(0, 0, 0, $req_stdtmonth, $req_stdtday, $req_stdtyear);
|
||||
$req_enddtmonth=GETPOST('req_enddtmonth', 'int');
|
||||
$req_enddtday=GETPOST('req_enddtday', 'int');
|
||||
$req_enddtyear=GETPOST('req_enddtyear', 'int');
|
||||
$req_enddt = dol_mktime(23, 59, 59, $req_enddtmonth, $req_enddtday, $req_enddtyear);
|
||||
|
||||
$vline=GETPOST("vline");
|
||||
$page=GETPOST('page','int');
|
||||
$negpage=GETPOST('negpage','int');
|
||||
@@ -87,6 +97,14 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$req_desc="";
|
||||
$req_debit="";
|
||||
$req_credit="";
|
||||
$req_stdtmonth="";
|
||||
$req_stdtday="";
|
||||
$req_stdtyear="";
|
||||
$req_stdt = "";
|
||||
$req_enddtmonth="";
|
||||
$req_enddtday="";
|
||||
$req_enddtyear="";
|
||||
$req_enddt = "";
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -158,7 +176,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->m
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
llxHeader('',$langs->trans("FinancialAccount").'-'.$langs->trans("Transactions"));
|
||||
|
||||
$societestatic=new Societe($db);
|
||||
$userstatic=new User($db);
|
||||
@@ -253,6 +271,27 @@ if ($id > 0 || ! empty($ref))
|
||||
$param.='&paiementtype='.urlencode($paiementtype);
|
||||
$mode_search = 1;
|
||||
}
|
||||
|
||||
if ($req_stdt && $req_enddt)
|
||||
{
|
||||
$sql_rech.=" AND (b.datev BETWEEN '".$db->escape($db->idate($req_stdt))."' AND '".$db->escape($db->idate($req_enddt))."')";
|
||||
$param.='&req_stdtmonth='.$req_stdtmonth.'&req_stdtyear='.$req_stdtyear.'&req_stdtday='.$req_stdtday;
|
||||
$param.='&req_enddtmonth='.$req_enddtmonth.'&req_enddtday='.$req_enddtday.'&req_enddtyear='.$req_enddtyear;
|
||||
$mode_search = 1;
|
||||
}
|
||||
elseif ($req_stdt)
|
||||
{
|
||||
$sql_rech.=" AND b.datev >= '".$db->escape($db->idate($req_stdt))."'";
|
||||
$param.='&req_stdtmonth='.$req_stdtmonth.'&req_stdtyear='.$req_stdtyear.'&req_stdtday='.$req_stdtday;
|
||||
$mode_search = 1;
|
||||
}
|
||||
elseif ($req_enddt)
|
||||
{
|
||||
$sql_rech.=" AND b.datev <= '".$db->escape($db->idate($req_enddt))."'";
|
||||
$param.='&req_enddtmonth='.$req_enddtmonth.'&req_enddtday='.$req_enddtday.'&req_enddtyear='.$req_enddtyear;
|
||||
$mode_search = 1;
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT count(*) as total";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
@@ -324,8 +363,54 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Boutons actions
|
||||
*/
|
||||
|
||||
if ($action != 'delete')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($object->type != 2 && $object->rappro) // If not cash account and can be reconciliate
|
||||
{
|
||||
if ($user->rights->banque->consolidate)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($action != 'addline')
|
||||
{
|
||||
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
|
||||
{
|
||||
if ($user->rights->banque->modifier)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=addline&id='.$object->id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
/**
|
||||
* Search form
|
||||
*/
|
||||
@@ -352,7 +437,13 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<input type="hidden" name="thirdparty" value="'.$thirdparty.'">';
|
||||
print '<input type="hidden" name="nbpage" value="'.$totalPages.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
print '<input type="hidden" name="req_stdtmonth" value="'.$req_stdtmonth.'">';
|
||||
print '<input type="hidden" name="req_stdtyear" value="'.$req_stdtyear.'">';
|
||||
print '<input type="hidden" name="req_stdtday" value="'.$req_stdtday.'">';
|
||||
print '<input type="hidden" name="req_enddtmonth" value="'.$req_enddtmonth.'">';
|
||||
print '<input type="hidden" name="req_enddtday" value="'.$req_enddtday.'">';
|
||||
print '<input type="hidden" name="req_enddtyear" value="'.$req_enddtyear.'">';
|
||||
|
||||
$navig ='<div data-role="fieldcontain">';
|
||||
if ($limitsql > $viewline) $navig.='<a href="account.php?'.$param.'&page='.($page+1).'">'.img_previous().'</a>';
|
||||
$navig.= '<label for="negpage">'.$langs->trans("Page")."</label> "; // ' Page ';
|
||||
@@ -364,15 +455,15 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
$navig.='</div>';
|
||||
|
||||
|
||||
//var_dump($navig);
|
||||
|
||||
print '<table class="notopnoleftnoright" width="100%">';
|
||||
|
||||
// Show title
|
||||
if ($action != 'addline' && $action != 'delete')
|
||||
{
|
||||
print '<tr><td colspan="10" align="right">'.$navig.'</td></tr>';
|
||||
print '<div class="floatright">'.$navig.'</div>';
|
||||
}
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Form to add a transaction with no invoice
|
||||
if ($user->rights->banque->modifier && $action == 'addline')
|
||||
@@ -443,9 +534,12 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<input type="hidden" name="action" value="search">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
$period_filter .= $langs->trans('From').' '.$form->select_date($req_stdt,'req_stdt',0,0,1,null,1,1,1);
|
||||
$period_filter .= '<BR>'. $langs->trans('to').' '.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1);
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td>'.$period_filter.'</td>';
|
||||
print '<td>';
|
||||
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
|
||||
$filtertype='';
|
||||
@@ -530,7 +624,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$var=true;
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0; $total = 0; $sep = -1;
|
||||
$i = 0; $total = 0; $sep = -1; $total_deb=0; $total_cred=0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
@@ -765,10 +859,12 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($objp->amount < 0)
|
||||
{
|
||||
print '<td align="right" class="nowrap">'.price($objp->amount * -1).'</td><td> </td>'."\n";
|
||||
$total_deb +=$objp->amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td> </td><td align="right" class="nowrap"> '.price($objp->amount).'</td>'."\n";
|
||||
$total_cred +=$objp->amount;
|
||||
}
|
||||
|
||||
// Balance
|
||||
@@ -840,11 +936,23 @@ if ($id > 0 || ! empty($ref))
|
||||
// Show total
|
||||
if ($page == 0 && ! $mode_search)
|
||||
{
|
||||
//Real account situation
|
||||
print '<tr class="liste_total"><td align="left" colspan="8">';
|
||||
if ($sep > 0) print ' '; // If we had at least one line in future
|
||||
else print $langs->trans("CurrentBalance");
|
||||
print ' '.$object->currency_code.'</td>';
|
||||
print '<td align="right" class="nowrap"><b>'.price($total, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
|
||||
print '<td align="right" class="nowrap"><b>'.price($solde, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
// Only total according row displays
|
||||
print '<tr class="liste_total"><td align="left" colspan="6">';
|
||||
if ($sep > 0) print ' '; // If we had at least one line in future
|
||||
else print $langs->trans("Total");
|
||||
print ' '.$object->currency_code.'</td>';
|
||||
print '<td align="right" class="nowrap"><b>'.price($total_deb*-1, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
|
||||
print '<td align="right" class="nowrap"><b>'.price($total_cred, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
|
||||
print '<td align="right" class="nowrap"><b>'.price($total_cred-($total_deb*-1), 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -859,51 +967,6 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* Boutons actions
|
||||
*/
|
||||
|
||||
if ($action != 'delete')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($object->type != 2 && $object->rappro) // If not cash account and can be reconciliate
|
||||
{
|
||||
if ($user->rights->banque->consolidate)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($action != 'addline')
|
||||
{
|
||||
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
|
||||
{
|
||||
if ($user->rights->banque->modifier)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=addline&id='.$object->id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
else
|
||||
|
||||
@@ -186,12 +186,14 @@ print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Affiche tableau
|
||||
print '<table class="notopnoleftnoright" width="100%">';
|
||||
print '<div class="floatright">'.$link.'</div>';
|
||||
|
||||
print '<tr><td colspan="'.(1+($year_end-$year_start+1)*2).'" align="right">'.$link.'</td></tr>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
@@ -245,16 +247,13 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
// Ligne vierge
|
||||
print '<tr><td> </td>';
|
||||
$nbcol=0;
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
$nbcol+=2;
|
||||
}
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
|
||||
// Solde actuel
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Current balance
|
||||
$balance=0;
|
||||
|
||||
$sql = "SELECT SUM(b.amount) as total";
|
||||
@@ -274,6 +273,9 @@ if ($resql)
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_total"><td><b>'.$langs->trans("CurrentBalance")."</b></td>";
|
||||
print '<td colspan="'.($nbcol).'" align="right">'.price($balance).'</td>';
|
||||
print "</tr>\n";
|
||||
@@ -496,9 +498,9 @@ else
|
||||
unset($tblyear[1]);
|
||||
unset($tblyear[2]);
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft"><div class="center">';
|
||||
print '<div class="fichecenter"><div class="fichehalfleft"><div align="center">'; // do not use class="center" here, it will have no effect for the js graph inside.
|
||||
print $show1;
|
||||
print '</div></div><div class="fichehalfright"><div class="ficheaddleft"><div class="center">';
|
||||
print '</div></div><div class="fichehalfright"><div class="ficheaddleft"><div align="center">'; // do not use class="center" here, it will have no effect for the js graph inside.
|
||||
print $show2;
|
||||
print '</div></div></div></div>';
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
@@ -813,6 +813,9 @@ print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<table class="notopnoleftnoright" width="100%">';
|
||||
|
||||
// Navigation links
|
||||
@@ -876,8 +879,6 @@ if ($mode == 'showalltime')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@@ -139,11 +139,10 @@ if (empty($num))
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$acct->id, $sortfield, $sortorder,'',$numrows);
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$acct->id, $sortfield, $sortorder,'',$numrows);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Vinícius Nogueira <viniciusvgn@gmail.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro>
|
||||
@@ -196,13 +196,13 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'b.rowid','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('DateOperationShort'),$_SERVER['PHP_SELF'],'b.dateo','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Value'),$_SERVER['PHP_SELF'],'b.datev','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre" align="center">'.$langs->trans("Type").'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans("Numero").'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans("Description").'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans("ThirdParty").'</td>';
|
||||
print '<td class="liste_titre" align="right">'.$langs->trans("Debit").'</td>';
|
||||
print '<td class="liste_titre" align="right">'.$langs->trans("Credit").'</td>';
|
||||
print '<td class="liste_titre" align="left"> '.$langs->trans("Account").'</td>';
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER['PHP_SELF'],'','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Numero"));
|
||||
print_liste_field_titre($langs->trans("Description"));
|
||||
print_liste_field_titre($langs->trans("ThirdParty"));
|
||||
print_liste_field_titre($langs->trans("Debit"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@@ -214,9 +214,9 @@ if ($resql)
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="req_nb" value="'.GETPOST("req_nb").'" size="2"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="description" size="24" value="'.$description.'">';
|
||||
print '<input type="text" class="flat" name="description" size="10" value="'.$description.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="thirdparty" value="'.GETPOST("thirdparty").'" size="14"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="thirdparty" value="'.GETPOST("thirdparty").'" size="10"></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="text" class="flat" name="debit" size="4" value="'.$debit.'">';
|
||||
print '</td>';
|
||||
@@ -267,7 +267,7 @@ if ($resql)
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($objp->dv),"day")."</td>\n";
|
||||
|
||||
// Payment type
|
||||
print '<td class="nowrap">';
|
||||
print '<td align="center" class="nowrap">';
|
||||
$labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle');
|
||||
if ($labeltype == 'SOLD') print ' '; //$langs->trans("InitialBankBalance");
|
||||
else print $labeltype;
|
||||
@@ -305,7 +305,7 @@ if ($resql)
|
||||
// Debit/Credit
|
||||
if ($objp->amount < 0)
|
||||
{
|
||||
print "<td align=\"right\">".price($objp->amount * -1)."</td><td> </td>\n";
|
||||
print '<td align="right">'.price($objp->amount * -1)."</td><td> </td>\n";
|
||||
$total_debit+=$objp->amount;
|
||||
}
|
||||
else
|
||||
@@ -315,7 +315,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
// Bank account
|
||||
print '<td align="left" class="nowrap">';
|
||||
print '<td align="right" class="nowrap">';
|
||||
$bankaccountstatic->id=$objp->bankid;
|
||||
$bankaccountstatic->label=$objp->bankref;
|
||||
print $bankaccountstatic->getNomUrl(1);
|
||||
|
||||
@@ -85,10 +85,6 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
// Onglets
|
||||
$head=bank_prepare_head($acct);
|
||||
dol_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0,'account');
|
||||
@@ -109,14 +105,15 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$solde = $acct->solde(0);
|
||||
|
||||
/*
|
||||
* Affiche tableau des echeances a venir
|
||||
*/
|
||||
print '<table class="notopnoleftnoright" width="100% border="1">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
// Ligne de titre tableau des ecritures
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@@ -1743,8 +1743,8 @@ if (empty($reshook))
|
||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db, $result);
|
||||
exit();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1970,7 +1970,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="originid" value="' . $originid . '">';
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
@@ -2475,7 +2475,7 @@ if ($action == 'create')
|
||||
print "</table>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Button "Create Draft"
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '">';
|
||||
|
||||
@@ -323,7 +323,7 @@ if ($resql)
|
||||
$formother->select_year($year?$year:-1,'year',1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left"> </td>';
|
||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" name="search_societe" value="'.$search_societe.'"></td>';
|
||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="8" name="search_societe" value="'.$search_societe.'"></td>';
|
||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ht" value="'.$search_montant_ht.'"></td>';
|
||||
print '<td class="liste_titre" align="right"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ttc" value="'.$search_montant_ttc.'"></td>';
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -262,7 +263,7 @@ else if ($action == 'remove_file' && $user->rights->banque->cheque)
|
||||
|
||||
$langs->load("other");
|
||||
|
||||
$file=$dir.get_exdir($object->number,2,1) . GETPOST('file');
|
||||
$file=$dir.get_exdir($object->number,2,1,0,$object,'cheque') . GETPOST('file');
|
||||
$ret=dol_delete_file($file,0,0,0,$object);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors');
|
||||
@@ -322,7 +323,7 @@ else
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -331,7 +332,7 @@ else
|
||||
if ($action == 'valide')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +348,9 @@ if ($action == 'new')
|
||||
|
||||
print '<form class="nocellnopadd" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="action" value="new">';
|
||||
//print '<fieldset><legend>aaa</legend>';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
//print '<tr><td width="30%">'.$langs->trans('Date').'</td><td width="70%">'.dol_print_date($now,'day').'</td></tr>';
|
||||
// Filter
|
||||
@@ -358,6 +361,9 @@ if ($action == 'new')
|
||||
$form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1);
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="filter" value="'.dol_escape_htmltag($langs->trans("ToFilter")).'">';
|
||||
if ($filterdate || $filteraccountid > 0)
|
||||
@@ -366,8 +372,7 @@ if ($action == 'new')
|
||||
print '<input type="submit" class="button" name="removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
}
|
||||
print '</div>';
|
||||
//print '</fieldset>';
|
||||
print '</form>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
$sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as chqid, ";
|
||||
@@ -704,7 +709,7 @@ if ($action != 'new')
|
||||
if ($object->statut == 1)
|
||||
{
|
||||
$filename=dol_sanitizeFileName($object->ref);
|
||||
$filedir=$dir.get_exdir($object->number,2,1) . dol_sanitizeFileName($object->ref);
|
||||
$filedir=$dir.get_exdir($object->number,2,1,0,$object,'cheque') . dol_sanitizeFileName($object->ref);
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
|
||||
$formfile->show_documents('remisecheque', $filename, $filedir, $urlsource, 1, 1);
|
||||
|
||||
@@ -42,6 +42,7 @@ $socid = GETPOST('socid','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'prelevement','','');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@@ -158,7 +159,7 @@ if ($resql)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="2">'.$langs->trans("NoInvoiceToWithdraw").'</td></tr>';
|
||||
print '<tr '.$bc[false].'><td colspan="2">'.$langs->trans("NoInvoiceToWithdraw").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -26,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
|
||||
$langs->load("products");
|
||||
$langs->load("categories");
|
||||
@@ -245,7 +247,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
// Category filter
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>';
|
||||
print $langs->trans("Category") . ': ' . $formother->select_categories(0, $selected_cat, 'search_categ', true);
|
||||
print $langs->trans("Category") . ': ' . $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', true);
|
||||
print ' ';
|
||||
print $langs->trans("SubCats") . '? ';
|
||||
print '<input type="checkbox" name="subcat" value="yes"';
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -29,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("categories");
|
||||
@@ -313,7 +315,7 @@ print "<table class=\"noborder\" width=\"100%\">";
|
||||
// Category filter
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>';
|
||||
print $langs->trans("Category") . ': ' . $formother->select_categories(2, $selected_cat, 'search_categ', true);
|
||||
print $langs->trans("Category") . ': ' . $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', true);
|
||||
print ' ';
|
||||
print $langs->trans("SubCats") . '? ';
|
||||
print '<input type="checkbox" name="subcat" value="yes"';
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -187,6 +188,8 @@ if ($action == 'create')
|
||||
|
||||
print_fiche_titre($langs->trans("NewVATPayment"));
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print "<tr>";
|
||||
@@ -228,7 +231,7 @@ if ($action == 'create')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print "<br>";
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
|
||||
@@ -812,7 +812,7 @@ else
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||
print '<td>';
|
||||
print $object->getLibStatut(5);
|
||||
print $object->getLibStatut(4);
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
@@ -1036,7 +1036,7 @@ else
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||
print '<td>';
|
||||
print $object->getLibStatut(5);
|
||||
print $object->getLibStatut(4);
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
// Other attributes
|
||||
|
||||
@@ -970,7 +970,7 @@ class Contact extends CommonObject
|
||||
}
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('StatusContactDraft');
|
||||
if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
}
|
||||
elseif ($mode == 5)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -275,8 +275,9 @@ if ($result)
|
||||
|
||||
if (! empty($conf->categorie->enabled))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$moreforfilter.=$langs->trans('Categories'). ': ';
|
||||
$moreforfilter.=$formother->select_categories(4,$search_categ,'search_categ',1);
|
||||
$moreforfilter.=$formother->select_categories(Categorie::TYPE_CONTACT,$search_categ,'search_categ',1);
|
||||
$moreforfilter.=' ';
|
||||
}
|
||||
if ($moreforfilter)
|
||||
|
||||
@@ -807,13 +807,10 @@ else if ($action == 'builddoc' && $user->rights->contrat->creer) {
|
||||
}
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $result);
|
||||
exit();
|
||||
} else {
|
||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc'));
|
||||
exit();
|
||||
if ($result <= 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Services").'</td></tr>'."\n";
|
||||
$var=true;
|
||||
$listofstatus=array(0,4,4,5); $bool=false;
|
||||
|
||||
@@ -418,7 +418,7 @@ abstract class CommonObject
|
||||
/**
|
||||
* Get array of all contacts for an object
|
||||
*
|
||||
* @param int $statut Status of lines to get (-1=all)
|
||||
* @param int $statut Status of links to get (-1=all)
|
||||
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
|
||||
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
|
||||
* @return array Array of contacts
|
||||
@@ -429,9 +429,9 @@ abstract class CommonObject
|
||||
|
||||
$tab=array();
|
||||
|
||||
$sql = "SELECT ec.rowid, ec.statut, ec.fk_socpeople as id, ec.fk_c_type_contact"; // This field contains id of llx_socpeople or id of llx_user
|
||||
if ($source == 'internal') $sql.=", '-1' as socid";
|
||||
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid";
|
||||
$sql = "SELECT ec.rowid, ec.statut as statuslink, ec.fk_socpeople as id, ec.fk_c_type_contact"; // This field contains id of llx_socpeople or id of llx_user
|
||||
if ($source == 'internal') $sql.=", '-1' as socid, t.statut as statuscontact";
|
||||
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid, t.statut as statuscontact";
|
||||
$sql.= ", t.civility as civility, t.lastname as lastname, t.firstname, t.email";
|
||||
$sql.= ", tc.source, tc.element, tc.code, tc.libelle";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
|
||||
@@ -463,8 +463,8 @@ abstract class CommonObject
|
||||
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
|
||||
$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,
|
||||
'nom'=>$obj->lastname, // For backward compatibility
|
||||
'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email,
|
||||
'rowid'=>$obj->rowid,'code'=>$obj->code,'libelle'=>$libelle_type,'status'=>$obj->statut, 'fk_c_type_contact' => $obj->fk_c_type_contact);
|
||||
'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email, 'statuscontact'=>$obj->statuscontact,
|
||||
'rowid'=>$obj->rowid, 'code'=>$obj->code, 'libelle'=>$libelle_type, 'status'=>$obj->statuslink, 'fk_c_type_contact'=>$obj->fk_c_type_contact);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -923,7 +923,12 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'chkbxlst')
|
||||
{
|
||||
$value_arr = explode(',', $value);
|
||||
if (is_array($value)) {
|
||||
$value_arr = $value;
|
||||
}
|
||||
else {
|
||||
$value_arr = explode(',', $value);
|
||||
}
|
||||
|
||||
if (is_array($param['options'])) {
|
||||
$param_list = array_keys($param['options']);
|
||||
|
||||
@@ -132,7 +132,7 @@ class FileUpload
|
||||
|
||||
$object_ref = dol_sanitizeFileName($object->ref);
|
||||
if ($element == 'invoice_supplier') {
|
||||
$object_ref = get_exdir($object->id, 2) . $object_ref;
|
||||
$object_ref = get_exdir($object->id,2,0,0,$object,'invoice_supplier') . $object_ref;
|
||||
} else if ($element == 'project_task') {
|
||||
$object_ref = $object->project->ref . '/' . $object_ref;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<?php
|
||||
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
||||
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
||||
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -4304,36 +4304,40 @@ class Form
|
||||
|
||||
/**
|
||||
* Return a HTML select string, built from an array of key+value.
|
||||
* Note: Do not use returned string into a langs->trans function, content may be entity encoded twice.
|
||||
* Note: Do not apply langs->trans function on returned content, content may be entity encoded twice.
|
||||
*
|
||||
* @param string $htmlname Name of html select area
|
||||
* @param array $array Array with key+value
|
||||
* @param string $id Preselected key
|
||||
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' ').
|
||||
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
|
||||
* @param int $value_as_key 1 to use value as key
|
||||
* @param string $moreparam Add more parameters onto the select tag
|
||||
* @param int $translate Translate and encode value
|
||||
* @param int $maxlen Length maximum for labels
|
||||
* @param int $disabled Html select box is disabled
|
||||
* @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort
|
||||
* @param string $morecss Add more class to css styles
|
||||
* @param int $addjscombo Add js combo
|
||||
* @return string HTML select string.
|
||||
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
|
||||
* @param array $array Array with key+value
|
||||
* @param string|string[] $id Preselected key or preselected keys for multiselect
|
||||
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' ').
|
||||
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
|
||||
* @param int $value_as_key 1 to use value as key
|
||||
* @param string $moreparam Add more parameters onto the select tag
|
||||
* @param int $translate Translate and encode value
|
||||
* @param int $maxlen Length maximum for labels
|
||||
* @param int $disabled Html select box is disabled
|
||||
* @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort
|
||||
* @param string $morecss Add more class to css styles
|
||||
* @param int $addjscombo Add js combo
|
||||
* @return string HTML select string.
|
||||
* @see multiselectarray
|
||||
*/
|
||||
static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
// Do we want a multiselect ?
|
||||
$multiselect = 0;
|
||||
if (preg_match('/^multi/',$htmlname)) $multiselect = 1;
|
||||
|
||||
if ($value_as_key) $array=array_combine($array, $array);
|
||||
|
||||
$out='';
|
||||
|
||||
// Add code for jquery to use multiselect
|
||||
if ($addjscombo && empty($conf->dol_use_jmobile) && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')))
|
||||
if ($addjscombo && empty($conf->dol_use_jmobile) && $multiselect)
|
||||
{
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT')?constant('REQUIRE_JQUERY_MULTISELECT'):'select2':$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
$out.='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
@@ -4393,12 +4397,11 @@ class Form
|
||||
|
||||
|
||||
/**
|
||||
* Return a HTML select string, built from an array of key+value.
|
||||
* Note: Do not use returned string into a langs->trans function, content may be entity encoded twice.
|
||||
* Return a HTML select string, built from an array of key+value but content returned into select come from an Ajax call of an URL.
|
||||
* Note: Do not apply langs->trans function on returned content, content may be entity encoded twice.
|
||||
*
|
||||
* @param string $url Url
|
||||
* @param string $htmlname Name of html select area
|
||||
* @param array $array Array with key+value
|
||||
* @param string $url Url
|
||||
* @param string $id Preselected key
|
||||
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' ').
|
||||
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
|
||||
@@ -4412,7 +4415,7 @@ class Form
|
||||
* @param int $addjscombo Add js combo
|
||||
* @return string HTML select string.
|
||||
*/
|
||||
static function selectArrayAjax($url, $htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0)
|
||||
static function selectArrayAjax($htmlname, $url, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0)
|
||||
{
|
||||
$out = '';
|
||||
|
||||
@@ -4455,7 +4458,7 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO get values from ajax page to use a standard already completed array
|
||||
// TODO get all values from $url into $array
|
||||
|
||||
}
|
||||
|
||||
@@ -4590,7 +4593,7 @@ class Form
|
||||
|
||||
if ($rendermode == 0)
|
||||
{
|
||||
$cate_arbo = $this->select_all_categories(0, '', 'parent', 64, 0, 1);
|
||||
$cate_arbo = $this->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
|
||||
foreach($categories as $c) {
|
||||
$arrayselected[] = $c->id;
|
||||
}
|
||||
@@ -4806,19 +4809,19 @@ class Form
|
||||
else if ($modulepart=='userphoto')
|
||||
{
|
||||
$dir=$conf->user->dir_output;
|
||||
if ($object->photo) $file=get_exdir($id, 2).$object->photo;
|
||||
if ($object->photo) $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
|
||||
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
||||
$email=$object->email;
|
||||
}
|
||||
else if ($modulepart=='memberphoto')
|
||||
{
|
||||
$dir=$conf->adherent->dir_output;
|
||||
if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo;
|
||||
if ($object->photo) $file=get_exdir($id, 2, 0, 0, $object, 'invoice_supplier').'photos/'.$object->photo;
|
||||
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
||||
$email=$object->email;
|
||||
}else {
|
||||
$dir=$conf->$modulepart->dir_output;
|
||||
if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo;
|
||||
if ($object->photo) $file=get_exdir($id, 2, 0, 0, $adherent, 'member').'photos/'.$object->photo;
|
||||
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
||||
$email=$object->email;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
@@ -118,7 +118,7 @@ class FormFile
|
||||
$out .= '<input class="flat" type="file" name="userfile" size="'.$maxlength.'"';
|
||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':'');
|
||||
$out .= '>';
|
||||
$out .= ' ';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
|
||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':'');
|
||||
$out .= '>';
|
||||
@@ -183,6 +183,7 @@ class FormFile
|
||||
$out .= '<input type="text" name="label" id="label">';
|
||||
$out .= '<input type="hidden" name="objecttype" value="' . $object->element . '">';
|
||||
$out .= '<input type="hidden" name="objectid" value="' . $object->id . '">';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" name="linkit" value="'.$langs->trans("ToLink").'"';
|
||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':'');
|
||||
$out .= '>';
|
||||
@@ -265,7 +266,6 @@ class FormFile
|
||||
|
||||
if (! is_object($form)) $form=new Form($this->db);
|
||||
|
||||
// filedir = $conf->...->dir_ouput."/".get_exdir(id)
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
// For backward compatibility
|
||||
@@ -579,11 +579,9 @@ class FormFile
|
||||
$var=!$var;
|
||||
|
||||
// Define relative path for download link (depends on module)
|
||||
$relativepath=$file["name"]; // Cas general
|
||||
$relativepath=$file["name"]; // Cas general
|
||||
if ($modulesubdir) $relativepath=$modulesubdir."/".$file["name"]; // Cas propal, facture...
|
||||
// Autre cas
|
||||
if ($modulepart == 'donation') { $relativepath = get_exdir($modulesubdir,2).$file["name"]; }
|
||||
if ($modulepart == 'export') { $relativepath = $file["name"]; }
|
||||
if ($modulepart == 'export') $relativepath = $file["name"]; // Other case
|
||||
|
||||
$out.= "<tr ".$bc[$var].">";
|
||||
|
||||
@@ -701,14 +699,14 @@ class FormFile
|
||||
if ($modulesubdir) $relativepath=$modulesubdir."/".$file["name"]; // Cas propal, facture...
|
||||
// Autre cas
|
||||
if ($modulepart == 'donation') {
|
||||
$relativepath = get_exdir($modulesubdir,2).$file["name"];
|
||||
$relativepath = get_exdir($modulesubdir,2,0,0,null,'donation').$file["name"];
|
||||
}
|
||||
if ($modulepart == 'export') {
|
||||
$relativepath = $file["name"];
|
||||
}
|
||||
if ($modulepart == 'facture_fournisseur') {
|
||||
$relativepath = get_exdir($modulesubdir, 2). $modulesubdir. "/" . $file["name"];
|
||||
}
|
||||
if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_fournisseur') {
|
||||
$relativepath = get_exdir($modulesubdir, 2,0,0,null,'invoice_supplier'). $modulesubdir. "/" . $file["name"];
|
||||
}
|
||||
|
||||
// Show file name with link to download
|
||||
$out.= '<a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
||||
@@ -802,8 +800,8 @@ class FormFile
|
||||
if (empty($relativepath))
|
||||
{
|
||||
$relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/';
|
||||
if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath
|
||||
if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath
|
||||
if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2,0,0,$object,'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath
|
||||
if ($object->element == 'member') $relativepath=get_exdir($object->id,2,0,0,$object,'member').$relativepath; // TODO Call using a defined value for $relativepath
|
||||
if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.';
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ class FormOther
|
||||
}
|
||||
// Select each sales and print them in a select input
|
||||
$out.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
|
||||
if ($showempty) $out.='<option value="-1"> </option>';
|
||||
if ($showempty) $out.='<option value="0"> </option>';
|
||||
|
||||
// Get list of users allowed to be viewed
|
||||
$sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login";
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr>
|
||||
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -83,8 +84,9 @@ function societe_prepare_head(Societe $object)
|
||||
//show categorie tab
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
$type = 2;
|
||||
if ($object->fournisseur) $type = 1;
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$type = Categorie::TYPE_CUSTOMER;
|
||||
if ($object->fournisseur) $type = Categorie::TYPE_SUPPLIER;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$object->id."&type=".$type;
|
||||
$head[$h][1] = $langs->trans('Categories');
|
||||
$head[$h][2] = 'category';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -88,7 +89,8 @@ function contact_prepare_head(Contact $object)
|
||||
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
$type = 4;
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$type = Categorie::TYPE_CONTACT;
|
||||
$head[$tab][0] = DOL_URL_ROOT.'/categories/categorie.php?id='.$object->id."&type=".$type;
|
||||
$head[$tab][1] = $langs->trans('Categories');
|
||||
$head[$tab][2] = 'category';
|
||||
|
||||
@@ -1399,7 +1399,7 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta
|
||||
/**
|
||||
* Security check when accessing to a document (used by document.php, viewimage.php and webservices)
|
||||
*
|
||||
* @param string $modulepart Module of document (module, module_user_temp, module_user or module_temp)
|
||||
* @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp')
|
||||
* @param string $original_file Relative path with filename
|
||||
* @param string $entity Restrict onto entity
|
||||
* @param User $fuser User object (forced)
|
||||
@@ -1817,7 +1817,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
$accessallowed=1;
|
||||
}
|
||||
|
||||
$original_file=$conf->banque->dir_output.'/bordereau/'.get_exdir(basename($original_file,".pdf"),2,1).$original_file;
|
||||
$original_file=$conf->banque->dir_output.'/bordereau/'.$original_file; // original_file should contains relative path so include the get_exdir result
|
||||
}
|
||||
|
||||
// Wrapping for export module
|
||||
|
||||
@@ -69,7 +69,7 @@ function facturefourn_prepare_head($object)
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$object->ref;
|
||||
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$object->ref;
|
||||
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$object->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
|
||||
@@ -1127,19 +1127,6 @@ function dol_getdate($timestamp,$fast=false)
|
||||
else
|
||||
{
|
||||
$arrayinfo=getdate($timestamp);
|
||||
|
||||
/*$startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1;
|
||||
if($startday==1)
|
||||
{
|
||||
if ($arrayinfo["wday"]==0)
|
||||
{
|
||||
$arrayinfo["wday"]=6;
|
||||
}
|
||||
else
|
||||
{
|
||||
$arrayinfo["wday"]=$arrayinfo["wday"]-1;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return $arrayinfo;
|
||||
@@ -2826,7 +2813,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
{
|
||||
if ($totalnboflines) // If we know total nb of lines
|
||||
{
|
||||
$maxnbofpage=10;
|
||||
$maxnbofpage=(empty($conf->dol_optimize_smallscreen)?10:3); // nb before and after selected page
|
||||
|
||||
$nbpages=ceil($totalnboflines/$conf->liste_limit);
|
||||
$cpt=($page-$maxnbofpage);
|
||||
@@ -2834,36 +2821,34 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
|
||||
if ($cpt>=1)
|
||||
{
|
||||
$pagelist.= '<li><a href="'.$file.'?page=0'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">1</a></li>'."\n";
|
||||
if ($cpt >= 2) $pagelist.='<li><span>...</span></li>';
|
||||
$pagelist.= '<li class="pagination"><a href="'.$file.'?page=0'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">1</a></li>';
|
||||
if ($cpt >= 2) $pagelist.='<li><span class="inactive">...</span></li>';
|
||||
}
|
||||
do
|
||||
{
|
||||
if ($cpt==$page)
|
||||
{
|
||||
$pagelist.= '<li><span class="active">'.($page+1).'</span></li>'."\n";
|
||||
$pagelist.= '<li class="pagination"><span class="active">'.($page+1).'</span></li>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$pagelist.= '<li><a href="'.$file.'?page='.$cpt.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($cpt+1).'</a></li>'."\n";
|
||||
$pagelist.= '<li class="pagination"><a href="'.$file.'?page='.$cpt.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($cpt+1).'</a></li>';
|
||||
}
|
||||
$cpt++;
|
||||
}
|
||||
while ($cpt < $nbpages && $cpt<=$page+$maxnbofpage);
|
||||
if ($cpt<$nbpages)
|
||||
{
|
||||
if ($cpt<$nbpages-1) $pagelist.= '<li><span>...</span></li>';
|
||||
$pagelist.= '<li><a href="'.$file.'?page='.($nbpages-1).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$nbpages.'</a></li>'."\n";
|
||||
if ($cpt<$nbpages-1) $pagelist.= '<li class="pagination"><span class="inactive">...</span></li>';
|
||||
$pagelist.= '<li class="pagination"><a href="'.$file.'?page='.($nbpages-1).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$nbpages.'</a></li>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$pagelist.= '<li><span class="active">'.($page+1)."</li>\n";
|
||||
$pagelist.= '<li class="pagination"><span class="active">'.($page+1)."</li>";
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
print_fleche_navigation($page,$file,$options,$nextpage,$pagelist);
|
||||
if ($morehtml) print $morehtml;
|
||||
print_fleche_navigation($page,$file,$options,$nextpage,$pagelist,$morehtml);
|
||||
print '</td>';
|
||||
|
||||
print '</tr></table>'."\n";
|
||||
@@ -2874,28 +2859,35 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
* Function to show navigation arrows into lists
|
||||
*
|
||||
* @param int $page Number of page
|
||||
* @param string $file Page
|
||||
* @param string $file Page URL (in most cases provided with $_SERVER["PHP_SELF"])
|
||||
* @param string $options Other url paramaters to propagate ("" by default)
|
||||
* @param integer $nextpage Do we show a next page button
|
||||
* @param string $betweenarrows HTML Content to show between arrows
|
||||
* @param string $betweenarrows HTML content to show between arrows. Must contains '<li> </li>' tags.
|
||||
* @param string $afterarrows HTML content to show after arrows. Must NOT contains '<li> </li>' tags.
|
||||
* @return void
|
||||
*/
|
||||
function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarrows='')
|
||||
function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarrows='',$afterarrows='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
print '<div class="pagination"><ul>';
|
||||
if ($page > 0)
|
||||
{
|
||||
if (empty($conf->dol_use_jmobile)) print '<li><a class="paginationprevious" href="'.$file.'?page='.($page-1).$options.'"><</a></li>'."\n";
|
||||
else print '<li><a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$file.'?page='.($page-1).$options.'">'.$langs->trans("Previous").'</a></li>'."\n";
|
||||
if (empty($conf->dol_use_jmobile)) print '<li class="pagination"><a class="paginationprevious" href="'.$file.'?page='.($page-1).$options.'"><</a></li>';
|
||||
else print '<li><a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$file.'?page='.($page-1).$options.'">'.$langs->trans("Previous").'</a></li>';
|
||||
}
|
||||
//if ($betweenarrows) print ($page > 0?' ':'').$betweenarrows.($nextpage>0?' ':'');
|
||||
print $betweenarrows;
|
||||
if ($nextpage > 0)
|
||||
{
|
||||
if (empty($conf->dol_use_jmobile)) print '<li><a class="paginationnext" href="'.$file.'?page='.($page+1).$options.'">></a></li>'."\n";
|
||||
else print '<li><a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$file.'?page='.($page+1).$options.'">'.$langs->trans("Next").'</a></li>'."\n";
|
||||
if (empty($conf->dol_use_jmobile)) print '<li class="pagination"><a class="paginationnext" href="'.$file.'?page='.($page+1).$options.'">></a></li>';
|
||||
else print '<li><a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$file.'?page='.($page+1).$options.'">'.$langs->trans("Next").'</a></li>';
|
||||
}
|
||||
if ($afterarrows)
|
||||
{
|
||||
print '<li class="paginationafterarrows">';
|
||||
print $afterarrows;
|
||||
print '</li>';
|
||||
}
|
||||
print '</ul></div>'."\n";
|
||||
}
|
||||
@@ -3709,26 +3701,46 @@ function yn($yesno, $case=1, $color=0)
|
||||
|
||||
|
||||
/**
|
||||
* Return a path to have a directory according to an id
|
||||
* Return a path to have a directory according to object.
|
||||
* Examples: '001' with level 3->"0/0/1/", '015' with level 3->"0/1/5/"
|
||||
* Examples: 'ABC-1' with level 3 ->"0/0/1/", '015' with level 1->"5/"
|
||||
*
|
||||
* @param string $num Id to develop
|
||||
* @param int $level Level of development (1, 2 or 3 level)
|
||||
* @param string $num Id of object
|
||||
* @param int $level Level of subdirs to return (1, 2 or 3 levels)
|
||||
* @param int $alpha Use alpha ref
|
||||
* @param int $withoutslash 0=With slash at end, 1=without slash at end
|
||||
* @return string Dir to use
|
||||
* @param int $withoutslash 0=With slash at end, 1=without slash at end (except if '/', we return '')
|
||||
* @param Object $object Object
|
||||
* @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...')
|
||||
* @return string Dir to use ending. Example '' or '1/' or '1/2/'
|
||||
*/
|
||||
function get_exdir($num,$level=3,$alpha=0,$withoutslash=0)
|
||||
function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$path = '';
|
||||
if (empty($alpha)) $num = preg_replace('/([^0-9])/i','',$num);
|
||||
else $num = preg_replace('/^.*\-/i','',$num);
|
||||
$num = substr("000".$num, -$level);
|
||||
if ($level == 1) $path = substr($num,0,1);
|
||||
if ($level == 2) $path = substr($num,1,1).'/'.substr($num,0,1);
|
||||
if ($level == 3) $path = substr($num,2,1).'/'.substr($num,1,1).'/'.substr($num,0,1);
|
||||
if (empty($withoutslash)) $path.='/';
|
||||
|
||||
// TODO if object is null, load it from id and modulepart.
|
||||
|
||||
|
||||
if (! empty($level) && in_array($modulepart, array('cheque','user','category','shipment', 'member','don','donation','supplier_invoice','invoice_supplier')))
|
||||
{
|
||||
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided
|
||||
if (empty($alpha)) $num = preg_replace('/([^0-9])/i','',$num);
|
||||
else $num = preg_replace('/^.*\-/i','',$num);
|
||||
$num = substr("000".$num, -$level);
|
||||
if ($level == 1) $path = substr($num,0,1);
|
||||
if ($level == 2) $path = substr($num,1,1).'/'.substr($num,0,1);
|
||||
if ($level == 3) $path = substr($num,2,1).'/'.substr($num,1,1).'/'.substr($num,0,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
// We will introduce here a common way of forging path for document storage
|
||||
// Here, $num=id, ref and modulepart are required.
|
||||
|
||||
}
|
||||
|
||||
if (empty($withoutslash) && ! empty($path)) $path.='/';
|
||||
return $path;
|
||||
}
|
||||
|
||||
@@ -4008,7 +4020,7 @@ function dol_nboflines($s,$maxchar=0)
|
||||
* @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut)
|
||||
* @param string $charset Give the charset used to encode the $text variable in memory.
|
||||
* @return int Number of lines
|
||||
* @see dol_nboflines
|
||||
* @see dol_nboflines, dolGetFirstLineOfText
|
||||
*/
|
||||
function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8')
|
||||
{
|
||||
@@ -4962,21 +4974,22 @@ function dol_getmypid()
|
||||
|
||||
|
||||
/**
|
||||
* Generate natural SQL search string
|
||||
* Generate natural SQL search string for a criteria (this criteria can be tested on one or several fields)
|
||||
*
|
||||
* @param string|string[] $fields String or array of strings, filled with the name of fields in the SQL query
|
||||
* @param string|string[] $fields String or array of strings, filled with the name of all fields in the SQL query we must check (combined with a OR)
|
||||
* @param string $value The value to look for.
|
||||
* If param $numeric is 0, can contains several keywords separated with a space, like "keyword1 keyword2" = We want record field like keyword1 and field like keyword2
|
||||
* If param $numeric is 1, can contains an operator <>= like "<10" or ">=100.5 < 1000"
|
||||
* @param integer $numeric 0=value is list of keywords, 1=value is a numeric test
|
||||
* If param $mode is 0, can contains several keywords separated with a space, like "keyword1 keyword2" = We want record field like keyword1 and field like keyword2
|
||||
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
|
||||
* If param $mode is 2, can contains a list of id separated by comma like "1,3,4"
|
||||
* @param integer $mode 0=value is list of keywords, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
|
||||
* @param integer $nofinaland 1=Do now output the final 'AND'
|
||||
* @return string $res The statement to append to the SQL query
|
||||
*/
|
||||
function natural_search($fields, $value, $numeric=0, $nofinaland=0)
|
||||
function natural_search($fields, $value, $mode=0, $nofinaland=0)
|
||||
{
|
||||
global $db,$langs;
|
||||
|
||||
if ($numeric)
|
||||
if ($mode == 1)
|
||||
{
|
||||
$value=preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
||||
}
|
||||
@@ -4993,7 +5006,7 @@ function natural_search($fields, $value, $numeric=0, $nofinaland=0)
|
||||
$newres = '';
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
if ($numeric)
|
||||
if ($mode == 1)
|
||||
{
|
||||
$operator='=';
|
||||
$newcrit = preg_replace('/([<>=]+)/','',trim($crit));
|
||||
@@ -5017,8 +5030,13 @@ function natural_search($fields, $value, $numeric=0, $nofinaland=0)
|
||||
$i2++; // a criteria was added to string
|
||||
}
|
||||
}
|
||||
else
|
||||
else if ($mode == 2)
|
||||
{
|
||||
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $db->escape(trim($crit)) . ")";
|
||||
$i2++; // a criteria was added to string
|
||||
}
|
||||
else
|
||||
{
|
||||
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . " LIKE '%" . $db->escape(trim($crit)) . "%'";
|
||||
$i2++; // a criteria was added to string
|
||||
}
|
||||
|
||||
@@ -29,6 +29,25 @@
|
||||
// Enable this line to trace path when function is called.
|
||||
//print xdebug_print_function_stack('Functions2.lib was called');exit;
|
||||
|
||||
/**
|
||||
* Return first line of text. Cut will depends if content is HTML or not.
|
||||
*
|
||||
* @param string $text Input text
|
||||
* @return string Output text
|
||||
* @see dol_nboflines_bis
|
||||
*/
|
||||
function dolGetFirstLineOfText($text)
|
||||
{
|
||||
if (dol_textishtml($text))
|
||||
{
|
||||
$firstline=preg_replace('/<br[^>]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters
|
||||
}
|
||||
else
|
||||
{
|
||||
$firstline=preg_replace('/[\n\r].*/','',$text);
|
||||
}
|
||||
return $firstline.((strlen($firstline) != strlen($text))?'...':'');
|
||||
}
|
||||
|
||||
/**
|
||||
* Same function than javascript unescape() function but in PHP.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -69,7 +71,9 @@ function member_prepare_head(Adherent $object)
|
||||
// Show category tab
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=3';
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$type = Categorie::TYPE_MEMBER;
|
||||
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
|
||||
$head[$h][1] = $langs->trans('Categories');
|
||||
$head[$h][2] = 'category';
|
||||
$h++;
|
||||
@@ -107,6 +111,34 @@ function member_prepare_head(Adherent $object)
|
||||
return $head;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array head with list of tabs to view object informations
|
||||
*
|
||||
* @param Adherent $object Member
|
||||
* @return array head
|
||||
*/
|
||||
function member_type_prepare_head(AdherentType $object)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
|
||||
$h=0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/type.php?rowid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'membertype');
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'membertype','remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array head with list of tabs to view object informations
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
@@ -1127,7 +1127,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$categstatic=new Categorie($db);
|
||||
// recovering the list of all the categories linked to product
|
||||
$tblcateg=$categstatic->containing($idprod,0);
|
||||
$tblcateg=$categstatic->containing($idprod, Categorie::TYPE_PRODUCT);
|
||||
foreach ($tblcateg as $cate)
|
||||
{
|
||||
// Adding the descriptions if they are filled
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -60,7 +61,9 @@ function product_prepare_head($object)
|
||||
/* No more required. Replaced with new multiselect component
|
||||
if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=0';
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$type = Categorie::TYPE_PRODUCT;
|
||||
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
|
||||
$head[$h][1] = $langs->trans('Categories');
|
||||
$head[$h][2] = 'category';
|
||||
$h++;
|
||||
|
||||
@@ -583,11 +583,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$langs->load("commercial");
|
||||
$newmenu->add("/comm/prospect/list.php?leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects');
|
||||
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire);
|
||||
|
||||
$newmenu->add("/societe/soc.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer);
|
||||
//$newmenu->add("/contact/list.php?leftmenu=customers&type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire);
|
||||
|
||||
@@ -165,7 +165,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
|
||||
$objphoto = new Product($this->db);
|
||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product,2) . $object->lines[$i]->fk_product ."/photos/";
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
|
||||
$realpath='';
|
||||
@@ -708,7 +708,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posxval, $posy);
|
||||
|
||||
|
||||
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
|
||||
$pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L');
|
||||
|
||||
@@ -1266,7 +1266,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("AskPriceSupplierDate")." : " . dol_print_date($object->date_livraison,"day",false,$outputlangs,true), '', 'R');
|
||||
*/
|
||||
|
||||
|
||||
if ($object->client->code_client)
|
||||
{
|
||||
$posy+=4;
|
||||
|
||||
@@ -98,7 +98,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("compta");
|
||||
|
||||
$dir = $_dir . "/".get_exdir($number,2,1).$number;
|
||||
$dir = $_dir . "/".get_exdir($number,2,1,0,null,'cheque').$number;
|
||||
|
||||
if (! is_dir($dir))
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -105,7 +105,7 @@ class html_cerfafr extends ModeleDon
|
||||
else
|
||||
{
|
||||
$donref = dol_sanitizeFileName($don->ref);
|
||||
$dir = $conf->don->dir_output . "/" . get_exdir($donref,2);
|
||||
$dir = $conf->don->dir_output . "/" . get_exdir($donref,2,0,1,$don,'donation') . "/" . dol_sanitizeFileName($don->ref);
|
||||
$file = $dir . "/" . $donref . ".html";
|
||||
}
|
||||
|
||||
@@ -168,18 +168,18 @@ class html_cerfafr extends ModeleDon
|
||||
$form = str_replace('__Message__',$outputlangs->trans("Message"),$form);
|
||||
$form = str_replace('__IConfirmDonationReception__',$outputlangs->trans("IConfirmDonationReception"),$form);
|
||||
$form = str_replace('__DonationMessage__',$conf->global->DONATION_MESSAGE,$form);
|
||||
|
||||
|
||||
$frencharticle='';
|
||||
if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencharticle='<font size="+1">Article 200, 238 bis et 885-0 V bis A du code général des impôts (CGI)</font>';
|
||||
$form = str_replace('__FrenchArticle__',$frencharticle,$form);
|
||||
|
||||
|
||||
$frencheligibility='';
|
||||
if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencheligibility='Le bénéficiaire certifie sur l\'honneur que les dons et versements qu\'il reçoit ouvrent droit à la réduction d\'impôt prévue à l\'article :';
|
||||
$form = str_replace('__FrenchEligibility__',$frencheligibility,$form);
|
||||
|
||||
|
||||
$art200='';
|
||||
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
|
||||
if ($conf->global->DONATION_ART200 >= 1)
|
||||
if ($conf->global->DONATION_ART200 >= 1)
|
||||
{
|
||||
$art200='<input type="checkbox" checked>200 du CGI';
|
||||
}
|
||||
@@ -192,7 +192,7 @@ class html_cerfafr extends ModeleDon
|
||||
|
||||
$art238='';
|
||||
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
|
||||
if ($conf->global->DONATION_ART238 >= 1)
|
||||
if ($conf->global->DONATION_ART238 >= 1)
|
||||
{
|
||||
$art238='<input type="checkbox" checked>238 bis du CGI';
|
||||
}
|
||||
@@ -202,10 +202,10 @@ class html_cerfafr extends ModeleDon
|
||||
}
|
||||
}
|
||||
$form = str_replace('__ARTICLE238__',$art238,$form);
|
||||
|
||||
|
||||
$art885='';
|
||||
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
|
||||
if ($conf->global->DONATION_ART885 >= 1)
|
||||
if ($conf->global->DONATION_ART885 >= 1)
|
||||
{
|
||||
$art885='<input type="checkbox" checked>885-0 V bis du CGI';
|
||||
}
|
||||
@@ -215,7 +215,7 @@ class html_cerfafr extends ModeleDon
|
||||
}
|
||||
}
|
||||
$form = str_replace('__ARTICLE885__',$art885,$form);
|
||||
|
||||
|
||||
// Save file on disk
|
||||
dol_syslog("html_cerfafr::write_file $file");
|
||||
$handle=fopen($file,"w");
|
||||
|
||||
@@ -191,7 +191,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$objphoto = new Product($this->db);
|
||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product,2) . $object->lines[$i]->fk_product ."/photos/";
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,'product') . $object->lines[$i]->fk_product ."/photos/";
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
|
||||
$realpath='';
|
||||
|
||||
@@ -45,7 +45,7 @@ class pdf_standard extends CommonStickerGenerator
|
||||
function addSticker(&$pdf,$outputlangs,$param) {
|
||||
// use this method in future refactoring
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0)
|
||||
* - %LOGO% is replace with company logo
|
||||
@@ -96,7 +96,7 @@ class pdf_standard extends CommonStickerGenerator
|
||||
$dir=$conf->adherent->dir_output;
|
||||
if (! empty($photo))
|
||||
{
|
||||
$file=get_exdir($idmember,2).'photos/'.$photo;
|
||||
$file=get_exdir($idmember,2,0,0,null,'member').'photos/'.$photo;
|
||||
$photo=$dir.'/'.$file;
|
||||
if (! is_readable($photo)) $photo='';
|
||||
}
|
||||
|
||||
@@ -180,13 +180,13 @@ class pdf_azur extends ModelePDFPropales
|
||||
|
||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
|
||||
{
|
||||
$pdir[0] = get_exdir($objphoto->id,2) . $objphoto->id ."/photos/";
|
||||
$pdir[0] = get_exdir($objphoto->id,2,0,0,$objphoto,'product') . $objphoto->id ."/photos/";
|
||||
$pdir[1] = dol_sanitizeFileName($objphoto->ref).'/';
|
||||
}
|
||||
else
|
||||
{
|
||||
$pdir[0] = dol_sanitizeFileName($objphoto->ref).'/';
|
||||
$pdir[1] = get_exdir($objphoto->id,2) . $objphoto->id ."/photos/";
|
||||
$pdir[0] = dol_sanitizeFileName($objphoto->ref).'/'; // default
|
||||
$pdir[1] = get_exdir($objphoto->id,2,0,0,$objphoto,'product') . $objphoto->id ."/photos/"; // alternative
|
||||
}
|
||||
|
||||
$arephoto = false;
|
||||
@@ -332,7 +332,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||
$tab_height = 130;
|
||||
$tab_height_newpage = 150;
|
||||
|
||||
|
||||
// Incoterm
|
||||
$height_incoterms = 0;
|
||||
if ($conf->incoterm->enabled)
|
||||
@@ -346,11 +346,11 @@ class pdf_azur extends ModelePDFPropales
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
$height_incoterms=$nexY-$tab_top;
|
||||
|
||||
|
||||
// Rect prend une longueur en 3eme param
|
||||
$pdf->SetDrawColor(192,192,192);
|
||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||
|
||||
|
||||
$tab_top = $nexY+6;
|
||||
$height_incoterms += 4;
|
||||
}
|
||||
@@ -645,7 +645,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// Customer signature area
|
||||
$posy=$this->_signature_area($pdf, $object, $posy, $outputlangs);
|
||||
|
||||
@@ -654,35 +654,44 @@ class pdf_azur extends ModelePDFPropales
|
||||
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||
|
||||
//If propal merge product PDF is active
|
||||
if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL))
|
||||
if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/propalmergepdfproduct.class.php';
|
||||
|
||||
|
||||
$already_merged = array ();
|
||||
foreach ( $object->lines as $line ) {
|
||||
if (! empty($line->fk_product) && ! (in_array($line->fk_product, $already_merged))) {
|
||||
// Find the desire PDF
|
||||
$filetomerge = new Propalmergepdfproduct($this->db);
|
||||
|
||||
|
||||
if ($conf->global->MAIN_MULTILANGS) {
|
||||
$filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang);
|
||||
} else {
|
||||
$filetomerge->fetch_by_product($line->fk_product);
|
||||
}
|
||||
|
||||
|
||||
$already_merged[] = $line->fk_product;
|
||||
|
||||
|
||||
$product = new Product($this->db);
|
||||
$product->fetch($line->fk_product);
|
||||
|
||||
if ($product->entity!=$conf->entity) {
|
||||
$entity_product_file=$product->entity;
|
||||
} else {
|
||||
$entity_product_file=$conf->entity;
|
||||
}
|
||||
|
||||
// If PDF is selected and file is not empty
|
||||
if (count($filetomerge->lines) > 0) {
|
||||
foreach ( $filetomerge->lines as $linefile ) {
|
||||
if (! empty($linefile->id) && ! empty($linefile->file_name)) {
|
||||
if (! empty($conf->product->enabled))
|
||||
$filetomerge_dir = $conf->product->multidir_output[$conf->entity] . '/' . dol_sanitizeFileName($line->product_ref);
|
||||
$filetomerge_dir = $conf->product->multidir_output[$entity_product_file] . '/' . dol_sanitizeFileName($line->product_ref);
|
||||
elseif (! empty($conf->service->enabled))
|
||||
$filetomerge_dir = $conf->service->multidir_output[$conf->entity] . '/' . dol_sanitizeFileName($line->product_ref);
|
||||
|
||||
$filetomerge_dir = $conf->service->multidir_output[$entity_product_file] . '/' . dol_sanitizeFileName($line->product_ref);
|
||||
|
||||
dol_syslog(get_class($this) . ':: upload_dir=' . $filetomerge_dir, LOG_DEBUG);
|
||||
|
||||
|
||||
$infile = $filetomerge_dir . '/' . $linefile->file_name;
|
||||
if (is_file($infile)) {
|
||||
$pagecount = $pdf->setSourceFile($infile);
|
||||
@@ -699,11 +708,11 @@ class pdf_azur extends ModelePDFPropales
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//exit;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf->Close();
|
||||
|
||||
$pdf->Output($file,'F');
|
||||
@@ -1556,10 +1565,10 @@ class pdf_azur extends ModelePDFPropales
|
||||
$pdf->SetFillColor(255,255,255);
|
||||
$pdf->SetXY($posx, $tab_top + 0);
|
||||
$pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1);
|
||||
|
||||
|
||||
$pdf->SetXY($posx, $tab_top + $tab_hl);
|
||||
$pdf->MultiCell($largcol, $tab_hl*6, '', 1, 'R');
|
||||
|
||||
|
||||
return ($tab_hl*7);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
{
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$objectrefsupplier = dol_sanitizeFileName($object->ref_supplier);
|
||||
$dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$objectref;
|
||||
$dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$objectref;
|
||||
$file = $dir . "/" . $objectref . ".pdf";
|
||||
if (! empty($conf->global->SUPPLIER_REF_IN_NAME)) $file = $dir . "/" . $objectref . ($objectrefsupplier?"_".$objectrefsupplier:"").".pdf";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -164,6 +164,8 @@ $userstatic=new User($db);
|
||||
</div>
|
||||
<div class="tagtd">
|
||||
<?php
|
||||
$statusofcontact = $tab[$i]['status'];
|
||||
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
@@ -182,24 +184,24 @@ $userstatic=new User($db);
|
||||
</div>
|
||||
<div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div>
|
||||
<div class="tagtd" align="center">
|
||||
<?php if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">'; ?>
|
||||
<?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">'; ?>
|
||||
<?php
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->lastname=$tab[$i]['lastname'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
//echo $userstatic->LibStatut($tab[$i]['status'],3);
|
||||
echo $userstatic->LibStatut($tab[$i]['statuscontact'],3);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
echo $contactstatic->LibStatut($tab[$i]['status'],3);
|
||||
echo $contactstatic->LibStatut($tab[$i]['statuscontact'],3);
|
||||
}
|
||||
?>
|
||||
<?php if ($object->statut >= 0) echo '</a>'; ?>
|
||||
<?php //if ($object->statut >= 0) echo '</a>'; ?>
|
||||
</div>
|
||||
<div class="tagtd nowrap" align="right">
|
||||
<?php if ($permission) { ?>
|
||||
|
||||
@@ -110,7 +110,7 @@ if ($action == 'update')
|
||||
$object->fk_projet = GETPOST("fk_projet");
|
||||
$object->note_private= GETPOST("note_private");
|
||||
$object->note_public = GETPOST("note_public");
|
||||
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0) $error++;
|
||||
@@ -163,7 +163,7 @@ if ($action == 'add')
|
||||
$object->note_public = GETPOST("note_public");
|
||||
$object->public = GETPOST("public");
|
||||
$object->fk_projet = GETPOST("fk_projet");
|
||||
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0) $error++;
|
||||
@@ -173,6 +173,10 @@ if ($action == 'add')
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights->don->supprimer)
|
||||
@@ -232,7 +236,7 @@ if ($action == 'set_paid')
|
||||
if ($action == 'builddoc')
|
||||
{
|
||||
$object = new Don($db);
|
||||
$object->fetch($id);
|
||||
$result=$object->fetch($id);
|
||||
|
||||
// Save last template used to generate document
|
||||
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
||||
@@ -274,10 +278,11 @@ 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="action" value="add">';
|
||||
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tbody>';
|
||||
|
||||
$nbrows=11;
|
||||
if (! empty($conf->projet->enabled)) $nbrows++;
|
||||
@@ -312,14 +317,14 @@ if ($action == 'create')
|
||||
print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id);
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.GETPOST("email").'" size="40"></td></tr>';
|
||||
|
||||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
|
||||
|
||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
|
||||
print $doleditor->Create(1);
|
||||
print '</td></tr>';
|
||||
@@ -337,9 +342,9 @@ if ($action == 'create')
|
||||
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
|
||||
|
||||
$formproject=new FormProjets($db);
|
||||
|
||||
|
||||
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
||||
$formproject->select_projects(-1, GETPOST("fk_projet"),'fk_projet', 0, 0, 1, 1);
|
||||
print "</td></tr>\n";
|
||||
@@ -352,12 +357,13 @@ if ($action == 'create')
|
||||
{
|
||||
print $object->showOptionals($extrafields,'edit',$parameters);
|
||||
}
|
||||
|
||||
|
||||
print '</tbody>';
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
@@ -380,6 +386,7 @@ if (! empty($id) && $action == 'edit')
|
||||
dol_print_error($db); exit;
|
||||
}
|
||||
|
||||
$hselected='card';
|
||||
$head = donation_prepare_head($object);
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
|
||||
|
||||
@@ -441,7 +448,7 @@ if (! empty($id) && $action == 'edit')
|
||||
print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40" value="'.$object->email.'"></td></tr>';
|
||||
|
||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
||||
@@ -458,7 +465,7 @@ if (! empty($id) && $action == 'edit')
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$formproject=new FormProjets($db);
|
||||
|
||||
|
||||
$langs->load('projects');
|
||||
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
||||
$formproject->select_projects(-1, $object->fk_projet,'fk_projet', 0, 1, 0, 1);
|
||||
@@ -497,7 +504,7 @@ if (! empty($id) && $action != 'edit')
|
||||
$text=$langs->trans("ConfirmDeleteADonation");
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteADonation"),$text,"confirm_delete",'','',1);
|
||||
}
|
||||
|
||||
|
||||
$result=$object->fetch($id);
|
||||
if ($result < 0) {
|
||||
dol_print_error($db,$object->error); exit;
|
||||
@@ -506,7 +513,9 @@ if (! empty($id) && $action != 'edit')
|
||||
if ($result < 0) {
|
||||
dol_print_error($db); exit;
|
||||
}
|
||||
|
||||
|
||||
$hselected='card';
|
||||
|
||||
$head = donation_prepare_head($object);
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
|
||||
|
||||
@@ -542,7 +551,7 @@ if (! empty($id) && $action != 'edit')
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td colspan="2">'.$object->lastname.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td colspan="2">'.$object->firstname.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td>'.dol_nl2br($object->address).'</td>';
|
||||
|
||||
|
||||
$rowspan=6;
|
||||
if (! empty($conf->projet->enabled)) $rowspan++;
|
||||
print '<td rowspan="'.$rowspan.'" valign="top">';
|
||||
@@ -584,7 +593,7 @@ if (! empty($id) && $action != 'edit')
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
$labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->paiement_type;
|
||||
$labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->paiement_type;
|
||||
print "<td>".$labeltype.' '.$object->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
@@ -628,7 +637,7 @@ if (! empty($id) && $action != 'edit')
|
||||
else
|
||||
{
|
||||
print $object->country_olddata;
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// EMail
|
||||
@@ -683,12 +692,12 @@ if (! empty($id) && $action != 'edit')
|
||||
}
|
||||
|
||||
// Create payment
|
||||
if ($object->statut == 1 && $object->paid == 0 && $user->rights->don->creer)
|
||||
if ($object->statut == 1 && $object->paid == 0 && $user->rights->don->creer)
|
||||
{
|
||||
if ($remaintopay == 0)
|
||||
if ($remaintopay == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/don/payment/payment.php?rowid=' . $object->id . '&action=create">' . $langs->trans('DoPayment') . '</a></div>';
|
||||
@@ -700,7 +709,7 @@ if (! empty($id) && $action != 'edit')
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?rowid='.$object->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
|
||||
}
|
||||
|
||||
|
||||
// Delete
|
||||
if ($user->rights->don->supprimer)
|
||||
{
|
||||
@@ -720,7 +729,7 @@ if (! empty($id) && $action != 'edit')
|
||||
* Documents generes
|
||||
*/
|
||||
$filename=dol_sanitizeFileName($object->id);
|
||||
$filedir=$conf->don->dir_output . '/' . get_exdir($filename,2);
|
||||
$filedir=$conf->don->dir_output . '/' . get_exdir($filename,2,0,1,$object,'donation'). '/'. dol_sanitizeFileName($object->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?rowid='.$object->id;
|
||||
// $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer);
|
||||
// $delallowed=$user->rights->facture->supprimer;
|
||||
@@ -730,7 +739,7 @@ if (! empty($id) && $action != 'edit')
|
||||
$var=true;
|
||||
|
||||
print '<br>';
|
||||
$formfile->show_documents('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed);
|
||||
$formfile->show_documents('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
print '</td><td> </td>';
|
||||
|
||||
|
||||
@@ -60,9 +60,10 @@ class Don extends CommonObject
|
||||
var $note_private;
|
||||
var $note_public;
|
||||
var $statut;
|
||||
|
||||
var $modelpdf;
|
||||
var $projet;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -306,14 +307,14 @@ class Don extends CommonObject
|
||||
* @return int <0 if KO, id of created donation if OK
|
||||
* TODO add numbering module for Ref
|
||||
*/
|
||||
function create($user, $notrigger)
|
||||
function create($user, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
||||
$error = 0;
|
||||
$ret = 0;
|
||||
$now=dol_now();
|
||||
|
||||
|
||||
// Clean parameters
|
||||
$this->address=($this->address>0?$this->address:$this->address);
|
||||
$this->zip=($this->zip>0?$this->zip:$this->zip);
|
||||
@@ -391,7 +392,7 @@ class Don extends CommonObject
|
||||
$this->errno = $this->db->lasterrno();
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Update extrafield
|
||||
if (!$error) {
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
@@ -403,7 +404,7 @@ class Don extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$error && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS))
|
||||
{
|
||||
$res = $this->setValid($user);
|
||||
@@ -434,7 +435,7 @@ class Don extends CommonObject
|
||||
global $langs, $conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
// Clean parameters
|
||||
$this->address=($this->address>0?$this->address:$this->address);
|
||||
$this->zip=($this->zip>0?$this->zip:$this->zip);
|
||||
@@ -523,11 +524,11 @@ class Don extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
// Delete donation
|
||||
if (! $error)
|
||||
{
|
||||
@@ -601,7 +602,7 @@ class Don extends CommonObject
|
||||
$sql = "SELECT d.rowid, d.datec, d.tms as datem, d.datedon,";
|
||||
$sql.= " d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, ";
|
||||
$sql.= " d.fk_country, d.country as country_olddata, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, cp.libelle, d.email, d.phone, ";
|
||||
$sql.= " d.phone_mobile, d.fk_projet,";
|
||||
$sql.= " d.phone_mobile, d.fk_projet, d.model_pdf,";
|
||||
$sql.= " p.title as project_label,";
|
||||
$sql.= " c.code as country_code, c.label as country";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
@@ -651,12 +652,13 @@ class Don extends CommonObject
|
||||
$this->public = $obj->public;
|
||||
$this->modepaymentid = $obj->fk_payment;
|
||||
$this->modepayment = $obj->libelle;
|
||||
$this->paid = $obj->paid;
|
||||
$this->paid = $obj->paid;
|
||||
$this->amount = $obj->amount;
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->commentaire = $obj->note; // deprecated
|
||||
|
||||
|
||||
// Retrieve all extrafield for thirdparty
|
||||
// fetch optionals attributes and labels
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
@@ -821,7 +823,7 @@ class Don extends CommonObject
|
||||
if ($withpicto != 2) $result.=$link.$this->id.$linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Information on record
|
||||
*
|
||||
|
||||
@@ -85,7 +85,7 @@ print '<table width="100%" class="notopnoleftnoright">';
|
||||
print '<tr><td class="notopnoleft" width="30%" valign="top">';
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4">'.$langs->trans("Statistics").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@@ -20,7 +21,6 @@
|
||||
* \file htdocs/ecm/docdir.php
|
||||
* \ingroup ecm
|
||||
* \brief Main page for ECM section area
|
||||
* \author Laurent Destailleur
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@@ -154,6 +154,8 @@ if ($action == 'create')
|
||||
|
||||
$title=$langs->trans("ECMNewSection");
|
||||
print_fiche_titre($title);
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
@@ -174,6 +176,8 @@ if ($action == 'create')
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="create" value="'.$langs->trans("Create").'">';
|
||||
|
||||
@@ -409,8 +409,8 @@ if (empty($reshook))
|
||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ if ($action == 'create')
|
||||
$liste = ModelePdfExpedition::liste_modeles($db);
|
||||
print $form->selectarray('model', $liste, $conf->global->EXPEDITION_ADDON_PDF);
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="3"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@@ -497,7 +497,7 @@ class Expedition extends CommonObject
|
||||
|
||||
if ($this->statut == 0) $this->brouillon = 1;
|
||||
|
||||
$file = $conf->expedition->dir_output . "/" .get_exdir($this->id, 2) . "/" . $this->id.".pdf";
|
||||
$file = $conf->expedition->dir_output . "/" .get_exdir($this->id, 2, 0, 0, $this, 'shipment') . "/" . $this->id.".pdf";
|
||||
$this->pdf_filename = $file;
|
||||
|
||||
// Tracking url
|
||||
|
||||
@@ -122,16 +122,17 @@ if ($resql)
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"e.ref","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"],"s.nom", "", $param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDeliveryPlanned"), $_SERVER["PHP_SELF"],"e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder);
|
||||
if($conf->livraison_bon->enabled)
|
||||
if($conf->livraison_bon->enabled)
|
||||
{
|
||||
print_liste_field_titre($langs->trans("DeliveryOrder"), $_SERVER["PHP_SELF"],"l.ref","",$param, '',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateReceived"), $_SERVER["PHP_SELF"],"l.date_delivery","",$param, 'align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"],"e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@@ -149,7 +150,7 @@ if ($resql)
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td class="liste_titre"> </td>';
|
||||
}
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
@@ -168,7 +169,7 @@ if ($resql)
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$var=!$var;
|
||||
|
||||
|
||||
// Ref
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>";
|
||||
@@ -198,17 +199,17 @@ if ($resql)
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->date_expedition),"day");
|
||||
print '</td>'."\n";
|
||||
|
||||
if ($conf->livraison_bon->enabled)
|
||||
|
||||
if ($conf->livraison_bon->enabled)
|
||||
{
|
||||
$shipment->fetchObjectLinked($shipment->id,$shipment->element);
|
||||
$receiving=(! empty($shipment->linkedObjects['delivery'][0])?$shipment->linkedObjects['delivery'][0]:'');
|
||||
|
||||
|
||||
// Ref
|
||||
print '<td>';
|
||||
print !empty($receiving) ? $receiving->getNomUrl($db) : '';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->date_reception),"day");
|
||||
print '</td>'."\n";
|
||||
|
||||
@@ -546,7 +546,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
// Show subproducts details
|
||||
// Show subproducts lines
|
||||
if ($objp->fk_product > 0 && ! empty($conf->global->PRODUIT_SOUSPRODUITS))
|
||||
{
|
||||
// Set tree of subproducts in product->sousprods
|
||||
@@ -560,20 +560,16 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
foreach($prods_arbo as $key => $value)
|
||||
{
|
||||
print '<tr><td colspan="4">';
|
||||
|
||||
$img='';
|
||||
if ($value['stock'] < $value['stock_alert'])
|
||||
{
|
||||
$img=img_warning($langs->trans("StockTooLow"));
|
||||
}
|
||||
print '<tr><td> -> <a href="'.DOL_URL_ROOT."/product/card.php?id=".$value['id'].'">'.$value['fullpath'].'</a> ('.$value['nb'].')</td>';
|
||||
print '<tr '.$bc[$var].'><td> -> <a href="'.DOL_URL_ROOT."/product/card.php?id=".$value['id'].'">'.$value['fullpath'].'</a> ('.$value['nb'].')</td>';
|
||||
print '<td align="center"> '.$value['nb_total'].'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="center">'.$value['stock'].' '.$img.'</td></tr>'."\n";
|
||||
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user