diff --git a/ChangeLog b/ChangeLog index bbbd2a97e89..68d6b1848f1 100644 --- a/ChangeLog +++ b/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 diff --git a/build/debian/changelog b/build/debian/changelog index a8d056d77ab..72718de7c6c 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -3,4 +3,4 @@ dolibarr (3.8.0-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. - -- Laurent Destailleur (eldy) Sun, 21 March 2015 12:00:00 +0100 + -- Laurent Destailleur (eldy) Tue, 12 May 2015 12:00:00 +0100 diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 6183bcac85c..a837450f077 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -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" diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 2a2903e813f..c667754d4ab 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -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; diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 8c9e3e5b4b7..7f814a826df 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -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. diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index c34cd4e9d61..f4e1fe2b330 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -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__ diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index c3c3b2a7939..171132aaf51 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -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__ diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index efe55e2aa7a..4d020ad97de 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -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__ diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 6a86f9e3ffa..f92bf828ed9 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -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__ diff --git a/dev/ansible/deployplaybook/deploydev.yml b/dev/ansible/deployplaybook/deploydev.yml new file mode 100644 index 00000000000..5802fb10a1e --- /dev/null +++ b/dev/ansible/deployplaybook/deploydev.yml @@ -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 + diff --git a/dev/ansible/deployplaybook/files/apachealias.conf b/dev/ansible/deployplaybook/files/apachealias.conf new file mode 100644 index 00000000000..d801094af5a --- /dev/null +++ b/dev/ansible/deployplaybook/files/apachealias.conf @@ -0,0 +1,2 @@ + +Alias /dolibarr_dev /var/www/dolibarr diff --git a/dev/ansible/deployplaybook/hosts b/dev/ansible/deployplaybook/hosts new file mode 100644 index 00000000000..99627faba2b --- /dev/null +++ b/dev/ansible/deployplaybook/hosts @@ -0,0 +1,2 @@ +[webservers] +testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=22 diff --git a/dev/ansible/deployplaybook/templates/info.html.j2 b/dev/ansible/deployplaybook/templates/info.html.j2 new file mode 100644 index 00000000000..66fac1c4deb --- /dev/null +++ b/dev/ansible/deployplaybook/templates/info.html.j2 @@ -0,0 +1,10 @@ + + + Page info ansible + + +

Apache, configured by Ansible

+

If you can see this, Ansible successfully installed apache.

+

{{ ansible_managed }}

+ + \ No newline at end of file diff --git a/dev/ical/event_recu.txt b/dev/ical/event_recu.txt new file mode 100644 index 00000000000..d9e62dccbdb --- /dev/null +++ b/dev/ical/event_recu.txt @@ -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 diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index fdc2f78be64..d555ed46092 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * * 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 '
' . "\n"; print ''; print ''; - + + dol_fiche_head(); + print ''; print ''; @@ -163,8 +164,10 @@ if ($action == 'create') print ''; print '
' . $langs->trans("AccountNumber") . '
'; - - print '
'; + + dol_fiche_end(); + + print '
'; print ''; print '     '; print ''; @@ -216,16 +219,16 @@ else if ($id) print ''; print ''; - - print '
'; + + dol_fiche_end(); + + print '
'; print ''; print '     '; print ''; print '
'; print ''; - - print '
'; } else { @@ -268,8 +271,8 @@ else if ($id) print ''; print ''; - - print '
'; + + dol_fiche_end(); /* * Barre d'actions @@ -297,6 +300,6 @@ else if ($id) dol_print_error($db); } } +$db->close(); -llxFooter(); -$db->close(); \ No newline at end of file +llxFooter(); \ No newline at end of file diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 040419c89c2..fc985efffe7 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2015 Alexandre Spangaro * * 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 ''; print ''; + dol_fiche_head(); + print ''; // Label @@ -199,8 +201,10 @@ if ($action == 'create') print ''; print '
'; + + dol_fiche_end(); - print '
'; + print '
'; print ''; print '     '; print ''; diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 54667967634..6ac36cac022 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -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'; diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index 2f57ce4ed6b..19695a2ef6d 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -68,7 +68,7 @@ llxHeader('',$langs->trans("MembersSetup"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup_title'); +print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup'); $head = member_admin_prepare_head(); diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index b7383e00010..d591d377ac9 100644 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -1,9 +1,8 @@ - * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2006-2015 Laurent Destailleur * Copyright (C) 2006-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry * * 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 '
'; +print ''; + 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").'

'; -print ''; -print ''; print ''; @@ -198,19 +200,20 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled)) print '\n"; } print '
'; print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL"); print ''; - print ''; + print '';; print "
'; -print '
'; +dol_fiche_end(); + +print '
'; print ''; -print '
'; +print ''; print '
'; -dol_fiche_end(); print '
'; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 0fe6366ae58..100d1e23e74 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2012-2013 Philippe Grand + * Copyright (C) 2015 Alexandre Spangaro * * 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 ''; print ''; + dol_fiche_head(''); + print ''; + print ''; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) @@ -868,13 +874,13 @@ else print ''; } - // Tel pro + // Pro phone print ''; - // Tel perso + // Personal phone print ''; - // Tel mobile + // Mobile phone print ''; // Skype @@ -888,7 +894,7 @@ else $form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); print "\n"; - // Profil public + // Public profil print "\n"; @@ -915,21 +921,25 @@ else print $form->select_dolusers($object->user_id,'userid',1); print ''; */ - + print ''; print "
'.$langs->trans("PhonePro").'
'.$langs->trans("PhonePerso").'
'.$langs->trans("PhoneMobile").'
".$langs->trans("Public")."\n"; print $form->selectyesno("public",$object->public,1); print "
\n"; - print '
'; - print '
'; + dol_fiche_end(); + + print '
'; + print ''; + print '     '; + print ''; + print '
'; print "\n"; - } if ($action == 'edit') { /******************************************** - * - * Fiche en mode edition + * + * Edition mode * ********************************************/ @@ -1027,6 +1037,7 @@ else print ''.$langs->trans("Nature").''; print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy); print ""; + // Photo print ''; print $form->showphoto('memberphoto',$object)."\n"; @@ -1107,13 +1118,13 @@ else print ''; } - // Tel + // Pro phone print ''.$langs->trans("PhonePro").'phone).'">'; - // Tel perso + // Personal phone print ''.$langs->trans("PhonePerso").'phone_perso).'">'; - // Tel mobile + // Mobile phone print ''.$langs->trans("PhoneMobile").'phone_mobile).'">'; // Skype @@ -1127,7 +1138,7 @@ else $form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); print "\n"; - // Profil public + // Public profil print "".$langs->trans("Public")."\n"; print $form->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1); print "\n"; @@ -1171,7 +1182,7 @@ else print '
'; print ''; print '     '; - print ''; + print ''; print '
'; print ''; @@ -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 '
'; if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty') @@ -1553,7 +1563,7 @@ else print '
'.$langs->trans("Modify").'
'; } - // 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 '
'.$langs->trans("SendCardByMail")."
"; } - // Resilier + // Terminate if ($object->statut >= 1) { if ($user->rights->adherent->supprimer) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 3761b75f384..dabbf142730 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -3,6 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2015 Alexandre Spangaro * * 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 ''; print ''; print ''; - print "\n"; - $today=dol_now(); + dol_fiche_head(''); + + print "
\n"; + print ''; + + $today=dol_now(); $datefrom=0; $dateto=0; $paymentdate=-1; @@ -1102,8 +1107,10 @@ if ($rowid > 0) print $form->textwithpicto($tmp,$helpcontent,1,'help'); } print ''; + print ''; print '
'; - print '
'; + + dol_fiche_end(); print '
'; print ''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f3c391b5ecd..40029d45f84 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2014-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Frederic France + * Copyright (C) 2015 Raphaël Doursenaud * * 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 = ''; } diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 1d780eb21a5..71f1df22937 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -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 */ diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 62e54c17948..9f404fe1510 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -157,7 +157,7 @@ print ""; if ($conf->use_javascript_ajax) { print '
'; - print ''; + print '
'; print ''; print ''; 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 ''; print '
'.$langs->trans("Statistics").'
'; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 38ffeae2993..05035fa1f9f 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -1,8 +1,8 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2013 Raphaël Doursenaud +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2013-2015 Raphaël Doursenaud * * 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) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index cdeaa21ba9f..e830254fd97 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Alexandre Spangaro * * 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 '
'; @@ -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 '
'; print ''; - print ''; + dol_fiche_head(''); + + print '
'; + print ''; + print ''; print ''; @@ -260,7 +264,7 @@ if ($action == 'create') print ''; @@ -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 ''; print "
'.$langs->trans("Label").'
'.$langs->trans("WelcomeEMail").''; 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 '
\n"; + + dol_fiche_end(); - print '
'; + print '
'; print ''; print '     '; print ''; @@ -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 ''; $linkback = ''.$langs->trans("BackToList").''; @@ -312,25 +313,25 @@ if ($rowid > 0) // Ref print ''; print ''; // Label - print ''; + print ''; print ''; print ''; print '"; + print nl2br($object->note).""; print '"; + print nl2br($object->mail_valid).""; // 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 '
'.$langs->trans("Ref").''; - print $form->showrefnav($adht, 'rowid', $linkback); + print $form->showrefnav($object, 'rowid', $linkback); print '
'.$langs->trans("Label").''.$adht->libelle.'
'.$langs->trans("Label").''.$object->libelle.'
'.$langs->trans("SubscriptionRequired").''; - print yn($adht->cotisation); + print yn($object->cotisation); print '
'.$langs->trans("VoteAllowed").''; - print yn($adht->vote); + print yn($object->vote); print '
'.$langs->trans("Description").''; - print nl2br($adht->note)."
'.$langs->trans("WelcomeEMail").''; - print nl2br($adht->mail_valid)."
'; print '
'; /* - * Barre d'actions - * + * Hotbar */ print '
'; // Edit if ($user->rights->adherent->configurer) { - print ''; + print ''; } // Add - print ''; + print ''; // Delete if ($user->rights->adherent->configurer) { - print ''; + print ''; } print "
"; @@ -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 '
'; - print ''; + print ''; - print ''; + print ''; print ''; print ''; print ''; + print ''; print '"; @@ -668,13 +669,13 @@ if ($rowid > 0) print '
'.$langs->trans("Ref").''.$adht->id.'
'.$langs->trans("Ref").''.$object->id.'
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("SubscriptionRequired").''; - print $form->selectyesno("cotisation",$adht->cotisation,1); + print $form->selectyesno("cotisation",$object->cotisation,1); print '
'.$langs->trans("VoteAllowed").''; - print $form->selectyesno("vote",$adht->vote,1); + print $form->selectyesno("vote",$object->vote,1); print '
'.$langs->trans("Description").''; - print '
'.$langs->trans("WelcomeEMail").''; 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 "
'; - //Extra field + // Extra field if (empty($reshook) && ! empty($extrafields->attribute_label)) { print '

'; 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 '\n"; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 41c4fe6956c..7f1d17183d2 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -283,7 +283,7 @@ if ($action == 'edit') // Edit { // Show bugtrack link $var=!$var; - print ''; print ''; @@ -469,7 +469,7 @@ else // Show { // Show bugtrack link $var=!$var; - print '"; print ''; print ""; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 671a9bf9eba..88184065574 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -439,6 +439,26 @@ print "\n";
" id="buttonGo" />

+ +'.$langs->trans("RunCommandSummary").':
'."\n"; + print '
'."\n"; + print '
'; + + //print $paramclear; + + // Now run command and show result + print ''.$langs->trans("BackupResult").': '; + print $_SESSION["commandbackupresult"]; + + $_SESSION["commandbackuplastdone"]=''; + $_SESSION["commandbackuptorun"]=''; + $_SESSION["commandbackupresult"]=''; +} +?> +
trans("Error")." : ".$errormsg, 'errors'); - /* - print '
'.$langs->trans("Error")." : ".$errormsg.'
'; - print '
'; - print '
';*/ + + $resultstring=''; + $resultstring.='
'.$langs->trans("Error")." : ".$errormsg.'
'; + + $_SESSION["commandbackupresult"]=$resultstring; } else { if ($what) { setEventMessage($langs->trans("BackupFileSuccessfullyCreated").'.
'.$langs->trans("YouCanDownloadBackupFile")); - /*print '
'; - print $langs->trans("BackupFileSuccessfullyCreated").'.
'; - print $langs->trans("YouCanDownloadBackupFile"); - print '
'; - print '
';*/ + + $resultstring='
'; + $resultstring.=$langs->trans("BackupFileSuccessfullyCreated").'.
'; + $resultstring.=$langs->trans("YouCanDownloadBackupFile"); + $resultstring.='
'; + + $_SESSION["commandbackupresult"]=$resultstring; } else { diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 373b46c6062..72280ec7220 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -1,6 +1,7 @@ - * Copyright (C) 2005-2012 Regis Houssin +/* Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Bahfir Abbes * * 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 ''; print '
'; - print ''; + print ''; print ''; + print ''; } print "
'.$label.''; print $extrafields->showInputField($key,$value); print "
'.$langs->trans("ShowBugTrackLink").''; + print '
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1); print ' 
'.$langs->trans("ShowBugTrackLink").''; + print '
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)." 
 '.$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).''; print ''; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index cab2881ed16..efa3ffb91c0 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -174,7 +174,7 @@ if ($savehandler == 'files') if (count($listofsessions) == 0) { - print '
'.$langs->trans("NoSessionFound",$savepath,$openbasedir).'
'.$langs->trans("NoSessionFound",$savepath,$openbasedir).'
"; diff --git a/htdocs/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php index d1d965d99a7..ef4eaefe9c2 100644 --- a/htdocs/asterisk/cidlookup.php +++ b/htdocs/asterisk/cidlookup.php @@ -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; diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index db7b73998c1..7ba04331454 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Raphaël Doursenaud * * 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); diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index db47487fa07..2c892dae415 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -6,6 +6,7 @@ * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2015 Marcos García * * 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='
id.'&type='.$typeid).'">'; + $linktocreate='id.'&type='.$typeid).'">'; $linktocreate.=$langs->trans("CreateCat").' '; $linktocreate.=img_picto($langs->trans("Create"),'filenew'); $linktocreate.=""; @@ -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 ''; print ''; @@ -693,11 +694,11 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1) // Link to delete from category print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index dba17a4798c..e2422bffa70 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2015 Alexandre Spangaro * * 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 '
'; print ''; - //print '
aaa'; + + dol_fiche_head(); + print '
'.$title.':
'; $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 ""; @@ -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 "
"; } return 0; } - llxFooter(); $db->close(); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 20fce315153..e5953121e82 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1,13 +1,14 @@ - * Copyright (C) 2005 Davoleau Brice - * Copyright (C) 2005 Rodolphe Quiedeville - * Copyright (C) 2006-2012 Regis Houssin - * Copyright (C) 2006-2012 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2013 Philippe Grand - * Copyright (C) 2015 Marcos García +/* Copyright (C) 2005 Matthieu Valleton + * Copyright (C) 2005 Davoleau Brice + * Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2006-2012 Regis Houssin + * Copyright (C) 2006-2012 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015 Raphaël Doursenaud * * 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; } /** diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 76a19c91d7d..2a41d318ff5 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -1,9 +1,10 @@ - * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2005-2012 Regis Houssin +/* Copyright (C) 2005 Matthieu Valleton + * Copyright (C) 2005 Eric Seigne + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Raphaël Doursenaud * * 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'=>''. + ''. ''. '
'.$li. - ''. - ' '.$val['description'].''.dolGetFirstLineOfText($val['description']).''.img_view().'
' ); @@ -160,7 +161,7 @@ foreach($fulltree as $key => $val) print ''; -print '
'.$langs->trans("Categories").''.$langs->trans("Description").''; +print '
'.$langs->trans("Categories").''; if (! empty($conf->use_javascript_ajax)) { print ''; diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 59be328c55e..f3a84eed5d5 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2014 Jean-François Ferry +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014 Jean-François Ferry + * Copyright (C) 2015 Raphaël Doursenaud * * 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 '
'; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 98d4fb2b930..94570d48f3e 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -1,7 +1,8 @@ - * Copyright (C) 2007 Rodolphe Quiedeville - * Copyright (C) 2010-2012 Destailleur Laurent +/* Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2010-2012 Destailleur Laurent + * Copyright (C) 2015 Raphaël Doursenaud * * 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'); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 198ac73cd2a..36e6f53ecc3 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -1,8 +1,9 @@ - * Copyright (C) 2006-2010 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2005-2012 Regis Houssin +/* Copyright (C) 2005 Matthieu Valleton + * Copyright (C) 2006-2010 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Raphaël Doursenaud * * 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 '
'; $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 ""; @@ -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 ''; $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 ""; @@ -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 ''; $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 ""; @@ -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 ''; $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 ""; @@ -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 ''; $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 ""; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index eb88215fa20..aa34c83523c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -6,6 +6,7 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS + * Copyright (C) 2015 Alexandre Spangaro * * 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 ''; // Type of event @@ -784,7 +787,9 @@ if ($action == 'create') print '
'; - print '
'; + dol_fiche_end(); + + print '
'; print ''; print '     '; print ''; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index d9f2d7b6541..fb4c6f45d84 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -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']).")"; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 8fd26b52b7f..ee16bdd0711 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * 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.='   '; +$nav.=''; if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav.=''; if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.=''; if ($filter) $nav.=''; diff --git a/htdocs/comm/askpricesupplier/card.php b/htdocs/comm/askpricesupplier/card.php index 14d00d43780..c49881ba542 100644 --- a/htdocs/comm/askpricesupplier/card.php +++ b/htdocs/comm/askpricesupplier/card.php @@ -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(); } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 7c08235e788..91082646913 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -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 ''; print ''; print ''; @@ -706,12 +708,14 @@ if ($action == 'create') print ''; print '
'.$langs->trans("MailTitle").'
'.$langs->trans("MailFrom").'
'; // 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 '
'; - print '
'; + dol_fiche_end(); + + print '
'; print ''; } @@ -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); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 09c6087860c..5be006c0053 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -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=''; } } diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index b67b6fe9276..428e561f4fe 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -115,7 +115,7 @@ if ($resql) } $db->free($resql); - print ''; + print '
'; print ''."\n"; $var=true; $listofstatus=array(0,1,2,3,4); diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 3103251a3cb..c9b4e362ae5 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -1,12 +1,13 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Philippe Grand - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Marcos García +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2015 Marcos García * * 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 ''; print ''; - // Added by Matelli + // Prospect levelt print ''; + // Prospect status print ''; print '
'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'
'; - // Generate in $options_from the list of each option sorted - $options_from = ''; + $options_from = ''; // Generate in $options_from the list of each option sorted foreach ($tab_level as $tab_level_sortorder => $tab_level_label) { $options_from .= ''; } - - // Reverse the list - array_reverse($tab_level, true); - - // Generate in $options_to the list of each option sorted in the reversed order - $options_to = ''; + array_reverse($tab_level, true); // Reverse the list + $options_to = ''; // 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 .= ''; - print ' '; + // TODO Add here a list of prospect status + //print $form->selectarray($htmlname, $array, $search_stcomm); + //print ' '; print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 6ff12430000..4b7d0104ec9 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -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 ''; dol_fiche_head(''); - + print ''; // Reference @@ -1548,7 +1548,7 @@ if ($action == 'create' && $user->rights->commande->creer) print '
'; dol_fiche_end(); - + // Button "Create Draft" print '
'; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 7c6f2d52211..7957803a5d5 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -115,7 +115,7 @@ if ($resql) $i++; } $db->free($resql); - print ''; + print '
'; print ''."\n"; $listofstatus=array(0,1,2,3,3,-1); $bool=false; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 55797308fb2..e75a9dda73b 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -503,9 +503,8 @@ if ($action == 'create' && !$error) print "
'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'
\n"; } - //Mode liste -if (($action != 'create' && $action != 'add') || !$error) +if (($action != 'create' && $action != 'add') && !$error) { llxHeader(); ?> diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 75e650d69b8..7dffc753bc4 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -7,6 +7,7 @@ * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2012-2014 Marcos García * Copyright (C) 2011-2015 Alexandre Spangaro + * Copyright (C) 2015 Florian Henry * * 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 '
'; - print '
'; + dol_fiche_end(); + + + /* + * Boutons actions + */ + + if ($action != 'delete') + { + print '
'; + + if ($object->type != 2 && $object->rappro) // If not cash account and can be reconciliate + { + if ($user->rights->banque->consolidate) + { + print ''.$langs->trans("Conciliate").''; + } + else + { + print ''.$langs->trans("Conciliate").''; + } + } + + if ($action != 'addline') + { + if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) + { + if ($user->rights->banque->modifier) + { + print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").''; + } + else + { + print ''.$langs->trans("AddBankRecord").''; + } + } + else + { + print ''.$langs->trans("AddBankRecord").''; + } + } + + print '
'; + } + + print '
'; + /** * Search form */ @@ -352,7 +437,13 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $navig ='
'; if ($limitsql > $viewline) $navig.=''.img_previous().''; $navig.= ' "; // ' Page '; @@ -364,15 +455,15 @@ if ($id > 0 || ! empty($ref)) } $navig.='
'; + //var_dump($navig); - print ''; - - // Show title if ($action != 'addline' && $action != 'delete') { - print ''; + print '
'.$navig.'
'; } + + print '
'.$navig.'
'; // 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 ''; print ''; + $period_filter .= $langs->trans('From').' '.$form->select_date($req_stdt,'req_stdt',0,0,1,null,1,1,1); + $period_filter .= '
'. $langs->trans('to').' '.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1); + print ''; print ''; - print ''; + print ''; print ''."\n"; + $total_deb +=$objp->amount; } else { print ''."\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 ''; - print ''; + print ''; + print ''; + print ''; + } else { + // Only total according row displays + print ''; + print ''; + print ''; + print ''; print ''; print ''; } @@ -859,51 +967,6 @@ if ($id > 0 || ! empty($ref)) print "\n"; - dol_fiche_end(); - - - /* - * Boutons actions - */ - - if ($action != 'delete') - { - print '
'; - - if ($object->type != 2 && $object->rappro) // If not cash account and can be reconciliate - { - if ($user->rights->banque->consolidate) - { - print ''.$langs->trans("Conciliate").''; - } - else - { - print ''.$langs->trans("Conciliate").''; - } - } - - if ($action != 'addline') - { - if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) - { - if ($user->rights->banque->modifier) - { - print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").''; - } - else - { - print ''.$langs->trans("AddBankRecord").''; - } - } - else - { - print ''.$langs->trans("AddBankRecord").''; - } - } - - print '
'; - } - print '
'; } else diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 182340a2baa..68ef0a42e32 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -186,12 +186,14 @@ print ''; print '
  '.$period_filter.''; //$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 ''.price($objp->amount * -1).'   '.price($objp->amount).'
'; if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("CurrentBalance"); print ' '.$object->currency_code.''.price($total, 0, $langs, 0, 0, -1, $object->currency_code).''.price($solde, 0, $langs, 0, 0, -1, $object->currency_code).' 
'; + if ($sep > 0) print ' '; // If we had at least one line in future + else print $langs->trans("Total"); + print ' '.$object->currency_code.''.price($total_deb*-1, 0, $langs, 0, 0, -1, $object->currency_code).''.price($total_cred, 0, $langs, 0, 0, -1, $object->currency_code).''.price($total_cred-($total_deb*-1), 0, $langs, 0, 0, -1, $object->currency_code).' 
'; -print '
'; +dol_fiche_end(); + // Affiche tableau -print ''; +print '
'.$link.'
'; -print ''; + +print '
'.$link.'
'; print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) @@ -245,16 +247,13 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) } print "\n"; -// Ligne vierge -print ''; -$nbcol=0; -for ($annee = $year_start ; $annee <= $year_end ; $annee++) -{ - $nbcol+=2; -} -print "\n"; +print "
'.$langs->trans("Month").'
 
"; -// Solde actuel + +print '
'; + + +// Current balance $balance=0; $sql = "SELECT SUM(b.amount) as total"; @@ -274,6 +273,9 @@ if ($resql) else { dol_print_error($db); } + +print ''; + print '"; print ''; print "\n"; @@ -496,9 +498,9 @@ else unset($tblyear[1]); unset($tblyear[2]); - print '
'; + print '
'; // do not use class="center" here, it will have no effect for the js graph inside. print $show1; - print '
'; + print '
'; // do not use class="center" here, it will have no effect for the js graph inside. print $show2; print '
'; print '
'; diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index d0afdee61bb..6f885e12bde 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -813,6 +813,9 @@ print ''; print '
'.$langs->trans("CurrentBalance")."'.price($balance).'
'; +dol_fiche_end(); + + print ''; // Navigation links @@ -876,8 +879,6 @@ if ($mode == 'showalltime') print '
'; -print "\n
\n"; - llxFooter(); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index f82139d1f3a..eb56a95f96a 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -139,11 +139,10 @@ if (empty($num)) print '
'; - print '
'; + 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 ''; print ''; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 9c0205c62b3..80befe3d433 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012 Vinícius Nogueira * Copyright (C) 2014 Florian Henry @@ -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 ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + 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 "\n"; print ''; @@ -214,9 +214,9 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print ''; @@ -267,7 +267,7 @@ if ($resql) print '\n"; // Payment type - print '\n"; + print '\n"; $total_debit+=$objp->amount; } else @@ -315,7 +315,7 @@ if ($resql) } // Bank account - print '
'.$langs->trans("Type").''.$langs->trans("Numero").''.$langs->trans("Description").''.$langs->trans("ThirdParty").''.$langs->trans("Debit").''.$langs->trans("Credit").'   '.$langs->trans("Account").'
'; - print ''; + print ''; print ''; print ''; print ''.dol_print_date($db->jdate($objp->dv),"day")."'; + print ''; $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 "".price($objp->amount * -1)." '.price($objp->amount * -1)." '; + print ''; $bankaccountstatic->id=$objp->bankid; $bankaccountstatic->label=$objp->bankref; print $bankaccountstatic->getNomUrl(1); diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 4643b367630..38f6b94952e 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -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 '
'; - print '
'; + dol_fiche_end(); + $solde = $acct->solde(0); /* * Affiche tableau des echeances a venir */ - print ''; + print '
'; // Ligne de titre tableau des ecritures print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 6621db1d241..88d6bb587e4 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -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 ''; dol_fiche_head(''); - + print '
'; // Ref @@ -2475,7 +2475,7 @@ if ($action == 'create') print "
\n"; dol_fiche_end(); - + // Button "Create Draft" print '
'; print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index a396d9fdf1d..08a14b75602 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -323,7 +323,7 @@ if ($resql) $formother->select_year($year?$year:-1,'year',1, 20, 5); print '
  
'; //print ''; // Filter @@ -358,6 +361,9 @@ if ($action == 'new') $form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1); print ''; print '
'.$langs->trans('Date').''.dol_print_date($now,'day').'
'; + + dol_fiche_end(); + print '
'; print ''; if ($filterdate || $filteraccountid > 0) @@ -366,8 +372,7 @@ if ($action == 'new') print ''; } print '
'; - //print ''; - print ''; + print ''; print '
'; $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); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 1abc421cf46..ee11532a46f 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -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 ''.$langs->trans("NoInvoiceToWithdraw").''; + print ''.$langs->trans("NoInvoiceToWithdraw").''; } print "
"; } diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 61f0bbb590d..4b92ce7eebc 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -1,6 +1,7 @@ - * Copyright (C) 2013 Laurent Destailleur +/* Copyright (C) 2013 Antoine Iauch + * Copyright (C) 2013 Laurent Destailleur + * Copyright (C) 2015 Raphaël Doursenaud * * 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 ''; print ''; - 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 ' - * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2013 Antoine Iauch +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2013 Antoine Iauch + * Copyright (C) 2015 Raphaël Doursenaud * * 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 ""; // Category filter print ''; print ''; print ''; // Other attributes @@ -1036,7 +1036,7 @@ else // Statut print ''; print ''; print ''."\n"; // Other attributes diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a61b0ea37bf..72590c82e82 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -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) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index ec8004aa18a..72eee453c9f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1,12 +1,12 @@ - * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Raphaël Doursenaud - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013 Alexandre Spangaro - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2003 Eric Seigne + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013-2015 Raphaël Doursenaud + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2015 Jean-François Ferry * * 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) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index cc9a394d983..dd48b27684f 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -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=''; } } diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 84e8ae88431..56cdbe90ca3 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -177,7 +177,7 @@ else } -print '
'; -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 ' * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2015 Alexandre Spangaro * * 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 ''; print ""; @@ -228,7 +231,7 @@ if ($action == 'create') print '
'; - print "
"; + dol_fiche_end(); print '
'; print ''; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d7841677536..3d75c4a2036 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -812,7 +812,7 @@ else // Statut print '
'.$langs->trans("Status").''; - print $object->getLibStatut(5); + print $object->getLibStatut(4); print '
'.$langs->trans("Status").''; - print $object->getLibStatut(5); + print $object->getLibStatut(4); print '
'; +print '
'; print ''."\n"; $var=true; $listofstatus=array(0,4,4,5); $bool=false; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 77877a37cb2..0bd0625ee5d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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 { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 1c132502b78..e2313d157d5 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -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']); diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 520ab7634be..cdb7f66ac5f 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -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; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 406ad24db4b..b4e5a8a0ec0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1,21 +1,21 @@ - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2014 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2006 Marc Barilley/Ocebo - * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2010-2014 Philippe Grand - * Copyright (C) 2011 Herve Prot - * Copyright (C) 2012-2014 Marcos García - * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2012-2014 Raphaël Doursenaud - * Copyright (C) 2014 Alexandre Spangaro +/* Copyright (c) 2002-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2006 Marc Barilley/Ocebo + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2014 Philippe Grand + * Copyright (C) 2011 Herve Prot + * Copyright (C) 2012-2014 Marcos García + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2012-2015 Raphaël Doursenaud + * Copyright (C) 2014 Alexandre Spangaro * * 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.=' '; -// Print form -print '
'."\n"; -print ''; -print ''; -print ''; -print '
'; print '
'.$langs->trans("Statistics").' - '.$langs->trans("Services").'
'."\n"; // Type @@ -591,8 +596,10 @@ if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT) } print "
\n"; +dol_fiche_end(); + // Save -print '
'; +print '
'; print ''; if (! empty($backtopage)) { @@ -600,10 +607,12 @@ if (! empty($backtopage)) } print '
'; -print "
\n"; -print '
'; -print +print "\n"; +print "
"; +print '
'; + + llxFooterVierge(); $db->close(); diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index c2be96b4468..9f0cec70e62 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -10,6 +10,10 @@ if ($dolibarr_main_prod) { $usedolheader=1; // 1 = Test inside a dolibarr page, 0 = Use hard coded header +$form=new Form($db); + + + // HEADER //-------- @@ -62,8 +66,8 @@ else

This page is a sample of page using tables. It is designed to make test with
- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
-- jmobile (add parameter dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
-- no javascript / usage for bind people (add parameter nojs=1 to force disable javascript)
+- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
+- no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)
- dataTables
- tablednd

@@ -112,7 +116,7 @@ This page is a sample of page using tables. It is designed to make test with
-


Example 1 : Standard table/thead/tbody/tr/th-td (no class pair/impair on td) => Use this if you need the drag and drop for lines
+


Example 1 : Standard table/thead/tbody/tr/th-td (no class pair/impair on td) => Use this if you need the drag and drop for lines or for long result tables
use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; + +$nav=''; +$nav.='
'; +if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav.=''; +if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.=''; +if ($filter) $nav.=''; +if ($filtert) $nav.=''; +if ($socid) $nav.=''; +if ($showbirthday) $nav.=''; +if ($pid) $nav.=''; +if ($type) $nav.=''; +if ($usergroup) $nav.=''; +$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1); +$nav.=' '; +$nav.='
'; + +print_barre_liste('Title of my list', 3, $_SERVER["PHP_SELF"], '', '', '', 'Text in middle', 20, 5000, '', 0, $nav); + ?> @@ -138,7 +160,7 @@ if (! empty($conf->use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/aj -


Example 2 : Table using tags: table/thead/tbody/tr/th-td + dataTable => Use this for long result tables
+


Example 2 : Table using tags: table/thead/tbody/tr/th-td + dataTable => Use this for short result tables
diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index c0c81882fe2..f14652f6dc0 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -51,7 +51,7 @@ print "Test 4c: a select with ajax refresh
\n"; //$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz'); $array=array(); $selected=-1; -print $form->selectArrayAjax(DOL_URL_ROOT.'/core/ajax/selecsearchbox.php', 'testselectc', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); +print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selecsearchbox.php', $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); */ print '

'."\n"; diff --git a/htdocs/resource/add.php b/htdocs/resource/add.php index 679644ac9e0..b13e60bd0bc 100644 --- a/htdocs/resource/add.php +++ b/htdocs/resource/add.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2013 Jean-François Ferry + * Copyright (C) 2015 Alexandre Spangaro * * 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 @@ -22,15 +23,10 @@ * Initialy built by build_class_from_table on 2013-07-24 16:03 */ +require '../main.inc.php'; -// Change this following line to use the correct relative path (../, ../../, etc) -$res=0; -$res=@include("../main.inc.php"); // For root directory -if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory -if (! $res) die("Include of main fails"); - -require_once 'class/resource.class.php'; -require_once 'class/html.formresource.class.php'; +require_once DOL_DOCUMENT_ROOT.'/resource/class/resource.class.php'; +require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; // Load traductions files required by page $langs->load("resource"); @@ -132,6 +128,8 @@ if (! $action) print '
'; print ''; + dol_fiche_head(''); + print '
'; // Ref / label @@ -161,7 +159,7 @@ if (! $action) print ''; print ''; print ''; @@ -169,9 +167,11 @@ if (! $action) print '
'; - require_once (DOL_DOCUMENT_ROOT . "/core/class/doleditor.class.php"); + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($field, $$field, 160, '', '', false); $doleditor->Create(); print '
'; - echo '
', + dol_fiche_end(''); + + echo '
', '', - ' ', + '     ', '', '
'; diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 255ab6a05a6..3a57ce7a3d4 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -74,9 +74,10 @@ class CompanyBankAccount extends Account /** * Create bank information record * - * @return int <0 if KO, >= 0 if OK + * @param Object $user User + * @return int <0 if KO, >= 0 if OK */ - function create() + function create($user='') { $now=dol_now(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 89b7d29c2c5..a6967aab0d7 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1,16 +1,17 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2003 Brian Fraval - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Patrick Raguin - * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Alexandre Spangaro - * Copyright (C) 2013 Peter Fontaine - * Copyright (C) 2014-2015 Marcos García +/* Copyright (C) 2002-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2003 Brian Fraval + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Patrick Raguin + * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 Peter Fontaine + * Copyright (C) 2014-2015 Marcos García + * Copyright (C) 2015 Raphaël Doursenaud * * 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 @@ -1344,11 +1345,11 @@ class Societe extends CommonObject // Fill $toute_categs array with an array of (type => array of ("Categorie" instance)) if ($this->client || $this->prospect) { - $toute_categs ['societe'] = $static_cat->containing($this->id,2); + $toute_categs ['societe'] = $static_cat->containing($this->id,Categorie::TYPE_CUSTOMER); } if ($this->fournisseur) { - $toute_categs ['fournisseur'] = $static_cat->containing($this->id,1); + $toute_categs ['fournisseur'] = $static_cat->containing($this->id,Categorie::TYPE_SUPPLIER); } // Remove each "Categorie" @@ -2760,7 +2761,7 @@ class Societe extends CommonObject $this->SupplierCategories = array(); $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie"; - $sql.= " WHERE type = 1"; + $sql.= " WHERE type = ".Categorie::TYPE_SUPPLIER; $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 3712452a057..53549b04734 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -66,7 +66,7 @@ if ($id > 0 || ! empty($ref)) $result = $object->fetch($id, $ref); $upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id ; - $courrier_dir = $conf->societe->multidir_output[$object->entity] . "/courrier/" . get_exdir($object->id); + $courrier_dir = $conf->societe->multidir_output[$object->entity] . "/courrier/" . get_exdir($object->id,0,0,0,$object,'thirdparty'); } diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index fe66380d986..b03cb62eef0 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2014 Charles-Fr Benke - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2014 Charles-Fr Benke + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -135,7 +135,7 @@ if ($result) } else dol_print_error($db); -print ''."\n"; +print '
'."\n"; print ''; if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(round($third['customer'])?1:0)+(round($third['supplier'])?1:0)+(round($third['other'])?1:0) >= 2)) { diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 2fb1d764637..f74969575d1 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -761,11 +761,11 @@ else } $modCodeFournisseur = new $module; - //if ($_GET["type"]=='cp') { $object->client=3; } - if (GETPOST("type")!='f') { $object->client=3; } + // Define if customer/prospect or supplier status is set or not + if (GETPOST("type")!='f' && empty($conf->global->THIRDPARTY_NOTCUSTOMERPROSPECT_BY_DEFAULT)) { $object->client=3; } if (GETPOST("type")=='c') { $object->client=1; } if (GETPOST("type")=='p') { $object->client=2; } - if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } + if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && empty($conf->global->THIRDPARTY_NOTSUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } $object->name = GETPOST('nom', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); @@ -1020,7 +1020,7 @@ else // Address print ''; - print ''; @@ -2247,8 +2247,6 @@ else $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { - print ''; - if (! empty($object->email)) { $langs->load("mails"); @@ -2265,6 +2263,11 @@ else print ''."\n"; } + if ($user->rights->societe->supprimer) + { + print ''; + } + if ($user->rights->societe->supprimer) { if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) // We can't use preloaded confirm form with jmobile diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 8c21be8ac52..eb098c3169c 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2012 Marcos García - * Copyright (C) 2013 Raphaël Doursenaud +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012 Marcos García + * Copyright (C) 2013-2015 Raphaël Doursenaud * * 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 @@ -313,7 +313,7 @@ if ($resql) if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$htmlother->select_categories(2,$search_categ,'search_categ'); + $moreforfilter.=$htmlother->select_categories(Categories::TYPE_CUSTOMER,$search_categ,'search_categ'); $moreforfilter.='       '; } // If the user can view prospects other than his' diff --git a/htdocs/theme/amarok/img/stcomm-1.png b/htdocs/theme/amarok/img/stcomm-1.png index 8b77cfcae4a..2e3f98bb6fd 100644 Binary files a/htdocs/theme/amarok/img/stcomm-1.png and b/htdocs/theme/amarok/img/stcomm-1.png differ diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index c7f3d27dcfb..39c98e713fa 100644 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -1295,6 +1295,95 @@ table.liste td {padding:1px 2px 1px 0px;} .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } +/* Pagination */ +div.pagination { + float: right; +} +div.pagination a { + font-weight: normal; +} +div.pagination ul +{ + list-style: none; + display: inline-block; + padding-left: 0px; + padding-right: 0px; + margin: 0; +} +div.pagination li { + display: inline-block; + padding-left: 0px; + padding-right: 0px; + padding-top: 6px; + padding-bottom: 6px; +} +.pagination { + display: inline-block; + padding-left: 0; + border-radius: 4px; +} + +div.pagination li a, +div.pagination li span { + /*position: relative;*/ + /*float: left;*/ + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #000; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +div.pagination li:first-child a, +div.pagination li:first-child span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +div.pagination li:last-child a, +div.pagination li:last-child span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +div.pagination li a:hover, +div.pagination li span:hover, +div.pagination li a:focus, +div.pagination li span:focus { + color: #000; + background-color: #eee; + border-color: #ddd; +} +div.pagination li .active a, +div.pagination li .active span, +div.pagination li .active a:hover, +div.pagination li .active span:hover, +div.pagination li .active a:focus, +div.pagination li .active span:focus { + z-index: 2; + color: #fff; + cursor: default; + background-color: ; + border-color: #337ab7; +} +div.pagination .disabled span, +div.pagination .disabled span:hover, +div.pagination .disabled span:focus, +div.pagination .disabled a, +div.pagination .disabled a:hover, +div.pagination .disabled a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +div.pagination li .active { + text-decoration: underline; +} +div.pagination li.paginationafterarrows { + margin-left: 10px; +} + tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel { height: 22px; diff --git a/htdocs/theme/auguria/img/stcomm-1.png b/htdocs/theme/auguria/img/stcomm-1.png index df442fc1eda..2e3f98bb6fd 100644 Binary files a/htdocs/theme/auguria/img/stcomm-1.png and b/htdocs/theme/auguria/img/stcomm-1.png differ diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 7278521e092..4b536a4e1e3 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -1396,6 +1396,95 @@ table.liste td { .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } +/* Pagination */ +div.pagination { + float: right; +} +div.pagination a { + font-weight: normal; +} +div.pagination ul +{ + list-style: none; + display: inline-block; + padding-left: 0px; + padding-right: 0px; + margin: 0; +} +div.pagination li { + display: inline-block; + padding-left: 0px; + padding-right: 0px; + padding-top: 6px; + padding-bottom: 6px; +} +.pagination { + display: inline-block; + padding-left: 0; + border-radius: 4px; +} + +div.pagination li a, +div.pagination li span { + /*position: relative;*/ + /*float: left;*/ + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #000; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +div.pagination li:first-child a, +div.pagination li:first-child span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +div.pagination li:last-child a, +div.pagination li:last-child span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +div.pagination li a:hover, +div.pagination li span:hover, +div.pagination li a:focus, +div.pagination li span:focus { + color: #000; + background-color: #eee; + border-color: #ddd; +} +div.pagination li .active a, +div.pagination li .active span, +div.pagination li .active a:hover, +div.pagination li .active span:hover, +div.pagination li .active a:focus, +div.pagination li .active span:focus { + z-index: 2; + color: #fff; + cursor: default; + background-color: ; + border-color: #337ab7; +} +div.pagination .disabled span, +div.pagination .disabled span:hover, +div.pagination .disabled span:focus, +div.pagination .disabled a, +div.pagination .disabled a:hover, +div.pagination .disabled a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +div.pagination li .active { + text-decoration: underline; +} +div.pagination li.paginationafterarrows { + margin-left: 10px; +} + tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel { height: 24px; diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 31071f0b10c..88b9a5c1222 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -1516,6 +1516,95 @@ table.noborder { .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } +/* Pagination */ +div.pagination { + float: right; +} +div.pagination a { + font-weight: normal; +} +div.pagination ul +{ + list-style: none; + display: inline-block; + padding-left: 0px; + padding-right: 0px; + margin: 0; +} +div.pagination li { + display: inline-block; + padding-left: 0px; + padding-right: 0px; + padding-top: 6px; + padding-bottom: 6px; +} +.pagination { + display: inline-block; + padding-left: 0; + border-radius: 4px; +} + +div.pagination li a, +div.pagination li span { + /*position: relative;*/ + /*float: left;*/ + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #000; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +div.pagination li:first-child a, +div.pagination li:first-child span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +div.pagination li:last-child a, +div.pagination li:last-child span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +div.pagination li a:hover, +div.pagination li span:hover, +div.pagination li a:focus, +div.pagination li span:focus { + color: #000; + background-color: #eee; + border-color: #ddd; +} +div.pagination li .active a, +div.pagination li .active span, +div.pagination li .active a:hover, +div.pagination li .active span:hover, +div.pagination li .active a:focus, +div.pagination li .active span:focus { + z-index: 2; + color: #fff; + cursor: default; + background-color: ; + border-color: #337ab7; +} +div.pagination .disabled span, +div.pagination .disabled span:hover, +div.pagination .disabled span:focus, +div.pagination .disabled a, +div.pagination .disabled a:hover, +div.pagination .disabled a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +div.pagination li .active { + text-decoration: underline; +} +div.pagination li.paginationafterarrows { + margin-left: 10px; +} + tr.liste_titre, form.liste_titre { height: 25px; background-repeat: no-repeat; diff --git a/htdocs/theme/cameleo/img/stcomm-1.png b/htdocs/theme/cameleo/img/stcomm-1.png index af1e72ed897..2e3f98bb6fd 100644 Binary files a/htdocs/theme/cameleo/img/stcomm-1.png and b/htdocs/theme/cameleo/img/stcomm-1.png differ diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index d09cb844b88..640fea40575 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -1540,6 +1540,95 @@ table.liste td { .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } +/* Pagination */ +div.pagination { + float: right; +} +div.pagination a { + font-weight: normal; +} +div.pagination ul +{ + list-style: none; + display: inline-block; + padding-left: 0px; + padding-right: 0px; + margin: 0; +} +div.pagination li { + display: inline-block; + padding-left: 0px; + padding-right: 0px; + padding-top: 6px; + padding-bottom: 6px; +} +.pagination { + display: inline-block; + padding-left: 0; + border-radius: 4px; +} + +div.pagination li a, +div.pagination li span { + /*position: relative;*/ + /*float: left;*/ + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #000; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +div.pagination li:first-child a, +div.pagination li:first-child span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +div.pagination li:last-child a, +div.pagination li:last-child span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +div.pagination li a:hover, +div.pagination li span:hover, +div.pagination li a:focus, +div.pagination li span:focus { + color: #000; + background-color: #eee; + border-color: #ddd; +} +div.pagination li .active a, +div.pagination li .active span, +div.pagination li .active a:hover, +div.pagination li .active span:hover, +div.pagination li .active a:focus, +div.pagination li .active span:focus { + z-index: 2; + color: #fff; + cursor: default; + background-color: ; + border-color: #337ab7; +} +div.pagination .disabled span, +div.pagination .disabled span:hover, +div.pagination .disabled span:focus, +div.pagination .disabled a, +div.pagination .disabled a:hover, +div.pagination .disabled a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +div.pagination li .active { + text-decoration: underline; +} +div.pagination li.paginationafterarrows { + margin-left: 10px; +} + tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel { height: 20px !important; diff --git a/htdocs/theme/eldy/img/delete.png b/htdocs/theme/eldy/img/delete.png index 8ad73597be7..2482989b0cc 100644 Binary files a/htdocs/theme/eldy/img/delete.png and b/htdocs/theme/eldy/img/delete.png differ diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 8854e8f3477..f8ead18d96d 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -93,7 +93,6 @@ $isblue=max(0,(2*$colblue-$colred-$colgreen)/2); // 0 - 255 $colorbackhmenu1=($colred-3).','.($colgreen-3).','.($colblue-3); // topmenu $colorbackhmenu2=($colred+5).','.($colgreen+5).','.($colblue+5); $colorbackvmenu1=($colred+15).','.($colgreen+16).','.($colblue+17); // vmenu -$colorbackvmenu1b=($colred+5).','.($colgreen+6).','.($colblue+7); // vmenu (not menu) $colorbackvmenu2=($colred-15).','.($colgreen-15).','.($colblue-15); $colorbacktitle1=($colred-5).','.($colgreen-5).','.($colblue-5); // title of array $colorbacktitle2=($colred-15).','.($colgreen-15).','.($colblue-15); @@ -117,8 +116,7 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_TOPMENU_BACK1='140,160,185'; // topmenu $conf->global->THEME_ELDY_TOPMENU_BACK2='236,236,236'; $conf->global->THEME_ELDY_VERMENU_BACK1='255,255,255'; // vmenu - $conf->global->THEME_ELDY_VERMENU_BACK1b='230,232,232'; // vmenu (not menu) - $conf->global->THEME_ELDY_VERMENU_BACK2='240,240,240'; + $conf->global->THEME_ELDY_VERMENU_BACK2='255,255,255'; $conf->global->THEME_ELDY_BACKTITLE1='140,160,185'; // title of arrays TO MATCH ELDY //$conf->global->THEME_ELDY_BACKTITLE1='240,240,240'; // title of arrays TO MATCH BOOTSTRAP $conf->global->THEME_ELDY_BACKTITLE2='230,230,230'; @@ -140,7 +138,6 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1); $colorbackhmenu2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK2)?$colorbackhmenu2:$conf->global->THEME_ELDY_TOPMENU_BACK2) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK2)?$colorbackhmenu2:$user->conf->THEME_ELDY_TOPMENU_BACK2); $colorbackvmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$user->conf->THEME_ELDY_VERMENU_BACK1); -$colorbackvmenu1b =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1b)?$colorbackvmenu1:$conf->global->THEME_ELDY_VERMENU_BACK1b) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1b)?$colorbackvmenu1b:$user->conf->THEME_ELDY_VERMENU_BACK1b); $colorbackvmenu2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK2)?$colorbackvmenu2:$conf->global->THEME_ELDY_VERMENU_BACK2) :(empty($user->conf->THEME_ELDY_VERMENU_BACK2)?$colorbackvmenu2:$user->conf->THEME_ELDY_VERMENU_BACK2); $colorbacktitle1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE1) ?$colorbacktitle1:$conf->global->THEME_ELDY_BACKTITLE1) :(empty($user->conf->THEME_ELDY_BACKTITLE1)?$colorbacktitle1:$user->conf->THEME_ELDY_BACKTITLE1); $colorbacktitle2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE2) ?$colorbacktitle2:$conf->global->THEME_ELDY_BACKTITLE2) :(empty($user->conf->THEME_ELDY_BACKTITLE2)?$colorbacktitle2:$user->conf->THEME_ELDY_BACKTITLE2); @@ -264,6 +261,11 @@ input, textarea, select { margin-bottom:1px; margin-top:1px; } +input.removedassigned { + padding: 2px !important; + vertical-align: text-bottom; + margin-bottom: -3px; +} select.flat, form.flat select { @@ -446,6 +448,7 @@ textarea.centpercent { margin-left: 1px; } + /* ============================================================================== */ /* Styles to hide objects */ /* ============================================================================== */ @@ -493,7 +496,7 @@ td.showDragHandle { /* ============================================================================== */ #id-container { - margin-top: 8px; + margin-top: 12px; margin-bottom: 8px; display: table; table-layout: fixed; @@ -1033,18 +1036,14 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks padding-bottom: 3px; margin: 1px 0px 8px 2px; - background-image: -o-linear-gradient(bottom, rgb() 0px, rgb() 3px); - background-image: -moz-linear-gradient(bottom, rgb() 0px, rgb() 3px); - background-image: -webkit-linear-gradient(right, rgb() 0px, rgb() 3px); - background-image: -ms-linear-gradient(bottom, rgb() 0px, rgb() 3px); - background-image: linear-gradient(bottom, rgb() 0px, rgb() 3px); + background: rgb(); border-left: 1px solid #AAA; border-right: 1px solid #BBB; border-bottom: 1px solid #BBB; border-top: 1px solid #BBB; - border-radius: 5px; - -moz-border-radius: 5px; + border-radius: 4px; + -moz-border-radius: 4px; -moz-box-shadow: 3px 3px 4px #DDD; -webkit-box-shadow: 3px 3px 4px #DDD; box-shadow: 3px 3px 4px #DDD; @@ -1061,20 +1060,14 @@ div.blockvmenusearch padding-top: 3px; padding-bottom: 3px; margin: 1px 0px 8px 2px; - background: #E3E6E8; - - background-image: -o-linear-gradient(bottom, rgb() 90%, rgb() 100%); - background-image: -moz-linear-gradient(bottom, rgb() 90%, rgb() 100%); - background-image: -webkit-linear-gradient(bottom, rgb() 90%, rgb() 100%); - background-image: -ms-linear-gradient(bottom, rgb() 90%, rgb() 100%); - background-image: linear-gradient(bottom, rgb() 90%, rgb() 100%); + background: rgb(); border-left: 1px solid #AAA; border-right: 1px solid #CCC; border-bottom: 1px solid #CCC; border-top: 1px solid #CCC; - border-radius: 5px; - -moz-border-radius: 5px; + border-radius: 4px; + -moz-border-radius: 4px; -moz-box-shadow: 3px 3px 4px #DDD; -webkit-box-shadow: 3px 3px 4px #DDD; box-shadow: 3px 3px 4px #DDD; @@ -1154,9 +1147,9 @@ td.photo { background-repeat: repeat-x !important; border: 1px solid #CCC !important; - -moz-border-radius: 5px 5px 5px 5px !important; - -webkit-border-radius: 5px 5px 5px 5px !important; - border-radius: 5px 5px 5px 5px !important; + -moz-border-radius: 4px 4px 4px 4px !important; + -webkit-border-radius: 4px 4px 4px 4px !important; + border-radius: 4px 4px 4px 4px !important; -moz-box-shadow: 2px 2px 4px #DDD; -webkit-box-shadow: 2px 2px 4px #DDD; box-shadow: 2px 2px 4px #DDD; @@ -1380,7 +1373,7 @@ div.tabs { clear:both; height:100%; } -div.tabsElem { margin-top: 8px; } /* To avoid overlap of tabs when not browser */ +div.tabsElem { margin-top: 1px; } /* To avoid overlap of tabs when not browser */ div.tabBar { color: #; @@ -1389,9 +1382,9 @@ div.tabBar { padding-right: px; padding-bottom: px; margin: 0px 0px 14px 0px; - -moz-border-radius:6px; - -webkit-border-radius: 6px; - border-radius: 6px; + -moz-border-radius:4px; + -webkit-border-radius: 4px; + border-radius: 4px; border-right: 1px solid #AAA; border-bottom: 1px solid #AAA; border-left: 1px solid #AAA; @@ -1430,12 +1423,12 @@ a.tabTitle { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { font-family: ; - padding: 5px 12px 5px; + padding: 7px 12px 7px; margin: 0em 0.2em; text-decoration: none; white-space: nowrap; - -moz-border-radius:6px 6px 0px 0px; + /*-moz-border-radius:6px 6px 0px 0px; -webkit-border-radius:6px 6px 0px 0px; border-radius:6px 6px 0px 0px; @@ -1444,11 +1437,19 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { border-right: 1px solid #BBB; border-left: 1px solid #BBB; border-top: 1px solid #CCC; - margin: 0 0.2em 0 0.2em !important; - color: #444; + */ + + border-right: 1px solid transparent; + border-left: 1px solid transparent; + border-top: 1px solid transparent; + -moz-border-radius:4px 4px 0 0; + -webkit-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; + + background-image: none !important; } -.tabactive { +.tabactive, a.tab#active { color: # !important; background: rgb() !important; -moz-box-shadow: 0 -1px 4px rgba(0,0,0,.1); @@ -1458,11 +1459,17 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { border-right: 1px solid #AAA !important; border-left: 1px solid #AAA !important; border-top: 1px solid #BBB !important; + -moz-border-radius:4px 4px 0 0; + -webkit-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; } a.tab:hover { + /* background: rgba(, 0.5) url() 50% 0 repeat-x; color: #; + */ + text-decoration: underline; } a.tabimage { color: #434956; @@ -1483,9 +1490,9 @@ span.tabspan { margin: 0em 0.2em; text-decoration: none; white-space: nowrap; - -moz-border-radius:6px 6px 0px 0px; - -webkit-border-radius:6px 6px 0px 0px; - border-radius:6px 6px 0px 0px; + -moz-border-radius:4px 4px 0px 0px; + -webkit-border-radius:4px 4px 0px 0px; + border-radius:4px 4px 0px 0px; border-: 1px solid #555555; border-: 1px solid #D8D8D8; @@ -1500,53 +1507,150 @@ div.divButAction { margin-bottom: 1.4em; } .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { text-decoration: none; - white-space: nowrap; - padding: 0.4em em; margin: 0em em; font-family: ; +/* for bootstrap look + color: #fff; + background-color: #337ab7; + border-color: #2e6da4; + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-weight: normal; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; + */ - font-weight: bold; - background: white; - border: 1px solid #8CACBB; - color: #434956; - -moz-border-radius:0px 5px 0px 5px; - -webkit-border-radius:0px 5px 0px 5px; - border-radius:0px 5px 0px 5px; - -moz-box-shadow: 2px 2px 3px #DDD; - -webkit-box-shadow: 2px 2px 3px #DDD; - box-shadow: 2px 2px 3px #DDD; + font-weight: normal; + border-color: #c5c5c5; + border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); + display: inline-block; + padding: 4px 14px; + text-align: center; + cursor: pointer; + color: #333333; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + background-color: #f5f5f5; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + border: 1px solid #bbbbbb; + border-bottom-color: #a2a2a2; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); } .butAction:hover { - background: #dee7ec; +/* for bootstrap look + color: #fff; + background-color: #286090; + border-color: #204d74; +*/ + -moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); + -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); + box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); } .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { - border: 1px solid #997777; +/* for bootstrap look + color: #fff; + background-color: #d9534f; + border-color: #d43f3a; +*/ + color: #800; } .butActionDelete:hover { - background: #FFe7ec; +/* for bootstrap look + color: #fff; + background-color: #c9302c; + border-color: #ac2925; +*/ + -moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); + -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); + box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); } .butActionRefused { - text-decoration: none !important; + text-decoration: none !important; white-space: nowrap !important; - cursor: not-allowed; - padding: 0.4em em; + cursor: not-allowed !important; margin: 0em em; font-family: !important; +/* for bootstrap look + color: #333; + background-color: #e6e6e6; + border-color: #adadad; + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-weight: normal !important; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +*/ - font-weight: bold !important; - background: white !important; - border: 1px solid #AAAAAA !important; - color: #AAAAAA !important; - -moz-border-radius:0px 5px 0px 5px; - -webkit-border-radius:0px 5px 0px 5px; - border-radius:0px 5px 0px 5px; - -moz-box-shadow: 3px 3px 4px #DDD; - -webkit-box-shadow: 3px 3px 4px #DDD; - box-shadow: 3px 3px 4px #DDD; + font-weight: normal !important; + border-color: #c5c5c5; + border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); + display: inline-block; + padding: 4px 14px; + text-align: center; + cursor: pointer; + color: #999 !important; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + background-color: #f5f5f5; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + border: 1px solid #bbbbbb; + border-bottom-color: #a2a2a2; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); } global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> @@ -1781,7 +1885,7 @@ table.nobordernopadding tr { } table.nobordernopadding tr td { border: 0px; - padding: 0 3px 0 0 !important; + padding: 0 3px 0 0; } table.border tr td table.nobordernopadding tr td { padding-top: 0px; @@ -1837,36 +1941,47 @@ table.liste td { /* Pagination */ - +div.pagination { + float: right; +} div.pagination a { font-weight: normal; } -div.pagination ul, div.pagination li +div.pagination ul { list-style: none; display: inline-block; padding-left: 0px; + padding-right: 0px; + margin: 0; } - div.pagination li { - display: inline; + display: inline-block; + padding-left: 0px; + padding-right: 0px; + padding-top: 6px; + padding-bottom: 6px; } .pagination { display: inline-block; padding-left: 0; border-radius: 4px; } - -div.pagination li a, -div.pagination li span { - position: relative; - float: left; +div.pagination li.pagination a, +div.pagination li.pagination span { padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; color: #000; text-decoration: none; - background-color: #fff; +} +div.pagination li.pagination span.inactive { + cursor: default; +} +dol_use_jmobile)) { ?> +div.pagination li a, +div.pagination li span { + background-color: #fff; border: 1px solid #ddd; } div.pagination li:first-child a, @@ -1911,9 +2026,13 @@ div.pagination .disabled a:focus { background-color: #fff; border-color: #ddd; } -div.pagination li .active { + +div.pagination li.pagination .active { text-decoration: underline; } +div.pagination li.paginationafterarrows { + margin-left: 10px; +} /* Prepare to remove class pair - impair .noborder > tbody > tr:nth-child(even) td { @@ -1942,7 +2061,7 @@ div.pagination li .active { } */ - +/* Set the color for hover lines */ .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover { 0) { ?> @@ -1954,7 +2073,6 @@ div.pagination li .active { .odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover { font-family: ; - border: 0px; margin-bottom: 1px; color: #202020; min-height: 18px; /* seems to not be used */ @@ -1967,15 +2085,21 @@ div.pagination li .active { .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover { font-family: ; - border: 0px; margin-bottom: 1px; color: #202020; background-color: #f9f9f9; } + table.dataTable tr.odd { background-color: #f9f9f9 !important; } + +/* For no hover style */ +table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td { + background-color: #ffffff !important; +} + table.dataTable td { padding: 5px 2px 5px 3px !important; } @@ -2119,7 +2243,7 @@ div.tabBar .noborder { margin-bottom: 8px !important;*/ border: 1px solid #AAA; text-align: center; - border-radius: 5px; + border-radius: 4px; } .boxtable { @@ -2216,9 +2340,9 @@ div.warning { padding: 0.3em 0.3em 0.3em 0.3em; margin: 0.5em 0em 0.5em 0em; border: 1px solid #e0d0b0; - -moz-border-radius:6px; - -webkit-border-radius: 6px; - border-radius: 6px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; background: #EFDF9A; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } @@ -2228,9 +2352,9 @@ div.error { padding: 0.3em 0.3em 0.3em 0.3em; margin: 0.5em 0em 0.5em 0em; border: 1px solid #DC9CAB; - -moz-border-radius:6px; - -webkit-border-radius: 6px; - border-radius: 6px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; background: #EFCFCF; } @@ -2240,9 +2364,9 @@ div.info { padding: 0.4em 0.4em 0.4em 0.4em; margin: 0.5em 0em 0.5em 0em; border: 1px solid #DFBF9A; - -moz-border-radius:6px; - -webkit-border-radius: 6px; - border-radius:6px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; background: #EFCFAA; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } @@ -2305,7 +2429,6 @@ div.titre { color: rgb(); text-decoration: none; text-shadow: 1px 1px 2px #FFFFFF; - dol_optimize_smallscreen)?'':'margin-top: 4px;'); ?> } #dolpaymenttable { width: 600px; font-size: 13px; } @@ -2406,9 +2529,9 @@ table.valid { z-index: 3000; background-color: #FFF; opacity: 1; - -moz-border-radius:6px; - -webkit-border-radius: 6px; - border-radius: 6px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; } #tiptip_content { background-color: rgb(255,255,255); @@ -3031,6 +3154,7 @@ div.dolEventError h1, div.dolEventError h2 { /* ============================================================================== */ /* Datatable */ /* ============================================================================== */ + table.dataTable tr.odd td.sorting_1, table.dataTable tr.even td.sorting_1 { background: none !important; } @@ -3038,6 +3162,14 @@ table.dataTable tr.odd td.sorting_1, table.dataTable tr.even td.sorting_1 { .sorting_desc { background: url('') no-repeat center right !important; } .sorting_asc_disabled { background: url('') no-repeat center right !important; } .sorting_desc_disabled { background: url('') no-repeat center right !important; } +.dataTables_paginate { + margin-top: 8px; +} +.paginate_button_disabled { + opacity: 1 !important; + color: #888 !important; + cursor: default !important; +} .paginate_disabled_previous:hover, .paginate_enabled_previous:hover, .paginate_disabled_next:hover, .paginate_enabled_next:hover { font-weight: normal; @@ -3046,10 +3178,36 @@ table.dataTable tr.odd td.sorting_1, table.dataTable tr.even td.sorting_1 { { text-decoration: underline !important; } +.paginate_active +{ + text-decoration: underline !important; +} .paginate_button { font-weight: normal !important; + text-decoration: none !important; } +.paging_full_numbers { + height: inherit !important; +} +.paging_full_numbers a.paginate_active:hover, .paging_full_numbers a.paginate_button:hover { + background-color: #DDD !important; +} +.paging_full_numbers, .paging_full_numbers a.paginate_active, .paging_full_numbers a.paginate_button { + background-color: #FFF !important; + border-radius: inherit !important; +} +.paging_full_numbers a.paginate_button_disabled:hover { + background-color: #FFF !important; +} +.paginate_button, .paginate_active { + border: 1px solid #ddd !important; + padding: 6px 12px !important; + margin-left: -1px !important; + line-height: 1.42857143 !important; + margin: 0 0 !important; +} + /* For jquery plugin combobox */ /* Disable this. It breaks wrapping of boxes .ui-corner-all { white-space: nowrap; } */ diff --git a/htdocs/theme/md_exp/style.css.php b/htdocs/theme/md_exp/style.css.php index a0b62419971..543ae8a4a54 100644 --- a/htdocs/theme/md_exp/style.css.php +++ b/htdocs/theme/md_exp/style.css.php @@ -252,7 +252,6 @@ input, input.flat, textarea, textarea.flat, form.flat select select, select.flat font-family: ; background: #FDFDFD; border: 1px solid #C0C0C0; - /*padding: 1px 1px 1px 1px; */ margin: 0px 0px 0px 0px; } @@ -443,6 +442,9 @@ textarea.centpercent { { border-right: 1px solid #f4f4f4; } +#formuserfile { + margin-top: 4px; +} #formuserfile_link { margin-left: 1px; } @@ -604,6 +606,10 @@ margin : 0px auto; margin-right: 8px; margin-bottom: 4px; } +.pictosubstatus { + padding-left: 2px; + padding-right: 2px; +} /* ============================================================================== */ @@ -1064,7 +1070,7 @@ a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:px; font-family: ; text-align: ; font-weight: bold; color: #93a5aa; } a.vmenu:link, a.vmenu:visited { color: #; } -a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } +a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #93a5aa; } a.vsmenu:link, a.vsmenu:visited { color: #; } font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } @@ -1457,7 +1463,6 @@ a.tabTitle { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { font-family: ; padding: 5px 12px 5px; - /* padding: 3px 6px 2px 6px;*/ margin: 0em 0.2em; text-decoration: none; white-space: nowrap; @@ -1862,6 +1867,94 @@ table.liste td { .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } +/* Pagination */ +div.pagination { + float: right; +} +div.pagination a { + font-weight: normal; +} +div.pagination ul +{ + list-style: none; + display: inline-block; + padding-left: 0px; + padding-right: 0px; + margin: 0; +} +div.pagination li { + display: inline-block; + padding-left: 0px; + padding-right: 0px; + padding-top: 6px; + padding-bottom: 6px; +} +.pagination { + display: inline-block; + padding-left: 0; + border-radius: 4px; +} + +div.pagination li a, +div.pagination li span { + /*position: relative;*/ + /*float: left;*/ + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #000; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +div.pagination li:first-child a, +div.pagination li:first-child span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +div.pagination li:last-child a, +div.pagination li:last-child span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +div.pagination li a:hover, +div.pagination li span:hover, +div.pagination li a:focus, +div.pagination li span:focus { + color: #000; + background-color: #eee; + border-color: #ddd; +} +div.pagination li .active a, +div.pagination li .active span, +div.pagination li .active a:hover, +div.pagination li .active span:hover, +div.pagination li .active a:focus, +div.pagination li .active span:focus { + z-index: 2; + color: #fff; + cursor: default; + background-color: ; + border-color: #337ab7; +} +div.pagination .disabled span, +div.pagination .disabled span:hover, +div.pagination .disabled span:focus, +div.pagination .disabled a, +div.pagination .disabled a:hover, +div.pagination .disabled a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +div.pagination li .active { + text-decoration: underline; +} +div.pagination li.paginationafterarrows { + margin-left: 10px; +} /* Prepare to remove class pair - impair .noborder > tbody > tr:nth-child(even) td { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 332684a3238..3a561ce8ebb 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -438,15 +438,15 @@ if ($action == 'update' && ! $_POST["cancel"]) { if (GETPOST('deletephoto') && $object->photo) { - $fileimg=$conf->user->dir_output.'/'.get_exdir($object->id,2,0,1).'/logos/'.$object->photo; - $dirthumbs=$conf->user->dir_output.'/'.get_exdir($object->id,2,0,1).'/logos/thumbs'; + $fileimg=$conf->user->dir_output.'/'.get_exdir($object->id,2,0,1,$object,'user').'/logos/'.$object->photo; + $dirthumbs=$conf->user->dir_output.'/'.get_exdir($object->id,2,0,1,$object,'user').'/logos/thumbs'; dol_delete_file($fileimg); dol_delete_dir_recursive($dirthumbs); } if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name'])) { - $dir= $conf->user->dir_output . '/' . get_exdir($object->id,2,0,1); + $dir= $conf->user->dir_output . '/' . get_exdir($object->id,2,0,1,$object,'user'); dol_mkdir($dir); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ac9b67d975c..b1836ef8cde 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1479,10 +1479,10 @@ class User extends CommonObject /** - * Envoie mot de passe par mail + * Send new password by email * - * @param User $user Object user de l'utilisateur qui fait l'envoi - * @param string $password Nouveau mot de passe + * @param User $user Object user that send email + * @param string $password New password * @param int $changelater 1=Change password only after clicking on confirm email * @return int < 0 si erreur, > 0 si ok */ @@ -1528,7 +1528,7 @@ class User extends CommonObject $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; - $url = $urlwithroot; + $url = $urlwithroot.'/'; $mesg.= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $conf->global->MAIN_APPLICATION_TITLE).': '.$url."\n\n"; $mesg.= "--\n"; $mesg.= $user->getFullName($outputlangs); // Username that make then sending @@ -1847,7 +1847,7 @@ class User extends CommonObject $result.=($link.img_object(($notooltip?'':$label), 'user', ($notooltip?'':'class="classfortooltip"')).$linkend); if ($withpicto != 2) $result.=' '; } - $result.= $link . $this->getFullName($langs,'','',$maxlen) . $companylink . $linkend; + $result.= $link . $this->getFullName($langs,'',-1,$maxlen) . $companylink . $linkend; return $result; } diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index 345679f7c9a..2bf914ebd38 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -124,7 +124,7 @@ $server->wsdl->addComplexType( ) ) ); - + /* * An image */ @@ -217,7 +217,7 @@ function getCategory($authentication,$id) if ($result > 0) { $dir = (!empty($conf->categorie->dir_output)?$conf->categorie->dir_output:$conf->service->dir_output); - $pdir = get_exdir($categorie->id,2) . $categorie->id ."/photos/"; + $pdir = get_exdir($categorie->id,2,0,0,$categorie,'category') . $categorie->id ."/photos/"; $dir = $dir . '/'. $pdir; $cat = array( @@ -238,7 +238,7 @@ function getCategory($authentication,$id) foreach($cats as $fille) { $dir = (!empty($conf->categorie->dir_output)?$conf->categorie->dir_output:$conf->service->dir_output); - $pdir = get_exdir($fille->id,2) . $fille->id ."/photos/"; + $pdir = get_exdir($fille->id,2,0,0,$categorie,'category') . $fille->id ."/photos/"; $dir = $dir . '/'. $pdir; $cat['filles'][] = array( 'id'=>$fille->id, diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index b7af224ff52..86891e87595 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -374,7 +374,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang='' $product->load_stock(); $dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output); - $pdir = get_exdir($product->id,2) . $product->id ."/photos/"; + $pdir = get_exdir($product->id,2,0,0,$product,'product') . $product->id ."/photos/"; $dir = $dir . '/'. $pdir; if (! empty($product->multilangs[$langs->defaultlang]["label"])) $product->label = $product->multilangs[$langs->defaultlang]["label"]; @@ -1055,7 +1055,7 @@ function getProductsForCategory($authentication,$id,$lang='') if($obj->status > 0 ) { $dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output); - $pdir = get_exdir($obj->id,2) . $obj->id ."/photos/"; + $pdir = get_exdir($obj->id,2,0,0,$product,'product') . $obj->id ."/photos/"; $dir = $dir . '/'. $pdir; $products[] = array(
'.$langs->trans("Statistics").'