diff --git a/.gitattributes b/.gitattributes index c5785ace780..4b0ed3d14b5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -31,3 +31,22 @@ *.frm binary *.MYD binary *.MYI binary + +# Export ignores to generate clean production tarballs +/build export-ignore +/dev export-ignore +/doc export-ignore +/test export-ignore +.buildpath export-ignore +/build.xml export-ignore +.codeclimate.yml export-ignore +Dockerfile export-ignore +.dockerignore export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.mailmap export-ignore +.scrutinizer.yml export-ignore +.settings export-ignore +.travis.yml export-ignore +.tx export-ignore diff --git a/.travis.yml b/.travis.yml index 426c6b97d74..bb6b774d9ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,6 +113,7 @@ before_script: echo Start travis echo Current dir is `pwd` echo Home dir is `echo ~` + echo TRAVIS_BUILD_DIR is $TRAVIS_BUILD_DIR - | echo "Re-enabling Xdebug for PHP CodeSniffer and PHP Unit" @@ -154,7 +155,7 @@ before_script: mysql -e "SELECT VERSION();" echo fi - + - | echo "Setting up database" if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then @@ -171,8 +172,8 @@ before_script: echo - | - echo "Setting up Dolibarr" export CONF_FILE=htdocs/conf/conf.php + echo "Setting up Dolibarr $CONF_FILE" echo ' $CONF_FILE echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE @@ -189,15 +190,9 @@ before_script: #fi # TODO: SQLite echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE + cat $CONF_FILE echo -- | - if [ "$DEBUG" = true ]; then - echo "Debugging informations" - cat $CONF_FILE - echo - fi - - | echo "Create documents directory and set permissions" # and admin/temp subdirectory needed for unit tests @@ -274,12 +269,16 @@ script: cd htdocs/install php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log php upgrade2.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-2.log + php step5.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-3.log php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log php upgrade2.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-2.log + php step5.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-3.log php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log php upgrade2.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-2.log + php step5.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-3.log php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log php upgrade2.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-2.log + php step5.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-3.log cd - set +e echo @@ -311,3 +310,4 @@ after_failure: fi after_script: + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab328c8e785..6a188d04abb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,7 +76,7 @@ Feel free to express technical details, use cases or anything relevant to the cu This section can span multiple lines. -Try to keep lines under 72 characters. +Try to keep lines under 120 characters. #### Samples
diff --git a/COPYRIGHT b/COPYRIGHT
index 191639ed001..6c2dab9444a 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -14,7 +14,7 @@ Component              Version       License                     GPL Compatible
 PHP libraries:
 AdoDb-Date             0.36          Modified BSD License        Yes             Date convertion (not into rpm package)
 ChromePHP              4.1.0         Apache Software License 2.0 Yes             Return server log to chrome browser console
-CKEditor               4.3.3         LGPL-2.1+                   Yes             Editor WYSIWYG
+CKEditor               4.5.6         LGPL-2.1+                   Yes             Editor WYSIWYG
 EvalMath               1.0           BSD                         Yes             Safe math expressions evaluation
 Escpos-php                           MIT License                 Yes             Thermal receipt printer library, for use with ESC/POS compatible printers
 FPDI                   1.5.2         Apache Software License 2.0 Yes             PDF templates management
diff --git a/ChangeLog b/ChangeLog
index d2b0d63216a..439ae83b35d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,7 +26,6 @@ NEW: Add a tab "document" in donation card
 NEW: Add cancel button on thirdparty create page
 NEW: Add chart of product statistics
 NEW: Add color on categories
-NEW: Add css class and ids on column of detail lines to allow module to easily manipulate fields.
 NEW: Add date value filter on account records list
 NEW: Add __PROJECT_NAME__ tag for customer invoice emails
 NEW: Add option PDF_ALLOW_HTML_FOR_FREE_TEXT to be able to enter pdf footer text with wysiwyg editor.
@@ -36,99 +35,89 @@ NEW: Add filter on status on shipments
 NEW: Add gender property managed on user card FIX: Better error messages when uploading photo of user when permission to write are not granted
 NEW: Add help tooltips on fields of dictionary edit pages.
 NEW: Add hidden option MAIN_MAILFORM_DISABLE_ENTERKEY to disable the key enter into the form to send email.
-NEW: Add hook in send mail
-NEW: Add hooks on list of members to allow an external module to add more fields into list view.
-NEW: Add hooks to allow an external module to complete list of events into calendar views.
 NEW: Add $ID$ into extrafields management to allow use of current object id on filter for select list from table and checkbox list from table
 NEW: Add info page on product card
 NEW: Add into about page, a sample text to use to promote new version release (visible only if version is last stable)
 NEW: Add none/all selection into list of files for FTP browser module
 NEW: Add opportunity amount on project card.
-NEW: Add parameter to add a link to use "date of invoice" in one click when fille a payment card.
+NEW: Add link "date of invoice" to select date of invoice when creating a payment in one click.
 NEW: Add planned workload and declared progress on project summary list on project home page (data aggregated from tasks of project)
-NEW: Add "productpricecard" hook and uniformize code
 NEW: Add ref and label of project into export
 NEW: Add status into filters of graph
 NEW: Add tab document on salaries payment
-NEW: Add thumb of users into thumbs stats on home page
-NEW: A link to the bugtracker can be enabled in the GUI
+NEW: Add thumb of users into stats box on home page
+NEW: A link to the bugtracker report tool can be enabled in the GUI
 NEW: Better look for POS. More responsive design.
 NEW: Can add project search on left menu search area
-NEW: Can assign a task to yourself to have it appear on timesheet
-NEW: Can choose fields to show on project list
+NEW: Can assign a task to yourself to have it appear on timesheet.
 NEW: Can close a project that has draft status with no need to switch it to validate status before.
 NEW: Can edit Background color for Top menu and Background color for table title line.
-NEW: Can edit email template using WYSIWYG editor
-NEW: Can edit list of prospect status for customers/prospects. Add a new entry into dictionary table to manage list fo status. Removed deprecated files.
+NEW: Can edit email templates using WYSIWYG editor.
+NEW: Can edit list of prospect status for customers/prospects. Add a new entry into dictionary table to manage list fo status.
 NEW: Can filter on contact status in prospect list. Removed deprecated menu entry.
-NEW: Can filter proposal on a tag of a product Enhance also the prototype test_arrays to include select form before table.
+NEW: Can filter proposal on a tag of a product.
 NEW: Can filter proposal, orders or invoices with criteria "contain at least one product with following tag"
-NEW: Can select fields to show in product list. Extrafields are also supported.
-NEW: Can select fields to show into the contact list. Extrafields are also supported.
-NEW: Can select which field to show into list of users. Extrafields are also supported.
-NEW: Can set default value of event type when creating an event (if type of event option is used).
+NEW: Can choose fields to show on project list.
+NEW: Can choose fields to show in product list. Extrafields are also supported.
+NEW: Can choose fields to show into the contact list. Extrafields are also supported.
+NEW: Can choose fields to show into list of users. Extrafields are also supported.
+NEW: Can set default value of event type when creating an event (if option "manage type of event" is used).
 NEW: Can upload files on leave requests. Use more standard permissions.
-NEW: Can use a "|" to make a OR search on several different criterias into text filters of tables.
-NEW: Can use the * as a joker characters into search boxes of lists
-NEW: Clean code into salary module, debug and add indexes NEW: Can filter on user list and salary payments on user with naural search.
-NEW: clone action on agenda events
+NEW: Can use a "|" to make a OR search on several different criterias into search text filters of tables.
+NEW: Can use the * as a joker characters into search boxes of lists.
+NEW: Clean code into salary module, debug and add indexes 
+NEW: Can filter on user list and salary payments on user with naural search.
+NEW: Can clone agenda events.
 NEW: Color category is visible onto the thumb of tags on thirdparty, or products cards.
-NEW: conf to use next product/service ref when we clone a product/service
+NEW: Conf to use next product/service ref when we clone a product/service
 NEW: Contract module can be used to follow both sold and bought contracts/recurring subscriptions.
-NEW: Enhance prototype, project list and proposal list with new hooks to have an external module able to add more fields.
-NEW: Enhance style engine. Add option to set color of links.
-NEW: Enter amount for withdraws requests
+NEW: Can change amount when creating withdraws requests.
 NEW: FEATURE PROPOSAL: on proposal, order or invoice creation from scratch, reload page after customer selection so its informations can be loaded
 NEW: Filter "active" by default on user list. Fix label of permission of project module.
-NEW: Forms are using the tab look, even in creation mode.
+NEW: Forms are using the "tab look", even in creation mode.
 NEW: Free text for cheque deposit receipt can be HTML content.
 NEW: Hidden option THEME_ELDY_USE_HOVER is stable enough to become officialy visible into setup.
-NEW: If module salaries is on, you can set a hourly value for time consumed by users. Each time a user enter its time consumed on a project, a calculation is done to provide the cost for human services. This value appears into the "Transversal view" of project.
-NEW: Import Sales representatives of third parties
+NEW: If module salaries is on, you can set a hourly value for time consumed by users. When a user enter its time consumed on a project, a calculation is done to provide the cost for human services. This value appears into the "Overview" of project.
+NEW: Add import profile to import sales representatives of third parties.
 NEW: Increase length of bank code to 128 char #3704
-NEW: info function for product card
 NEW: Into the overview of projects, the name of thirdparty appears into combo lists of elements to link to project.
-NEW: Introduce a "code" into fiels to describe vat. This will allow to suggest different vat lines with same value with ability to differentiate them.
-NEW: Introduce cost price on product.
+NEW: Introduce a "code" into table of vats to describe VAT. This will allow to suggest different vat lines with same value with ability to differentiate them.
+NEW: Introduce cost price on products.
 NEW: Introduce hidden option MAIN_LANDING_PAGE to decide the home page visible just after login.
-NEW: Introduce hidden option MAIN_REPLACE_TRANS_xx_XX to allow simple replacement of translated string on the fly.
+NEW: Introduce hidden option MAIN_REPLACE_TRANS_xx_XX to allow simple replacement of translated string on the fly. Prefer to use next method.
 NEW: Introduce table llx_overwrite_trans to be able to overwrite translations by simple database edition.
-NEW: Introduce use of cache for thumbs images of users
-NEW: Experimental level multiprice generator based on per cent variations over base price
-NEW: List of projects of a thirdparty are visible on a project tab
+NEW: Introduce use of cache for thumbs images of users to save bandwith.
+NEW: Experimental level multiprice generator based on per cent variations over base price.
+NEW: List of projects of a thirdparty are visible on a project tab for the thirdparty.
 NEW: Merge all left menu search boxes into one.
-NEW: Merge all search fields of an area page into one search box
-NEW: next ref on clone doesn't need conf, it's used if mask exists
-NEW: ODT generators can set meta properties of ODT file
-NEW: On list of thirdparties, user can select fields to show. Make phpunit test working again localy. Add missing columns into llx_expedition.
-NEW: Only arrow of current sorted field is visible into table views. This save a lot of spaces. You can click on the column title to sort. This make clickable area larger and click to sort is easier.
+NEW: Merge all search fields of an area page into one search box.
+NEW: Next ref on clone doesn't need conf, it's used if mask exists.
+NEW: Only arrow of current sorted field is visible into table views. This save a lot of space. You can click on the column title to sort. This make clickable area larger and click to sort is easier.
 NEW: On page to see/edit contact of an ojbect, the status of contact is visible (for both external and internal users).
-NEW: Option encrypt password into databae is set to on by default on first install.
-NEW: print event type on third party card tab agenda list (only if AGENDA_USE_EVENT_TYPE = 1)
+NEW: Option "encrypt password" into database is set to on by default on first install.
+NEW: Print event type on third party card tab agenda list (only if AGENDA_USE_EVENT_TYPE = 1)
 NEW: Provide an easier way to understand if an order can be shipped.
-NEW: Quick searh filter works on invoice, proposal, order, intervention, contract
-NEW: Rename install "etape" into english "step"
+NEW: Quick search filter works also on invoice, proposal, order, intervention, contract and expense reports.
 NEW: Replace category edition page on members with new select2 component.
-NEW: Show photo of logged user into login top right block. NEW: If no photo is available for user, we show a generic photo depending on gender
-NEW: Show photo of user into user list. A new function getImageFileNameForSize was also introduced to choose image best size according to usage to save bandwith.
-NEW: Show which fields are used for search when doing a generic search from the quick search form.
+NEW: Show photo of logged user into login top right block. 
+NEW: If no photo is available for user, we show a generic photo depending on gender.
+NEW: Show photo of user into user list.
+NEW: Show which fields were used for search when doing a "generic search" from the "quick search" form on left menu.
 NEW: Statistic graphs on products offer a filter on product type (product / service or both)
-NEW: Support logging to a Sentry server
 NEW: Syslog displays configuration errors
 NEW: The clicktodial module is now able to provide link "tel:" on phone numbers. So it is also possible to use clicktodial with a client solution like the "xivo" local client.
 NEW: The conditional IF into ODT templates works also on not defined var so we can show data only if defined. Close #3819
-NEW: The free text in PDF footer can now be a HTML content. So the WYSIWYG editor is on by default to edit it into module setup.
-NEW: The quick search box on left menu can also search into expense reports.
-NEW: The search box and the bookmarks are now rendered by the menu manager.
-NEW: The thirdparties tabs, the contacts tabs and the members tabs are now presented using a new top banner, saving space and using a same way to show address, status and navigation arrows.
+NEW: The free text in PDF footers can now be a HTML content. So the WYSIWYG editor is on by default to edit it into module setup.
+NEW: The thirdparties tabs, the contacts tabs and the members tabs are now presented using a new "top banner", saving space and using a same way to show address, status and navigation arrows.
 NEW: Thumbs for statistics on main page are fully clicable (not only link inside the thumb)
-NEW: Translate extrafield's labels
-NEW: Uniformize way of working for search filters. One filter per object.
-NEW: Used matching icons for Material Design theme
+NEW: Translate extrafield's labels.
 NEW: Use new select2 component for juridical status, country and state selection.
-NEW: When creating order, proposal or invoice from thirdparty card, the project is asked during creation. A link to create project if it does not exists is also available. NEW: Uniformize form creation of proposal to add public and private notes during creation like done for order and invoice.
+NEW: When creating order, proposal or invoice from thirdparty card, the project is asked during creation. A link to create project if it does not exists is also available. 
+NEW: Uniformize form creation of proposal to add public and private notes during creation like for order and invoice.
+NEW: More robust antiXSS engine.
 
 For developers:
+NEW: The search box and the bookmarks are now rendered by the menu manager.
 NEW: Add a new widget $form->selectArrayAjax() to use combo list with content coming from an Ajax URL.
 NEW: Add doActions hook method call in contract card
 NEW: Added doActions hooks to user cards
@@ -144,10 +133,26 @@ NEW: A module can add its entries into cron module.
 NEW: Framework feature. To have a page being loaded at same scrollbar level after a click on a href link, just add the class "reposition" on this link.
 NEW: Add exemple of setup for multitail to render dolibarr log files
 NEW: Add restler framework. First step to build REST API into Dolibarr.
-
+NEW: Add css class and ids on column of detail lines to allow module to easily manipulate fields.
+NEW: Add hook in send mail
+NEW: Add hooks on list of members to allow an external module to add more fields into list view.
+NEW: Add hooks to allow an external module to complete list of events into calendar views.
+NEW: Add "productpricecard" hook and uniformize code
+NEW: Enhance also the prototype test_arrays to include select form before table.
+NEW: Enhance prototype, project list and proposal list with new hooks to have an external module able to add more fields.
+NEW: Enhance style engine. Add option to set color of links.
+NEW: ODT generators can now also set meta properties of ODT file.
+NEW: Add missing columns into llx_expedition to match other tables.
+NEW: A new function getImageFileNameForSize was also introduced to choose image best size according to usage to save bandwith.
+NEW: Support logging to a Sentry server
+NEW: Prepare database to have agenda able to store more detailed emails events. 
 
 WARNING: 
 
+Dolibarr 3.9 is not yet fully compatible with PHP 7 even if most features seems to work.
+
+Mysql minimum version is now 5.0.3 
+
 Following changes may create regression for some external modules, but were necessary to make
 Dolibarr better:
 - Deprecated Product::setPriceExpression. Use Product::update instead
@@ -165,6 +170,84 @@ This is list of hooks modified:
 
 
  
+***** ChangeLog for 3.8.3 compared to 3.8.2 *****
+FIX: #3805
+FIX: #3231 [Members] Public subscription page displays GeoIP error
+FIX: #3240
+FIX: #3293 Login page form icons not shown
+FIX: #3508 Useless tooltip in 3.8 boxes
+FIX: #3661 Margin is not selected correctly when adding a product
+FIX: #3679 Error when deleting a Localtax2 special payment
+FIX: #3707 Thirdparty bank account page table has a glitch
+FIX: #3726 When upload file, don't test if PRODUCT_USE_OLD_PATH_FOR_PHOTO variable is empty or not
+FIX: #3734 Do not show empty links of deleted source objects in stock movement list
+FIX: #3836 Unable to upload a document to an invoice under some circunstances
+FIX: #3878 Storing and deleting files on emailing was done at wrong place
+FIX: #3880
+FIX: #3882
+FIX: #3890 Expected transactions bank account page, shows negative numbers
+FIX: #3912
+FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
+FIX: #3953 Don't round supplier price
+FIX: #3953 rounding of buying price
+FIX: #3980 Search field in "product by supplier" list sends empty result 3.8 and 3.7
+FIX: #3987 Undefined variable $newref in CommandeFournisseur::approve
+FIX: #3988 Undefined variable $conf and $error in CommandeFournisseur::addline
+FIX: #3989 Undefined variable $conf in CommandeFournisseur::getNomUrl
+FIX: #3990
+FIX: #3992 CommandeFournisseur::ref is marked as deprecated and it shouldn't be
+FIX: #3996 Dictionnary hooks are not working in 3.8
+FIX: #3997 Wrong permission key used for Margins > Read all
+FIX: #4016 User link is not correctly formed in emailing receivers
+FIX: #4018 SQL error if trying to access the mailing/card.php page without an ID defined
+FIX: #4036 Direct printing module without any driver configured, shows an unformatted error message
+FIX: #4043 Incorrect translation in error mesage in menu creation admin page
+FIX: #4049 PHP warning when trying to access a non-existing product/service
+FIX: #4055 SQL error when trying to access a non-existing expedition
+FIX: #4081 Added missing translation
+FIX: #4097 Public holiday calculation
+FIX: #4182 SQL error when deleting an unexisting bank entry
+FIX: #4242 Allow disabling dashes in documents
+FIX: #4243 sql injection
+FIX: #4281
+FIX: #4282 Defined shipping time were not shown in Customer order's PDF documents
+FIX: #4285 SQL query shown when accessing an unexisting invoice
+FIX: #4287 SQL error when accessing an unexisting proposal
+FIX: #4302 Undefined variable $conf in Commande::LibStatut
+FIX: Allow to search on alias name into select
+FIX: Add a protection to not make release if ChangeLog was not generated.
+FIX: autofocus on input search product
+FIX: bad calculation for stock value
+FIX: Better compatibility for users that used the not supported option MAIN_USE_JQUERY_MULTISELECT set to 1.
+FIX: Bug: $this is not accessible in static context in Mailing::libStatutDest #4050
+FIX: can not have access to the new ids or propal lines on PROPAL_CLONE
+FIX: Can't update line's duration
+FIX: Can use formated float number on old expense report module.
+FIX: change object statut on close shipping and remove erratic db commit
+FIX: change order date on clone (as everywhere else)
+FIX: event's data lost on user assign update
+FIX: export propal and order with extrafields
+FIX: export with category contact extrafields
+FIX: jquery select of project generate js error on change event
+FIX: label of line is set in description field if empty
+FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch
+FIX: mail isn't display in title on event in mode view
+FIX: Missing to set context into workflow actions, so triggers can't know we are creating an invoice from order or an order from a proposal.
+FIX: NB task and percent progress in box project
+FIX: Not delete a product when have customer price
+FIX: Not deleting contrats on element_element table
+FIX: Not use localtaxes when invoice some orders
+FIX: only active customer should be available into select list thirdparty on invoice creation
+FIX: only active customer should be return into new invoice creation select list
+FIX: AWP calculation
+FIX: product link in project box
+FIX: Remove  column creation for table llx_product_fournisseur_price, the column use un calss is fk_supplier_price_expression, and fk_price_expression does not exist into lx_product_fournisseur_price sql file declaration
+FIX: Show category selector if we have permission to view products or services
+FIX: showrefnav htmlspecialchar instead of < >
+FIX: The label hidden was not supported when using jmobile
+FIX: Too many information were hidden. A lot of users still need bank account on PDF.
+FIX: Use "WHERE true" instead of "WHERE 1" #4132
+
 ***** ChangeLog for 3.8.2 compared to 3.8.1 *****
 FIX: Add a protection to not make release if ChangeLog was not generated.
 FIX: 1/ update_extra() function must not be in  "if(!empty(MAIN_DISABLE_CONTACTS_TAB)" test. 2/ Reindented code
@@ -509,6 +592,25 @@ Dolibarr better:
 - Function get_exdir require now 6 parameters. This is to prepare a future feature.
 
 
+***** ChangeLog for 3.7.3 compared to 3.7.2 *****
+FIX: #3734 Do not show empty links of deleted source objects in stock movement list
+FIX: #3890 Expected transactions bank account page, shows negative numbers
+FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
+FIX: #3980 Search field in "product by supplier" list sends empty result 3.8 and 3.7
+FIX: #4081 Added missing translation
+FIX: #4097 Public holiday calculation
+FIX: #4242 Allow disabling dashes in documents
+FIX: #4243 sql injection
+FIX: Can use formated float number on old expense report module.
+FIX: Change object statut when closing shipment and remove erratic db commit
+FIX: Export with category contact extrafields
+FIX: NB task and percent progress in box project
+FIX: Not delete a product when have customer price
+FIX: Not deleting contrats on element_element table
+FIX: Not use localtaxes when invoice some orders
+FIX: Product link in project box
+FIX: Use "WHERE true" instead of "WHERE 1" #4132
+
 ***** ChangeLog for 3.7.2 compared to 3.7.1 *****
 FIX: #2957 : missing $langs object for trigger
 FIX: #2983 Load gravatar avatar images securely over HTTPS
@@ -822,6 +924,17 @@ Dolibarr better:
 - Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
 
 
+***** ChangeLog for 3.6.6 compared to 3.6.5 *****
+FIX: #3734 Do not show empty links of deleted source objects in stock movement list
+FIX: #4081 Added missing translation
+FIX: #4097 Public holiday calculation
+FIX: #4242 Allow disabling dashes in documents
+FIX: #4243 sql injection
+FIX: Add a protection to not make release if ChangeLog was not generated. Prepare package 3.6.5
+FIX: export with category contact extrafields
+FIX: Not delete a product when have customer price
+FIX: Not deleting contrats on element_element table
+
 ***** ChangeLog for 3.6.5 compared to 3.6.4 *****
 FIX: #2957 : missing $langs object for trigger
 FIX: #2983 Load gravatar avatar images securely over HTTPS
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 8fc8e49aaf8..ac5529d7d8f 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -495,6 +495,8 @@ if ($nboftargetok) {
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
+		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimed*`;
+		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimod*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
@@ -505,7 +507,10 @@ if ($nboftargetok) {
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
+		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
+		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/accountingexport*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
+		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
 		# Removed other test files
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/api/explorer`;				# This is a dev tool
diff --git a/composer.json b/composer.json
index 583e08078af..f4ea5de0c73 100644
--- a/composer.json
+++ b/composer.json
@@ -16,13 +16,19 @@
         "php": ">=5.3.0",
         "ext-curl": "*",
         "ccampbell/chromephp": "^4.1",
-        "ckeditor/ckeditor": "dev-full/4.3.x#0b7c3f1",
+        "ckeditor/ckeditor": "dev-full/stable",
         "mike42/escpos-php": "dev-master",
         "mobiledetect/mobiledetectlib": "2.8.17",
         "phpoffice/phpexcel": "1.8.1",
         "restler/framework": "^3.0",
         "tecnickcom/tcpdf": "6.2.12"
     },
+    "require-dev": {
+        "jakub-onderka/php-parallel-lint": "^0",
+        "jakub-onderka/php-console-highlighter": "^0",
+        "phpunit/phpunit": "^4",
+        "squizlabs/php_codesniffer": "^2"
+    },
     "suggest": {
         "ext-mysqlnd": "To use with MySQL or MariaDB",
         "ext-mysqli": "To use with MySQL or MariaDB",
diff --git a/composer.lock b/composer.lock
index da19c20fbc5..2ccd1f616a5 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "d8229cbb9aea945c9ca803bbe54d7aa7",
-    "content-hash": "47929ed42fb67e5159ccec6a3a5a45eb",
+    "hash": "4a06567f53c5f081f9c961a0b3093da3",
+    "content-hash": "265061f1a1056df2e8c5184841993d0f",
     "packages": [
         {
             "name": "ccampbell/chromephp",
@@ -52,16 +52,16 @@
         },
         {
             "name": "ckeditor/ckeditor",
-            "version": "dev-full/4.3.x",
+            "version": "dev-full/stable",
             "source": {
                 "type": "git",
                 "url": "https://github.com/ckeditor/ckeditor-releases.git",
-                "reference": "0b7c3f1"
+                "reference": "c1cefe7341e6910a1e6cb2f3f024bbdaf6cd1d4d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/252e512e911f21d880ea542fe162c4643885b317",
-                "reference": "0b7c3f1",
+                "url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/c1cefe7341e6910a1e6cb2f3f024bbdaf6cd1d4d",
+                "reference": "c1cefe7341e6910a1e6cb2f3f024bbdaf6cd1d4d",
                 "shasum": ""
             },
             "type": "library",
@@ -89,7 +89,7 @@
                 "text",
                 "wysiwyg"
             ],
-            "time": "2014-02-26 15:43:10"
+            "time": "2015-12-09 15:49:34"
         },
         {
             "name": "mike42/escpos-php",
@@ -398,7 +398,1119 @@
             "time": "2015-09-12 10:08:34"
         }
     ],
-    "packages-dev": [],
+    "packages-dev": [
+        {
+            "name": "doctrine/instantiator",
+            "version": "1.0.5",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/instantiator.git",
+                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
+                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3,<8.0-DEV"
+            },
+            "require-dev": {
+                "athletic/athletic": "~0.1.8",
+                "ext-pdo": "*",
+                "ext-phar": "*",
+                "phpunit/phpunit": "~4.0",
+                "squizlabs/php_codesniffer": "~2.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Marco Pivetta",
+                    "email": "ocramius@gmail.com",
+                    "homepage": "http://ocramius.github.com/"
+                }
+            ],
+            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+            "homepage": "https://github.com/doctrine/instantiator",
+            "keywords": [
+                "constructor",
+                "instantiate"
+            ],
+            "time": "2015-06-14 21:17:01"
+        },
+        {
+            "name": "myclabs/deep-copy",
+            "version": "1.5.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/myclabs/DeepCopy.git",
+                "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e3abefcd7f106677fd352cd7c187d6c969aa9ddc",
+                "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.4.0"
+            },
+            "require-dev": {
+                "doctrine/collections": "1.*",
+                "phpunit/phpunit": "~4.1"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "DeepCopy\\": "src/DeepCopy/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "description": "Create deep copies (clones) of your objects",
+            "homepage": "https://github.com/myclabs/DeepCopy",
+            "keywords": [
+                "clone",
+                "copy",
+                "duplicate",
+                "object",
+                "object graph"
+            ],
+            "time": "2015-11-07 22:20:37"
+        },
+        {
+            "name": "phpdocumentor/reflection-docblock",
+            "version": "2.0.4",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
+                "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
+                "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.0"
+            },
+            "suggest": {
+                "dflydev/markdown": "~1.0",
+                "erusev/parsedown": "~1.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "phpDocumentor": [
+                        "src/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mike van Riel",
+                    "email": "mike.vanriel@naenius.com"
+                }
+            ],
+            "time": "2015-02-03 12:10:50"
+        },
+        {
+            "name": "phpspec/prophecy",
+            "version": "v1.5.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpspec/prophecy.git",
+                "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7",
+                "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/instantiator": "^1.0.2",
+                "phpdocumentor/reflection-docblock": "~2.0",
+                "sebastian/comparator": "~1.1"
+            },
+            "require-dev": {
+                "phpspec/phpspec": "~2.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.4.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Prophecy\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Konstantin Kudryashov",
+                    "email": "ever.zet@gmail.com",
+                    "homepage": "http://everzet.com"
+                },
+                {
+                    "name": "Marcello Duarte",
+                    "email": "marcello.duarte@gmail.com"
+                }
+            ],
+            "description": "Highly opinionated mocking framework for PHP 5.3+",
+            "homepage": "https://github.com/phpspec/prophecy",
+            "keywords": [
+                "Double",
+                "Dummy",
+                "fake",
+                "mock",
+                "spy",
+                "stub"
+            ],
+            "time": "2015-08-13 10:07:40"
+        },
+        {
+            "name": "phpunit/php-code-coverage",
+            "version": "3.0.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+                "reference": "f7bb5cddf4ffe113eeb737b05241adb947b43f9d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f7bb5cddf4ffe113eeb737b05241adb947b43f9d",
+                "reference": "f7bb5cddf4ffe113eeb737b05241adb947b43f9d",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.6",
+                "phpunit/php-file-iterator": "~1.3",
+                "phpunit/php-text-template": "~1.2",
+                "phpunit/php-token-stream": "~1.3",
+                "sebastian/environment": "^1.3.2",
+                "sebastian/version": "~1.0"
+            },
+            "require-dev": {
+                "ext-xdebug": ">=2.1.4",
+                "phpunit/phpunit": "~5"
+            },
+            "suggest": {
+                "ext-dom": "*",
+                "ext-xdebug": ">=2.2.1",
+                "ext-xmlwriter": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+            "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+            "keywords": [
+                "coverage",
+                "testing",
+                "xunit"
+            ],
+            "time": "2015-11-12 21:08:20"
+        },
+        {
+            "name": "phpunit/php-file-iterator",
+            "version": "1.4.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+                "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
+                "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.4.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+            "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+            "keywords": [
+                "filesystem",
+                "iterator"
+            ],
+            "time": "2015-06-21 13:08:43"
+        },
+        {
+            "name": "phpunit/php-text-template",
+            "version": "1.2.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-text-template.git",
+                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Simple template engine.",
+            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+            "keywords": [
+                "template"
+            ],
+            "time": "2015-06-21 13:50:34"
+        },
+        {
+            "name": "phpunit/php-timer",
+            "version": "1.0.7",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-timer.git",
+                "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
+                "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Utility class for timing",
+            "homepage": "https://github.com/sebastianbergmann/php-timer/",
+            "keywords": [
+                "timer"
+            ],
+            "time": "2015-06-21 08:01:12"
+        },
+        {
+            "name": "phpunit/php-token-stream",
+            "version": "1.4.8",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+                "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
+                "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
+                "shasum": ""
+            },
+            "require": {
+                "ext-tokenizer": "*",
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.2"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.4-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Wrapper around PHP's tokenizer extension.",
+            "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+            "keywords": [
+                "tokenizer"
+            ],
+            "time": "2015-09-15 10:49:45"
+        },
+        {
+            "name": "phpunit/phpunit",
+            "version": "5.1.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/phpunit.git",
+                "reference": "c047ff05d2279404af9a7e89e2a7151c32c88022"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c047ff05d2279404af9a7e89e2a7151c32c88022",
+                "reference": "c047ff05d2279404af9a7e89e2a7151c32c88022",
+                "shasum": ""
+            },
+            "require": {
+                "ext-dom": "*",
+                "ext-json": "*",
+                "ext-pcre": "*",
+                "ext-reflection": "*",
+                "ext-spl": "*",
+                "myclabs/deep-copy": "~1.3",
+                "php": ">=5.6",
+                "phpspec/prophecy": "^1.3.1",
+                "phpunit/php-code-coverage": "~3.0",
+                "phpunit/php-file-iterator": "~1.4",
+                "phpunit/php-text-template": "~1.2",
+                "phpunit/php-timer": ">=1.0.6",
+                "phpunit/phpunit-mock-objects": ">=3.0.5",
+                "sebastian/comparator": "~1.1",
+                "sebastian/diff": "~1.2",
+                "sebastian/environment": "~1.3",
+                "sebastian/exporter": "~1.2",
+                "sebastian/global-state": "~1.0",
+                "sebastian/resource-operations": "~1.0",
+                "sebastian/version": "~1.0",
+                "symfony/yaml": "~2.1|~3.0"
+            },
+            "suggest": {
+                "phpunit/php-invoker": "~1.1"
+            },
+            "bin": [
+                "phpunit"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "5.1.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "The PHP Unit Testing framework.",
+            "homepage": "https://phpunit.de/",
+            "keywords": [
+                "phpunit",
+                "testing",
+                "xunit"
+            ],
+            "time": "2015-12-10 07:54:54"
+        },
+        {
+            "name": "phpunit/phpunit-mock-objects",
+            "version": "3.0.6",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+                "reference": "49bc700750196c04dd6bc2c4c99cb632b893836b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/49bc700750196c04dd6bc2c4c99cb632b893836b",
+                "reference": "49bc700750196c04dd6bc2c4c99cb632b893836b",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/instantiator": "^1.0.2",
+                "php": ">=5.6",
+                "phpunit/php-text-template": "~1.2",
+                "sebastian/exporter": "~1.2"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~5"
+            },
+            "suggest": {
+                "ext-soap": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Mock Object library for PHPUnit",
+            "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+            "keywords": [
+                "mock",
+                "xunit"
+            ],
+            "time": "2015-12-08 08:47:06"
+        },
+        {
+            "name": "sebastian/comparator",
+            "version": "1.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/comparator.git",
+                "reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
+                "reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3",
+                "sebastian/diff": "~1.2",
+                "sebastian/exporter": "~1.2"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.4"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Jeff Welch",
+                    "email": "whatthejeff@gmail.com"
+                },
+                {
+                    "name": "Volker Dusch",
+                    "email": "github@wallbash.com"
+                },
+                {
+                    "name": "Bernhard Schussek",
+                    "email": "bschussek@2bepublished.at"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Provides the functionality to compare PHP values for equality",
+            "homepage": "http://www.github.com/sebastianbergmann/comparator",
+            "keywords": [
+                "comparator",
+                "compare",
+                "equality"
+            ],
+            "time": "2015-07-26 15:48:44"
+        },
+        {
+            "name": "sebastian/diff",
+            "version": "1.4.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/diff.git",
+                "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
+                "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.8"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.4-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Kore Nordmann",
+                    "email": "mail@kore-nordmann.de"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Diff implementation",
+            "homepage": "https://github.com/sebastianbergmann/diff",
+            "keywords": [
+                "diff"
+            ],
+            "time": "2015-12-08 07:14:41"
+        },
+        {
+            "name": "sebastian/environment",
+            "version": "1.3.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/environment.git",
+                "reference": "6e7133793a8e5a5714a551a8324337374be209df"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e7133793a8e5a5714a551a8324337374be209df",
+                "reference": "6e7133793a8e5a5714a551a8324337374be209df",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.4"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.3.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Provides functionality to handle HHVM/PHP environments",
+            "homepage": "http://www.github.com/sebastianbergmann/environment",
+            "keywords": [
+                "Xdebug",
+                "environment",
+                "hhvm"
+            ],
+            "time": "2015-12-02 08:37:27"
+        },
+        {
+            "name": "sebastian/exporter",
+            "version": "1.2.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/exporter.git",
+                "reference": "7ae5513327cb536431847bcc0c10edba2701064e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e",
+                "reference": "7ae5513327cb536431847bcc0c10edba2701064e",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3",
+                "sebastian/recursion-context": "~1.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.4"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Jeff Welch",
+                    "email": "whatthejeff@gmail.com"
+                },
+                {
+                    "name": "Volker Dusch",
+                    "email": "github@wallbash.com"
+                },
+                {
+                    "name": "Bernhard Schussek",
+                    "email": "bschussek@2bepublished.at"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                },
+                {
+                    "name": "Adam Harvey",
+                    "email": "aharvey@php.net"
+                }
+            ],
+            "description": "Provides the functionality to export PHP variables for visualization",
+            "homepage": "http://www.github.com/sebastianbergmann/exporter",
+            "keywords": [
+                "export",
+                "exporter"
+            ],
+            "time": "2015-06-21 07:55:53"
+        },
+        {
+            "name": "sebastian/global-state",
+            "version": "1.1.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/global-state.git",
+                "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
+                "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.2"
+            },
+            "suggest": {
+                "ext-uopz": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Snapshotting of global state",
+            "homepage": "http://www.github.com/sebastianbergmann/global-state",
+            "keywords": [
+                "global state"
+            ],
+            "time": "2015-10-12 03:26:01"
+        },
+        {
+            "name": "sebastian/recursion-context",
+            "version": "1.0.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/recursion-context.git",
+                "reference": "913401df809e99e4f47b27cdd781f4a258d58791"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
+                "reference": "913401df809e99e4f47b27cdd781f4a258d58791",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.4"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Jeff Welch",
+                    "email": "whatthejeff@gmail.com"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                },
+                {
+                    "name": "Adam Harvey",
+                    "email": "aharvey@php.net"
+                }
+            ],
+            "description": "Provides functionality to recursively process PHP variables",
+            "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+            "time": "2015-11-11 19:50:13"
+        },
+        {
+            "name": "sebastian/resource-operations",
+            "version": "1.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/resource-operations.git",
+                "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+                "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.6.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Provides a list of PHP built-in functions that operate on resources",
+            "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
+            "time": "2015-07-28 20:34:47"
+        },
+        {
+            "name": "sebastian/version",
+            "version": "1.0.6",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/version.git",
+                "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
+                "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
+                "shasum": ""
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+            "homepage": "https://github.com/sebastianbergmann/version",
+            "time": "2015-06-21 13:59:46"
+        },
+        {
+            "name": "squizlabs/php_codesniffer",
+            "version": "2.4.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+                "reference": "32a879f4f35019d78d568db2885d7779ca084a33"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/32a879f4f35019d78d568db2885d7779ca084a33",
+                "reference": "32a879f4f35019d78d568db2885d7779ca084a33",
+                "shasum": ""
+            },
+            "require": {
+                "ext-tokenizer": "*",
+                "ext-xmlwriter": "*",
+                "php": ">=5.1.2"
+            },
+            "bin": [
+                "scripts/phpcs",
+                "scripts/phpcbf"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "CodeSniffer.php",
+                    "CodeSniffer/CLI.php",
+                    "CodeSniffer/Exception.php",
+                    "CodeSniffer/File.php",
+                    "CodeSniffer/Fixer.php",
+                    "CodeSniffer/Report.php",
+                    "CodeSniffer/Reporting.php",
+                    "CodeSniffer/Sniff.php",
+                    "CodeSniffer/Tokens.php",
+                    "CodeSniffer/Reports/",
+                    "CodeSniffer/Tokenizers/",
+                    "CodeSniffer/DocGenerators/",
+                    "CodeSniffer/Standards/AbstractPatternSniff.php",
+                    "CodeSniffer/Standards/AbstractScopeSniff.php",
+                    "CodeSniffer/Standards/AbstractVariableSniff.php",
+                    "CodeSniffer/Standards/IncorrectPatternException.php",
+                    "CodeSniffer/Standards/Generic/Sniffs/",
+                    "CodeSniffer/Standards/MySource/Sniffs/",
+                    "CodeSniffer/Standards/PEAR/Sniffs/",
+                    "CodeSniffer/Standards/PSR1/Sniffs/",
+                    "CodeSniffer/Standards/PSR2/Sniffs/",
+                    "CodeSniffer/Standards/Squiz/Sniffs/",
+                    "CodeSniffer/Standards/Zend/Sniffs/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Greg Sherwood",
+                    "role": "lead"
+                }
+            ],
+            "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+            "homepage": "http://www.squizlabs.com/php-codesniffer",
+            "keywords": [
+                "phpcs",
+                "standards"
+            ],
+            "time": "2015-11-23 21:30:59"
+        },
+        {
+            "name": "symfony/yaml",
+            "version": "v3.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/yaml.git",
+                "reference": "177a015cb0e19ff4a49e0e2e2c5fc1c1bee07002"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/yaml/zipball/177a015cb0e19ff4a49e0e2e2c5fc1c1bee07002",
+                "reference": "177a015cb0e19ff4a49e0e2e2c5fc1c1bee07002",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.5.9"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.0-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\Yaml\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Yaml Component",
+            "homepage": "https://symfony.com",
+            "time": "2015-11-30 12:36:17"
+        }
+    ],
     "aliases": [],
     "minimum-stability": "stable",
     "stability-flags": {
diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml
index 64194c7b756..7b887113d90 100644
--- a/dev/codesniffer/ruleset.xml
+++ b/dev/codesniffer/ruleset.xml
@@ -124,7 +124,7 @@
     
     
         
-            
+            
             
         
     
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index c7b5e0cd8fc..c5487f67273 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -62,6 +62,13 @@ In htdocs/includes/tcpdf/tcpdf.php
 * Renamed getmypid into dol_getmypid().
 
 
+To avoid to have QRcode changed because generated with a random mask, replace
+define('QR_FIND_FROM_RANDOM', 2);
+with
+define('QR_FIND_FROM_RANDOM', false);
+
+
+
 TCPDI:
 ------
 Add fpdf_tpl.php 1.2
diff --git a/htdocs/.gitignore b/htdocs/.gitignore
index bf6a1487ea6..050707daf91 100644
--- a/htdocs/.gitignore
+++ b/htdocs/.gitignore
@@ -20,4 +20,5 @@
 /allscreens*
 /ecommerce/
 /cabinetmed*
-/conf/conf.php
\ No newline at end of file
+/conf/conf.php
+/webmail*
diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index d1c4ef409b4..8213fed9d48 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -49,7 +49,7 @@ if (!$user->admin)
 
 $sortfield = GETPOST("sortfield", 'alpha');
 $sortorder = GETPOST("sortorder", 'sortorder');
-$limit = $conf->liste_limit;
+$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
 $page = GETPOST("page", 'int');
 if ($page == - 1) {
 	$page = 0;
diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index dc8dac4f959..1440a515794 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -148,14 +148,14 @@ if ($action == 'create')
 	dol_fiche_head();
 
 	print '';
-
-	print '';
+	
+	print '';
 	print '';
-	print '';
+	print '';
 	print '';
 	print '';
 	print '';
 	print '';
 	print '';
-	print '';
+	print '';
 
 	// Center
 	if ($center)
@@ -2997,13 +3003,13 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
 	if ($sortorder) $options .= "&sortorder=".$sortorder;
 	// Show navigation bar
 	$pagelist = '';
-	if ($page > 0 || $num > $conf->liste_limit)
+	if ($page > 0 || $num > $limit)
 	{
 		if ($totalnboflines)	// If we know total nb of lines
 		{
 			$maxnbofpage=(empty($conf->dol_optimize_smallscreen) ? 6 : 3);		// nb before and after selected page + ... + first or last
 
-			$nbpages=ceil($totalnboflines/$conf->liste_limit);
+			$nbpages=ceil($totalnboflines/$limit);
 			$cpt=($page-$maxnbofpage);
 			if ($cpt < 0) { $cpt=0; }
 
@@ -3961,9 +3967,12 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
 	else
 	{
 		// TODO
-		// We will introduce here a common way of forging path for document storage
+		// We will enhance here a common way of forging path for document storage
 		// Here, object->id, object->ref and object->modulepart are required.
-
+        if (in_array($modulepart, array('thirdparty','contact')))
+        {
+            $path=$object->ref?$object->ref:$object->id;
+        }
 	}
 
 	if (empty($withoutslash) && ! empty($path)) $path.='/';
diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php
index 42551601524..ed4c6d874a3 100644
--- a/htdocs/core/lib/holiday.lib.php
+++ b/htdocs/core/lib/holiday.lib.php
@@ -39,10 +39,15 @@ function holiday_prepare_head($object)
     $head[$h][2] = 'card';
     $h++;
 
-	$head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id;
-	$head[$h][1] = $langs->trans('Document');
-	$head[$h][2] = 'documents';
-	$h++;
+    // Attachments
+    require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+    $upload_dir = $conf->holiday->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
+    $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+    $head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id;
+    $head[$h][1] = $langs->trans('Documents');
+    if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.'';
+    $head[$h][2] = 'documents';
+    $h++;
 
     // Show more tabs from modules
     // Entries must be declared in modules descriptor with line
diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php
index 513a16a71f6..a295d433b6f 100644
--- a/htdocs/core/lib/member.lib.php
+++ b/htdocs/core/lib/member.lib.php
@@ -84,9 +84,14 @@ function member_prepare_head(Adherent $object)
     if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
 	$h++;
 
+    // Attachments
+    require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+    $upload_dir = $conf->adherent->multidir_output[$object->entity].'/'.get_exdir($object->id,2,0,1,$object,'member').'/'.dol_sanitizeFileName($object->ref);
+    $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
     $head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id;
-    $head[$h][1] = $langs->trans("Documents");
-    $head[$h][2] = 'document';
+    $head[$h][1] = $langs->trans('Documents');
+    if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.'';
+    $head[$h][2] = 'documents';
     $h++;
 
     $head[$h][0] = DOL_URL_ROOT.'/adherents/info.php?id='.$object->id;
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index aaa7738a9b1..62a92f4d5ac 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1008,17 +1008,16 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
 	{
 		foreach($linkedobjects as $linkedobject)
 		{
+		    $reftoshow = $linkedobject["ref_title"].' : '.$linkedobject["ref_value"];
+		    if (! empty($linkedobject["date_value"]))
+		    {
+		        $reftoshow .= ' / '.$linkedobject["date_value"];
+		    }
+		    
 			$posy+=3;
 			$pdf->SetXY($posx,$posy);
 			$pdf->SetFont('','', $default_font_size - 2);
-			$pdf->MultiCell($w, $h, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', $align);
-
-			if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"]))
-			{
-				$posy+=3;
-				$pdf->SetXY($posx,$posy);
-				$pdf->MultiCell($w, $h, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', $align);
-			}
+			$pdf->MultiCell($w, $h, $reftoshow, '', $align);
 		}
 	}
 
@@ -1826,10 +1825,11 @@ function pdf_getTotalQty($object,$type,$outputlangs)
 
 /**
  * 	Return linked objects
+ *  FIXME This function returns only one link per link type instead of all links. If we fix this, we must also fix function pdf_writeLinkedObjects
  *
  * 	@param	object		$object			Object
  * 	@param	Translate	$outputlangs	Object lang for output
- * 	@return	array   Linked objects
+ * 	@return	array                       Linked objects
  */
 function pdf_getLinkedObjects($object,$outputlangs)
 {
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 73c74cfb97e..6deaf7eae08 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -45,21 +45,27 @@ function product_prepare_head($object)
 	$head[$h][2] = 'card';
 	$h++;
 
-	$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id;
-	$head[$h][1] = $langs->trans("SellingPrices");
-	$head[$h][2] = 'price';
-	$h++;
-
-	if ((! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
-	|| (! empty($conf->margin->enabled) && $user->rights->margin->liretous)
-	)
+	if (! empty($object->status))
 	{
-		$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
-		$head[$h][1] = $langs->trans("BuyingPrices");
-		$head[$h][2] = 'suppliers';
-		$h++;
+    	$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id;
+    	$head[$h][1] = $langs->trans("SellingPrices");
+    	$head[$h][2] = 'price';
+    	$h++;
 	}
-
+	
+	if (! empty($object->status_buy) || (! empty($conf->margin->enabled) && ! empty($object->status)))   // If margin is on and product on sell, we may need the cost price even if product os not on purchase
+	{
+    	if ((! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
+    	|| (! empty($conf->margin->enabled) && $user->rights->margin->liretous)
+    	)
+    	{
+    		$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
+    		$head[$h][1] = $langs->trans("BuyingPrices");
+    		$head[$h][2] = 'suppliers';
+    		$h++;
+    	}
+	}
+	
 	// Show category tab
 	/* No more required. Replaced with new multiselect component
 	if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire)
diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php
index e8cecacf589..fa05e632983 100644
--- a/htdocs/core/lib/report.lib.php
+++ b/htdocs/core/lib/report.lib.php
@@ -48,8 +48,6 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
 	
 	if(! empty($varlink)) $varlink = '?'.$varlink;
 
-	if(! empty($varlink)) $varlink = '?'.$varlink;
-
 	$h=0;
 	$head[$h][0] = $_SERVER["PHP_SELF"].$varlink;
 	$head[$h][1] = $langs->trans("Report");
diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php
index b3f3e16a3bd..e900931037e 100644
--- a/htdocs/core/lib/treeview.lib.php
+++ b/htdocs/core/lib/treeview.lib.php
@@ -98,6 +98,7 @@ function tree_showpad(&$fulltree,$key,$silent=0)
 
 /**
  *  Recursive function to output menu tree. 
+ *  It is also used for the tree of categories.
  *  Note: To have this function working, check you have loaded the js and css for treeview.
  *  $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
  *                   '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
@@ -132,7 +133,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree')
 		print '
@@ -167,7 +167,7 @@ if (! empty($hookmanager->resArray['options'])) {
 
-
+ diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 4d3afeb8d92..b3a50223806 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; class InterfaceWorkflowManager extends DolibarrTriggers { - public $picto = 'paypal@paypal'; + public $picto = 'technic'; public $family = 'core'; public $description = "Triggers of this module allows to manage workflows"; public $version = self::VERSION_DOLIBARR; diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 0912e7aee10..40a06f11648 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -698,9 +698,9 @@ class InterfaceActionsAuto extends DolibarrTriggers require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $actioncomm = new ActionComm($this->db); $actioncomm->type_code = $object->actiontypecode; // code of parent table llx_c_actioncomm (will be deprecated) - $actioncomm->code='AC_'.$action; + $actioncomm->code = 'AC_'.$action; $actioncomm->label = $object->actionmsg2; - $actioncomm->note = $object->actionmsg; + $actioncomm->note = $object->actionmsg; // TODO Replace with $actioncomm->email_msgid ? $object->email_content : $object->actionmsg $actioncomm->datep = $now; $actioncomm->datef = $now; $actioncomm->durationp = 0; @@ -712,15 +712,22 @@ class InterfaceActionsAuto extends DolibarrTriggers $actioncomm->contactid = $contactforaction->id; $actioncomm->authorid = $user->id; // User saving action $actioncomm->userownerid = $user->id; // Owner of action - //$actioncomm->userdone = $user; // User doing action (not used anymore) - //$actioncomm->userdoneid = $user->id; // User doing action (not used anymore) + // Fields when action is en email (coentent should be into note) + $actioncomm->email_msgid = $object->email_msgid; + $actioncomm->email_from = $object->email_from; + $actioncomm->email_sender= $object->email_sender; + $actioncomm->email_to = $object->email_to; + $actioncomm->email_tocc = $object->email_tocc; + $actioncomm->email_tobcc = $object->email_tobcc; + $actioncomm->email_subject = $object->email_subject; + $actioncomm->errors_to = $object->errors_to; $actioncomm->fk_element = $object->id; $actioncomm->elementtype = $object->element; - $ret=$actioncomm->add($user); // User qui saisit l'action + $ret=$actioncomm->add($user); // User creating action - unset($object->actionmsg); unset($object->actionmsg2); unset($object->actiontypecode); // When several action are called on same object, we must be sure to not reuse vallue of first action. + unset($object->actionmsg); unset($object->actionmsg2); unset($object->actiontypecode); // When several action are called on same object, we must be sure to not reuse value of first action. if ($ret > 0) { diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 474670e27cc..569c85b2ce8 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -43,6 +43,11 @@ $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); $cancel=GETPOST('cancel'); + +/* + * Actions + */ + $object = new Cronjob($db); if (!empty($id)) { @@ -53,7 +58,7 @@ if (!empty($id)) } } -if(!empty($cancel)) +if (!empty($cancel)) { if (!empty($id)) { @@ -61,7 +66,7 @@ if(!empty($cancel)) } else { - Header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=1'); + Header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); exit; } } @@ -78,7 +83,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del } else { - Header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=1'); + Header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); exit; } } @@ -86,6 +91,8 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del // Execute jobs if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute) { + $now = dol_now(); // Date we start + $result=$object->run_jobs($user->login); if ($result < 0) @@ -95,7 +102,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex } else { - $res = $object->reprogram_jobs($user->login); + $res = $object->reprogram_jobs($user->login, $now); if ($res > 0) { if ($object->lastresult > 0) setEventMessages($langs->trans("JobFinished"), null, 'warnings'); @@ -312,7 +319,7 @@ if (($action=="create") || ($action=="edit")) print "\n"; print "
"; print ""; print ""; + print '"; + print ""; print "")}f.push("")}f.push("
' . $langs->trans("AccountNumber") . '
' . $langs->trans("AccountNumber") . '
' . $langs->trans("Label") . '
' . $langs->trans("Label") . '
' . $langs->trans("Accountparent") . ''; - print $htmlacc->select_account($accounting->account_parent, 'account_parent'); + print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1); print '
' . $langs->trans("Pcgtype") . ''; @@ -204,13 +204,13 @@ else if ($id) print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; print ''; } +foreach ($list_account as $key) +{ + $var=!$var; + + print ''; + + // Param + $label = $langs->trans($key); + print ''; + + // Value + print ''; +} + $var = ! $var; print ""; print ''; diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 0bea58fd75c..2be16820445 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -22,17 +22,18 @@ /** * \file htdocs/accountancy/admin/productaccount.php * \ingroup Accounting Expert - * \brief Onglet de gestion de parametrages des ventilations + * \brief To define accounting account on product / service */ require '../../main.inc.php'; // Class -require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; -require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; // Langs $langs->load("companies"); @@ -40,6 +41,10 @@ $langs->load("compta"); $langs->load("main"); $langs->load("accountancy"); +// Security check +if (!$user->admin) accessforbidden(); +if (empty($conf->accounting->enabled)) accessforbidden(); + // search & action GETPOST $action = GETPOST('action'); $codeventil_buy = GETPOST('codeventil_buy', 'array'); @@ -67,10 +72,8 @@ $pagenext = $page + 1; // bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed ! if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) { $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; - // } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { - // $limit = $conf->liste_limit; } else { - $limit = $conf->liste_limit; + $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; } $offset = $limit * $page; @@ -79,7 +82,7 @@ if (! $sortfield) if (! $sortorder) $sortorder = "ASC"; - // sales or purchase +// Sales or Purchase mode ? if ($action == 'update') { if (! empty($btn_changetype)) { $error = 0; @@ -128,12 +131,12 @@ if ($action == 'update') { $sql .= " SET accountancy_code_sell = " . $accounting->account_number; } $sql .= " WHERE rowid = " . $productid; - + dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG); if ($db->query($sql)) { - $msg .= '
' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '
'; + $msg .= '
' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '
'; } else { - $msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $accounting->account_number . '
' . $sql . '
'; + $msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '
' . $sql . '
'; } } @@ -147,13 +150,6 @@ if ($action == 'update') { } } -// Security check -if ($user->societe_id > 0) - accessforbidden(); - // TODO after adding menu - // if (! $user->rights->accounting->ventilation->dispatch) - // accessforbidden(); - $form = new FormVentilation($db); // Defaut AccountingAccount RowId Product / Service @@ -179,13 +175,12 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_desc = ''; } -// debug move header to top -llxHeader('', $langs->trans("Accounts")); - /* * View */ +llxHeader('', $langs->trans("Accounts")); + print ''; @@ -231,7 +232,7 @@ class box_actions extends ModeleBoxes else { print ''; } } diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 384e30f8b12..d314af73cd1 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -25,6 +25,7 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); + /** * Class to manage the box to show last task */ @@ -36,6 +37,7 @@ class box_task extends ModeleBoxes //var $depends = array("projet"); var $db; var $param; + var $enabled = 0; // Disabled because bugged. var $info_box_head = array(); var $info_box_contents = array(); @@ -79,8 +81,8 @@ class box_task extends ModeleBoxes // list the summary of the orders if ($user->rights->projet->lire) { - - $sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot"; + // FIXME fk_statut on a task is not be used. We use the percent. This means this box is useless. + $sql = "SELECT pt.fk_statut, count(DISTINCT pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt"; $sql.= " WHERE pt.datec BETWEEN '".$this->db->idate(dol_get_first_day(date("Y"), 1))."' AND '".$this->db->idate(dol_get_last_day(date("Y"), 12))."'"; $sql.= " AND pt.rowid = ptt.fk_task"; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index c2634cbaaed..5804ab4cf9f 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Marcos García + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Marcos García + * Copyright (C) 2016 Charlie Benke * * 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 @@ -560,7 +561,7 @@ abstract class CommonDocGenerator * @param Object $object Object with extrafields (must have $object->array_options filled) * @param array $array_to_fill Substitution array * @param Extrafields $extrafields Extrafields object - * @param string $array_key Name of the key for return array + * @param string $array_key Prefix for name of the keys into returned array * @param Translate $outputlangs Lang object to use for output * @return array Substitution array */ @@ -581,12 +582,25 @@ abstract class CommonDocGenerator $object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]]; } else if($extrafields->attribute_type[$key] == 'date') - { - $object->array_options['options_'.$key] = (strlen($object->array_options['options_'.$key])>0?dol_print_date($object->array_options['options_'.$key],'day'):''); + { + if (strlen($object->array_options['options_'.$key])>0) + { + $object->array_options['options_'.$key] = dol_print_date($object->array_options['options_'.$key],'day'); // using company output language + $object->array_options['options_'.$key.'_locale'] = dol_print_date($object->array_options['options_'.$key],'day','tzserver',$outputlangs); // using output language format + $object->array_options['options_'.$key.'_rfc'] = dol_print_date($object->array_options['options_'.$key],'dayrfc'); // international format + } + else + { + $object->array_options['options_'.$key] = ''; + $object->array_options['options_'.$key.'_locale'] = ''; + $object->array_options['options_'.$key.'_rfc'] = ''; + } } else if($extrafields->attribute_type[$key] == 'datetime') { - $object->array_options['options_'.$key] = ($object->array_options['options_'.$key]!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhour'):''); + $object->array_options['options_'.$key] = ($object->array_options['options_'.$key]!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhour'):''); // using company output language + $object->array_options['options_'.$key.'_locale'] = ($object->array_options['options_'.$key]!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhour','tzserver',$outputlangs):''); // using output language format + $object->array_options['options_'.$key.'_rfc'] = ($object->array_options['options_'.$key]!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhourrfc'):''); // international format } $array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key => $object->array_options['options_'.$key])); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 659ff4d3c5a..2929b66e80c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2054,7 +2054,7 @@ abstract class CommonObject $forcedroundingmode=$roundingadjust; if ($forcedroundingmode == 'auto' && isset($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)) $forcedroundingmode=$conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND; - if ($forcedroundingmode == 'auto') $forcedroundingmode='0'; + elseif ($forcedroundingmode == 'auto') $forcedroundingmode='0'; $error=0; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 7adcd79d364..34fc77bbc34 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -205,6 +205,17 @@ class Conf $db->free($resql); } + // Include local constants files and fetch their values to the corresponding database constants + if(! empty($this->global->LOCAL_CONSTS_FILES)) { + $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES); + foreach ($filesList as $file) { + $file=dol_sanitizeFileName($file); + include_once DOL_DOCUMENT_ROOT . "/$file/{$file}_consts.php"; + foreach ($file2bddconsts as $key=>$value) { + $conf->global->$key=constant($value); + } + } + } //var_dump($this->modules); //var_dump($this->modules_parts['theme']); diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 60d24558d86..35c3b3909ef 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -60,7 +60,7 @@ class DolEditor * @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. * @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor) * @param int $rows Size of rows for textarea tool - * @param int $cols Size of cols for textarea tool (textarea number of cols or %) + * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') * @param int $readonly 0=Read/Edit, 1=Read only */ function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0,$readonly=0) diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php index fdd0fc2732c..869b26e2f75 100644 --- a/htdocs/core/class/dolprintipp.class.php +++ b/htdocs/core/class/dolprintipp.class.php @@ -66,7 +66,7 @@ class dolprintIPP */ function list_jobs($module) { - global $conf, $db, $bc; + global $conf, $db, $bc, $langs; include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; $ipp = new CupsPrintIPP(); $ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose @@ -96,7 +96,8 @@ class dolprintIPP } catch(Exception $e) { - print $e->getMessage(); + setEventMessage('[printipp] '.$langs->trans('CoreErrorMessage'), 'errors'); + dol_syslog($e->getMessage(), LOG_ERR); } print '
' . $langs->trans("AccountNumber") . '
' . $langs->trans("AccountNumber") . '
' . $langs->trans("Label") . '
' . $langs->trans("Label") . '
' . $langs->trans("Accountparent") . ''; - print $htmlacc->select_account($accounting->account_parent, 'account_parent'); + print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1); print '
' . $langs->trans("Pcgtype") . ''; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 40dff028783..67a708f38d2 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -31,8 +31,9 @@ require '../../main.inc.php'; // Class -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; $langs->load("compta"); $langs->load("bills"); @@ -51,7 +52,10 @@ $list = array ( 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc 'ACCOUNTING_LENGTH_GACCOUNT', - 'ACCOUNTING_LENGTH_AACCOUNT', + 'ACCOUNTING_LENGTH_AACCOUNT' +); + +$list_account = array ( 'ACCOUNTING_ACCOUNT_CUSTOMER', 'ACCOUNTING_ACCOUNT_SUPPLIER', 'ACCOUNTING_PRODUCT_BUY_ACCOUNT', @@ -109,6 +113,14 @@ if ($action == 'update') } } + foreach ($list_account as $constname) { + $constvalue = GETPOST($constname, 'alpha'); + + if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error++; + } + } + if (! $error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -151,6 +163,7 @@ if ($action == 'setlistsortdone') { llxHeader(); $form = new Form($db); +$formaccountancy = New FormVentilation($db); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup'); @@ -262,6 +275,22 @@ foreach ($list as $key) print '
'; + print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1); + print '
' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '
'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a5643c26dc5..62ebd0589c0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -898,9 +898,10 @@ class Form * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param int $limit Maximum number of elements * @param string $morecss Add more css styles to the SELECT component + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @return string HTML string with select box for thirdparty. */ - function select_company($selected='', $htmlname='socid', $filter='', $showempty=0, $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100') + function select_company($selected='', $htmlname='socid', $filter='', $showempty=0, $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='') { $out=''; @@ -934,7 +935,7 @@ class Form } else {*/ - $out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss); + $out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam); //} return $out; @@ -954,9 +955,10 @@ class Form * @param int $outputmode 0=HTML select string, 1=Array * @param int $limit Limit number of answers * @param string $morecss Add more css styles to the SELECT component + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @return string HTML string with */ - function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100') + function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='') { global $conf,$user,$langs; @@ -1010,12 +1012,13 @@ class Form } // Construct $out and $outarray - $out.= ''."\n"; $textifempty=''; // Do not use textempty = ' ' or ' ' here, or search on key will search on ' key'. //$textifempty=' '; //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $textifempty.=$langs->trans("NoFilter"); if ($showempty) $out.= ''."\n"; $num = $this->db->num_rows($resql); @@ -1099,7 +1102,7 @@ class Form $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; $sql.= " re.description, re.fk_facture_source"; $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re"; - $sql.= " WHERE fk_soc = ".$socid; + $sql.= " WHERE fk_soc = ".(int) $socid; if ($filter) $sql.= " AND ".$filter; $sql.= " ORDER BY re.description ASC"; @@ -1718,13 +1721,13 @@ class Form foreach ($scrit as $crit) { if ($i > 0) $sql.=" AND "; - $sql.="(p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%'"; - if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$prefix.$crit."%'"; + $sql.="(p.ref LIKE '".$db->escape($prefix.$crit)."%' OR p.label LIKE '".$db->escape($prefix.$crit)."%'"; + if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$db->escape($prefix.$crit)."%'"; $sql.=")"; $i++; } if (count($scrit) > 1) $sql.=")"; - if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'"; + if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$db->escape($prefix.$filterkey)."%'"; $sql.=')'; } $sql.= $db->order("p.ref"); @@ -2087,7 +2090,7 @@ class Form $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " AND p.tobuy = 1"; - if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype; + if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$this->db->escape($filtertype); if (! empty($filtre)) $sql.=" ".$filtre; // Add criteria on ref/label if ($filterkey != '') @@ -2101,11 +2104,11 @@ class Form foreach ($scrit as $crit) { if ($i > 0) $sql.=" AND "; - $sql.="(pfp.ref_fourn LIKE '".$prefix.$crit."%' OR p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%')"; + $sql.="(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%')"; $i++; } if (count($scrit) > 1) $sql.=")"; - if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'"; + if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; $sql.=')'; } $sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC"; @@ -2619,7 +2622,7 @@ class Form /** * Charge dans cache la liste des types de paiements possibles * - * @return int Nb of lines loaded, <0 if KO + * @return int Nb of lines loaded, <0 if KO */ function load_cache_types_paiements() { @@ -2632,9 +2635,9 @@ class Form $this->cache_types_paiements = array(); - $sql = "SELECT id, code, libelle as label, type"; + $sql = "SELECT id, code, libelle as label, type, active"; $sql.= " FROM ".MAIN_DB_PREFIX."c_paiement"; - $sql.= " WHERE active > 0"; + //if ($active >= 0) $sql.= " WHERE active = ".$active; $resql = $this->db->query($sql); if ($resql) @@ -2651,6 +2654,7 @@ class Form $this->cache_types_paiements[$obj->id]['code'] =$obj->code; $this->cache_types_paiements[$obj->id]['label']=$label; $this->cache_types_paiements[$obj->id]['type'] =$obj->type; + $this->cache_types_paiements[$obj->id]['active'] =$obj->active; $i++; } @@ -2708,14 +2712,15 @@ class Form * * @param string $selected Id du mode de paiement pre-selectionne * @param string $htmlname Nom de la zone select - * @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz)) + * @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz)) * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code * @param int $empty 1=peut etre vide, 0 sinon * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $maxlength Max length of label + * @param int $active Active or not, -1 = all * @return void */ - function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0) + function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0, $active=1) { global $langs,$user; @@ -2732,6 +2737,9 @@ class Form if ($empty) print ''; foreach($this->cache_types_paiements as $id => $arraytypes) { + // If not good status + if ($active >= 0 && $arraytypes['active'] != $active) continue; + // On passe si on a demande de filtrer sur des modes de paiments particuliers if (count($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue; @@ -3685,9 +3693,10 @@ class Form * @param int $selected Id mode pre-selectionne * @param string $htmlname Name of select html field * @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz)) + * @param int $active Active or not, -1 = all * @return void */ - function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='') + function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1) { global $langs; if ($htmlname != "none") @@ -3697,7 +3706,7 @@ class Form print ''; print '
'; print ''; print ''; print '
'; - $this->select_types_paiements($selected,$htmlname,$filtertype); + $this->select_types_paiements($selected,$htmlname,$filtertype,0,0,0,0,$active); print '
'; @@ -3707,7 +3716,6 @@ class Form if ($selected) { $this->load_cache_types_paiements(); - print $this->cache_types_paiements[$selected]['label']; } else { print " "; @@ -4242,8 +4250,9 @@ class Form // Show date with combo selects else { + //$retstring.='
'; // Day - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { @@ -4257,7 +4266,7 @@ class Form $retstring.=""; - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { $retstring.=''; @@ -4275,11 +4284,11 @@ class Form // Year if ($emptydate || $set_time == -1) { - $retstring.=''; + $retstring.=''; } else { - $retstring.=''; + $retstring.=''; for ($year = $syear - 5; $year < $syear + 10 ; $year++) { @@ -4287,6 +4296,7 @@ class Form } $retstring.="\n"; } + //$retstring.='
'; } } @@ -4502,7 +4512,7 @@ class Form * @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '), <0 to add an empty value with key that is this value. * @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 string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @param int $translate Translate and encode value * @param int $maxlen Length maximum for labels * @param int $disabled Html select box is disabled @@ -4842,7 +4852,7 @@ class Form
-
    +
      '.$lis.'
@@ -4909,7 +4919,7 @@ class Form $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text foreach($ways as $way) { - $toprint[] = '
  • color?' style="background: #'.$c->color.';"':'').'>'.img_object('','category').' '.$way.'
  • '; + $toprint[] = '
  • color?' style="background: #'.$c->color.';"':' style="background: #aaa"').'>'.img_object('','category').' '.$way.'
  • '; } } return '
      '.implode(' ', $toprint).'
    '; @@ -5323,7 +5333,7 @@ class Form { $ret.=''; } - $ret.='
    '.$morehtmlright.'
    '; + if ($morehtmlright) $ret.='
    '.$morehtmlright.'
    '; $ret.=''; return $ret; @@ -5381,19 +5391,15 @@ class Form $id = (! empty($object->id) ? $object->id : $object->rowid); $ret='';$dir='';$file='';$originalfile='';$altfile='';$email=''; - if ($modulepart=='societe') { $dir=$conf->societe->multidir_output[$entity]; - $smallfile=$object->logo; - $smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile); if (! empty($object->logo)) { - // TODO Introduce get_exdir - if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini'); - else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small'); - else $file=$id.'/logos/thumbs/'.$smallfile; - $originalfile=$id.'/logos/thumbs/'.$smallfile; + if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs + else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small'); + else $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo; + $originalfile=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo; } } else if ($modulepart=='contact') @@ -5401,11 +5407,10 @@ class Form $dir=$conf->societe->multidir_output[$entity].'/contact'; if (! empty($object->photo)) { - // TODO Introduce get_exdir - if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini'); - else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small'); - else $file=$id.'/photos/'.$object->photo; - $originalfile=$id.'/photos/'.$object->photo; + if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo; + $originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo; } } else if ($modulepart=='userphoto') diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 88f2f87c1e3..0316fb461cf 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -243,10 +243,10 @@ class FormActions * Output html select list of type of event * * @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx') - * @param string $htmlname Nom champ formulaire + * @param string $htmlname Name of select field * @param string $excludetype A type to exclude ('systemauto', 'system', '') * @param string $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type - * @param int $hideinfohelp 1=Do not show info help + * @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value * @param int $multiselect 1=Allow multiselect of action type * @return void */ @@ -280,7 +280,10 @@ class FormActions print $form->selectarray($htmlname, $arraylist, $selected); } - if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0) + { + print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup").($hideinfohelp == -1 ? ". ".$langs->trans("YouCanSetDefaultValueInModuleSetup") : ''),1); + } } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index bc185ef6d71..8e7064d1893 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -630,7 +630,8 @@ class FormMail extends Form } if ($this->withfile == 2) // Can add other files { - $out.= ''; + if (!empty($conf->global->FROM_MAIL_USE_INPUT_FILE_MULTIPLE)) $out.= ''; + else $out.= ''; $out.= ' '; $out.= ''; } diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index 0bb318df8da..4ecbef60b58 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -55,6 +55,8 @@ class FormOrder */ function selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status') { + $tmpsupplierorder=new CommandeFournisseur($db); + print ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 51cf8a9c7a7..1727db5f227 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -598,7 +598,11 @@ class FormOther include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $color = colorArrayToHex(colorStringToArray($color,array()),''); - if ($color) print ''; + $textcolor='000'; + $tmpcolorweight=0; + foreach(colorStringToArray($color,array()) as $x) $tmpcolorweight+=$x; + if ($tmpcolorweight < 400) $textcolor='FFF'; + if ($color) print ''; else print $textifnotdefined; } diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 2b7f76dedf9..3b26576b0fa 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -269,7 +269,7 @@ class FormProjets * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable) * @param int $forcefocus Force focus on field (works with javascript only) * @param int $disabled Disabled - * @return int Nber of project if OK, <0 if KO + * @return int Nbr of project if OK, <0 if KO */ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0) { diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index cc373acc163..34a7ebdf9f5 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -38,7 +38,7 @@ class DoliDBMysql extends DoliDB //! Database label const LABEL='MySQL'; //! Version min database - const VERSIONMIN='4.1.0'; + const VERSIONMIN='5.0.3'; /** @var resource Resultset of last query */ private $_results; diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 8b68fa921ac..04f6372055f 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -38,7 +38,7 @@ class DoliDBMysqli extends DoliDB //! Database label const LABEL='MySQL or MariaDB'; //! Version min database - const VERSIONMIN='4.1.3'; + const VERSIONMIN='5.0.3'; /** @var mysqli_result Resultset of last query */ private $_results; diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index b843f83e1d0..234a2348590 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -940,10 +940,11 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, function copyToClipboard(text,text2) { text = text.replace(/
    /g,"\n"); - var newElem = '

    '+text2; - $("#dialog").html(newElem); - $("#dialog").dialog(); - $("#coords").select(); + var newElem = '

    '+text2; + /* alert(newElem); */ + $("#dialogforpopup").html(newElem); + $("#dialogforpopup").dialog(); + $("#coordsforpopup").select(); return false; } @@ -1034,7 +1035,7 @@ function price2numjs(amount) { print "var dec='" . $dec . "'; var thousand='" . $thousand . "';\n"; // Set var in javascript ?> - var main_max_dec_shown = global->MAIN_MAX_DECIMALS_SHOWN; ?>; + var main_max_dec_shown = global->MAIN_MAX_DECIMALS_SHOWN); ?>; var main_rounding_unit = global->MAIN_MAX_DECIMALS_UNIT; ?>; var main_rounding_tot = global->MAIN_MAX_DECIMALS_TOT; ?>; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c7b370b287f..fc544a51d93 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -767,9 +767,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''."\n"; - // A div for the address popup - print ''; - return $i; } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index db6582ba332..c8891e5c325 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1438,56 +1438,71 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio dol_syslog('dol_add_file_process upload_dir='.$upload_dir.' allowoverwrite='.$allowoverwrite.' donotupdatesession='.$donotupdatesession.' savingdocmask='.$savingdocmask, LOG_DEBUG); if (dol_mkdir($upload_dir) >= 0) { - // Define $destpath (path to file including filename) and $destfile (only filename) - $destpath=$upload_dir . "/" . $_FILES[$varfiles]['name']; - $destfile=$_FILES[$varfiles]['name']; - - $savingdocmask = dol_sanitizeFileName($savingdocmask); - - if ($savingdocmask) + $TFile = $_FILES[$varfiles]; + if (!is_array($TFile['name'])) { - $destpath=$upload_dir . "/" . preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); - $destfile=preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); - } - - $resupload = dol_move_uploaded_file($_FILES[$varfiles]['tmp_name'], $destpath, $allowoverwrite, 0, $_FILES[$varfiles]['error'], 0, $varfiles); - if (is_numeric($resupload) && $resupload > 0) - { - include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - if (empty($donotupdatesession)) + foreach ($TFile as $key => &$val) { - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $formmail->add_attached_files($destpath, $destfile, $_FILES[$varfiles]['type']); - } - if (image_format_supported($destpath) == 1) - { - // Create small thumbs for image (Ratio is near 16/9) - // Used on logon for example - $imgThumbSmall = vignette($destpath, 160, 120, '_small', 50, "thumbs"); - // Create mini thumbs for image (Ratio is near 16/9) - // Used on menu or for setup page for example - $imgThumbMini = vignette($destpath, 160, 120, '_mini', 50, "thumbs"); - } - - setEventMessages($langs->trans("FileTransferComplete"), null, 'mesgs'); - } - else - { - $langs->load("errors"); - if ($resupload < 0) // Unknown error - { - setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors'); - } - else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus - { - setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors'); - } - else // Known error - { - setEventMessages($langs->trans($resupload), null, 'errors'); + $val = array($val); } } + + $nbfile = count($TFile['name']); + + for ($i = 0; $i < $nbfile; $i++) + { + // Define $destpath (path to file including filename) and $destfile (only filename) + $destpath=$upload_dir . "/" . $TFile['name'][$i]; + $destfile=$TFile['name'][$i]; + + $savingdocmask = dol_sanitizeFileName($savingdocmask); + + if ($savingdocmask) + { + $destpath=$upload_dir . "/" . preg_replace('/__file__/',$TFile['name'][$i],$savingdocmask); + $destfile=preg_replace('/__file__/',$TFile['name'][$i],$savingdocmask); + } + + $resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destpath, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles); + if (is_numeric($resupload) && $resupload > 0) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + if (empty($donotupdatesession)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->add_attached_files($destpath, $destfile, $TFile['type'][$i]); + } + if (image_format_supported($destpath) == 1) + { + // Create small thumbs for image (Ratio is near 16/9) + // Used on logon for example + $imgThumbSmall = vignette($destpath, 160, 120, '_small', 50, "thumbs"); + // Create mini thumbs for image (Ratio is near 16/9) + // Used on menu or for setup page for example + $imgThumbMini = vignette($destpath, 160, 120, '_mini', 50, "thumbs"); + } + + setEventMessages($langs->trans("FileTransferComplete"), null, 'mesgs'); + } + else + { + $langs->load("errors"); + if ($resupload < 0) // Unknown error + { + setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors'); + } + else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus + { + setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors'); + } + else // Known error + { + setEventMessages($langs->trans($resupload), null, 'errors'); + } + } + } + } } elseif ($link) { if (dol_mkdir($upload_dir) >= 0) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 82d5c52c575..51e47c0ee8a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -908,7 +908,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } else { - if ($showimage) $morehtmlleft.='
    '.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'
    '; + if ($showimage) $morehtmlleft.='
    '.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'
    '; } if ($showbarcode) $morehtmlleft.='
    '.$form->showbarcode($object).'
    '; if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { @@ -2959,16 +2959,18 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois * @param int $pictoisfullpath 1=Icon name is a full absolute url of image * @param string $morehtml More html to show * @param string $morecss More css to the table + * @param int $limit Limit ofnumber of lines on each page * @return void */ -function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='') +function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=0) { global $conf,$langs; if ($picto == 'setup') $picto='title_setup.png'; if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif'; - - if (($num > $conf->liste_limit) || ($num == -1)) + if ($limit < 1) $limit = $conf->liste_limit; + + if (($num > $limit) || ($num == -1)) { $nextpage = 1; } @@ -2983,7 +2985,11 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so // Left if ($picto && $titre) print '
    '.img_picto('', $picto, '', $pictoisfullpath).'
    '.$titre.'
    '.$titre; + if (!empty($totalnboflines) && !empty($titre)) { + print ' ('.$totalnboflines.')'; + } + print '
    -" id="username" name="username" class="flat input-icon-user" size="20" value="" tabindex="1" /> +" id="username" name="username" class="flat input-icon-user" size="20" value="" tabindex="1" />
    "; - print $langs->trans('CronHourStart').""; + print $langs->trans('CronDtStart').""; if(!empty($object->datestart)) { $form->select_date($object->datestart,'datestart',1,1,'',"cronform"); @@ -513,15 +520,22 @@ else print "
    "; - print $langs->trans('CronHourStart').""; - if(!empty($object->datestart)) {print dol_print_date($object->datestart,'dayhourtext');} else {print $langs->trans('CronNone');} + print $langs->trans('CronDtStart').""; + if(!empty($object->datestart)) {print dol_print_date($object->datestart,'dayhourtext');} print "
    "; print $langs->trans('CronDtEnd').""; - if(!empty($object->dateend)) {print dol_print_date($object->dateend,'dayhourtext');} else {print $langs->trans('CronNone');} + if(!empty($object->dateend)) {print dol_print_date($object->dateend,'dayhourtext');} print "
    '; + print $langs->trans('CronDtNextLaunch'); + print ' ('.$langs->trans('CronFrom').')'; + print ""; + if(!empty($object->datenextrun)) {print dol_print_date($object->datenextrun,'dayhoursec');} else {print $langs->trans('CronNone');} + print "
    "; print $langs->trans('CronPriority')."".$object->priority; @@ -586,23 +600,17 @@ else print '
    '; + print ''; print '"; - - print '"; print '"; print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 002b6e35565..5d29468090e 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -61,7 +61,7 @@ if ($page == -1) { $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $form = new Form($db); $establishmenttmp=new Establishment($db); diff --git a/htdocs/includes/ckeditor/ckeditor/CHANGES.md b/htdocs/includes/ckeditor/ckeditor/CHANGES.md index a5bec2ba830..ff1cb9fdfa6 100644 --- a/htdocs/includes/ckeditor/ckeditor/CHANGES.md +++ b/htdocs/includes/ckeditor/ckeditor/CHANGES.md @@ -1,11 +1,606 @@ CKEditor 4 Changelog ==================== +## CKEditor 4.5.6 + +New Features: + +* Introduced the [`CKEDITOR.tools.getCookie()`](http://docs.ckeditor.com/#!/api/CKEDITOR.tools-method-getCookie) and [`CKEDITOR.tools.setCookie()`](http://docs.ckeditor.com/#!/api/CKEDITOR.tools-method-setCookie) methods for accessing cookies. +* Introduced the [`CKEDITOR.tools.getCsrfToken()`](http://docs.ckeditor.com/#!/api/CKEDITOR.tools-method-getCsrfToken) method. The CSRF token is now automatically sent by the [File Browser](http://ckeditor.com/addon/filebrowser) and [File Tools](http://ckeditor.com/addon/filetools) plugins during file uploads. The server-side upload handlers may check it and use it to additionally secure the communication. + +Other Changes: + +* Updated [SCAYT](http://ckeditor.com/addon/scayt) (Spell Check As You Type): + - New features: + - CKEditor [Language](http://ckeditor.com/addon/language) plugin support. + - CKEditor [Placeholder](http://ckeditor.com/addon/placeholder) plugin support. + - [Drag&Drop](http://sdk.ckeditor.com/samples/fileupload.html) support. + - **Experimental** [GRAYT](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-grayt_autoStartup) (Grammar As You Type) functionality. + - Fixed issues: + * [#98](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/98): SCAYT affects dialog double-click. Fixed in SCAYT core. + * [#102](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/102): SCAYT core performance enhancements. + * [#104](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/104): SCAYT's spans leak into the clipboard and after pasting. + * [#105](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/105): A JavaScript error fired in case of multiple instances of CKEditor on one page. + * [#107](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/107): SCAYT should not check non-editable parts of content. + * [#108](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/108): Latest SCAYT copies the ID of the editor element to the iframe. + * SCAYT stops working when CKEditor [Undo plugin](http://ckeditor.com/addon/undo) not enabled. + * Issue with pasting SCAYT markup in CKEditor. + * SCAYT stops working after pressing the *Cancel* button in the WSC dialog. + +## CKEditor 4.5.5 + +Fixed Issues: + +* [#13887](https://dev.ckeditor.com/ticket/13887): Fixed: [Link](http://ckeditor.com/addon/link) plugin alters the `target` attribute value. Thanks to [SamZiemer](https://github.com/SamZiemer)! +* [#12189](http://dev.ckeditor.com/ticket/12189): Fixed: The [Link](http://ckeditor.com/addon/link) plugin dialog does not display the subject of email links if the subject parameter is not lowercase. +* [#9192](http://dev.ckeditor.com/ticket/9192): Fixed: An `undefined` string is appended to an email address added with the [Link](http://ckeditor.com/addon/link) plugin if subject and email body are empty and [`config.emailProtection`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-emailProtection) is set to `encode`. +* [#13790](https://dev.ckeditor.com/ticket/13790): Fixed: It is not possible to destroy the editor `');return b.join("")})}},fileButton:function(b,a,d){if(!(3>arguments.length)){i.call(this,a);var e=this;a.validate&&(this.validate=a.validate);var c=CKEDITOR.tools.extend({},a),f=c.onClick;c.className=(c.className?c.className+" ":"")+"cke_dialog_ui_button";c.onClick=function(c){var d= -a["for"];if(!f||f.call(this,c)!==false){b.getContentElement(d[0],d[1]).submit();this.disable()}};b.on("load",function(){b.getContentElement(a["for"][0],a["for"][1])._.buttons.push(e)});CKEDITOR.ui.dialog.button.call(this,b,c,d)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,a=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,d=/\/$/;return function(e,c,f){if(!(3>arguments.length)){var h=[],g=c.html;"<"!=g.charAt(0)&&(g=""+g+"");var k=c.focus;if(k){var j=this.focus;this.focus=function(){("function"== -typeof k?k:j).call(this);this.fire("focus")};c.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,e,c,h,"span",null,null,"");h=h.join("").match(b);g=g.match(a)||["","",""];d.test(g[1])&&(g[1]=g[1].slice(0,-1),g[2]="/"+g[2]);f.push([g[1]," ",h[1]||"",g[2]].join(""))}}}(),fieldset:function(b,a,d,e,c){var f=c.label;this._={children:a};CKEDITOR.ui.dialog.uiElement.call(this,b,c,e,"fieldset",null,null,function(){var a=[];f&&a.push(""+f+"");for(var b=0;ba.getChildCount()?(new CKEDITOR.dom.text(b,CKEDITOR.document)).appendTo(a):a.getChild(0).$.nodeValue=b;return this},getLabel:function(){var b= -CKEDITOR.document.getById(this._.labelId);return!b||1>b.getChildCount()?"":b.getChild(0).getText()},eventProcessors:o},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return!this._.disabled?this.fire("click",{dialog:this._.dialog}):!1},enable:function(){this._.disabled=!1;var b=this.getElement();b&&b.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()}, +return function(g,e){var a=g.uiColor,a={id:"."+g.id,defaultBorder:b(a,-.1),defaultGradient:c(b(a,.9),a),lightGradient:c(b(a,1),b(a,.7)),mediumGradient:c(b(a,.8),b(a,.5)),ckeButtonOn:c(b(a,.6),b(a,.7)),ckeResizer:b(a,-.4),ckeToolbarSeparator:b(a,.5),ckeColorauto:b(a,.8),dialogBody:b(a,.7),dialogTabSelected:c("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:b(a,-.6),elementsPathBg:a,menubuttonIcon:b(a,.5),menubuttonIconHover:b(a,.3)};return f[e].output(a).replace(/\[/g,"{").replace(/\]/g, +"}")}}();CKEDITOR.plugins.add("dialogui",{onLoad:function(){var h=function(b){this._||(this._={});this._["default"]=this._.initValue=b["default"]||"";this._.required=b.required||!1;for(var a=[this._],d=1;darguments.length)){var c=h.call(this,a);c.labelId=CKEDITOR.tools.getNextId()+ +"_label";this._.children=[];var e={role:a.role||"presentation"};a.includeLabel&&(e["aria-labelledby"]=c.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"div",null,e,function(){var e=[],g=a.required?" cke_required":"";"horizontal"!=a.labelLayout?e.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" ',' id\x3d"'+c.labelId+'"',c.inputId?' for\x3d"'+c.inputId+'"':"",(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",a.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"', +a.controlStyle?' style\x3d"'+a.controlStyle+'"':"",' role\x3d"presentation"\x3e',f.call(this,b,a),"\x3c/div\x3e"):(g={type:"hbox",widths:a.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" id\x3d"'+c.labelId+'" for\x3d"'+c.inputId+'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(a.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+(a.controlStyle?' style\x3d"'+a.controlStyle+ +'"':"")+"\x3e"+f.call(this,b,a)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,g,e));return e.join("")})}},textInput:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);var f=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",c={"class":"cke_dialog_ui_input_"+a.type,id:f,type:a.type};a.validate&&(this.validate=a.validate);a.maxLength&&(c.maxlength=a.maxLength);a.size&&(c.size=a.size);a.inputStyle&&(c.style=a.inputStyle);var e=this,m=!1;b.on("load",function(){e.getInputElement().on("keydown", +function(a){13==a.data.getKeystroke()&&(m=!0)});e.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&m&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),m=!1);e.bidi&&w.call(e,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var b=['\x3cdiv class\x3d"cke_dialog_ui_input_',a.type,'" role\x3d"presentation"'];a.width&&b.push('style\x3d"width:'+a.width+'" ');b.push("\x3e\x3cinput ");c["aria-labelledby"]=this._.labelId;this._.required&& +(c["aria-required"]=this._.required);for(var e in c)b.push(e+'\x3d"'+c[e]+'" ');b.push(" /\x3e\x3c/div\x3e");return b.join("")})}},textarea:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);var f=this,c=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",e={};a.validate&&(this.validate=a.validate);e.rows=a.rows||5;e.cols=a.cols||20;e["class"]="cke_dialog_ui_input_textarea "+(a["class"]||"");"undefined"!=typeof a.inputStyle&&(e.style=a.inputStyle);a.dir&&(e.dir=a.dir);if(f.bidi)b.on("load", +function(){f.getInputElement().on("keyup",w)},f);CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){e["aria-labelledby"]=this._.labelId;this._.required&&(e["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',c,'" '],b;for(b in e)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(e[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(f._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(b, +a,d){if(!(3>arguments.length)){var f=h.call(this,a,{"default":!!a["default"]});a.validate&&(this.validate=a.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"span",null,null,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),e=[],d=CKEDITOR.tools.getNextId()+"_label",g={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":d};t(c);a["default"]&&(g.checked="checked");"undefined"!=typeof c.inputStyle&&(c.style=c.inputStyle); +f.checkbox=new CKEDITOR.ui.dialog.uiElement(b,c,e,"input",null,g);e.push(' \x3clabel id\x3d"',d,'" for\x3d"',g.id,'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(a.label),"\x3c/label\x3e");return e.join("")})}},radio:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);this._["default"]||(this._["default"]=this._.initValue=a.items[0][1]);a.validate&&(this.validate=a.validate);var f=[],c=this;a.role="radiogroup";a.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this, +b,a,d,function(){for(var e=[],d=[],g=(a.id?a.id:CKEDITOR.tools.getNextId())+"_radio",k=0;karguments.length)){var f=h.call(this,a);a.validate&&(this.validate=a.validate);f.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),e=[],d=[],g={id:f.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};e.push('\x3cdiv class\x3d"cke_dialog_ui_input_', +a.type,'" role\x3d"presentation"');a.width&&e.push('style\x3d"width:'+a.width+'" ');e.push("\x3e");void 0!==a.size&&(g.size=a.size);void 0!==a.multiple&&(g.multiple=a.multiple);t(c);for(var k=0,l;karguments.length)){void 0===a["default"]&&(a["default"]="");var f=CKEDITOR.tools.extend(h.call(this,a),{definition:a,buttons:[]});a.validate&&(this.validate=a.validate);b.on("load",function(){CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){f.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var b=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"', +f.frameId,'" title\x3d"',a.label,'" src\x3d"javascript:void('];b.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");b.push(')"\x3e\x3c/iframe\x3e');return b.join("")})}},fileButton:function(b,a,d){var f=this;if(!(3>arguments.length)){h.call(this,a);a.validate&&(this.validate=a.validate);var c=CKEDITOR.tools.extend({},a),e=c.onClick;c.className=(c.className?c.className+" ":"")+"cke_dialog_ui_button";c.onClick=function(c){var d= +a["for"];e&&!1===e.call(this,c)||(b.getContentElement(d[0],d[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(a["for"][0],a["for"][1])._.buttons.push(f)});CKEDITOR.ui.dialog.button.call(this,b,c,d)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,a=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,d=/\/$/;return function(f,c,e){if(!(3>arguments.length)){var m=[],g=c.html;"\x3c"!=g.charAt(0)&&(g="\x3cspan\x3e"+g+"\x3c/span\x3e");var k=c.focus;if(k){var l=this.focus;this.focus=function(){("function"== +typeof k?k:l).call(this);this.fire("focus")};c.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,f,c,m,"span",null,null,"");m=m.join("").match(b);g=g.match(a)||["","",""];d.test(g[1])&&(g[1]=g[1].slice(0,-1),g[2]="/"+g[2]);e.push([g[1]," ",m[1]||"",g[2]].join(""))}}}(),fieldset:function(b,a,d,f,c){var e=c.label;this._={children:a};CKEDITOR.ui.dialog.uiElement.call(this,b,c,f,"fieldset",null,null,function(){var a=[];e&&a.push("\x3clegend"+ +(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e"+e+"\x3c/legend\x3e");for(var b=0;ba.getChildCount()?(new CKEDITOR.dom.text(b,CKEDITOR.document)).appendTo(a):a.getChild(0).$.nodeValue=b;return this},getLabel:function(){var b= +CKEDITOR.document.getById(this._.labelId);return!b||1>b.getChildCount()?"":b.getChild(0).getText()},eventProcessors:r},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var b=this.getElement();b&&b.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()}, isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(b,a){this.on("click",function(){a.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)}, -focus:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&a.$.focus()},0)},select:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&(a.$.focus(),a.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(b){!b&&(b="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},keyboardFocusable:!0},n,!0);CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype= -CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(b,a,d){var e=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),c=this.getInputElement().$;e.$.text=b;e.$.value=void 0===a||null===a?b:a;void 0===d||null===d?CKEDITOR.env.ie?c.add(e.$):c.add(e.$,null):c.add(e.$,d);return this},remove:function(b){this.getInputElement().$.remove(b);return this},clear:function(){for(var b=this.getInputElement().$;0< -b.length;)b.remove(0);return this},keyboardFocusable:!0},n,!0);CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(b,a){this.getInputElement().$.checked=b;!a&&this.fire("change",{value:b})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(b,a){if(!CKEDITOR.env.ie||8','
    diff --git a/htdocs/includes/ckeditor/ckeditor/plugins/scayt/CHANGELOG.md b/htdocs/includes/ckeditor/ckeditor/plugins/scayt/CHANGELOG.md new file mode 100644 index 00000000000..27822a7330e --- /dev/null +++ b/htdocs/includes/ckeditor/ckeditor/plugins/scayt/CHANGELOG.md @@ -0,0 +1,20 @@ +SCAYT plugin for CKEditor 4 Changelog +==================== +### CKEditor 4.5.6 + +New Features: +* CKEditor [language adddon](http://ckeditor.com/addon/language) support +* CKEditor [placeholder adddon](http://ckeditor.com/addon/placeholder) support +* Drag and Drop support +* *Experimental* GRAYT functionality http://www.webspellchecker.net/samples/scayt-ckeditor-plugin.html#25 + +Fixed issues: +* [#98](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/98) SCAYT Affects Dialog Double Click. Fixed in SCAYT Core. +* [#102](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/102) SCAYT Core performance enhancements +* [#104](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/104) SCAYT's spans leak into the clipboard and after pasting +* [#105](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/105) Javascript error fired in case of multiple instances of CKEditor in one page +* [#107](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/107) SCAYT should not check non-editable parts of content +* [#108](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/108) Latest SCAYT copies id of editor element to the iframe +* SCAYT stops working when CKEditor Undo plug-in not enabled +* Issue with pasting SCAYT markup in CKEditor +* SCAYT stops working after pressing Cancel button in WSC dialog diff --git a/htdocs/includes/ckeditor/ckeditor/plugins/scayt/README.md b/htdocs/includes/ckeditor/ckeditor/plugins/scayt/README.md index 3b1ad94cb57..1b3de25d38a 100644 --- a/htdocs/includes/ckeditor/ckeditor/plugins/scayt/README.md +++ b/htdocs/includes/ckeditor/ckeditor/plugins/scayt/README.md @@ -1,7 +1,7 @@ CKEditor SCAYT Plugin ===================== -This plugin brings Spell Check As You Type (SCAYT) into CKEditor. +This plugin brings Spell Check As You Type (SCAYT) into up to CKEditor 4+. SCAYT is a "installation-less", using the web-services of [WebSpellChecker.net](http://www.webspellchecker.net/). It's an out of the box solution. diff --git a/htdocs/includes/ckeditor/ckeditor/plugins/scayt/dialogs/options.js b/htdocs/includes/ckeditor/ckeditor/plugins/scayt/dialogs/options.js index cc97b33a78f..12dbfd132d0 100644 --- a/htdocs/includes/ckeditor/ckeditor/plugins/scayt/dialogs/options.js +++ b/htdocs/includes/ckeditor/ckeditor/plugins/scayt/dialogs/options.js @@ -1,20 +1,19 @@ -/* - Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. - For licensing, see LICENSE.html or http://ckeditor.com/license -*/ -CKEDITOR.dialog.add("scaytcheck",function(j){function w(){return"undefined"!=typeof document.forms["optionsbar_"+b]?document.forms["optionsbar_"+b].options:[]}function x(a,b){if(a){var e=a.length;if(void 0==e)a.checked=a.value==b.toString();else for(var d=0;d'+a+"")}function o(a){f.getById("dic_message_"+b).setHtml(''+a+"")} -function p(a){for(var a=(""+a).split(","),b=0,e=a.length;b
    \t
    \t
    \t\t\t\t\t
    \t
    \t\t\t\t\t
    \t
    \t\t\t\t
    \t
    \t\t\t\t\t
    '}]},{id:"langs",label:g.languagesTab,elements:[{type:"html",id:"langs", -html:'
    \t
    \t
    '}]},{id:"dictionaries",label:g.dictionariesTab,elements:[{type:"html",style:"",id:"dictionaries",html:'
    \t
    \t
    Dictionary name
    \t\t\t\t\t
    \t\t\t\t\t\t
    \t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t
    '}]},{id:"about", -label:g.aboutTab,elements:[{type:"html",id:"about",style:"margin: 5px 5px;",html:'
    '}]}],B={title:g.title,minWidth:360,minHeight:220,onShow:function(){var a=this;a.data=j.fire("scaytDialog",{});a.options=a.data.scayt_control.option();a.chosed_lang=a.sLang=a.data.scayt_control.sLang;if(!a.data||!a.data.scayt||!a.data.scayt_control)alert("Error loading application service"),a.hide();else{var b=0;s?a.data.scayt.getCaption(j.langCode||"en",function(e){0'+h["button_"+d[c]]+"");f.getById("dic_info_"+ -b).setHtml(h.dic_info)}if(1==l[0])for(c in v)d="label_"+v[c],g=f.getById(d+"_"+b),"undefined"!=typeof g&&("undefined"!=typeof h[d]&&"undefined"!=typeof k.options[v[c]])&&(g.setHtml(h[d]),g.getParent().$.style.display="block");d='

    '+h.version+window.scayt.getAboutInfo().version.toString()+"

    "+h.about_throwt_copy+"

    ";f.getById("scayt_about_"+b).setHtml(d);d=function(a,b){var c=f.createElement("label");c.setAttribute("for","cke_option"+ -a);c.setStyle("display","inline");c.setHtml(b[a]);k.sLang==a&&(k.chosed_lang=a);var d=f.createElement("div"),e=CKEDITOR.dom.element.createFromHtml('');e.on("click",function(){this.$.checked=true;k.chosed_lang=a});d.append(e);d.append(c);return{lang:b[a],code:a,radio:d}};if(1==l[1]){for(c in e.rtl)i[i.length]=d(c,e.ltr);for(c in e.ltr)i[i.length]=d(c, -e.ltr);i.sort(function(a,b){return b.lang>a.lang?-1:1});e=f.getById("scayt_lcol_"+b);d=f.getById("scayt_rcol_"+b);for(c=0;cb[1]?c=1:a[1]'+a.options+"",'
    '; print $langs->trans('CronDtLastLaunch').""; - if(!empty($object->datelastrun)) {print dol_print_date($object->datelastrun,'dayhourtext');} else {print $langs->trans('CronNone');} - print "
    '; - print $langs->trans('CronDtNextLaunch'); - print ' ('.$langs->trans('CronFrom').')'; - print ""; - if(!empty($object->datenextrun)) {print dol_print_date($object->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');} + if(!empty($object->datelastrun)) {print dol_print_date($object->datelastrun,'dayhoursec');} else {print $langs->trans('CronNone');} print "
    '; print $langs->trans('CronDtLastResult').""; - if(!empty($object->datelastresult)) {print dol_print_date($object->datelastresult,'dayhourtext');} else {print $langs->trans('CronNone');} + if(!empty($object->datelastresult)) {print dol_print_date($object->datelastresult,'dayhoursec');} else {print $langs->trans('CronNone');} print "
    '; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 742db0cb461..39eaacd303f 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -521,9 +521,6 @@ class Cronjob extends CommonObject // Check parameters // Put here code to add a control on parameters values - if (empty($this->status)) { - $this->dateend=dol_now(); - } if (dol_strlen($this->datestart)==0) { $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronDtStart')); $error++; @@ -830,7 +827,9 @@ class Cronjob extends CommonObject /** - * Run a job + * Run a job. + * Once job is finished, status and nb of of run is updated. + * This function does not plan the next run. This is done by function ->reprogram_jobs * * @param string $userlogin User login * @return int <0 if KO, >0 if OK @@ -843,7 +842,8 @@ class Cronjob extends CommonObject $langs->load('cron'); - if (empty($userlogin)) { + if (empty($userlogin)) + { $this->error="User login is mandatory"; dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); return -1; @@ -891,7 +891,7 @@ class Cronjob extends CommonObject $this->datelastrun=$now; $this->lastoutput=''; $this->lastresult=''; - $this->nbrun=$this->nbrun+1; + $this->nbrun=$this->nbrun + 1; $result = $this->update($user); if ($result<0) { dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); @@ -1055,23 +1055,27 @@ class Cronjob extends CommonObject /** * Reprogram a job * - * @param string $userlogin User login - * @return int <0 if KO, >0 if OK - * + * @param string $userlogin User login + * @param timestamp $now Date returned by dol_now() + * @return int <0 if KO, >0 if OK */ - function reprogram_jobs($userlogin) + function reprogram_jobs($userlogin, $now) { dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG); - + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $user=new User($this->db); $result=$user->fetch('',$userlogin); - if ($result<0) { + if ($result<0) + { $this->error="User Error:".$user->error; dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); return -1; - }else { - if (empty($user->id)) { + } + else + { + if (empty($user->id)) + { $this->error=" User user login:".$userlogin." do not exists"; dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); return -1; @@ -1080,17 +1084,41 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::reprogram_jobs ", LOG_DEBUG); - if (empty($this->datenextrun)) { - $this->datenextrun=dol_now()+$this->frequency; - } else { - if ($this->datenextrundatenextrun=dol_now()+$this->frequency; - } else { - $this->datenextrun=$this->datenextrun+$this->frequency; + + if (empty($this->datenextrun)) + { + $this->datenextrun = $now + $this->frequency; + } + else + { + if ($this->datenextrun < $now && $this->frequency > 0) + { + // Loop until date is after future + while ($this->datenextrun < $now) + { + $this->datenextrun += $this->frequency; + } + } + else + { + //$this->datenextrun=$this->datenextrun+$this->frequency; } } + + // Archive job + if ($this->autodelete == 2) + { + if (($this->maxrun > 0 && ($this->nbrun >= $this->maxrun)) + || ($this->dateend && ($this->datenextrun > $this->dateend))) + { + $this->status = 2; + dol_syslog(get_class($this)."::reprogram_jobs Job must be set to archived", LOG_ERR); + } + } + $result = $this->update($user); - if ($result<0) { + if ($result<0) + { dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); return -1; } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 65c2104b85f..9645d42261b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -47,6 +47,7 @@ $sortorder=GETPOST('sortorder','alpha'); $sortfield=GETPOST('sortfield','alpha'); $page=GETPOST('page','int'); $status=GETPOST('status','int'); +if ($status == '') $status=-2; //Search criteria $search_label=GETPOST("search_label",'alpha'); @@ -92,17 +93,18 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del // Execute jobs if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute){ - //Execute jobs $object = new Cronjob($db); $job = $object->fetch($id); - $result = $object->run_jobs($user->login); + $now = dol_now(); // Date we start + + $result = $object->run_jobs($user->login); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { - $res = $object->reprogram_jobs($user->login); + $res = $object->reprogram_jobs($user->login, $now); if ($res > 0) { if ($object->lastresult > 0) setEventMessages($langs->trans("JobFinished"), null, 'warnings'); @@ -116,7 +118,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex } } - header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-1'); // Make a call to avoid to run twice job when using back + header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a call to avoid to run twice job when using back exit; } @@ -131,22 +133,6 @@ $pagetitle=$langs->trans("CronList"); llxHeader('',$pagetitle); -print load_fiche_titre($pagetitle,'','title_setup'); - -print $langs->trans('CronInfo'); - -if ($action == 'delete') -{ - print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); - -} - -if ($action == 'execute') -{ - print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); - -} - // list of jobs created $object = new Cronjob($db); $result=$object->fetch_all($sortorder, $sortfield, $limit, $offset, $status, $filter); @@ -154,29 +140,50 @@ if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } +$nbtotalofrecord=0; +$num=count($object->lines); + +$param='&page='.$page.'&status='.$status.'&search_label='.$search_label; +print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_setup'); + + +print $langs->trans('CronInfo'); print "

    "; +if ($action == 'delete') +{ + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); + +} + +if ($action == 'execute') +{ + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + +} + + print ''."\n"; print ''; print ''; print ''; -$arg_url='&page='.$page.'&status='.$status.'&search_label='.$search_label; -print_liste_field_titre($langs->trans("ID"),$_SERVER["PHP_SELF"],"t.rowid","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronLabel"),$_SERVER["PHP_SELF"],"t.label","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronTask"),'','',"",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronDtStart"),$_SERVER["PHP_SELF"],"t.datestart","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronDtEnd"),$_SERVER["PHP_SELF"],"t.dateend","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronDtLastLaunch"),$_SERVER["PHP_SELF"],"t.datelastrun","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronDtNextLaunch"),$_SERVER["PHP_SELF"],"t.datenextrun","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronFrequency"),'',"","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronNbRun"),$_SERVER["PHP_SELF"],"t.nbrun","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronLastResult"),$_SERVER["PHP_SELF"],"t.lastresult","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVER["PHP_SELF"],"t.lastoutput","",$arg_url,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Enabled"),$_SERVER["PHP_SELF"],"t.status","",$arg_url,'align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("ID"),$_SERVER["PHP_SELF"],"t.rowid","",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronLabel"),$_SERVER["PHP_SELF"],"t.label","",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronTask"),'','',"",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronDtStart"),$_SERVER["PHP_SELF"],"t.datestart","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronDtEnd"),$_SERVER["PHP_SELF"],"t.dateend","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronDtNextLaunch"),$_SERVER["PHP_SELF"],"t.datenextrun","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronFrequency"),'',"","",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronMaxRun"),$_SERVER["PHP_SELF"],"t.maxrun","",$param,'align="right"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronNbRun"),$_SERVER["PHP_SELF"],"t.nbrun","",$param,'align="right"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronDtLastLaunch"),$_SERVER["PHP_SELF"],"t.datelastrun","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronLastResult"),$_SERVER["PHP_SELF"],"t.lastresult","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVER["PHP_SELF"],"t.lastoutput","",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; @@ -194,8 +201,9 @@ print ''; print ''; print ''; print ''; +print ''; print ''; print ''; -if (count($object->lines) > 0) +if ($num > 0) { - // Loop on each active job + // Loop on each job $style='pair'; foreach($object->lines as $line) { @@ -229,7 +237,7 @@ if (count($object->lines) > 0) } else { - print $langs->trans('CronNone'); + //print $langs->trans('CronNone'); } print ''; @@ -252,20 +260,16 @@ if (count($object->lines) > 0) } print ''; - print ''; - print ''; - print ''; - - print ''; print ''; - print ''; + + print ''; + + print ''; + + print ''; print ''; - - print ''; // Status print ''; print ''; print ''; +print ''; print '\n"; diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 9477e91837e..83e1db184a5 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -34,7 +34,7 @@ $langs->load("donations"); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; if ($page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index bf773fcab62..7da3fadcc6e 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -49,6 +49,7 @@ $endyear=$year; $langs->load("sendings"); $langs->load("other"); +$langs->load("companies"); /* @@ -240,7 +241,7 @@ print '
    '; print '
    '; // User print '
         '; -print $form->selectarray('status', array('0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")), $status, 1); +print $form->selectarray('status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Enabled"), '-2'=>$langs->trans("EnabledAndDisabled"), '2'=>$langs->trans("Archived")), $status, 1); print ''; print ''; print ''; @@ -203,9 +211,9 @@ print '
    '; - if(!empty($line->datestart)) {print dol_print_date($line->datestart,'dayhour');} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->datestart)) {print dol_print_date($line->datestart,'dayhour');} print ''; - if(!empty($line->dateend)) {print dol_print_date($line->dateend,'dayhour');} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->dateend)) {print dol_print_date($line->dateend,'dayhour');} print ''; - if(!empty($line->datelastrun)) {print dol_print_date($line->datelastrun,'dayhour');} else {print $langs->trans('CronNone');} - print ''; - if(!empty($line->datenextrun)) {print dol_print_date($line->datenextrun,'dayhour');} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->datenextrun)) {print dol_print_date($line->datenextrun,'dayhour');} print ''; @@ -275,21 +279,31 @@ if (count($object->lines) > 0) if($line->unitfrequency == "604800") print $langs->trans('CronEach')." ".($line->frequency/$line->unitfrequency)." ".$langs->trans('Weeks'); print ''; - if(!empty($line->nbrun)) {print $line->nbrun;} else {print '0';} + print ''; + if (!empty($line->maxrun)) {print $line->maxrun;} + print ''; + if (!empty($line->nbrun)) {print $line->nbrun;} else {print '0';} + print ''; + if(!empty($line->datelastrun)) {print dol_print_date($line->datelastrun,'dayhour');} + print ''; + if(!empty($line->lastresult)) {print dol_trunc($line->lastresult);} print ''; - if(!empty($line->lastresult)) {print dol_trunc($line->lastresult);} else {print $langs->trans('CronNone');} - print ''; - if(!empty($line->lastoutput)) {print dol_trunc(nl2br($line->lastoutput),100);} else {print $langs->trans('CronNone');} + if(!empty($line->lastoutput)) {print dol_trunc(nl2br($line->lastoutput),100);} print ''; - print yn($line->status); + if ($line->status == 1) print $langs->trans("Enabled"); + elseif ($line->status == 2) print $langs->trans("Archived"); + else print $langs->trans("Disabled"); print ''; diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 4719bd6855a..d699a9fc7a6 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -25,10 +25,11 @@ * \brief Page to setup the donation module */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/donation.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/don/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; +if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; $langs->load("admin"); $langs->load("donations"); @@ -198,6 +199,7 @@ else if ($action == 'setart885') { $dir = "../../core/modules/dons/"; $form=new Form($db); +if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db); llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration'); $linkback=''.$langs->trans("BackToModuleList").''; @@ -228,9 +230,16 @@ print '
    '; $label = $langs->trans("AccountAccounting"); -print ''; -print ''; +if (! empty($conf->accounting->enabled)) +{ + print $formaccountancy->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, '', 1, 1); +} +else +{ + print ''; +} print ''; print ''; print "
    '.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->select_company($socid,'socid',$filter,1); + print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); print '
    '.$langs->trans("CreatedBy").''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 92cf48aea32..1615f75ceb6 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -248,7 +248,7 @@ if (empty($reshook)) // Extrafields $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i); + $array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -292,6 +292,7 @@ if (empty($reshook)) $idl = "idl".$i; $entrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int'); if ($entrepot_id < 0) $entrepot_id=''; + if (! ($objectsrc->lines[$i]->fk_product > 0)) $entrepot_id = 0; $ret=$object->addline($entrepot_id,GETPOST($idl,'int'),GETPOST($qty,'int'),$array_options[$i]); if ($ret < 0) @@ -885,19 +886,22 @@ if ($action == 'create') if (! empty($conf->stock->enabled)) { print ''; - if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) + if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) // Type of product need stock change ? { // Show warehouse combo list $ent = "entl".$indiceAsked; $idl = "idl".$indiceAsked; $tmpentrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):$warehouse_id; - print $formproduct->selectWarehouses($tmpentrepot_id,'entl'.$indiceAsked,'',1,0,$line->fk_product); - if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) + if ($line->fk_product > 0) { - //print $stock.' '.$quantityToBeDelivered; - if ($stock < $quantityToBeDelivered) + print $formproduct->selectWarehouses($tmpentrepot_id,'entl'.$indiceAsked,'',1,0,$line->fk_product); + if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) { - print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse + //print $stock.' '.$quantityToBeDelivered; + if ($stock < $quantityToBeDelivered) + { + print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse + } } } } @@ -1755,7 +1759,6 @@ else if ($id || $ref) } print ''; - print "
    \n"; } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 0c575974b5f..dbdecc2f3e9 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -574,7 +574,7 @@ class Expedition extends CommonObject else { dol_syslog(get_class($this).'::Fetch no expedition found', LOG_ERR); - $this->error='Delivery with id '.$id.' not found sql='.$sql; + $this->error='Delivery with id '.$id.' not found'; return 0; } } diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index c397605645d..19b11a0ddf6 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -51,9 +51,9 @@ $var=false; print ''; print ''; print ''; -print ''; +print ''; print ''; +print $langs->trans("Shipment").':'; print "
    '.$langs->trans("SearchASending").'
    '.$langs->trans("Search").'
    '; -print $langs->trans("Ref").':

    \n"; /* diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index bee47fe25bd..00796add031 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -38,12 +38,13 @@ $result = restrictedArea($user, 'expedition',$expeditionid,''); $search_ref_exp = GETPOST("search_ref_exp"); $search_ref_liv = GETPOST('search_ref_liv'); $search_company = GETPOST("search_company"); +$sall = GETPOST('sall'); $optioncss = GETPOST('optioncss','alpha'); $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; if ($page == -1) { $page = 0; } $offset = $limit * $page; @@ -63,6 +64,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $viewstatut=''; } +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'e.ref'=>"Ref", + 's.nom'=>"ThirdParty" +); + + /* * View */ @@ -100,6 +108,7 @@ if ($viewstatut <> '') { if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp); if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv); if ($search_company) $sql .= natural_search('s.nom', $search_company); +if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1,$offset); @@ -123,12 +132,21 @@ if ($resql) $i = 0; print '
    '."\n"; if ($optioncss != '') print ''; - print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } + + $moreforfilter=''; + + print '
    '; print ''; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"e.ref","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"],"s.nom", "", $param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"), $_SERVER["PHP_SELF"],"s.nom", "", $param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDeliveryPlanned"), $_SERVER["PHP_SELF"],"e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder); if($conf->livraison_bon->enabled) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 123766d9623..58d65eea6d3 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -578,7 +578,7 @@ if ($id > 0 || ! empty($ref)) } // Qty ordered - print ''; + print ''; // Qty already shipped $qtyProdCom=$objp->qty; diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index f0f5198bee5..cc5e770d02a 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -48,6 +48,7 @@ $endyear=$year; $langs->load("sendings"); $langs->load("other"); +$langs->load("companies"); /* @@ -239,7 +240,7 @@ print '
    '; print '
    '; // User print ''; print ''; @@ -1163,7 +1163,7 @@ if ($action == 'create') print ''; print ''; } @@ -1303,7 +1303,7 @@ else print ''; print ''; @@ -1313,7 +1313,7 @@ else print ''; print ''; } diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index ece9f9260ac..b980199c800 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -48,7 +48,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="d.date_create"; -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; /* diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 0d1dc22971a..fe775139362 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -93,7 +93,7 @@ $sortfield = GETPOST("sortfield"); $page = GETPOST("page"); if (!$sortorder) $sortorder="DESC"; if (!$sortfield) $sortfield="d.date_debut"; -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; if ($page == -1) { $page = 0 ; @@ -211,7 +211,6 @@ if ($resql) if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); } print '
    ' . ($objp->qty!=1?''.$objp->qty.'':$objp->qty) . '' . $objp->qty . '
    '.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->select_company($socid,'socid',$filter,1); + print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); print '
    '.$langs->trans("CreatedBy").''; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 30642ad09c5..a14e006fd7c 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1153,7 +1153,7 @@ if ($action == 'create') print '' . $langs->trans('NotePublic') . ''; - $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); + $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); print '
    ' . $langs->trans('NotePrivate') . ''; - $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); + $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); print '
    ' . $langs->trans('NotePublic') . ''; - $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); + $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); print '
    ' . $langs->trans('NotePrivate') . ''; - $doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); + $doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); print '
    '; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 80965deebfa..6c515192f78 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereportstats.class.php'; $langs->load("trips"); +$langs->load("companies"); $WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); @@ -217,7 +218,7 @@ print ''; */ // User diff --git a/htdocs/fichinter/admin/fichinter_extrafields.php b/htdocs/fichinter/admin/fichinter_extrafields.php index 955b66f0beb..b7b809d277d 100644 --- a/htdocs/fichinter/admin/fichinter_extrafields.php +++ b/htdocs/fichinter/admin/fichinter_extrafields.php @@ -89,8 +89,8 @@ if ($action != 'create' && $action != 'edit') /* ************************************************************************** */ /* */ -/* Creation d'un champ optionnel - /* */ +/* Creation of an optional field */ +/* */ /* ************************************************************************** */ if ($action == 'create') @@ -103,7 +103,7 @@ if ($action == 'create') /* ************************************************************************** */ /* */ -/* Edition d'un champ optionnel */ +/* Edition of an optional field */ /* */ /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 3fd45013ab5..4d80ac04039 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1,11 +1,11 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Ferran Marcet - * Copyright (C) 201 Charlie Benke + * Copyright (C) 2014-2015 Charlie Benke * Copyright (C) 2015 Abbes Bahfir * * This program is free software; you can redistribute it and/or modify @@ -1056,7 +1056,7 @@ if ($action == 'create') print ''; // Description (must be a textarea and not html must be allowed (used in list view) - print ''; + print ''; print ''; @@ -1068,7 +1068,7 @@ if ($action == 'create') $langs->load("project"); - print ''; - print ''; - print ''; + print ''; // Private note - if (!empty($user->societe_id)) + if (empty($user->societe_id)) { print ''; - print ''; - print ''; + print ''; print ''; print ''; + + // Date create + print ''; + print ''; + print ''; + + // Date Validation + print ''; + print ''; + print ''; + + // Date Start + print ''; + print ''; + print ''; + + // Date End + print ''; + print ''; + print ''; + + // Date Terminate/close + print ''; + print ''; + print ''; } // Description (must be a textarea and not html must be allowed (used in list view) - print ''; print ''; print ''; print ''; print ''; print ''; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 6bb253319e0..eb558e1c37f 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -33,7 +33,9 @@ class Holiday extends CommonObject { public $element='holiday'; public $table_element='holiday'; - + protected $isnolinkedbythird = 1; // No field fk_soc + protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** * @deprecated * @see id @@ -211,7 +213,8 @@ class Holiday extends CommonObject $sql.= " cp.note_private,"; $sql.= " cp.note_public,"; $sql.= " cp.fk_user_create,"; - $sql.= " cp.fk_type"; + $sql.= " cp.fk_type,"; + $sql.= " cp.entity"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp"; $sql.= " WHERE cp.rowid = ".$id; @@ -247,6 +250,7 @@ class Holiday extends CommonObject $this->note_public = $obj->note_public; $this->fk_user_create = $obj->fk_user_create; $this->fk_type = $obj->fk_type; + $this->entity = $obj->entity; } $this->db->free($resql); @@ -732,6 +736,16 @@ class Holiday extends CommonObject if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5').' '.$langs->trans('CancelCP'); if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5').' '.$langs->trans('RefuseCP'); } + if ($mode == 3) + { + $pictoapproved='statut6'; + if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; + if ($statut == 1) return img_picto($langs->trans('DraftCP'),'statut0'); + if ($statut == 2) return img_picto($langs->trans('ToReviewCP'),'statut1'); + if ($statut == 3) return img_picto($langs->trans('ApprovedCP'),$pictoapproved); + if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5'); + if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5'); + } if ($mode == 5) { $pictoapproved='statut6'; @@ -1794,8 +1808,8 @@ class Holiday extends CommonObject /** * Return array with list of types * - * @param int $active Status of type - * @param int $affect Filter on affect + * @param int $active Status of type. -1 = Both + * @param int $affect Filter on affect (a request will change sold or not). -1 = Both * @return array Return array with list of types */ function getTypes($active=-1, $affect=-1) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index c64e89b342f..eb7fea3598c 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -40,6 +40,7 @@ $action=GETPOST('action'); $holiday = new Holiday($db); $langs->load('users'); +$langs->load('hrm'); /* @@ -131,7 +132,8 @@ elseif($action == 'add_event') $new_holiday = $nb_holiday + $add_holiday; // add event to existing types of vacation - foreach ($typeleaves as $key => $leave) { + foreach ($typeleaves as $key => $leave) + { $vacationTypeID = $leave['rowid']; // On ajoute la modification dans le LOG @@ -157,8 +159,18 @@ llxHeader(array(),$langs->trans('CPTitreMenu')); print load_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png'); print '
    '.$langs->trans('LastUpdateCP').': '."\n"; -if ($holiday->getConfCP('lastUpdate')) print ''.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')),'dayhour','tzuser').''; +$lastUpdate = $holiday->getConfCP('lastUpdate', 0); +if ($lastUpdate) +{ + $monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; + $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; + print ''.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')),'dayhour','tzuser').''; + print '
    '.$langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.''."\n"; +} else print $langs->trans('None'); + + + print "

    \n"; $result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. @@ -192,52 +204,77 @@ if ($cp_events == 1) $typeleaves=$holiday->getTypes(1,1); -print ''."\n"; -print ''; - -print '
    '.$langs->tra /* print '
    '.$langs->trans("ThirdParty").''; $filter=''; -print $form->select_company($socid,'socid',$filter,1,1); +print $form->select_company($socid,'socid',$filter,1,1,0,array(),0,'','style="width: 95%"'); print '
    '.$langs->trans('Ref').''.$langs->trans("Draft").'
    '.$langs->trans("Description").'
    '.$langs->trans("Description").''; print ''; print '
    '.$langs->trans("Project").''; + print '
    '.$langs->trans("Project").''; /* Fix: If a project must be linked to any companies (suppliers or not), project must be not be set as limited to customer but must be not linked to any particular thirdparty if ($societe->fournisseur==1) $numprojet=select_projects(-1,$_POST["projectid"],'projectid'); @@ -1087,7 +1087,7 @@ if ($action == 'create') if ($conf->contrat->enabled) { $langs->load("contracts"); - print '
    '.$langs->trans("Contract").''; + print '
    '.$langs->trans("Contract").''; $numcontrat=$formcontract->select_contract($soc->id,GETPOST('contratid','int'),'contratid',0,1); if ($numcontrat==0) { @@ -1106,19 +1106,19 @@ if ($action == 'create') // Public note print '
    '.$langs->trans('NotePublic').''; + print ''.$langs->trans('NotePublic').''; $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); //print ''; print '
    '.$langs->trans('NotePrivate').''; + print ''.$langs->trans('NotePrivate').''; $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); //print ''; @@ -1275,10 +1275,45 @@ else if ($id > 0 || ! empty($ref)) print '
    '.$langs->trans("TotalDuration").''.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'
    '.$langs->trans("Datec").''; + print $object->datec ? dol_print_date($object->datec, 'daytext') : ' '; + print '
    '.$langs->trans("Datev").''; + print $object->datev ? dol_print_date($object->datev, 'daytext') : ' '; + print '
    '.$langs->trans("Dateo").''; + print $object->dateo ? dol_print_date($object->dateo, 'daytext') : ' '; + print '
    '.$langs->trans("Datee").''; + print $object->datee ? dol_print_date($object->datee, 'daytext') : ' '; + print '
    '.$langs->trans("Datet").''; + print $object->datet ? dol_print_date($object->datet, 'daytext') : ' '; + print '
    '; + print '
    '; print $form->editfieldkey("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea'); print ''; print $form->editfieldval("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea:8:80'); diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index c1e7a3aaca2..ca698c55d5c 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2015 Marcos García + * Copyright (C) 2015 Charlie Benke * * 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 @@ -48,9 +49,12 @@ class Fichinter extends CommonObject var $author; var $datec; var $datev; + var $dateo; + var $datee; + var $datet; var $datem; var $duration; - var $statut; // 0=draft, 1=validated, 2=invoiced + var $statut; // 0=draft, 1=validated, 2=invoiced, 3=Terminate var $description; var $fk_contrat; var $extraparams=array(); @@ -74,12 +78,15 @@ class Fichinter extends CommonObject $this->statuts[0]='Draft'; $this->statuts[1]='Validated'; $this->statuts[2]='StatusInterInvoiced'; + $this->statuts[3]='Close'; $this->statuts_short[0]='Draft'; $this->statuts_short[1]='Validated'; $this->statuts_short[2]='StatusInterInvoiced'; + $this->statuts_short[3]='Close'; $this->statuts_logo[0]='statut0'; - $this->statuts_logo[1]='statut4'; + $this->statuts_logo[1]='statut1'; $this->statuts_logo[2]='statut6'; + $this->statuts_logo[3]='statut4'; } @@ -277,7 +284,7 @@ class Fichinter extends CommonObject function fetch($rowid,$ref='') { $sql = "SELECT f.rowid, f.ref, f.description, f.fk_soc, f.fk_statut,"; - $sql.= " f.datec,"; + $sql.= " f.datec, f.dateo, f.datee, f.datet,"; $sql.= " f.date_valid as datev,"; $sql.= " f.tms as datem,"; $sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat"; @@ -300,6 +307,9 @@ class Fichinter extends CommonObject $this->statut = $obj->fk_statut; $this->duration = $obj->duree; $this->datec = $this->db->jdate($obj->datec); + $this->datee = $this->db->jdate($obj->dateo); + $this->dateo = $this->db->jdate($obj->datee); + $this->datet = $this->db->jdate($obj->datet); $this->datev = $this->db->jdate($obj->datev); $this->datem = $this->db->jdate($obj->datem); $this->fk_project = $obj->fk_projet; @@ -1264,7 +1274,7 @@ class FichinterLigne extends CommonObjectLine $this->db->begin(); - $sql = "SELECT SUM(duree) as total_duration"; + $sql = "SELECT SUM(duree) as total_duration, min(date) as dateo, max(date) as datee "; $sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet"; $sql.= " WHERE fk_fichinter=".$this->fk_fichinter; @@ -1278,6 +1288,8 @@ class FichinterLigne extends CommonObjectLine $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql.= " SET duree = ".$total_duration; + $sql.= " , dateo = ".(! empty($obj->dateo)?"'".$this->db->idate($obj->dateo)."'":"null"); + $sql.= " , datee = ".(! empty($obj->datee)?"'".$this->db->idate($obj->datee)."'":"null"); $sql.= " WHERE rowid = ".$this->fk_fichinter; $sql.= " AND entity = ".$conf->entity; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 35224cb7780..74edaf72099 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -44,7 +44,7 @@ $result = restrictedArea($user, 'ficheinter', $fichinterid,'fichinter'); $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $page = GETPOST('page','int'); if ($page == -1) { $page = 0; } $offset = $limit * $page; @@ -123,6 +123,12 @@ if ($socid) if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } +$totalnboflines=0; +$result=$db->query($sql); +if ($result) +{ + $totalnboflines = $db->num_rows($result); +} $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); //print $sql; @@ -152,7 +158,7 @@ if ($result) if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } print ''; diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 534ef2587bc..b97721f2108 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.0-beta'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','4.0.0-beta'); if (! defined('EURO')) define('EURO',chr(128)); @@ -167,9 +167,9 @@ $tmp=''; $found=0; $real_dolibarr_main_document_root=str_replace('\\','/',realpath($dolibarr_main_document_root)); // A) Value found into config file, to say where are store htdocs files. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs if (!empty($_SERVER["DOCUMENT_ROOT"])) { - $pathroot = $_SERVER["DOCUMENT_ROOT"]; // B) Value reported by web server setup, to say where is root of web server instance. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs + $pathroot = $_SERVER["DOCUMENT_ROOT"]; // B) Value reported by web server setup (not defined on CLI mode), to say where is root of web server instance. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs } else { - $pathroot = 'BOGUS'; + $pathroot = 'NOTDEFINED'; } $paths=explode('/',str_replace('\\','/',$_SERVER["SCRIPT_NAME"])); // C) Value reported by web server, to say full path on filesystem of a file. Ex: /dolibarr/htdocs/admin/system/phpinfo.php // Try to detect if $_SERVER["DOCUMENT_ROOT"]+start of $_SERVER["SCRIPT_NAME"] is $dolibarr_main_document_root. If yes, relative url to add before dol files is this start part. @@ -189,6 +189,7 @@ foreach($paths as $tmppath) // We check to find (B+start of C)=A } //else print "Not found yet for concatpath=".$concatpath."
    \n"; } +//print "found=".$found." dolibarr_main_url_root=".$dolibarr_main_url_root."\n"; if (! $found) $tmp=$dolibarr_main_url_root; // If autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT). else $tmp='http'.(((empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') && (empty($_SERVER["SERVER_PORT"])||$_SERVER["SERVER_PORT"]!=443))?'':'s').'://'.$_SERVER["SERVER_NAME"].((empty($_SERVER["SERVER_PORT"])||$_SERVER["SERVER_PORT"]==80||$_SERVER["SERVER_PORT"]==443)?'':':'.$_SERVER["SERVER_PORT"]).($tmp3?(preg_match('/^\//',$tmp3)?'':'/').$tmp3:''); //print "tmp1=".$tmp1." tmp2=".$tmp2." tmp3=".$tmp3." tmp=".$tmp."\n"; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index c19773653c7..3deb2dc1c45 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -529,72 +529,72 @@ if ($object->id > 0) if (empty($reshook)) { - print '
    '; + print '
    '; - if ($user->rights->fournisseur->commande->creer) - { - $langs->load("orders"); - print ''.$langs->trans("AddOrder").''; + if ($user->rights->fournisseur->commande->creer) + { + $langs->load("orders"); + print ''.$langs->trans("AddOrder").''; + } + + if ($user->rights->fournisseur->facture->creer) + { + $langs->load("bills"); + print ''.$langs->trans("AddBill").''; + } + + if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer) + { + $langs->load("supplier_proposal"); + print ''.$langs->trans("AddSupplierProposal").''; + } + + if ($user->rights->fournisseur->facture->creer) + { + if (! empty($orders2invoice) && $orders2invoice > 0) print ''; + else print ''; + } + + // Add action + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + { + if ($user->rights->agenda->myactions->create) + { + print ''.$langs->trans("AddAction").''; + } + else + { + print ''.$langs->trans("AddAction").''; + } + } + + print '
    '; + print '
    '; + + if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) + { + print '
    '; + // List of contacts + show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } + + // Addresses list + if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB)) + { + $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } + + if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + { + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); + + // List of todo actions + show_actions_todo($conf,$langs,$db,$object); + + // List of done actions + show_actions_done($conf,$langs,$db,$object); + } } - - if ($user->rights->fournisseur->facture->creer) - { - $langs->load("bills"); - print ''.$langs->trans("AddBill").''; - } - - if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer) - { - $langs->load("supplier_proposal"); - print ''.$langs->trans("AddSupplierProposal").''; - } - - if ($user->rights->fournisseur->facture->creer) - { - if (! empty($orders2invoice) && $orders2invoice > 0) print ''; - else print ''; - } - - // Add action - if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) - { - if ($user->rights->agenda->myactions->create) - { - print ''.$langs->trans("AddAction").''; - } - else - { - print ''.$langs->trans("AddAction").''; - } - } - - print '
    '; - print '
    '; - - if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) - { - print '
    '; - // List of contacts - show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } - - // Addresses list - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB)) - { - $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } - - if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) - { - print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); - - // List of todo actions - show_actions_todo($conf,$langs,$db,$object); - - // List of done actions - show_actions_done($conf,$langs,$db,$object); - } -} } else { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 236eca113ff..a0184662065 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -498,7 +498,7 @@ class CommandeFournisseur extends CommonOrder */ function getLibStatut($mode=0) { - return $this->LibStatut($this->statut,$mode); + return $this->LibStatut($this->statut,$mode,$this->billed); } /** @@ -506,16 +506,17 @@ class CommandeFournisseur extends CommonOrder * * @param int $statut Id statut * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto + * @param int $billed 1=Billed * @return string Label of status */ - function LibStatut($statut,$mode=0) + function LibStatut($statut,$mode=0,$billed=0) { global $langs; $langs->load('orders'); $billedtext=''; //if ($statut==5 && $this->billed == 1) $statut = 8; - if ($this->billed == 1) $billedtext=$langs->trans("Billed"); + if ($billed == 1) $billedtext=$langs->trans("Billed"); // List of language codes for status $statutshort[0] = 'StatusOrderDraftShort'; @@ -732,7 +733,8 @@ class CommandeFournisseur extends CommonOrder // Do we have to change status now ? (If double approval is required and first approval, we keep status to 1 = validated) $movetoapprovestatus=true; - + $comment=''; + $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; $sql.= " SET ref='".$this->db->escape($num)."',"; if (empty($secondlevel)) // standard or first level approval @@ -741,7 +743,11 @@ class CommandeFournisseur extends CommonOrder $sql.= " fk_user_approve = ".$user->id; if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $this->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) { - if (empty($this->user_approve_id2)) $movetoapprovestatus=false; // second level approval not done + if (empty($this->user_approve_id2)) + { + $movetoapprovestatus=false; // second level approval not done + $comment=' (first level)'; + } } } else // request a second level approval @@ -749,6 +755,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " date_approve2='".$this->db->idate($now)."',"; $sql.= " fk_user_approve2 = ".$user->id; if (empty($this->user_approve_id)) $movetoapprovestatus=false; // first level approval not done + $comment=' (second level)'; } // If double approval is required and first approval, we keep status to 1 = validated if ($movetoapprovestatus) $sql.= ", fk_statut = 2"; @@ -758,7 +765,7 @@ class CommandeFournisseur extends CommonOrder if ($this->db->query($sql)) { - $this->log($user, 2, time()); // Statut 2 + $this->log($user, 2, time(), $comment); // Statut 2 if (! empty($conf->global->SUPPLIER_ORDER_AUTOADD_USER_CONTACT)) { diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 424f9ad65d4..4865eac6951 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -122,7 +122,9 @@ class ProductFournisseur extends Product function remove_product_fournisseur_price($rowid) { global $conf, $user; - + + $error=0; + $this->db->begin(); // Call trigger @@ -289,7 +291,7 @@ class ProductFournisseur extends Product $error++; } - if (! $error && !empty($cong->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) + if (! $error && !empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { // Add record into log table $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price_log("; @@ -353,7 +355,7 @@ class ProductFournisseur extends Product function fetch_product_fournisseur_price($rowid, $ignore_expression = 0) { $sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability,"; - $sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.fk_product, pfp.charges, pfp.cost_price, pfp.unitcharges, pfp.fk_supplier_price_expression, pfp.delivery_time_days"; // , pfp.recuperableonly as fourn_tva_npr"; FIXME this field not exist in llx_product_fournisseur_price + $sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.fk_product, pfp.charges, pfp.unitcharges, pfp.fk_supplier_price_expression, pfp.delivery_time_days"; // , pfp.recuperableonly as fourn_tva_npr"; FIXME this field not exist in llx_product_fournisseur_price $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " WHERE pfp.rowid = ".$rowid; diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 5326bbde85e..bfdfea41fe4 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -65,18 +65,28 @@ class PaiementFourn extends Paiement /** * Load payment object * - * @param int $id Id if payment to get - * @return int <0 if ko, >0 if ok + * @param int $id Id if payment to get + * @param string $ref Ref of payment to get (currently ref = id but this may change in future) + * @param int $fk_bank Id of bank line associated to payment + * @return int <0 if KO, -2 if not found, >0 if OK */ - function fetch($id) + function fetch($id, $ref='', $fk_bank='') { + $error=0; + $sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank,'; $sql.= ' c.code as paiement_code, c.libelle as paiement_type,'; $sql.= ' p.num_paiement, p.note, b.fk_account'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiementfourn as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid '; $sql.= ' WHERE p.fk_paiement = c.id'; - $sql.= ' AND p.rowid = '.$id; + if ($id > 0) + $sql.= ' AND p.rowid = '.$id; + else if ($ref) + $sql.= ' AND p.rowid = '.$ref; + else if ($fk_bank) + $sql.= ' AND p.fk_bank = '.$fk_bank; + $resql = $this->db->query($sql); if ($resql) { @@ -99,7 +109,7 @@ class PaiementFourn extends Paiement } else { - $error = -2; + $error = -2; // TODO Use 0 instead } $this->db->free($resql); } @@ -241,6 +251,8 @@ class PaiementFourn extends Paiement */ function delete($notrigger=0) { + global $conf, $user, $langs; + $bank_line_id = $this->bank_line; $this->db->begin(); @@ -309,6 +321,19 @@ class PaiementFourn extends Paiement return -4; } } + + if (! $notrigger) + { + // Appel des triggers + $result=$this->call_trigger('PAYMENT_SUPPLIER_DELETE', $user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // Fin appel triggers + } + $this->db->commit(); return 1; } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 65394016f6c..42d9b8bc99e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2733,10 +2733,24 @@ elseif (! empty($object->id)) // Reopen if (in_array($object->statut, array(2))) { - if ($user->rights->fournisseur->commande->commander) - { - print ''.$langs->trans("Disapprove").''; - } + $buttonshown=0; + if (! $buttonshown && $user->rights->fournisseur->commande->approuver) + { + if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) + || (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) && $user->id == $object->user_approve_id)) + { + print ''.$langs->trans("Disapprove").''; + $buttonshown++; + } + } + if (! $buttonshown && $user->rights->fournisseur->commande->approve2 && ! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)) + { + if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) + || (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) && $user->id == $object->user_approve_id2)) + { + print ''.$langs->trans("Disapprove").''; + } + } } if (in_array($object->statut, array(3, 5, 6, 7, 9)) || ($object->statut == 4 && $object->billed)) { diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index 13520b723b5..e6f6b288b14 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -50,7 +50,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="p.name"; -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; /* diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 41837da45c9..a72a6f61aa3 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -447,7 +447,7 @@ if (empty($reshook)) 'HT', $product_type, $lines[$i]->rang, - 1, + 0, $lines[$i]->array_options, $lines[$i]->fk_unit ); @@ -1007,22 +1007,29 @@ if (empty($reshook)) $error=0; - // Initialisation donnees + // Init data for trigger $object->sendtoid = $sendtoid; $object->actiontypecode = $actiontypecode; $object->actionmsg = $actionmsg; $object->actionmsg2 = $actionmsg2; $object->fk_element = $object->id; $object->elementtype = $object->element; + + $object->email_subject = $subject; + $object->email_to = $sendto; + $object->email_tocc = $sendtocc; + $object->email_tobcc = $sendtobcc; + $object->email_from = $from; + $object->email_content = $_POST['message']; - // Appel des triggers + // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('BILL_SUPPLIER_SENTBYMAIL',$object,$user,$langs,$conf); if ($result < 0) { $error++; $object->errors=$interface->errors; } - // Fin appel triggers + // End call triggers if ($error) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 6b69adceb3e..6731c70d328 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -61,7 +61,7 @@ $sortorder = GETPOST("sortorder",'alpha'); $sortfield = GETPOST("sortfield",'alpha'); if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -261,7 +261,8 @@ if ($resql) if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($search_status >= 0) $param.="&search_status=".$search_status; - print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); + print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy'); + print ''; if ($optioncss != '') print ''; print ''; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 599ce879d8e..c4b2e4c01f6 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -53,7 +53,7 @@ if ($page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="p.rowid"; $optioncss = GETPOST('optioncss','alpha'); @@ -454,7 +454,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if (empty($action)) { if ($page == -1) $page = 0 ; - $limit = $conf->liste_limit; + $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; if (! $sortorder) $sortorder='DESC'; diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index f3295bf744c..3b93eb85cc9 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -171,37 +171,38 @@ if ($result > 0) print '
    '; print ''; - print ''; // Date payment - print ''; // Payment mode $labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->type_libelle; - print ''; + print ''; // Payment numero - print ''; // Amount - print ''; + print ''; if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { - print ''; + print ''; } // Note - print ''; + $allow_delete = 1 ; // Bank account if (! empty($conf->banque->enabled)) { @@ -209,6 +210,11 @@ if ($result > 0) { $bankline=new AccountLine($db); $bankline->fetch($object->bank_line); + if ($bankline->rappro) + { + $allow_delete=0; + $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment")); + } print ''; print ''; @@ -236,7 +242,6 @@ if ($result > 0) /** * Liste des factures */ - $allow_delete = 1 ; $sql = 'SELECT f.rowid, f.ref, f.ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom as name, s.rowid as socid'; $sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf,'.MAIN_DB_PREFIX.'facture_fourn as f,'.MAIN_DB_PREFIX.'societe as s'; $sql .= ' WHERE pf.fk_facturefourn = f.rowid AND f.fk_soc = s.rowid'; @@ -288,6 +293,7 @@ if ($result > 0) if ($objp->paye == 1) { $allow_delete = 0; + $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid")); } $total = $total + $objp->amount; $i++; @@ -323,12 +329,18 @@ if ($result > 0) } } } - if ($user->societe_id == 0 && $allow_delete && $object->statut == 0 && $action == '') + if ($user->societe_id == 0 && $action == '') { if ($user->rights->fournisseur->facture->supprimer) { - print ''.$langs->trans('Delete').''; - + if ($allow_delete) + { + print ''.$langs->trans('Delete').''; + } + else + { + print ''.$langs->trans('Delete').''; + } } } print ''; diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index f21390776d3..6a4f2255f6b 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -49,7 +49,7 @@ if ($page < 0) { $page = 0 ; } -$limit = $conf->liste_limit; +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; if (! $sortfield) $sortfield = 'p.ref'; @@ -109,7 +109,7 @@ if ($sref) } if ($snom) { - $sql .= natural_search('s.nom', $snom); + $sql .= natural_search('p.label', $snom); } if($catid) { diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index acf4c9400d3..1137f0de14b 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * * 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 @@ -19,7 +19,7 @@ /** * \file htdocs/fourn/recap-fourn.php * \ingroup fournisseur - * \brief Page de fiche recap fournisseur + * \brief Page de fiche recap supplier */ require '../main.inc.php'; @@ -30,7 +30,7 @@ $langs->load("companies"); $langs->load("bills"); // Security check -$socid = $_GET["socid"]; +$socid = GETPOST("socid",'int'); if ($user->societe_id > 0) { $action = ''; @@ -43,6 +43,9 @@ if ($user->societe_id > 0) * View */ +$form = new Form($db); +$userstatic=new User($db); + llxHeader(); if ($socid > 0) @@ -56,36 +59,12 @@ if ($socid > 0) $head = societe_prepare_head($societe); dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"), 0, 'company'); - - - print "
    '.$langs->trans('Ref').''; + print ''.$langs->trans('Ref').''; print $form->showrefnav($object,'id','',1,'rowid','ref'); print '
    '.$form->editfieldkey("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).''; + print '
    '.$form->editfieldkey("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).''; print $form->editfieldval("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded')); print '
    '.$langs->trans('PaymentMode').''.$labeltype.'
    '.$langs->trans('PaymentMode').''.$labeltype.'
    '.$form->editfieldkey("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).''; + print '
    '.$form->editfieldkey("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).''; print $form->editfieldval("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded')); print '
    '.$langs->trans('Amount').''.price($object->montant,'',$langs,0,0,-1,$conf->currency).'
    '.$langs->trans('Amount').''.price($object->montant,'',$langs,0,0,-1,$conf->currency).'
    '.$langs->trans('Status').''.$object->getLibStatut(4).'
    '.$langs->trans('Status').''.$object->getLibStatut(4).'
    '.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->fournisseur->facture->creer).''; + print '
    '.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->fournisseur->facture->creer).''; print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->fournisseur->facture->creer,'textarea'); print '
    '.$langs->trans('BankTransactionLine').'
    \n"; - print '
    '; - - print ''; - - // Nom - print ''; - - // Prefix - if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field - { - print ''; - } - - print "
    '.$langs->trans("Name").''.$societe->nom.'
    '.$langs->trans("Prefix").''; - print ($societe->prefix_comm?$societe->prefix_comm:' '); - print '
    "; - - print "
    \n"; - - print ''; - - - + dol_banner_tab($societe, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + dol_fiche_end(); if (! empty($conf->fournisseur->enabled) && $user->rights->facture->lire) { - // Invoices list + // Invoice list print load_fiche_titre($langs->trans("SupplierPreview")); print ''; @@ -203,10 +182,9 @@ if ($socid > 0) { dol_print_error($db); } + print "
    "; - print "
    "; } - } else { diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 80d06fdb446..bd9fd680087 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -84,7 +84,7 @@ if ($action == 'create') $description = trim(GETPOST('description')); $userID = GETPOST('userID'); - // If no start date + // If no type if ($type <= 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); @@ -136,12 +136,6 @@ if ($action == 'create') $result = 0; - if ($type < 1) - { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Type")), null, 'errors'); - $error++; - } - if (! $error) { $cp->fk_user = $userid; @@ -362,7 +356,7 @@ if ($action == 'confirm_send') if ($cp->getConfCP('AlertValidatorSolde')) { $nbopenedday=num_open_day($cp->date_debut_gmt,$cp->date_fin_gmt,0,1,$cp->halfday); - if ($nbopenedday > $cp->getCPforUser($cp->fk_user)) + if ($nbopenedday > $cp->getCPforUser($cp->fk_user, $cp->fk_type)) { $message.= "\n"; $message.= $langs->transnoentities("HolidaysToValidateAlertSolde")."\n"; @@ -419,14 +413,14 @@ if ($action == 'confirm_valid') // Calculcate number of days consummed $nbopenedday=num_open_day($cp->date_debut_gmt,$cp->date_fin_gmt,0,1,$cp->halfday); - $soldeActuel = $cp->getCpforUser($cp->fk_user); + $soldeActuel = $cp->getCpforUser($cp->fk_user, $cp->fk_type); $newSolde = $soldeActuel - ($nbopenedday * $cp->getConfCP('nbHolidayDeducted')); // On ajoute la modification dans le LOG - $cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde); + $cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde, $cp->fk_type); // Mise à jour du solde - $cp->updateSoldeCP($cp->fk_user, $newSolde); + $cp->updateSoldeCP($cp->fk_user, $newSolde, $cp->fk_type); // To $destinataire = new User($db); @@ -584,14 +578,14 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') // Calculcate number of days consummed $nbopenedday=num_open_day($cp->date_debut_gmt,$cp->date_fin_gmt,0,1,$cp->halfday); - $soldeActuel = $cp->getCpforUser($cp->fk_user); + $soldeActuel = $cp->getCpforUser($cp->fk_user, $cp->fk_type); $newSolde = $soldeActuel + ($nbopenedday * $cp->getConfCP('nbHolidayDeducted')); // On ajoute la modification dans le LOG - $result1=$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde); + $result1=$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde, $cp->fk_type); // Mise à jour du solde - $result2=$cp->updateSoldeCP($cp->fk_user, $newSolde); + $result2=$cp->updateSoldeCP($cp->fk_user, $newSolde, $cp->fk_type); if ($result1 < 0 || $result2 < 0) { @@ -806,7 +800,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create print '
    '.$langs->trans("Type").''; - $typeleaves=$cp->getTypes(1,1); + $typeleaves=$cp->getTypes(1,-1); $arraytypeleaves=array(); foreach($typeleaves as $key => $val) { @@ -1019,7 +1013,7 @@ else print '
    '.$langs->trans("Type").''; - $typeleaves=$cp->getTypes(1,1); + $typeleaves=$cp->getTypes(1,-1); print $typeleaves[$cp->fk_type]['label']; print '
    '; -print ""; -print ''; -foreach($typeleaves as $key => $val) +if (count($typeleaves) == 0) { - print ''; + //print '
    '; + print $langs->trans("NoLeaveWithCounterDefined")."
    \n"; + print $langs->trans("GoIntoDictionaryHolidayTypes"); + //print '
    '; } -print ''; -print ''; -print ''; - - -foreach($listUsers as $users) +else { - $var=!$var; - - print ''; - print ''; - foreach($typeleaves as $key => $val) - { - $nbtoshow=''; - if ($holiday->getCPforUser($users['rowid'], $val['rowid']) != '') $nbtoshow=price2num($holiday->getCPforUser($users['rowid'], $val['rowid']), 5); - print ''."\n"; - } - print ''; - print ''."\n"; + print ''."\n"; + print ''; + + print '
    '.$langs->trans('Employee').''.$val['label'].''.$langs->trans('Note').'
    '; - $userstatic->id=$users['rowid']; - $userstatic->lastname=$users['name']; - $userstatic->firstname=$users['firstname']; - print $userstatic->getNomUrl(1); - print ''; - print ''; - //print ' '.$langs->trans('days'); - print '
    '; + print ""; + print ''; + if (count($typeleaves)) + { + foreach($typeleaves as $key => $val) + { + print ''; + } + } + else + { + print ''; + } + print ''; + print ''; print ''; - - $i++; + + + foreach($listUsers as $users) + { + $var=!$var; + + print ''; + print ''; + + if (count($typeleaves)) + { + foreach($typeleaves as $key => $val) + { + $nbtoshow=''; + if ($holiday->getCPforUser($users['rowid'], $val['rowid']) != '') $nbtoshow=price2num($holiday->getCPforUser($users['rowid'], $val['rowid']), 5); + print ''."\n"; + } + } + else + { + print ''; + } + print ''; + print ''."\n"; + print ''; + + $i++; + } + + print '
    '.$langs->trans('Employee').''.$val['label'].''.$langs->trans("NoLeaveWithCounterDefined").''.$langs->trans('Note').'
    '; + $userstatic->id=$users['rowid']; + $userstatic->lastname=$users['name']; + $userstatic->firstname=$users['firstname']; + print $userstatic->getNomUrl(1); + print ''; + print ''; + //print ' '.$langs->trans('days'); + print '
    '; + + print '
    '; } -print '
    '; - -print ''; - llxFooter(); $db->close(); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 1c82288973e..2a673333430 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -35,10 +35,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; $langs->load('users'); $langs->load('holidays'); +$langs->load('hrm'); // Protection if external user if ($user->societe_id > 0) accessforbidden(); +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -47,7 +49,7 @@ $page = $page == -1 ? 0 : $page; if (! $sortfield) $sortfield="cp.rowid"; if (! $sortorder) $sortorder="DESC"; -$offset = $conf->liste_limit * $page ; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -102,6 +104,9 @@ $holiday = new Holiday($db); $holidaystatic=new Holiday($db); $fuser = new User($db); +$childids = $user->getAllChildIds(); +$childids[]=$user->id; + // Update sold $result = $holiday->updateBalance(); @@ -111,7 +116,7 @@ $filter=''; llxHeader(array(),$langs->trans('CPTitreMenu')); -$order = $db->order($sortfield,$sortorder).$db->plimit($conf->liste_limit + 1, $offset); +$order = $db->order($sortfield,$sortorder).$db->plimit($limit + 1, $offset); // WHERE if(!empty($search_ref)) @@ -184,10 +189,8 @@ if (!empty($sall)) $filter.= natural_search(array_keys($fieldstosearchall), $sall); } +if (empty($user->rights->holiday->read_all)) $filter.=' AND cp.fk_user IN ('.join(',',$childids).')'; -/************************************* - * Fin des filtres de recherche -*************************************/ // Récupération de l'ID de l'utilisateur $user_id = $user->id; @@ -200,7 +203,7 @@ if ($id > 0) $user_id = $fuser->id; } // Récupération des congés payés de l'utilisateur ou de tous les users -if (empty($user->rights->holiday->write_all) || $id > 0) +if (empty($user->rights->holiday->read_all) || $id > 0) { $holiday_payes = $holiday->fetchByUser($user_id,$order,$filter); // Load array $holiday->holiday } @@ -220,7 +223,8 @@ if ($holiday_payes == '-1') // Show table of vacations -$var=true; $num = count($holiday->holiday); +$var=true; +$num = count($holiday->holiday); $form = new Form($db); $formother = new FormOther($db); @@ -242,17 +246,20 @@ if ($id > 0) } else { - print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num, 0, 'title_hrm.png'); + //print $num; + //print count($holiday->holiday); + print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num, count($holiday->holiday), 'title_hrm.png', 0, '', '', $limit); dol_fiche_head(''); } +$alltypeleaves=$holiday->getTypes(1,-1); // To have labels $out=''; $typeleaves=$holiday->getTypes(1,1); foreach($typeleaves as $key => $val) { - $nb_type = $holiday->getCPforUser($user->id, $val['rowid']); + $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); $nb_holiday += $nb_type; $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
    '; } @@ -285,7 +292,7 @@ print_liste_field_titre($langs->trans("DateCreateCP"),$_SERVER["PHP_SELF"],"cp.d print_liste_field_titre($langs->trans("Employe"),$_SERVER["PHP_SELF"],"cp.fk_user","",'','',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk_validator","",'','',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],'','','','',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder); @@ -401,7 +408,10 @@ if (! empty($holiday->holiday)) print '
    '.dol_print_date($date,'day').''.$userstatic->getNomUrl('1').''.$approbatorstatic->getNomUrl('1').''.$infos_CP['fk_type'].''; + $label=$alltypeleaves[$infos_CP['fk_type']]['label']; + print $label?$label:$infos_CP['fk_type']; + print ''; $nbopenedday=num_open_day($infos_CP['date_debut_gmt'], $infos_CP['date_fin_gmt'], 0, 1, $infos_CP['halfday']); print $nbopenedday.' '.$langs->trans('DurationDays'); diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php deleted file mode 100644 index e1204429100..00000000000 --- a/htdocs/holiday/month_report.php +++ /dev/null @@ -1,155 +0,0 @@ - - * Copyright (C) 2011 François Legastelois - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/holiday/month_report.php - * \ingroup holiday - * \brief Monthly report of paid holiday. - */ - -require('../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; - -// Protection if external user -if ($user->societe_id > 0) accessforbidden(); - - -// Si l'utilisateur n'a pas le droit de lire cette page -if(!$user->rights->holiday->read_all) accessforbidden(); - - - -/* - * View - */ - -$html = new Form($db); -$htmlother = new FormOther($db); -$holidaystatic = new Holiday($db); - -llxHeader(array(),$langs->trans('CPTitreMenu')); - -$cp = new Holiday($db); - -$month = GETPOST('month_start'); -$year = GETPOST('year_start'); - -if(empty($month)) { - $month = date('n'); -} -if(empty($year)) { - $year = date('Y'); -} - -$sql = "SELECT cp.rowid, cp.fk_user, cp.date_debut, cp.date_fin, cp.halfday"; -$sql.= " FROM " . MAIN_DB_PREFIX . "holiday cp"; -$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "user u ON cp.fk_user = u.rowid"; -$sql.= " WHERE cp.statut = 3"; // Approved -// TODO Use BETWEEN instead of date_format -$sql.= " AND (date_format(cp.date_debut, '%Y-%c') = '$year-$month' OR date_format(cp.date_fin, '%Y-%c') = '$year-$month')"; -$sql.= " ORDER BY u.lastname,cp.date_debut"; - -$result = $db->query($sql); -$num = $db->num_rows($result); - -print load_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm.png'); - -// Get month of last update -$lastUpdate = $cp->getConfCP('lastUpdate', 0); -$monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; -$yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; -print $langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.'

    '."\n"; - - -print '
    '."\n"; - -dol_fiche_head(); - -print $langs->trans('Month').': '; -print $htmlother->select_month($month, 'month_start').' '; -print $htmlother->select_year($year,'year_start',1,10,3); - -print ''; - -print '
    '; -print '
    '; - -$var=true; -print ''; - -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; - -if($num == '0') { - - print ''; - print ''; - print ''; - -} else { - - $langs->load('users'); - - while ($holiday = $db->fetch_array($result)) - { - $user = new User($db); - $user->fetch($holiday['fk_user']); - $var=!$var; - - $holidaystatic->id=$holiday['rowid']; - $holidaystatic->ref=$holiday['rowid']; - - $start_date=$db->jdate($holiday['date_debut']); - $end_date=$db->jdate($holiday['date_fin']); - $start_date_gmt=$db->jdate($holiday['date_debut'],1); - $end_date_gmt=$db->jdate($holiday['date_fin'],1); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } -} -print '
    '.$langs->trans('Ref').''.$langs->trans('Employee').''.$langs->trans('DateDebCP').''.$langs->trans('DateFinCP').''.$langs->trans('nbJours').'
    '.$langs->trans('None').'
    '.$holidaystatic->getNomUrl(1).''.$user->getNomUrl(1).''.dol_print_date($start_date,'day'); - print ''.dol_print_date($end_date,'day'); - print ''; - $nbopenedday=num_open_day($start_date_gmt, $end_date_gmt, 0, 1, $holiday['halfday']); - print $nbopenedday; - print '
    '; - -dol_fiche_end(); - -print '
    '; - - -// Fin de page -llxFooter(); - -$db->close(); diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 766478ed9de..cf1bdcb8748 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2016 Laurent Destailleur * Copyright (C) 2011 Dimitri Mouillard * * This program is free software; you can redistribute it and/or modify @@ -101,10 +101,10 @@ foreach($cp->logs as $logs_CP) } -if($log_holiday == '2') +if ($log_holiday == '2') { print '
    '.$langs->trans('NoResults').''.$langs->trans('None').'
    "],l=h.length,a=0;a');var m="cke_smile_label_"+a+"_"+CKEDITOR.tools.getNextNumber();d.push('");a%g==g-1&&d.push("")}if(a");d.push("")}d.push("
    "); -e={type:"html",id:"smileySelector",html:d.join(""),onLoad:function(a){i=a.sender},focus:function(){var a=this;setTimeout(function(){a.getElement().getElementsByTag("a").getItem(0).focus()},0)},onClick:k,style:"width: 100%; border-collapse: separate;"};return{title:f.lang.smiley.title,minWidth:270,minHeight:120,contents:[{id:"tab1",label:"",title:"",expand:!0,padding:0,elements:[e]}],buttons:[CKEDITOR.dialog.cancelButton]}}); \ No newline at end of file +CKEDITOR.dialog.add("smiley",function(f){for(var e=f.config,a=f.lang.smiley,h=e.smiley_images,g=e.smiley_columns||8,k,m=function(l){var c=l.data.getTarget(),b=c.getName();if("a"==b)c=c.getChild(0);else if("img"!=b)return;var b=c.getAttribute("cke_src"),a=c.getAttribute("title"),c=f.document.createElement("img",{attributes:{src:b,"data-cke-saved-src":b,title:a,alt:a,width:c.$.width,height:c.$.height}});f.insertElement(c);k.hide();l.data.preventDefault()},q=CKEDITOR.tools.addFunction(function(a,c){a= +new CKEDITOR.dom.event(a);c=new CKEDITOR.dom.element(c);var b;b=a.getKeystroke();var d="rtl"==f.lang.dir;switch(b){case 38:if(b=c.getParent().getParent().getPrevious())b=b.getChild([c.getParent().getIndex(),0]),b.focus();a.preventDefault();break;case 40:(b=c.getParent().getParent().getNext())&&(b=b.getChild([c.getParent().getIndex(),0]))&&b.focus();a.preventDefault();break;case 32:m({data:a});a.preventDefault();break;case d?37:39:if(b=c.getParent().getNext())b=b.getChild(0),b.focus(),a.preventDefault(!0); +else if(b=c.getParent().getParent().getNext())(b=b.getChild([0,0]))&&b.focus(),a.preventDefault(!0);break;case d?39:37:if(b=c.getParent().getPrevious())b=b.getChild(0),b.focus(),a.preventDefault(!0);else if(b=c.getParent().getParent().getPrevious())b=b.getLast().getChild(0),b.focus(),a.preventDefault(!0)}}),d=CKEDITOR.tools.getNextId()+"_smiley_emtions_label",d=['\x3cdiv\x3e\x3cspan id\x3d"'+d+'" class\x3d"cke_voice_label"\x3e'+a.options+"\x3c/span\x3e",'\x3ctable role\x3d"listbox" aria-labelledby\x3d"'+ +d+'" style\x3d"width:100%;height:100%;border-collapse:separate;" cellspacing\x3d"2" cellpadding\x3d"2"',CKEDITOR.env.ie&&CKEDITOR.env.quirks?' style\x3d"position:absolute;"':"","\x3e\x3ctbody\x3e"],n=h.length,a=0;a'],d=0,g=b.length,h,e;d');for(var j=0;j'+h+''+e+"")}else f.push('
     ');f.push("
    ",''+l.options+"");this.getContentElement("info","charContainer").getElement().setHtml(f.join(""))},contents:[{id:"info",label:i.lang.common.generalTab, -title:i.lang.common.generalTab,padding:0,align:"top",elements:[{type:"hbox",align:"top",widths:["320px","90px"],children:[{type:"html",id:"charContainer",html:"",onMouseover:g,onMouseout:d,focus:function(){var c=this.getElement().getElementsByTag("a").getItem(0);setTimeout(function(){c.focus();g(null,c)},0)},onShow:function(){var c=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){c.focus();g(null,c)},0)},onLoad:function(c){e=c.sender}},{type:"hbox",align:"top",widths:["100%"],children:[{type:"vbox", -align:"top",children:[{type:"html",html:"
    "},{type:"html",id:"charPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"
     
    "},{type:"html",id:"htmlPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;", -html:"
     
    "}]}]}]}]}]}}); \ No newline at end of file +d(null,b)}});return{title:n.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,onLoad:function(){for(var c=this.definition.charColumns,b=k.config.specialChars,a=CKEDITOR.tools.getNextId()+"_specialchar_table_label",f=['\x3ctable role\x3d"listbox" aria-labelledby\x3d"'+a+'" style\x3d"width: 320px; height: 100%; border-collapse: separate;" align\x3d"center" cellspacing\x3d"2" cellpadding\x3d"2" border\x3d"0"\x3e'],d=0,g=b.length,h,e;dl&&(l=e)}return l}function o(a){return function(){var e=this.getValue(),e=!!(CKEDITOR.dialog.validate.integer()(e)&&0n&&(n=f)}return n}function r(a){return function(){var f=this.getValue(),f=!!(CKEDITOR.dialog.validate.integer()(f)&&0n.getSize("width")?"100%":500:0,getValue:q,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&& -a.updateStyle("width",this.getValue())},setup:function(a){this.setValue(a.getStyle("width"))},commit:k}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em",label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:q,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles"); -a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:k}]},{type:"html",html:" "},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]",controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellSpacing", -this.getValue()):d.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellPadding",this.getValue()):d.removeAttribute("cellPadding")}}]}]},{type:"html",align:"right", -html:""},{type:"vbox",padding:0,children:[{type:"text",id:"txtCaption",requiredContent:"caption",label:a.lang.table.caption,setup:function(a){this.enable();a=a.getElementsByTag("caption");if(0q.getSize("width")?"100%":500:0,getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&& +a.updateStyle("width",this.getValue())},setup:function(a){a=a.getStyle("width");this.setValue(a)},commit:m}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em",label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced", +"advStyles");a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:m}]},{type:"html",html:"\x26nbsp;"},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]",controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,d){this.getValue()? +d.setAttribute("cellSpacing",this.getValue()):d.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellPadding",this.getValue()):d.removeAttribute("cellPadding")}}]}]}, +{type:"html",align:"right",html:""},{type:"vbox",padding:0,children:[{type:"text",id:"txtCaption",requiredContent:"caption",label:a.lang.table.caption,setup:function(a){this.enable();a=a.getElementsByTag("caption");if(0"+h.widthPx}]},f,{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==a.getStyle("white-space")|| -b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},f,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.alignLeft,"left"],[e.alignCenter,"center"],[e.alignRight,"right"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",b):a.removeStyle("text-align");a.removeAttribute("align")}}, -{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign"),a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");a.removeAttribute("vAlign")}}]},f,{type:"vbox", -padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},f,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:i.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",this.getValue()):a.removeAttribute("rowSpan")}}, -{type:"text",id:"colSpan",label:c.colSpan,"default":"",validate:i.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},f,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");return a.getStyle("background-color")|| -b}),commit:function(a){this.getValue()?a.setStyle("background-color",this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},k?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:f]},f,{type:"hbox",padding:0,widths:["60%","40%"], -children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},k?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(m?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align", +CKEDITOR.dialog.add("cellProperties",function(g){function d(a){return function(b){for(var c=a(b[0]),d=1;d
    '),d='';a.image&&b&&(d+='');d+='");k.on("click",function(){p(a.html)});return k}function p(a){var b=CKEDITOR.dialog.getCurrent();b.getValueOf("selectTpl","chkInsertOpt")?(c.fire("saveSnapshot"),c.setData(a,function(){b.hide();var a=c.createRange();a.moveToElementEditStart(c.editable());a.select();setTimeout(function(){c.fire("saveSnapshot")},0)})):(c.insertHtml(a),b.hide())}function i(a){var b=a.data.getTarget(), -c=g.equals(b);if(c||g.contains(b)){var d=a.data.getKeystroke(),f=g.getElementsByTag("a"),e;if(f){if(c)e=f.getItem(0);else switch(d){case 40:e=b.getNext();break;case 38:e=b.getPrevious();break;case 13:case 32:b.fire("click")}e&&(e.focus(),a.data.preventDefault())}}}var h=CKEDITOR.plugins.get("templates");CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(h.path+"dialogs/templates.css"));var g,h="cke_tpl_list_label_"+CKEDITOR.tools.getNextNumber(),f=c.lang.templates,l=c.config;return{title:c.lang.templates.title, -minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:"selectTpl",label:f.title,elements:[{type:"vbox",padding:5,children:[{id:"selectTplText",type:"html",html:""+f.selectPromptMsg+""},{id:"templatesList",type:"html",focus:!0,html:'
    '+f.options+""},{id:"chkInsertOpt",type:"checkbox",label:f.insertOption, -"default":l.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var a=this.getContentElement("selectTpl","templatesList");g=a.getElement();CKEDITOR.loadTemplates(l.templates_files,function(){var b=(l.templates||"default").split(",");if(b.length){var c=g;c.setHtml("");for(var d=0,h=b.length;d'+f.emptyListMsg+"")});this._.element.on("keydown",i)},onHide:function(){this._.element.removeListener("keydown",i)}}})})(); \ No newline at end of file +(function(){CKEDITOR.dialog.add("templates",function(c){function r(a,b){var m=CKEDITOR.dom.element.createFromHtml('\x3ca href\x3d"javascript:void(0)" tabIndex\x3d"-1" role\x3d"option" \x3e\x3cdiv class\x3d"cke_tpl_item"\x3e\x3c/div\x3e\x3c/a\x3e'),d='\x3ctable style\x3d"width:350px;" class\x3d"cke_tpl_preview" role\x3d"presentation"\x3e\x3ctr\x3e';a.image&&b&&(d+='\x3ctd class\x3d"cke_tpl_preview_img"\x3e\x3cimg src\x3d"'+CKEDITOR.getUrl(b+a.image)+'"'+(CKEDITOR.env.ie6Compat?' onload\x3d"this.width\x3dthis.width"': +"")+' alt\x3d"" title\x3d""\x3e\x3c/td\x3e');d+='\x3ctd style\x3d"white-space:normal;"\x3e\x3cspan class\x3d"cke_tpl_title"\x3e'+a.title+"\x3c/span\x3e\x3cbr/\x3e";a.description&&(d+="\x3cspan\x3e"+a.description+"\x3c/span\x3e");d+="\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e";m.getFirst().setHtml(d);m.on("click",function(){t(a.html)});return m}function t(a){var b=CKEDITOR.dialog.getCurrent();b.getValueOf("selectTpl","chkInsertOpt")?(c.fire("saveSnapshot"),c.setData(a,function(){b.hide();var a=c.createRange(); +a.moveToElementEditStart(c.editable());a.select();setTimeout(function(){c.fire("saveSnapshot")},0)})):(c.insertHtml(a),b.hide())}function k(a){var b=a.data.getTarget(),c=g.equals(b);if(c||g.contains(b)){var d=a.data.getKeystroke(),f=g.getElementsByTag("a"),e;if(f){if(c)e=f.getItem(0);else switch(d){case 40:e=b.getNext();break;case 38:e=b.getPrevious();break;case 13:case 32:b.fire("click")}e&&(e.focus(),a.data.preventDefault())}}}var h=CKEDITOR.plugins.get("templates");CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(h.path+ +"dialogs/templates.css"));var g,h="cke_tpl_list_label_"+CKEDITOR.tools.getNextNumber(),f=c.lang.templates,n=c.config;return{title:c.lang.templates.title,minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:"selectTpl",label:f.title,elements:[{type:"vbox",padding:5,children:[{id:"selectTplText",type:"html",html:"\x3cspan\x3e"+f.selectPromptMsg+"\x3c/span\x3e"},{id:"templatesList",type:"html",focus:!0,html:'\x3cdiv class\x3d"cke_tpl_list" tabIndex\x3d"-1" role\x3d"listbox" aria-labelledby\x3d"'+ +h+'"\x3e\x3cdiv class\x3d"cke_tpl_loading"\x3e\x3cspan\x3e\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e\x3cspan class\x3d"cke_voice_label" id\x3d"'+h+'"\x3e'+f.options+"\x3c/span\x3e"},{id:"chkInsertOpt",type:"checkbox",label:f.insertOption,"default":n.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var a=this.getContentElement("selectTpl","templatesList");g=a.getElement();CKEDITOR.loadTemplates(n.templates_files,function(){var b=(n.templates||"default").split(","); +if(b.length){var c=g;c.setHtml("");for(var d=0,h=b.length;dType the title here

    Type the text here

    '},{title:"Strange Template",image:"template2.gif",description:"A template that defines two colums, each one with a title, and some text.", -html:'

    Title 1

    Title 2

    Text 1Text 2

    More text goes here.

    '},{title:"Text and Table",image:"template3.gif",description:"A title with some text and a table.",html:'

    Title goes here

    Table title
       
       
       

    Type the text here

    '}]}); \ No newline at end of file +CKEDITOR.addTemplates("default",{imagesPath:CKEDITOR.getUrl(CKEDITOR.plugins.getPath("templates")+"templates/images/"),templates:[{title:"Image and Title",image:"template1.gif",description:"One main image with a title and text that surround the image.",html:'\x3ch3\x3e\x3cimg src\x3d" " alt\x3d"" style\x3d"margin-right: 10px" height\x3d"100" width\x3d"100" align\x3d"left" /\x3eType the title here\x3c/h3\x3e\x3cp\x3eType the text here\x3c/p\x3e'},{title:"Strange Template",image:"template2.gif",description:"A template that defines two colums, each one with a title, and some text.", +html:'\x3ctable cellspacing\x3d"0" cellpadding\x3d"0" style\x3d"width:100%" border\x3d"0"\x3e\x3ctr\x3e\x3ctd style\x3d"width:50%"\x3e\x3ch3\x3eTitle 1\x3c/h3\x3e\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd style\x3d"width:50%"\x3e\x3ch3\x3eTitle 2\x3c/h3\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3eText 1\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3eText 2\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cp\x3eMore text goes here.\x3c/p\x3e'},{title:"Text and Table",image:"template3.gif",description:"A title with some text and a table.", +html:'\x3cdiv style\x3d"width: 80%"\x3e\x3ch3\x3eTitle goes here\x3c/h3\x3e\x3ctable style\x3d"width:150px;float: right" cellspacing\x3d"0" cellpadding\x3d"0" border\x3d"1"\x3e\x3ccaption style\x3d"border:solid 1px black"\x3e\x3cstrong\x3eTable title\x3c/strong\x3e\x3c/caption\x3e\x3ctr\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cp\x3eType the text here\x3c/p\x3e\x3c/div\x3e'}]}); \ No newline at end of file diff --git a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/ciframe.html b/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/ciframe.html index 25db3c739fd..5809fbefe91 100644 --- a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/ciframe.html +++ b/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/ciframe.html @@ -1,6 +1,6 @@ diff --git a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/tmp.html b/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/tmp.html deleted file mode 100644 index 67642956f37..00000000000 --- a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/tmp.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - iframe - - - - -
    - - - - - - - diff --git a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/tmpFrameset.html b/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/tmpFrameset.html index 0d675f4d692..d5fc6bba4e6 100644 --- a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +++ b/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/tmpFrameset.html @@ -1,6 +1,6 @@ diff --git a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.css b/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.css index 9e834f1d094..1056b45f24b 100644 --- a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.css +++ b/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.css @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ diff --git a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.js b/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.js index 22410bdb155..5ef1d391f3e 100644 --- a/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.js +++ b/htdocs/includes/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.js @@ -1,67 +1,92 @@ /* - Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. + Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -(function(){function w(a){if(!a)throw"Languages-by-groups list are required for construct selectbox";var c=[],d="",f;for(f in a)for(var g in a[f]){var h=a[f][g];"en_US"==h?d=h:c.push(h)}c.sort();d&&c.unshift(d);return{getCurrentLangGroup:function(c){a:{for(var d in a)for(var f in a[d])if(f.toUpperCase()===c.toUpperCase()){c=d;break a}c=""}return c},setLangList:function(){var c={},d;for(d in a)for(var f in a[d])c[a[d][f]]=f;return c}()}}var e=function(){var a=function(a,b,f){var f=f||{},g=f.expires; -if("number"==typeof g&&g){var h=new Date;h.setTime(h.getTime()+1E3*g);g=f.expires=h}g&&g.toUTCString&&(f.expires=g.toUTCString());var b=encodeURIComponent(b),a=a+"="+b,e;for(e in f)b=f[e],a+="; "+e,!0!==b&&(a+="="+b);document.cookie=a};return{postMessage:{init:function(a){document.addEventListener?window.addEventListener("message",a,!1):window.attachEvent("onmessage",a)},send:function(a){var b=a.fn||null,f=a.id||"",g=a.target||window,h=a.message||{id:f};"[object Object]"==Object.prototype.toString.call(a.message)&& -(a.message.id||(a.message.id=f),h=a.message);a=window.JSON.stringify(h,b);g.postMessage(a,"*")}},hash:{create:function(){},parse:function(){}},cookie:{set:a,get:function(a){return(a=document.cookie.match(RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)")))?decodeURIComponent(a[1]):void 0},remove:function(c){a(c,"",{expires:-1})}}}}(),a=a||{};a.TextAreaNumber=null;a.load=!0;a.cmd={SpellTab:"spell",Thesaurus:"thes",GrammTab:"grammar"};a.dialog=null;a.optionNode=null;a.selectNode= -null;a.grammerSuggest=null;a.textNode={};a.iframeMain=null;a.dataTemp="";a.div_overlay=null;a.textNodeInfo={};a.selectNode={};a.selectNodeResponce={};a.langList=null;a.langSelectbox=null;a.banner="";a.show_grammar=null;a.div_overlay_no_check=null;a.targetFromFrame={};a.onLoadOverlay=null;a.LocalizationComing={};a.OverlayPlace=null;a.LocalizationButton={ChangeTo:{instance:null,text:"Change to"},ChangeAll:{instance:null,text:"Change All"},IgnoreWord:{instance:null,text:"Ignore word"},IgnoreAllWords:{instance:null, -text:"Ignore all words"},Options:{instance:null,text:"Options",optionsDialog:{instance:null}},AddWord:{instance:null,text:"Add word"},FinishChecking:{instance:null,text:"Finish Checking"}};a.LocalizationLabel={ChangeTo:{instance:null,text:"Change to"},Suggestions:{instance:null,text:"Suggestions"}};var x=function(b){for(var c in b)b[c].instance.getElement().setText(a.LocalizationComing[c])},y=function(b){for(var c in b){if(!b[c].instance.setLabel)break;b[c].instance.setLabel(a.LocalizationComing[c])}}, -j,p;a.framesetHtml=function(b){return''};a.setIframe=function(b,c){var d=a.framesetHtml(c);return b.getElement().setHtml(d)};a.setCurrentIframe=function(b){a.setIframe(a.dialog._.contents[b].Content,b)};a.setHeightBannerFrame=function(){var b=a.dialog.getContentElement("SpellTab","banner").getElement(), -c=a.dialog.getContentElement("GrammTab","banner").getElement(),d=a.dialog.getContentElement("Thesaurus","banner").getElement();b.setStyle("height","90px");c.setStyle("height","90px");d.setStyle("height","90px")};a.setHeightFrame=function(){document.getElementById(a.iframeNumber+"_"+a.dialog._.currentTabId).style.height="240px"};a.sendData=function(b){var c=b._.currentTabId,d=b._.contents[c].Content,f,g;a.setIframe(d,c);b.parts.tabs.removeAllListeners();b.parts.tabs.on("click",function(h){h=h||window.event; -h.data.getTarget().is("a")&&c!=b._.currentTabId&&(c=b._.currentTabId,d=b._.contents[c].Content,f=a.iframeNumber+"_"+c,a.div_overlay.setEnable(),d.getElement().getChildCount()?t(a.targetFromFrame[f],a.cmd[c]):(a.setIframe(d,c),g=document.getElementById(f),a.targetFromFrame[f]=g.contentWindow))})};a.buildSelectLang=function(a){var c=new CKEDITOR.dom.element("div"),d=new CKEDITOR.dom.element("select"),a="wscLang"+a;c.addClass("cke_dialog_ui_input_select");c.setAttribute("role","presentation");c.setStyles({height:"auto", -position:"absolute",right:"0",top:"-1px",width:"160px","white-space":"normal"});d.setAttribute("id",a);d.addClass("cke_dialog_ui_input_select");d.setStyles({width:"160px"});c.append(d);return c};a.buildOptionLang=function(b,c){var d=document.getElementById("wscLang"+c),f=document.createDocumentFragment(),g,h,e=[];if(0===d.options.length){for(g in b)e.push([g,b[g]]);e.sort();for(var k=0;k"},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(b){var b=a.iframeNumber+"_"+b._.currentTabId, -c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"hbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",widths:["50%","50%"],children:[{type:"hbox",id:"leftCol",align:"left",width:"50%",children:[{type:"vbox",id:"rightCol1",widths:["50%","50%"],children:[{type:"text",id:"text",label:a.LocalizationLabel.ChangeTo.text+":",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",width:"140px","default":"",onShow:function(){a.textNode.SpellTab=this;a.LocalizationLabel.ChangeTo.instance= -this},onHide:function(){this.reset()}},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"text",id:"labelSuggestions",label:a.LocalizationLabel.Suggestions.text+":",onShow:function(){a.LocalizationLabel.Suggestions.instance=this;this.getInputElement().hide()}},{type:"html",id:"logo",html:'WebSpellChecker.net',setup:function(){this.getElement().$.src= -a.logotype;this.getElement().getParent().setStyles({"text-align":"left"})}}]},{type:"select",id:"list_of_suggestions",labelStyle:"font: 12px/25px arial, sans-serif;",size:"6",inputStyle:"width: 140px; height: auto;",items:[["loading..."]],onShow:function(){p=this},onHide:function(){this.clear()},onChange:function(){a.textNode.SpellTab.setValue(this.getValue())}}]}]}]},{type:"hbox",id:"rightCol",align:"right",width:"50%",children:[{type:"vbox",id:"rightCol_col__left",widths:["50%","50%","50%","50%"], -children:[{type:"button",id:"ChangeTo",label:a.LocalizationButton.ChangeTo.text,title:"Change to",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.ChangeTo.instance=this},onClick:c},{type:"button",id:"ChangeAll",label:a.LocalizationButton.ChangeAll.text,title:"Change All",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.ChangeAll.instance=this},onClick:c},{type:"button",id:"AddWord", -label:a.LocalizationButton.AddWord.text,title:"Add word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.AddWord.instance=this},onClick:c},{type:"button",id:"FinishChecking",label:a.LocalizationButton.FinishChecking.text,title:"Finish Checking",style:"width: 100%;margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.FinishChecking.instance=this},onClick:c}]},{type:"vbox",id:"rightCol_col__right", -widths:["50%","50%","50%"],children:[{type:"button",id:"IgnoreWord",label:a.LocalizationButton.IgnoreWord.text,title:"Ignore word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.IgnoreWord.instance=this},onClick:c},{type:"button",id:"IgnoreAllWords",label:a.LocalizationButton.IgnoreAllWords.text,title:"Ignore all words",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.IgnoreAllWords.instance= -this},onClick:c},{type:"button",id:"option",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){a.LocalizationButton.Options.instance=this;"file:"==document.location.protocol&&this.disable()},onClick:function(){"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):b.openDialog("options")}}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().hide()}, -onHide:l,children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",setup:function(){this.getChild()[0].getElement().$.src=a.logotype;this.getChild()[0].getElement().getParent().setStyles({"text-align":"center"})},children:[{type:"html",id:"logo",html:'WebSpellChecker.net'}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox", -id:"rightCol_col__left",children:[{type:"button",id:"Option_button",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);"file:"==document.location.protocol&&this.disable()},onClick:function(){"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):b.openDialog("options")}},{type:"button",id:"FinishChecking",label:a.LocalizationButton.FinishChecking.text, -title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]}]},{id:"GrammTab",label:"Grammar",accessKey:"G",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"
    "},{type:"html",id:"Content",label:"GrammarContent",html:"",setup:function(){var b=a.iframeNumber+"_"+a.dialog._.currentTabId,c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"vbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;", -children:[{type:"hbox",id:"leftCol",widths:["66%","34%"],children:[{type:"vbox",children:[{type:"text",id:"text",label:"Change to:",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",inputStyle:"float: right; width: 200px;","default":"",onShow:function(){a.textNode.GrammTab=this},onHide:function(){this.reset()}},{type:"html",id:"html_text",html:"
    ", -onShow:function(){a.textNodeInfo.GrammTab=this}},{type:"html",id:"radio",html:"",onShow:function(){a.grammerSuggest=this}}]},{type:"vbox",children:[{type:"button",id:"ChangeTo",label:"Change to",title:"Change to",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c},{type:"button",id:"IgnoreWord",label:"Ignore word",title:"Ignore word",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)}, -onClick:c},{type:"button",id:"IgnoreAllWords",label:"Ignore Problem",title:"Ignore Problem",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c},{type:"button",id:"FinishChecking",label:"Finish Checking",title:"Finish Checking",style:"width: 133px; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;", -widths:["70%","30%"],onShow:function(){this.getElement().hide()},onHide:l,children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",children:[{type:"html",id:"logo",html:'WebSpellChecker.net',setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right", -width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"FinishChecking",label:"Finish Checking",title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]}]},{id:"Thesaurus",label:"Thesaurus",accessKey:"T",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"
    "},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(){var b=a.iframeNumber+"_"+a.dialog._.currentTabId, -c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"vbox",id:"bottomGroup",style:"width:560px; margin: -10px auto; overflow: hidden;",children:[{type:"hbox",widths:["75%","25%"],children:[{type:"vbox",children:[{type:"hbox",widths:["65%","35%"],children:[{type:"text",id:"ChangeTo",label:"Change to:",labelLayout:"horizontal",inputStyle:"width: 160px;",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onShow:function(){a.textNode.Thesaurus=this},onHide:function(){this.reset()}}, -{type:"button",id:"ChangeTo",label:"Change to",title:"Change to",style:"width: 121px; margin-top: 1px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]},{type:"hbox",children:[{type:"select",id:"categories",label:"Categories:",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",items:[],onShow:function(){a.selectNode.categories=this},onHide:function(){this.clear()},onChange:function(){a.buildOptionSynonyms(this.getValue())}}, -{type:"select",id:"synonyms",label:"Synonyms:",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",items:[],onShow:function(){a.selectNode.synonyms=this;a.textNode.Thesaurus.setValue(this.getValue())},onHide:function(){this.clear()},onChange:function(){a.textNode.Thesaurus.setValue(this.getValue())}}]}]},{type:"vbox",width:"120px",style:"margin-top:46px;",children:[{type:"html",id:"logotype",label:"WebSpellChecker.net",html:'WebSpellChecker.net', -setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}},{type:"button",id:"FinishChecking",label:"Finish Checking",title:"Finish Checking",style:"width: 121px; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().hide()},children:[{type:"hbox", -id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",children:[{type:"html",id:"logo",html:'WebSpellChecker.net',setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"FinishChecking", -label:"Finish Checking",title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]}]}]}});CKEDITOR.dialog.add("options",function(){var b=null,c={},d={},f=null,g=null;e.cookie.get("udn");e.cookie.get("osp");var h=function(){g=this.getElement().getAttribute("title-cmd");var a=[];a[0]=d.IgnoreAllCapsWords;a[1]=d.IgnoreWordsNumbers;a[2]=d.IgnoreMixedCaseWords;a[3]=d.IgnoreDomainNames;a=a.toString().replace(/,/g,"");e.cookie.set("osp", -a);e.cookie.set("udnCmd",g?g:"ignore");"delete"!=g&&(a="",""!==j.getValue()&&(a=j.getValue()),e.cookie.set("udn",a));e.postMessage.send({id:"options_dic_send"})},i=function(){f.getElement().setHtml(a.LocalizationComing.error);f.getElement().show()};return{title:a.LocalizationComing.Options,minWidth:430,minHeight:130,resizable:CKEDITOR.DIALOG_RESIZE_NONE,contents:[{id:"OptionsTab",label:"Options",accessKey:"O",elements:[{type:"hbox",id:"options_error",children:[{type:"html",style:"display: block;text-align: center;white-space: normal!important; font-size: 12px;color:red", -html:"
    ",onShow:function(){f=this}}]},{type:"vbox",id:"Options_content",children:[{type:"hbox",id:"Options_manager",widths:["52%","48%"],children:[{type:"fieldset",label:"Spell Checking Options",style:"border: none;margin-top: 13px;padding: 10px 0 10px 10px",onShow:function(){this.getInputElement().$.children[0].innerHTML=a.LocalizationComing.SpellCheckingOptions},children:[{type:"vbox",id:"Options_checkbox",children:[{type:"checkbox",id:"IgnoreAllCapsWords",label:"Ignore All-Caps Words", -labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=!this.getValue()?0:1}},{type:"checkbox",id:"IgnoreWordsNumbers",label:"Ignore Words with Numbers",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=!this.getValue()?0:1}},{type:"checkbox", -id:"IgnoreMixedCaseWords",label:"Ignore Mixed-Case Words",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=!this.getValue()?0:1}},{type:"checkbox",id:"IgnoreDomainNames",label:"Ignore Domain Names",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]= -!this.getValue()?0:1}}]}]},{type:"vbox",id:"Options_DictionaryName",children:[{type:"text",id:"DictionaryName",style:"margin-bottom: 10px",label:"Dictionary Name:",labelLayout:"vertical",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onLoad:function(){j=this;this.setValue(a.userDictionaryName?a.userDictionaryName:(e.cookie.get("udn"),this.getValue()))},onShow:function(){j=this;this.setValue(!e.cookie.get("udn")?this.getValue():e.cookie.get("udn"));this.setLabel(a.LocalizationComing.DictionaryName)}, -onHide:function(){this.reset()}},{type:"hbox",id:"Options_buttons",children:[{type:"vbox",id:"Options_leftCol_col",widths:["50%","50%"],children:[{type:"button",id:"create",label:"Create",title:"Create",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Create)},onClick:h},{type:"button",id:"restore",label:"Restore",title:"Restore",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd", -this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Restore)},onClick:h}]},{type:"vbox",id:"Options_rightCol_col",widths:["50%","50%"],children:[{type:"button",id:"rename",label:"Rename",title:"Rename",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Rename)},onClick:h},{type:"button",id:"delete",label:"Remove",title:"Remove",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd", -this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Remove)},onClick:h}]}]}]}]},{type:"hbox",id:"Options_text",children:[{type:"html",style:"text-align: justify;margin-top: 15px;white-space: normal!important; font-size: 12px;color:#777;",html:"
    "+a.LocalizationComing.OptionsTextIntro+"
    ",onShow:function(){this.getElement().setText(a.LocalizationComing.OptionsTextIntro)}}]}]}]}],buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton],onOk:function(){var a=[]; -a[0]=d.IgnoreAllCapsWords;a[1]=d.IgnoreWordsNumbers;a[2]=d.IgnoreMixedCaseWords;a[3]=d.IgnoreDomainNames;a=a.toString().replace(/,/g,"");e.cookie.set("osp",a);e.cookie.set("udn",j.getValue());e.postMessage.send({id:"options_checkbox_send"});f.getElement().hide();f.getElement().setHtml(" ")},onLoad:function(){b=this;e.postMessage.init(i);c.IgnoreAllCapsWords=b.getContentElement("OptionsTab","IgnoreAllCapsWords");c.IgnoreWordsNumbers=b.getContentElement("OptionsTab","IgnoreWordsNumbers");c.IgnoreMixedCaseWords= -b.getContentElement("OptionsTab","IgnoreMixedCaseWords");c.IgnoreDomainNames=b.getContentElement("OptionsTab","IgnoreDomainNames")},onShow:function(){var b=e.cookie.get("osp").split("");d.IgnoreAllCapsWords=b[0];d.IgnoreWordsNumbers=b[1];d.IgnoreMixedCaseWords=b[2];d.IgnoreDomainNames=b[3];!parseInt(d.IgnoreAllCapsWords,10)?c.IgnoreAllCapsWords.setValue("",!1):c.IgnoreAllCapsWords.setValue("checked",!1);!parseInt(d.IgnoreWordsNumbers,10)?c.IgnoreWordsNumbers.setValue("",!1):c.IgnoreWordsNumbers.setValue("checked", -!1);!parseInt(d.IgnoreMixedCaseWords,10)?c.IgnoreMixedCaseWords.setValue("",!1):c.IgnoreMixedCaseWords.setValue("checked",!1);!parseInt(d.IgnoreDomainNames,10)?c.IgnoreDomainNames.setValue("",!1):c.IgnoreDomainNames.setValue("checked",!1);d.IgnoreAllCapsWords=!c.IgnoreAllCapsWords.getValue()?0:1;d.IgnoreWordsNumbers=!c.IgnoreWordsNumbers.getValue()?0:1;d.IgnoreMixedCaseWords=!c.IgnoreMixedCaseWords.getValue()?0:1;d.IgnoreDomainNames=!c.IgnoreDomainNames.getValue()?0:1;c.IgnoreAllCapsWords.getElement().$.lastChild.innerHTML= -a.LocalizationComing.IgnoreAllCapsWords;c.IgnoreWordsNumbers.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreWordsWithNumbers;c.IgnoreMixedCaseWords.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreMixedCaseWords;c.IgnoreDomainNames.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreDomainNames}}});CKEDITOR.dialog.on("resize",function(b){var b=b.data,c=b.dialog,d=CKEDITOR.document.getById(a.iframeNumber+"_"+c._.currentTabId);"checkspell"==c._.name&&(a.bnr?d&& -d.setSize("height",b.height-310):d&&d.setSize("height",b.height-220))});CKEDITOR.on("dialogDefinition",function(b){var c=b.data.definition;a.onLoadOverlay=new q({opacity:"1",background:"#fff",target:c.dialog.parts.tabs.getParent().$});a.onLoadOverlay.setEnable();c.dialog.on("show",function(){});c.dialog.on("cancel",function(){c.dialog.getParentEditor().config.wsc_onClose.call(this.document.getWindow().getFrame());a.div_overlay.setDisable();return!1},this,null,-1)})})(); \ No newline at end of file +(function(){function z(a){return a&&a.domId&&a.getInputElement().$?a.getInputElement():a&&a.$?a:!1}function I(a){if(!a)throw"Languages-by-groups list are required for construct selectbox";var c=[],e="",d;for(d in a)for(var f in a[d]){var h=a[d][f];"en_US"==h?e=h:c.push(h)}c.sort();e&&c.unshift(e);return{getCurrentLangGroup:function(c){a:{for(var d in a)for(var e in a[d])if(e.toUpperCase()===c.toUpperCase()){c=d;break a}c=""}return c},setLangList:function(){var c={},d;for(d in a)for(var e in a[d])c[a[d][e]]= +e;return c}()}}var g=function(){var a=function(a,b,d){d=d||{};var f=d.expires;if("number"==typeof f&&f){var h=new Date;h.setTime(h.getTime()+1E3*f);f=d.expires=h}f&&f.toUTCString&&(d.expires=f.toUTCString());b=encodeURIComponent(b);a=a+"\x3d"+b;for(var k in d)b=d[k],a+="; "+k,!0!==b&&(a+="\x3d"+b);document.cookie=a};return{postMessage:{init:function(a){window.addEventListener?window.addEventListener("message",a,!1):window.attachEvent("onmessage",a)},send:function(a){var b=Object.prototype.toString, +d=a.fn||null,f=a.id||"",h=a.target||window,k=a.message||{id:f};a.message&&"[object Object]"==b.call(a.message)&&(a.message.id?a.message.id:a.message.id=f,k=a.message);a=window.JSON.stringify(k,d);h.postMessage(a,"*")},unbindHandler:function(a){window.removeEventListener?window.removeEventListener("message",a,!1):window.detachEvent("onmessage",a)}},hash:{create:function(){},parse:function(){}},cookie:{set:a,get:function(a){return(a=document.cookie.match(new RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, +"\\$1")+"\x3d([^;]*)")))?decodeURIComponent(a[1]):void 0},remove:function(c){a(c,"",{expires:-1})}},misc:{findFocusable:function(a){var b=null;a&&(b=a.find("a[href], area[href], input, select, textarea, button, *[tabindex], *[contenteditable]"));return b},isVisible:function(a){var b;(b=0===a.offsetWidth||0==a.offsetHeight)||(b="none"===(document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null).display:a.currentStyle?a.currentStyle.display:a.style.display)); +return!b},hasClass:function(a,b){return!(!a.className||!a.className.match(new RegExp("(\\s|^)"+b+"(\\s|$)")))}}}}(),a=a||{};a.TextAreaNumber=null;a.load=!0;a.cmd={SpellTab:"spell",Thesaurus:"thes",GrammTab:"grammar"};a.dialog=null;a.optionNode=null;a.selectNode=null;a.grammerSuggest=null;a.textNode={};a.iframeMain=null;a.dataTemp="";a.div_overlay=null;a.textNodeInfo={};a.selectNode={};a.selectNodeResponce={};a.langList=null;a.langSelectbox=null;a.banner="";a.show_grammar=null;a.div_overlay_no_check= +null;a.targetFromFrame={};a.onLoadOverlay=null;a.LocalizationComing={};a.OverlayPlace=null;a.sessionid="";a.LocalizationButton={ChangeTo_button:{instance:null,text:"Change to",localizationID:"ChangeTo"},ChangeAll:{instance:null,text:"Change All"},IgnoreWord:{instance:null,text:"Ignore word"},IgnoreAllWords:{instance:null,text:"Ignore all words"},Options:{instance:null,text:"Options",optionsDialog:{instance:null}},AddWord:{instance:null,text:"Add word"},FinishChecking_button:{instance:null,text:"Finish Checking", +localizationID:"FinishChecking"},FinishChecking_button_block:{instance:null,text:"Finish Checking",localizationID:"FinishChecking"}};a.LocalizationLabel={ChangeTo_label:{instance:null,text:"Change to",localizationID:"ChangeTo"},Suggestions:{instance:null,text:"Suggestions"},Categories:{instance:null,text:"Categories"},Synonyms:{instance:null,text:"Synonyms"}};var J=function(b){var c,e,d;for(d in b)c=(c=a.dialog.getContentElement(a.dialog._.currentTabId,d))?c.getElement():b[d].instance.getElement().getFirst()|| +b[d].instance.getElement(),e=b[d].localizationID||d,c.setText(a.LocalizationComing[e])},K=function(b){var c,e,d;for(d in b)c=a.dialog.getContentElement(a.dialog._.currentTabId,d),c||(c=b[d].instance),c.setLabel&&(e=b[d].localizationID||d,c.setLabel(a.LocalizationComing[e]+":"))},r,A;a.framesetHtml=function(b){return"\x3ciframe id\x3d"+a.iframeNumber+"_"+b+' frameborder\x3d"0" allowtransparency\x3d"1" style\x3d"width:100%;border: 1px solid #AEB3B9;overflow: auto;background:#fff; border-radius: 3px;"\x3e\x3c/iframe\x3e'}; +a.setIframe=function(b,c){var e;e=a.framesetHtml(c);var d=a.iframeNumber+"_"+c;b.getElement().setHtml(e);e=document.getElementById(d);e=e.contentWindow?e.contentWindow:e.contentDocument.document?e.contentDocument.document:e.contentDocument;e.document.open();e.document.write('\x3c!DOCTYPE html\x3e\x3chtml\x3e\x3chead\x3e\x3cmeta charset\x3d"UTF-8"\x3e\x3ctitle\x3eiframe\x3c/title\x3e\x3cstyle\x3ehtml,body{margin: 0;height: 100%;font: 13px/1.555 "Trebuchet MS", sans-serif;}a{color: #888;font-weight: bold;text-decoration: none;border-bottom: 1px solid #888;}.main-box {color:#252525;padding: 3px 5px;text-align: justify;}.main-box p{margin: 0 0 14px;}.main-box .cerr{color: #f00000;border-bottom-color: #f00000;}\x3c/style\x3e\x3c/head\x3e\x3cbody\x3e\x3cdiv id\x3d"content" class\x3d"main-box"\x3e\x3c/div\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"spelltext" name\x3d"spelltext" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadsuggestfirst" name\x3d"loadsuggestfirst" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadspellsuggestall" name\x3d"loadspellsuggestall" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadOptionsForm" name\x3d"loadOptionsForm" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3cscript\x3e(function(window) {var ManagerPostMessage \x3d function() {var _init \x3d function(handler) {if (document.addEventListener) {window.addEventListener("message", handler, false);} else {window.attachEvent("onmessage", handler);};};var _sendCmd \x3d function(o) {var str,type \x3d Object.prototype.toString,fn \x3d o.fn || null,id \x3d o.id || "",target \x3d o.target || window,message \x3d o.message || { "id": id };if (o.message \x26\x26 type.call(o.message) \x3d\x3d "[object Object]") {(o.message["id"]) ? o.message["id"] : o.message["id"] \x3d id;message \x3d o.message;};str \x3d JSON.stringify(message, fn);target.postMessage(str, "*");};return {init: _init,send: _sendCmd};};var manageMessageTmp \x3d new ManagerPostMessage;var appString \x3d (function(){var spell \x3d parent.CKEDITOR.config.wsc.DefaultParams.scriptPath;var serverUrl \x3d parent.CKEDITOR.config.wsc.DefaultParams.serviceHost;return serverUrl + spell;})();function loadScript(src, callback) {var scriptTag \x3d document.createElement("script");scriptTag.type \x3d "text/javascript";callback ? callback : callback \x3d function() {};if(scriptTag.readyState) {scriptTag.onreadystatechange \x3d function() {if (scriptTag.readyState \x3d\x3d "loaded" ||scriptTag.readyState \x3d\x3d "complete") {scriptTag.onreadystatechange \x3d null;setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();}};}else{scriptTag.onload \x3d function() {setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();};};scriptTag.src \x3d src;document.getElementsByTagName("head")[0].appendChild(scriptTag);};window.onload \x3d function(){loadScript(appString, function(){manageMessageTmp.send({"id": "iframeOnload","target": window.parent});});}})(this);\x3c/script\x3e\x3c/body\x3e\x3c/html\x3e'); +e.document.close()};a.setCurrentIframe=function(b){a.setIframe(a.dialog._.contents[b].Content,b)};a.setHeightBannerFrame=function(){var b=a.dialog.getContentElement("SpellTab","banner").getElement(),c=a.dialog.getContentElement("GrammTab","banner").getElement(),e=a.dialog.getContentElement("Thesaurus","banner").getElement();b.setStyle("height","90px");c.setStyle("height","90px");e.setStyle("height","90px")};a.setHeightFrame=function(){document.getElementById(a.iframeNumber+"_"+a.dialog._.currentTabId).style.height= +"240px"};a.sendData=function(b){var c=b._.currentTabId,e=b._.contents[c].Content,d,f;a.previousTab=c;a.setIframe(e,c);var h=function(h){c=b._.currentTabId;h=h||window.event;h.data.getTarget().is("a")&&c!==a.previousTab&&(a.previousTab=c,e=b._.contents[c].Content,d=a.iframeNumber+"_"+c,a.div_overlay.setEnable(),e.getElement().getChildCount()?E(a.targetFromFrame[d],a.cmd[c]):(a.setIframe(e,c),f=document.getElementById(d),a.targetFromFrame[d]=f.contentWindow))};b.parts.tabs.removeListener("click",h); +b.parts.tabs.on("click",h)};a.buildSelectLang=function(a){var c=new CKEDITOR.dom.element("div"),e=new CKEDITOR.dom.element("select");a="wscLang"+a;c.addClass("cke_dialog_ui_input_select");c.setAttribute("role","presentation");c.setStyles({height:"auto",position:"absolute",right:"0",top:"-1px",width:"160px","white-space":"normal"});e.setAttribute("id",a);e.addClass("cke_dialog_ui_input_select");e.setStyles({width:"160px"});c.append(e);return c};a.buildOptionLang=function(b,c){var e=document.getElementById("wscLang"+ +c),d=document.createDocumentFragment(),f,h,k=[];if(0===e.options.length){for(f in b)k.push([f,b[f]]);k.sort();for(var p=0;pm.width-D&&(e=m.width-D);if(gm.height-q&&(g=m.height-q);n.width=e+D;n.height=g+q;a._.fromResizeEvent=!1;a.resize(e,g);setTimeout(function(){a._.fromResizeEvent=!1;CKEDITOR.dialog.fire("resize",{dialog:a,width:e,height:g},b)},300)}a._.moved||(q=isNaN(c)&&isNaN(d)?0:1,isNaN(c)&&(c=(m.width-n.width)/2),0>c&&(c=0),c>m.width-n.width&&(c=m.width-n.width),isNaN(d)&&(d=(m.height-n.height)/2),0>d&&(d=0),d>m.height-n.height&&(d=m.height-n.height),a.move(c, +d,q))}function e(){b.wsc={};(function(a){var b={separator:"\x3c$\x3e",getDataType:function(a){return"undefined"===typeof a?"undefined":null===a?"null":Object.prototype.toString.call(a).slice(8,-1)},convertDataToString:function(a){return this.getDataType(a).toLowerCase()+this.separator+a},restoreDataFromString:function(a){var b=a,c;a=this.backCompatibility(a);if("string"===typeof a)switch(b=a.indexOf(this.separator),c=a.substring(0,b),b=a.substring(b+this.separator.length),c){case "boolean":b="true"=== +b;break;case "number":b=parseFloat(b);break;case "array":b=""===b?[]:b.split(",");break;case "null":b=null;break;case "undefined":b=void 0}return b},backCompatibility:function(a){var b=a,c;"string"===typeof a&&(c=a.indexOf(this.separator),0>c&&(b=parseFloat(a),isNaN(b)&&("["===a[0]&&"]"===a[a.length-1]?(a=a.replace("[",""),a=a.replace("]",""),b=""===a?[]:a.split(",")):b="true"===a||"false"===a?"true"===a:a),b=this.convertDataToString(b)));return b}},c={get:function(a){return b.restoreDataFromString(window.localStorage.getItem(a))}, +set:function(a,c){var d=b.convertDataToString(c);window.localStorage.setItem(a,d)},del:function(a){window.localStorage.removeItem(a)},clear:function(){window.localStorage.clear()}},d={expiration:31622400,get:function(a){return b.restoreDataFromString(this.getCookie(a))},set:function(a,c){var d=b.convertDataToString(c);this.setCookie(a,d,{expires:this.expiration})},del:function(a){this.deleteCookie(a)},getCookie:function(a){return(a=document.cookie.match(new RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, +"\\$1")+"\x3d([^;]*)")))?decodeURIComponent(a[1]):void 0},setCookie:function(a,b,c){c=c||{};var d=c.expires;if("number"===typeof d&&d){var e=new Date;e.setTime(e.getTime()+1E3*d);d=c.expires=e}d&&d.toUTCString&&(c.expires=d.toUTCString());b=encodeURIComponent(b);a=a+"\x3d"+b;for(var h in c)b=c[h],a+="; "+h,!0!==b&&(a+="\x3d"+b);document.cookie=a},deleteCookie:function(a){this.setCookie(a,null,{expires:-1})},clear:function(){for(var a=document.cookie.split(";"),b=0;b