Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop
19
.gitattributes
vendored
@ -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
|
||||
|
||||
26
.travis.yml
@ -109,6 +109,12 @@ install:
|
||||
echo
|
||||
|
||||
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"
|
||||
phpenv config-add /tmp/xdebug.ini
|
||||
@ -149,7 +155,7 @@ before_script:
|
||||
mysql -e "SELECT VERSION();"
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
- |
|
||||
echo "Setting up database"
|
||||
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
|
||||
@ -166,8 +172,8 @@ before_script:
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Setting up Dolibarr"
|
||||
export CONF_FILE=htdocs/conf/conf.php
|
||||
echo "Setting up Dolibarr $CONF_FILE"
|
||||
echo '<?php ' > $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
|
||||
@ -184,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
|
||||
@ -269,12 +269,19 @@ 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
|
||||
php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log
|
||||
php upgrade2.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400-2.log
|
||||
php step5.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400-3.log
|
||||
cd -
|
||||
set +e
|
||||
echo
|
||||
@ -306,3 +313,4 @@ after_failure:
|
||||
fi
|
||||
|
||||
after_script:
|
||||
|
||||
|
||||
@ -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
|
||||
<pre>
|
||||
|
||||
@ -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
|
||||
|
||||
227
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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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",
|
||||
|
||||
1128
composer.lock
generated
@ -124,7 +124,7 @@
|
||||
<!-- Tweaks to metrics -->
|
||||
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="complexity" value="80" />
|
||||
<property name="complexity" value="120" />
|
||||
<property name="absoluteComplexity" value="250" />
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
@ -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
|
||||
|
||||
BIN
dev/initdata/img/applepieproduct.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
dev/initdata/img/dolidroid_114x114.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
dev/initdata/img/dolidroid_512x512_en.png
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
dev/initdata/img/dolidroid_screenshot_home_720x1280.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
dev/initdata/img/genericcustomer.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
dev/initdata/img/indiancompany.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
dev/initdata/img/logo_nltechno_94x100.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
dev/initdata/img/nocountrycomp.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
dev/initdata/img/pearpieproduct.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
dev/initdata/img/pinkdressproduct.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 20 KiB |
BIN
dev/initdata/img/rolluproduct.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
dev/initdata/img/spanishcompany.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
dev/initdata/img/swisstouch.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
dev/initdata/img/teclibcompany.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -53,11 +53,16 @@ class modMyModule extends DolibarrModules
|
||||
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
|
||||
// It is used to group modules in module setup page
|
||||
$this->family = "other";
|
||||
// Module position in the family
|
||||
$this->module_position = 500;
|
||||
// Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
||||
$this->familyinfo = array('myownfamily' => array('position' => '001', 'label' => $langs->trans("MyOwnFamily")));
|
||||
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->description = "Description of module MyModule";
|
||||
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
||||
$this->version = '1.0';
|
||||
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
||||
@ -174,8 +179,8 @@ class modMyModule extends DolibarrModules
|
||||
|
||||
// Cronjobs
|
||||
$this->cronjobs = array(); // List of cron jobs entries to add
|
||||
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600),
|
||||
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600)
|
||||
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600),
|
||||
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24)
|
||||
// );
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -7,13 +7,15 @@
|
||||
# Usage: txpush.sh (source|xx_XX) [-r dolibarr.file] [-f]
|
||||
#------------------------------------------------------
|
||||
|
||||
export project='dolibarr'
|
||||
|
||||
# Syntax
|
||||
if [ "x$1" = "x" ]
|
||||
then
|
||||
echo "This push local files to transifex."
|
||||
echo "This push local files to transifex for project $project."
|
||||
echo "Note: If you push a language file (not source), file will be skipped if transifex file is newer."
|
||||
echo " Using -f will overwrite translation but not memory."
|
||||
echo "Usage: ./dev/translation/txpush.sh (source|xx_XX) [-r dolibarr.file] [-f] [--no-interactive]"
|
||||
echo "Usage: ./dev/translation/txpush.sh (source|xx_XX|all) [-r dolibarr.file] [-f] [--no-interactive]"
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -28,11 +30,24 @@ then
|
||||
echo "tx push -s $2 $3"
|
||||
tx push -s $2 $3
|
||||
else
|
||||
for file in `find htdocs/langs/$1/*.lang -type f`
|
||||
do
|
||||
echo $file
|
||||
export basefile=`basename $file | sed -s s/\.lang//g`
|
||||
echo "tx push --skip -r dolibarr.$basefile -t -l $1 $2 $3 $4"
|
||||
tx push --skip -r dolibarr.$basefile -t -l $1 $2 $3 $4
|
||||
done
|
||||
if [ "x$1" = "xall" ]
|
||||
then
|
||||
for dir in `find htdocs/langs/* -type d`
|
||||
do
|
||||
shortdir=`basename $dir`
|
||||
file=$3
|
||||
echo $file
|
||||
export basefile=`basename $file | sed -s s/\.lang//g`
|
||||
echo "tx push --skip -t -l $shortdir $2 $3 $4"
|
||||
tx push --skip -t -l $shortdir $2 $3 $4
|
||||
done
|
||||
else
|
||||
for file in `find htdocs/langs/$1/*.lang -type f`
|
||||
do
|
||||
echo $file
|
||||
export basefile=`basename $file | sed -s s/\.lang//g`
|
||||
echo "tx push --skip -r $project.$basefile -t -l $1 $2 $3 $4"
|
||||
tx push --skip -r $project.$basefile -t -l $1 $2 $3 $4
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
3
htdocs/.gitignore
vendored
@ -20,4 +20,5 @@
|
||||
/allscreens*
|
||||
/ecommerce/
|
||||
/cabinetmed*
|
||||
/conf/conf.php
|
||||
/conf/conf.php
|
||||
/webmail*
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -148,14 +148,14 @@ if ($action == 'create')
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
|
||||
|
||||
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||
print '<td><input name="account_number" size="30" value="' . $accounting->account_number . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td>';
|
||||
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
||||
print '<td><input name="label" size="70" value="' . $accounting->label . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>';
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent');
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
print '<td>';
|
||||
@ -204,13 +204,13 @@ else if ($id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
|
||||
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||
print '<td><input name="account_number" size="30" value="' . $accounting->account_number . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td>';
|
||||
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
||||
print '<td><input name="label" size="70" value="' . $accounting->label . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>';
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent');
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -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='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup');
|
||||
@ -262,6 +275,22 @@ foreach ($list as $key)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
foreach ($list_account as $key)
|
||||
{
|
||||
$var=!$var;
|
||||
|
||||
print '<tr '.$bc[$var].' class="value">';
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td><label for="'.$key.'">'.$label.'</label></td>';
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td width="80%">' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
||||
|
||||
@ -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 .= '<div><font color="green">' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
|
||||
$msg .= '<div><font color="green">' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '</font></div>';
|
||||
} else {
|
||||
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $accounting->account_number . '<br/> <pre>' . $sql . '</pre></font></div>';
|
||||
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '<br/> <pre>' . $sql . '</pre></font></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 '<script type="text/javascript">
|
||||
$(function () {
|
||||
$(\'#select-all\').click(function(event) {
|
||||
@ -209,7 +204,7 @@ $sql .= " WHERE (";
|
||||
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') {
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') {
|
||||
$sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL";
|
||||
$sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN
|
||||
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
|
||||
@ -241,28 +236,29 @@ if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
||||
|
||||
print load_fiche_titre($langs->trans("InitAccountancy"),'','title_setup');
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("InitAccountancyDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('OptionMode') . '</td><td>' . $langs->trans('Description') . '</td>';
|
||||
print '<td>' . $langs->trans('Options') . '</td><td>' . $langs->trans('Description') . '</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr ' . $bc[false] . '><td width="200"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"' . ($accounting_product_mode != 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('Accountancy_code_sell') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductSell'));
|
||||
print '<tr ' . $bc[false] . '><td width="25%"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"' . ($accounting_product_mode != 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductSell') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductSellDesc'));
|
||||
print "</td></tr>\n";
|
||||
print '<tr ' . $bc[true] . '><td width="200"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('Accountancy_code_buy') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductBuy')) . "</td></tr>\n";
|
||||
print '<tr ' . $bc[true] . '><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductBuy') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductBuyDesc')) . "</td></tr>\n";
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print '<br /><div style="text-align:center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="changetype"></div>';
|
||||
print '<br /><div align="right"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="changetype"></div>';
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
@ -270,33 +266,29 @@ if ($result) {
|
||||
print $msg;
|
||||
}
|
||||
|
||||
// print '<td align="left"><b>' . $langs->trans("DescProductAccountingAccount") . '</b></td> ';
|
||||
// print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"], "p.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print ' ';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
/*
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
print '<th align="left">' . $langs->trans("Accountancy_code_buy") . '</td>';
|
||||
print '<th align="left">' . $langs->trans("Accountancy_code_buy_suggest") . '</td>';
|
||||
print_liste_field_titre($langs->trans("Accountancy_code_buy"));
|
||||
} else {
|
||||
print '<th align="left">' . $langs->trans("Accountancy_code_sell") . '</td>';
|
||||
print '<th align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>';
|
||||
print_liste_field_titre($langs->trans("Accountancy_code_sell"));
|
||||
}
|
||||
// print_liste_field_titre('');
|
||||
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label> / <label id="unselect-all">' . $langs->trans('None') . '</label>');
|
||||
*/
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"));
|
||||
print_liste_field_titre($langs->trans("Modify") . '<br><label id="select-all">' . $langs->trans('All') . '</label> / <label id="unselect-all">' . $langs->trans('None') . '</label>','','','','','align="center"');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_ref" value="' . $search_ref . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . $search_ref . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="30" name="search_desc" value="' . $search_desc . '"></td>';
|
||||
|
||||
print '<td class="liste_titre" colspan="2"> </td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<td class=liste_titre"> </td>';
|
||||
print '<td align="center" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
@ -349,13 +341,13 @@ if ($result) {
|
||||
// TODO ADJUST DESCRIPTION SIZE
|
||||
// print '<td align="left">' . $obj->description . '</td>';
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 64;
|
||||
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
|
||||
|
||||
// acountingaccount buy
|
||||
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
print '<td align="left">' . $obj->accountancy_code_buy . '</td>';
|
||||
// Accounting account buy
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY')
|
||||
{
|
||||
// print '<td align="left">' . $obj->accountancy_code_buy . '</td>';
|
||||
// TODO: replace by select
|
||||
// print '<td align="left">' . $compta_prodbuy . '</td>';
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
@ -363,10 +355,11 @@ if ($result) {
|
||||
print '<td align="left">';
|
||||
print $form->select_account($compta_prodbuy_id, 'codeventil_'.$product_static->id, 1);
|
||||
print '</td>';
|
||||
} else {
|
||||
|
||||
// acountingaccount sel
|
||||
print '<td align="left">' . $obj->accountancy_code_sell . '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
// Accounting account sell
|
||||
// print '<td align="left">' . $obj->accountancy_code_sell . '</td>';
|
||||
// TODO: replace by select
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
||||
@ -383,7 +376,7 @@ if ($result) {
|
||||
$i ++;
|
||||
}
|
||||
print '</table>';
|
||||
print '<br><div align="center"><input type="submit" class="butAction" name="changeaccount" value="' . $langs->trans("Change_Account") . '"></div>';
|
||||
print '<br><div align="right"><input type="submit" class="butAction" name="changeaccount" value="' . $langs->trans("Validate") . '"></div>';
|
||||
print '</form>';
|
||||
|
||||
$db->free($result);
|
||||
|
||||
@ -27,6 +27,7 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
@ -41,12 +42,24 @@ $piece_num = GETPOST("piece_num");
|
||||
|
||||
$mesg = '';
|
||||
|
||||
$numero_compte = GETPOST('numero_compte');
|
||||
$account_number = GETPOST('account_number');
|
||||
$code_tiers = GETPOST('code_tiers');
|
||||
if ($code_tiers==-1) {
|
||||
$code_tiers=null;
|
||||
}
|
||||
$label_compte = GETPOST('label_compte');
|
||||
$debit = price2num(GETPOST('debit'));
|
||||
$credit = price2num(GETPOST('credit'));
|
||||
|
||||
$save=GETPOST('save');
|
||||
if (!empty($save)) {
|
||||
$action='add';
|
||||
}
|
||||
$update=GETPOST('update');
|
||||
if (!empty($update)) {
|
||||
$action='confirm_update';
|
||||
}
|
||||
|
||||
if ($action == "confirm_update") {
|
||||
|
||||
$error = 0;
|
||||
@ -63,7 +76,7 @@ if ($action == "confirm_update") {
|
||||
if ($result < 0) {
|
||||
setEventMessages($book->error, $book->errors, 'errors');
|
||||
} else {
|
||||
$book->numero_compte = $numero_compte;
|
||||
$book->numero_compte = $account_number;
|
||||
$book->code_tiers = $code_tiers;
|
||||
$book->label_compte = $label_compte;
|
||||
$book->debit = $debit;
|
||||
@ -92,15 +105,15 @@ if ($action == "confirm_update") {
|
||||
else if ($action == "add") {
|
||||
$error = 0;
|
||||
|
||||
if ((intval($debit) != 0) && (intval($credit) != 0)) {
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0)) {
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$book = new BookKeeping($db);
|
||||
|
||||
$book->numero_compte = $numero_compte;
|
||||
$book->numero_compte = $account_number;
|
||||
$book->code_tiers = $code_tiers;
|
||||
$book->label_compte = $label_compte;
|
||||
$book->debit = $debit;
|
||||
@ -113,11 +126,12 @@ else if ($action == "add") {
|
||||
$book->fk_doc = GETPOST('fk_doc');
|
||||
$book->fk_docdet = GETPOST('fk_docdet');
|
||||
|
||||
if (! empty($debit)) {
|
||||
if (floatval($debit) != 0.0) {
|
||||
$book->montant = $debit;
|
||||
$book->sens = 'D';
|
||||
}
|
||||
if (! empty($credit)) {
|
||||
|
||||
if (floatval($credit) != 0.0) {
|
||||
$book->montant = $credit;
|
||||
$book->sens = 'C';
|
||||
}
|
||||
@ -179,6 +193,7 @@ else if ($action == "confirm_create") {
|
||||
llxHeader();
|
||||
|
||||
$html = new Form($db);
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
/*
|
||||
* Confirmation to delete the command
|
||||
@ -198,6 +213,18 @@ if ($action == 'create') {
|
||||
$conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL => $conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL,
|
||||
$conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL => $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL
|
||||
);
|
||||
|
||||
$sql = 'SELECT DISTINCT accountancy_journal FROM '.MAIN_DB_PREFIX.'bank_account WHERE clos=0';
|
||||
$resql=$db->query($sql);
|
||||
if (!$resql) {
|
||||
setEventMessages($db->lasterror,null,'errors');
|
||||
} else {
|
||||
while ($obj_bank=$db->fetch_object($resql)) {
|
||||
if (!empty($obj_bank->accountancy_journal)) {
|
||||
$code_journal_array[$obj_bank->accountancy_journal]=$obj_bank->accountancy_journal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$book = new BookKeeping($db);
|
||||
$next_num_mvt = $book->getNextNumMvt();
|
||||
@ -281,9 +308,21 @@ if ($action == 'create') {
|
||||
} else {
|
||||
|
||||
print load_fiche_titre($langs->trans("ListeMvts"));
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">';
|
||||
print '<input type="hidden" name="doc_date" value="' . $book->doc_date . '">' . "\n";
|
||||
print '<input type="hidden" name="doc_type" value="' . $book->doc_type . '">' . "\n";
|
||||
print '<input type="hidden" name="doc_ref" value="' . $book->doc_ref . '">' . "\n";
|
||||
print '<input type="hidden" name="code_journal" value="' . $book->code_journal . '">' . "\n";
|
||||
print '<input type="hidden" name="fk_doc" value="' . $book->fk_doc . '">' . "\n";
|
||||
print '<input type="hidden" name="fk_docdet" value="' . $book->fk_docdet . '">' . "\n";
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
if (count($book->linesmvt) > 0) {
|
||||
|
||||
$total_debit=0;
|
||||
$total_credit=0;
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print_liste_field_titre($langs->trans("Numerocompte"));
|
||||
@ -301,21 +340,26 @@ if ($action == 'create') {
|
||||
$var = ! $var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
$total_debit+=$line->debit;
|
||||
$total_credit+=$line->credit;
|
||||
|
||||
if ($action == 'update' && $line->id == $id) {
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">';
|
||||
print '<input type="hidden" name="id" value="' . $line->id . '">' . "\n";
|
||||
print '<input type="hidden" name="action" value="confirm_update">' . "\n";
|
||||
print '<td><input type="text" size="6" name="numero_compte" value="' . $line->numero_compte . '"/></td>';
|
||||
print '<td><input type="text" size="15" name="code_tiers" value="' . $line->code_tiers . '"/></td>';
|
||||
|
||||
print '<td>';
|
||||
print $formventilation->select_account($line->numero_compte, 'account_number', 0, array (), 1, 1,'');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $formventilation->select_auxaccount($line->code_tiers, 'code_tiers',1);
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>';
|
||||
print '<td><input type="text" size="6" name="debit" value="' . price($line->debit) . '"/></td>';
|
||||
print '<td><input type="text" size="6" name="credit" value="' . price($line->credit) . '"/></td>';
|
||||
print '<td>' . $line->montant . '</td>';
|
||||
print '<td>' . $line->sens . '</td>';
|
||||
print '<td>';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">';
|
||||
print '</form>';
|
||||
print '<input type="hidden" name="id" value="' . $line->id . '">' . "\n";
|
||||
print '<input type="submit" class="button" name="update" value="' . $langs->trans("Update") . '">';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td>' . $line->numero_compte . '</td>';
|
||||
@ -327,10 +371,10 @@ if ($action == 'create') {
|
||||
print '<td>' . $line->sens . '</td>';
|
||||
|
||||
print '<td>';
|
||||
print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print img_edit();
|
||||
print '</a> ';
|
||||
print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
|
||||
@ -339,34 +383,32 @@ if ($action == 'create') {
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if ($total_debit!=$total_credit) {
|
||||
setEventMessages(null, array('MvtNotCorrectlyBalanced',$total_credit,$total_debit),'errors');
|
||||
}
|
||||
|
||||
if ($action == "" || $action == 'add') {
|
||||
$var = ! $var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">';
|
||||
print '<input type="hidden" name="action" value="add">' . "\n";
|
||||
print '<input type="hidden" name="doc_date" value="' . $book->doc_date . '">' . "\n";
|
||||
print '<input type="hidden" name="doc_type" value="' . $book->doc_type . '">' . "\n";
|
||||
print '<input type="hidden" name="doc_ref" value="' . $book->doc_ref . '">' . "\n";
|
||||
print '<input type="hidden" name="code_journal" value="' . $book->code_journal . '">' . "\n";
|
||||
print '<input type="hidden" name="fk_doc" value="' . $book->fk_doc . '">' . "\n";
|
||||
print '<input type="hidden" name="fk_docdet" value="' . $book->fk_docdet . '">' . "\n";
|
||||
print '<td><input type="text" size="6" name="numero_compte" value="' . $numero_compte . '"/></td>';
|
||||
print '<td><input type="text" size="15" name="code_tiers" value="' . $code_tiers . '"/></td>';
|
||||
print '<td>';
|
||||
print $formventilation->select_account($account_number, 'account_number', 0, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $formventilation->select_auxaccount($code_tiers, 'code_tiers',1);
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="15" name="label_compte" value="' . $label_compte . '"/></td>';
|
||||
print '<td><input type="text" size="6" name="debit" value="' . price($debit) . '"/></td>';
|
||||
print '<td><input type="text" size="6" name="credit" value="' . price($credit) . '"/></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td><input type="submit" class="button" value="' . $langs->trans("Save") . '"></td>';
|
||||
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print load_fiche_titre($langs->trans("NoRecords"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,18 +19,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/bookkeeping/list.php
|
||||
* \ingroup Accounting Expert
|
||||
* \brief List operation of book keeping
|
||||
* \file htdocs/accountancy/bookkeeping/list.php
|
||||
* \ingroup Accounting Expert
|
||||
* \brief List operation of book keeping
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
@ -44,7 +43,7 @@ $search_doc_ref = GETPOST("search_doc_ref");
|
||||
$search_account = GETPOST("search_account");
|
||||
$search_thirdparty = GETPOST("search_thirdparty");
|
||||
$search_journal = GETPOST("search_journal");
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
if ($sortorder == "")
|
||||
$sortorder = "ASC";
|
||||
@ -58,11 +57,11 @@ $formother = new FormOther($db);
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_doc_type="";
|
||||
$search_doc_ref="";
|
||||
$search_account="";
|
||||
$search_thirdparty="";
|
||||
$search_journal="";
|
||||
$search_piece_num = "";
|
||||
$search_doc_ref = "";
|
||||
$search_account = "";
|
||||
$search_thirdparty = "";
|
||||
$search_journal = "";
|
||||
}
|
||||
|
||||
/*
|
||||
@ -80,8 +79,7 @@ if ($action == 'delbookkeeping') {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($action == 'delbookkeepingyear') {
|
||||
} elseif ($action == 'delbookkeepingyear') {
|
||||
|
||||
$delyear = GETPOST('delyear', 'int');
|
||||
|
||||
@ -93,8 +91,7 @@ elseif ($action == 'delbookkeepingyear') {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($action == 'delbookkeepingyear') {
|
||||
} elseif ($action == 'delbookkeepingyear') {
|
||||
|
||||
$delyear = GETPOST('delyear', 'int');
|
||||
|
||||
@ -106,7 +103,7 @@ elseif ($action == 'delbookkeepingyear') {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}// Export
|
||||
} // Export
|
||||
else if ($action == 'export_csv') {
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
@ -118,19 +115,55 @@ else if ($action == 'export_csv') {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
foreach ( $object->linesexport as $line ) {
|
||||
print $line->id . ',';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $line->code_journal . '",';
|
||||
print '"' . $line->numero_compte . '",';
|
||||
print '"' . substr($line->code_journal, 0, 2) . '",';
|
||||
print '"' . substr($line->doc_ref, 0, 40) . '",';
|
||||
print '"' . $line->num_piece . '",';
|
||||
print '"' . $line->montant . '",';
|
||||
print '"' . $line->sens . '",';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $conf->currency . '",';
|
||||
print "\n";
|
||||
// Model classic Export
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) {
|
||||
|
||||
foreach ( $object->linesexport as $line ) {
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $line->code_journal . '",';
|
||||
print '"' . $line->numero_compte . '",';
|
||||
print '"' . substr($line->code_journal, 0, 2) . '",';
|
||||
print '"' . substr($line->doc_ref, 0, 40) . '",';
|
||||
print '"' . $line->num_piece . '",';
|
||||
print '"' . $line->debit . '",';
|
||||
print '"' . $line->credit . '",';
|
||||
print '"' . $conf->currency . '",';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
// Model cegid Export
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) {
|
||||
foreach ( $object->linesexport as $line ) {
|
||||
print $line->id . ',';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $line->code_journal . '",';
|
||||
print '"' . $line->numero_compte . '",';
|
||||
print '"' . substr($line->code_journal, 0, 2) . '",';
|
||||
print '"' . substr($line->doc_ref, 0, 40) . '",';
|
||||
print '"' . $line->num_piece . '",';
|
||||
print '"' . $line->montant . '",';
|
||||
print '"' . $line->sens . '",';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $conf->currency . '",';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
// Model Coala Export
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 3) {
|
||||
foreach ( $object->linesexport as $line ) {
|
||||
print $line->id . ',';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $line->code_journal . '",';
|
||||
print '"' . $line->numero_compte . '",';
|
||||
print '"' . substr($line->code_journal, 0, 2) . '",';
|
||||
print '"' . substr($line->doc_ref, 0, 40) . '",';
|
||||
print '"' . $line->num_piece . '",';
|
||||
print '"' . $line->montant . '",';
|
||||
print '"' . $line->sens . '",';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $conf->currency . '",';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,16 +171,16 @@ else {
|
||||
|
||||
llxHeader('', $langs->trans("Bookkeeping"));
|
||||
|
||||
/*
|
||||
* List
|
||||
*/
|
||||
/*
|
||||
* List
|
||||
*/
|
||||
|
||||
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
|
||||
|
||||
if (dol_strlen(trim($search_doc_type))) {
|
||||
|
||||
$sql .= " WHERE bk.doc_type LIKE '%" . $search_doc_type . "%'";
|
||||
$sql .= " WHERE bk.piece_num LIKE '%" . $search_piece_num . "%'";
|
||||
|
||||
if (dol_strlen(trim($search_doc_ref))) {
|
||||
$sql .= " AND bk.doc_ref LIKE '%" . $search_doc_ref . "%'";
|
||||
@ -177,20 +210,20 @@ else {
|
||||
print_barre_liste($langs->trans("Bookkeeping"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num);
|
||||
|
||||
/*print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="delbookkeeping">';
|
||||
|
||||
print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey'));
|
||||
|
||||
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||
|
||||
print '</form>';*/
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="delbookkeeping">';
|
||||
|
||||
print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey'));
|
||||
|
||||
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||
|
||||
print '</form>';*/
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="delbookkeepingyear">';
|
||||
|
||||
print $formother->select_year(GETPOST('delyear'),'delyear');
|
||||
print $formother->select_year(GETPOST('delyear'), 'delyear');
|
||||
|
||||
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||
|
||||
@ -204,7 +237,7 @@ else {
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Doctype"), $_SERVER['PHP_SELF'], "bk.doc_type", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("NumPiece"), $_SERVER['PHP_SELF'], "bk.piece_num", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "bk.doc_date", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "bk.doc_ref", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Numerocompte"), $_SERVER['PHP_SELF'], "bk.numero_compte", "", "", "", $sortfield, $sortorder);
|
||||
@ -215,12 +248,12 @@ else {
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "bk.code_journal", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"), $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||
print '<td><input type="text" name="search_doc_type" size="8" value="' . $search_doc_type . '"></td>';
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="GET">';
|
||||
print '<td><input type="text" name="search_doc_type" size="8" value="' . $search_piece_num . '"></td>';
|
||||
print '<td> </td>';
|
||||
print '<td><input type="text" name="search_doc_ref" size="8" value="' . $search_doc_ref . '"></td>';
|
||||
print '<td><input type="text" name="search_account" size="8" value="' . $search_account . '"></td>';
|
||||
@ -232,9 +265,9 @@ else {
|
||||
print '<td> </td>';
|
||||
print '<td><input type="text" name="search_journal" size="3" value="' . $search_journal . '"></td>';
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
print '</td>';
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
@ -247,7 +280,16 @@ else {
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<td>' . $obj->doc_type . '</td>';
|
||||
/* if ($old_piecenum!=$obj->piece_num) {
|
||||
$total_debit=0;
|
||||
$total_credit=0;
|
||||
} else {
|
||||
$total_debit+=$obj->debit;
|
||||
$total_credit+=$obj->credit;
|
||||
}
|
||||
*/
|
||||
|
||||
print '<td>' . $obj->piece_num . '</td>';
|
||||
print '<td align="center">' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
|
||||
print '<td>' . $obj->doc_ref . '</td>';
|
||||
print '<td>' . length_accountg($obj->numero_compte) . '</td>';
|
||||
@ -260,19 +302,23 @@ else {
|
||||
print '<td>' . $obj->code_journal . '</td>';
|
||||
print '<td align="center"><a href="./card.php?piece_num=' . $obj->piece_num . '">' . img_edit() . '</a></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
//$old_piecenum= $obj->piece_num;
|
||||
$i ++;
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="./card.php?action=create">'.$langs->trans("NewAccountingMvt").'</a>';
|
||||
print '<a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -36,7 +36,7 @@ $langs->load("accountancy");
|
||||
$page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
// Filter
|
||||
$year = GETPOST("year", 'int');
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -94,7 +94,7 @@ class FormVentilation extends Form
|
||||
* @param array $event Event options
|
||||
* @param int $select_in $selectid value is a aa.rowid (0 default) or aa.account_number (1)
|
||||
* @param int $select_out set value returned by select 0=rowid (default), 1=account_number
|
||||
* @param int $aabase set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by
|
||||
* @param int $aabase set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
||||
*
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
@ -126,7 +126,7 @@ class FormVentilation extends Form
|
||||
if ($num) {
|
||||
while ( $i < $num ) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$label = $obj->account_number . ' - ' . $obj->label;
|
||||
$label = length_accountg($obj->account_number) . ' - ' . $obj->label;
|
||||
$label = dol_trunc($label, $trunclength);
|
||||
if ($select_in == 0 ) $select_value_in = $obj->rowid;
|
||||
if ($select_in == 1 ) $select_value_in = $obj->account_number;
|
||||
@ -265,4 +265,81 @@ class FormVentilation extends Form
|
||||
$this->db->free($resql);
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of auxilary thirdparty accounts
|
||||
*
|
||||
* @param string $selectid Preselected pcg_type
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param array $event Event options
|
||||
*
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $event = array()) {
|
||||
global $conf;
|
||||
|
||||
$out = '';
|
||||
|
||||
$aux_account = array ();
|
||||
|
||||
// Auxiliary customer account
|
||||
$sql = "SELECT DISTINCT code_compta, nom ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe";
|
||||
$sql .= " ORDER BY code_compta";
|
||||
dol_syslog(get_class($this) . "::select_auxaccount", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
||||
if (! empty($obj->code_compta)) {
|
||||
$aux_account[$obj->code_compta] = $obj->code_compta . ' (' . $obj->nom . ')';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select_pcgsubtype " . $this->error, LOG_ERR);
|
||||
return - 1;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
// Auxiliary supplier account
|
||||
$sql = "SELECT DISTINCT code_compta_fournisseur, nom ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe";
|
||||
$sql .= " ORDER BY code_compta";
|
||||
dol_syslog(get_class($this) . "::select_auxaccount", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
||||
if (! empty($obj->code_compta_fournisseur)) {
|
||||
$aux_account[$obj->code_compta_fournisseur] = $obj->code_compta_fournisseur . ' (' . $obj->nom . ')';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select_pcgsubtype " . $this->error, LOG_ERR);
|
||||
return - 1;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
|
||||
//Build select
|
||||
if (count($aux_account) > 0) {
|
||||
|
||||
$out .= ajax_combobox($htmlname, $event);
|
||||
|
||||
$out .= '<select id="' . $htmlname . '" class="flat" name="' . $htmlname . '">';
|
||||
if ($showempty)
|
||||
$out .= '<option value="-1"></option>';
|
||||
foreach ( $aux_account as $key => $val ) {
|
||||
if (($selectid != '') && $selectid == $key) {
|
||||
$out .= '<option value="' . $key . '" selected>' . $val . '</option>';
|
||||
} else {
|
||||
$out .= '<option value="' . $key . '">' . $val . '</option>';
|
||||
}
|
||||
}
|
||||
$out .= '</select>';
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,9 +61,9 @@ $pagenext = $page + 1;
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
|
||||
@ -65,14 +65,14 @@ if ($page < 0)
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (! $sortfield)
|
||||
$sortfield = "f.facnumber";
|
||||
$sortfield = "f.datef, f.facnumber, l.rowid";
|
||||
|
||||
if (! $sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
|
||||
@ -169,9 +169,9 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -355,7 +355,7 @@ if ($action == 'writebookkeeping')
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->doc_type = 'banque';
|
||||
$bookkeeping->doc_type = 'bank';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||
$bookkeeping->label_compte = $tabcompany[$key]['name'];
|
||||
@ -577,9 +577,9 @@ else
|
||||
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
||||
|
||||
$varlink = 'id_account='.$id_bank_account;
|
||||
|
||||
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
|
||||
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||
|
||||
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||
@ -675,6 +675,7 @@ else
|
||||
|
||||
print "</table>";
|
||||
|
||||
llxFooter();
|
||||
}
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -375,7 +375,7 @@ if ($action == 'export_csv')
|
||||
}
|
||||
} else {
|
||||
|
||||
llxHeader('', '', '');
|
||||
llxHeader('', $langs->trans("PurchasesJournal"));
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@ -487,7 +487,9 @@ if ($action == 'export_csv')
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
}
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -531,6 +531,7 @@ if ($action == 'export_csv')
|
||||
|
||||
print "</table>";
|
||||
|
||||
llxFooter();
|
||||
}
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -66,11 +66,11 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION))
|
||||
}
|
||||
else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0)
|
||||
{
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid";
|
||||
|
||||
|
||||
@ -66,9 +66,9 @@ if ($page < 0)
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -111,7 +111,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
llxHeader('', $langs->trans("Ventilation"));
|
||||
llxHeader('', $langs->trans("SuppliersVentilation"));
|
||||
|
||||
print '<script type="text/javascript">
|
||||
$(function () {
|
||||
@ -174,9 +174,9 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -140,7 +140,7 @@ if (count($listofsearchfields))
|
||||
foreach($listofsearchfields as $key => $value)
|
||||
{
|
||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr>';
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -54,7 +54,7 @@ $langs->load("companies");
|
||||
|
||||
$memberstatic=new Adherent($db);
|
||||
|
||||
llxHeader('','','','',0,0,array('http://www.google.com/jsapi'));
|
||||
llxHeader('',$langs->trans("MembersStatisticsByProperties"),'','',0,0,array('http://www.google.com/jsapi'));
|
||||
|
||||
$title=$langs->trans("MembersStatisticsByProperties");
|
||||
|
||||
@ -119,7 +119,7 @@ else
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="center">'.$langs->trans("Nature").'</td>';
|
||||
print '<td align="center">'.$langs->trans("NbOfMembers").'</td>';
|
||||
print '<td align="right">'.$langs->trans("NbOfMembers").'</td>';
|
||||
print '<td align="center">'.$langs->trans("LastMemberDate").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -135,7 +135,7 @@ foreach ($data as $val)
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td align="center">'.$memberstatic->getmorphylib($val['label']).'</td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
print '<td align="right">'.dol_print_date($val['lastdate'],'dayhour').'</td>';
|
||||
print '<td align="center">'.dol_print_date($val['lastdate'],'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
$oldyear=$year;
|
||||
}
|
||||
|
||||
@ -55,7 +55,6 @@ $langs->load("companies");
|
||||
|
||||
$arrayjs=array('http://www.google.com/jsapi');
|
||||
if (! empty($conf->dol_use_jmobile)) $arrayjs=array();
|
||||
llxHeader('','','','',0,0,$arrayjs);
|
||||
|
||||
$title=$langs->trans("Statistics");
|
||||
if ($mode == 'memberbycountry') $title=$langs->trans("MembersStatisticsByCountries");
|
||||
@ -63,6 +62,7 @@ if ($mode == 'memberbystate') $title=$langs->trans("MembersStatisticsByState");
|
||||
if ($mode == 'memberbytown') $title=$langs->trans("MembersStatisticsByTown");
|
||||
if ($mode == 'memberbyregion') $title=$langs->trans("MembersStatisticsByRegion");
|
||||
|
||||
llxHeader('', $title,'','',0,0,$arrayjs);
|
||||
|
||||
print load_fiche_titre($title, $mesg);
|
||||
|
||||
|
||||
@ -170,9 +170,9 @@ $data = $stats->getAllByYear();
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre" height="24">';
|
||||
print '<td align="center">'.$langs->trans("Year").'</td>';
|
||||
print '<td align="center">'.$langs->trans("NbOfSubscriptions").'</td>';
|
||||
print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td align="right">'.$langs->trans("NbOfSubscriptions").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$oldyear=0;
|
||||
|
||||
@ -93,7 +93,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -107,7 +107,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -95,7 +96,7 @@ if ($actionsave)
|
||||
// Save nb of agenda
|
||||
if (! $error)
|
||||
{
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','int')),'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
||||
@ -214,9 +215,9 @@ while ($i <= $MAXAGENDA)
|
||||
// Nb
|
||||
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
// Name
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key):$conf->global->$name) . '" size="28"></td>';
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha'):$conf->global->$name) . '" size="28"></td>';
|
||||
// URL
|
||||
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key):$conf->global->$src) . '" size="60"></td>';
|
||||
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha'):$conf->global->$src) . '" size="60"></td>';
|
||||
// Offset TZ
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'. (GETPOST('AGENDA_EXT_OFFSETTZ'.$key)?GETPOST('AGENDA_EXT_OFFSETTZ'.$key):$conf->global->$offsettz) . '" size="2"></td>';
|
||||
// Color (Possible colors are limited by Google)
|
||||
|
||||
@ -89,7 +89,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* Creation of an optional field
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -103,7 +103,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -97,7 +97,7 @@ if ($action == 'setModuleOptions')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'msgs');
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -91,7 +91,7 @@ print '</td></tr>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("DefaultLink").'</td><td>';
|
||||
print '<input size="92" type="text" name="CLICKTODIAL_URL"'.($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS?' disabled="disabled"':'').' value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
|
||||
print '<input style="width: 90%" type="text" name="CLICKTODIAL_URL"'.($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS?' disabled="disabled"':'').' value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
|
||||
print '<br>';
|
||||
print $langs->trans("ClickToDialUrlDesc").'<br>';
|
||||
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
/* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>ù
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -26,6 +27,7 @@
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("sendings");
|
||||
@ -76,29 +78,9 @@ llxHeader("","");
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
|
||||
$head[$h][1] = $langs->trans("Setup");
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
|
||||
$head[$h][1] = $langs->trans("Shipment");
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$h++;
|
||||
}
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
dol_fiche_head($head, 'general', $langs->trans("ModuleSetup"), 0, 'sending');
|
||||
|
||||
/*
|
||||
* Formulaire parametres divers
|
||||
|
||||
@ -39,7 +39,13 @@ $modules=array(
|
||||
'img' => 'action'
|
||||
)
|
||||
),
|
||||
'propal' => array(
|
||||
'projet' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_TASKS_TODO',
|
||||
'img' => 'task'
|
||||
)
|
||||
),
|
||||
'propal' => array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_PROPALS_TO_CLOSE',
|
||||
'img' => 'propal'
|
||||
@ -175,9 +181,9 @@ if ($action == 'edit')
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
$var=false;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .$form->selectyesno('MAIN_DISABLE_METEO',(isset($conf->global->MAIN_DISABLE_METEO)?1:0),1) . '</td></tr>';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -222,7 +228,7 @@ else
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
$var=false;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
||||
* Copyright (C) 2011-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -36,11 +37,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
$langs->load("errors");
|
||||
$langs->load("admin");
|
||||
$langs->load("companies");
|
||||
$langs->load("resource");
|
||||
$langs->load("holiday");
|
||||
|
||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
@ -168,7 +172,7 @@ $tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX
|
||||
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates";
|
||||
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
@ -232,7 +236,7 @@ $tabfield[24]= "code,label";
|
||||
$tabfield[25]= "label,type_template,position,topic,content";
|
||||
$tabfield[26]= "code,label,short_label";
|
||||
$tabfield[27]= "code,libelle";
|
||||
$tabfield[28]= "code,label,delay,newByMonth,country_id,country";
|
||||
$tabfield[28]= "code,label,affect,delay,newByMonth,country_id,country";
|
||||
$tabfield[29]= "code,label,percent,position";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
@ -264,7 +268,7 @@ $tabfieldvalue[24]= "code,label";
|
||||
$tabfieldvalue[25]= "label,type_template,position,topic,content";
|
||||
$tabfieldvalue[26]= "code,label,short_label";
|
||||
$tabfieldvalue[27]= "code,libelle";
|
||||
$tabfieldvalue[28]= "code,label,delay,newByMonth,country";
|
||||
$tabfieldvalue[28]= "code,label,affect,delay,newByMonth,country";
|
||||
$tabfieldvalue[29]= "code,label,percent,position";
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
@ -296,7 +300,7 @@ $tabfieldinsert[24]= "code,label";
|
||||
$tabfieldinsert[25]= "label,type_template,position,topic,content";
|
||||
$tabfieldinsert[26]= "code,label,short_label";
|
||||
$tabfieldinsert[27]= "code,libelle";
|
||||
$tabfieldinsert[28]= "code,label,delay,newByMonth,fk_country";
|
||||
$tabfieldinsert[28]= "code,label,affect,delay,newByMonth,fk_country";
|
||||
$tabfieldinsert[29]= "code,label,percent,position";
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
@ -394,7 +398,7 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[25] = array('type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[28] = array('delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
|
||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
|
||||
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
|
||||
// List of check for fields (NOT USED YET)
|
||||
@ -478,20 +482,16 @@ if ($id == 11)
|
||||
if ($id == 25)
|
||||
{
|
||||
// We save list of template type Dolibarr can manage. This list can found by a grep into code on "->param['models']"
|
||||
$elementList = array(
|
||||
'propal_send' => $langs->trans('MailToSendProposal'),
|
||||
'order_send' => $langs->trans('MailToSendOrder'),
|
||||
'facture_send' => $langs->trans('MailToSendInvoice'),
|
||||
|
||||
'shipping_send' => $langs->trans('MailToSendShipment'),
|
||||
'fichinter_send' => $langs->trans('MailToSendIntervention'),
|
||||
|
||||
'supplier_proposal_send' => $langs->trans('MailToSendSupplierRequestForQuotation'),
|
||||
'order_supplier_send' => $langs->trans('MailToSendSupplierOrder'),
|
||||
'invoice_supplier_send' => $langs->trans('MailToSendSupplierInvoice'),
|
||||
|
||||
'thirdparty' => $langs->trans('MailToThirdparty')
|
||||
);
|
||||
$elementList = array();
|
||||
if ($conf->propal->enabled) $elementList['propal_send']=$langs->trans('MailToSendProposal');
|
||||
if ($conf->commande->enabled) $elementList['order_send']=$langs->trans('MailToSendOrder');
|
||||
if ($conf->facture->enabled) $elementList['facture_send']=$langs->trans('MailToSendInvoice');
|
||||
if ($conf->expedition->enabled) $elementList['shipping_send']=$langs->trans('MailToSendShipment');
|
||||
if ($conf->ficheinter->enabled) $elementList['fichinter_send']=$langs->trans('MailToSendIntervention');
|
||||
if ($conf->supplier_proposal->enabled) $elementList['supplier_proposal_send']=$langs->trans('MailToSendSupplierRequestForQuotation');
|
||||
if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder');
|
||||
if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice');
|
||||
if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty');
|
||||
}
|
||||
|
||||
// Define localtax_typeList (used for dictionary "llx_c_tva")
|
||||
@ -590,6 +590,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
// Clean some parameters
|
||||
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
|
||||
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
|
||||
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null
|
||||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
if ($ok && GETPOST('actionadd'))
|
||||
@ -1312,6 +1315,9 @@ if ($id)
|
||||
{
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
|
||||
$valuetoshow = length_accountg($valuetoshow);
|
||||
}
|
||||
|
||||
// Show value for field
|
||||
if ($showfield) print '<td align="'.$align.'">'.$valuetoshow.'</td>';
|
||||
@ -1465,6 +1471,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
|
||||
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
@ -1593,6 +1600,20 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
print $form->selectarray($fieldlist[$field], $localtax_typeList, (! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''));
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy')
|
||||
{
|
||||
print '<td>';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountancy_account = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print $formaccountancy->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
@ -1601,9 +1622,6 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
if ($fieldlist[$field]=='position') $size='size="4" ';
|
||||
if ($fieldlist[$field]=='libelle') $size='size="32" ';
|
||||
if ($fieldlist[$field]=='tracking') $size='size="92" ';
|
||||
if ($fieldlist[$field]=='accountancy_code') $size='size="10" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="10" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="10" ';
|
||||
if ($fieldlist[$field]=='sortorder') $size='size="2" ';
|
||||
print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
@ -219,30 +220,9 @@ llxHeader("","");
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
|
||||
//if ($mesg) print $mesg.'<br>';
|
||||
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
|
||||
$head[$h][1] = $langs->trans("Setup");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
|
||||
$head[$h][1] = $langs->trans("Shipment");
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$h++;
|
||||
}
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), 0, 'sending');
|
||||
|
||||
/*
|
||||
* Expedition numbering model
|
||||
|
||||
126
htdocs/admin/expedition_extrafields.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/expedition_extrafields.php
|
||||
* \ingroup expedition
|
||||
* \brief Page to setup extra fields of expedition
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
$langs->load("sendings");
|
||||
$langs->load("deliveries");
|
||||
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label=ExtraFields::$type2label;
|
||||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='expedition'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("Sendings");
|
||||
|
||||
llxHeader('',$langs->trans("SendingsSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), 0, 'sending');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
126
htdocs/admin/expeditiondet_extrafields.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
*
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/expeditiondet_extrafields.php
|
||||
* \ingroup expedition
|
||||
* \brief Page to setup extra fields of expedition
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
$langs->load("sendings");
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label=ExtraFields::$type2label;
|
||||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='expeditiondet'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("Sendings");
|
||||
|
||||
llxHeader('',$langs->trans("SendingsSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), 0, 'sending');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -48,13 +48,15 @@ if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
|
||||
|
||||
// List of supported permanent search area
|
||||
$searchform=array();
|
||||
/* deprecated
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
{
|
||||
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE");
|
||||
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE);
|
||||
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users"));
|
||||
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name');
|
||||
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE");
|
||||
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE);
|
||||
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users"));
|
||||
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module310Name','Module400Name');
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
@ -96,16 +98,6 @@ if ($action == 'update')
|
||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
|
||||
else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', join(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity);
|
||||
|
||||
/*
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity);
|
||||
*/
|
||||
|
||||
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -169,7 +169,7 @@ else
|
||||
if (empty($mysoc->country_code))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$warnpicto=img_error($langs->trans("WarningMandatorySetupNotComplete"));
|
||||
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
|
||||
print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -29,6 +30,7 @@
|
||||
*/
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
@ -210,28 +212,10 @@ $form=new Form($db);
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), 0, 'sending');
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
|
||||
$head[$h][1] = $langs->trans("Setup");
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
|
||||
$head[$h][1] = $langs->trans("Shipment");
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
/*
|
||||
* Livraison numbering model
|
||||
|
||||
126
htdocs/admin/livraison_extrafields.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/livraison_extrafields.php
|
||||
* \ingroup livraison
|
||||
* \brief Page to setup extra fields of livraison
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
$langs->load("sendings");
|
||||
$langs->load("deliveries");
|
||||
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label=ExtraFields::$type2label;
|
||||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='livraison'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("Receivings");
|
||||
|
||||
llxHeader('',$langs->trans("SendingsSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), 0, 'sending');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
126
htdocs/admin/livraisondet_extrafields.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
*
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/livraisondet_extrafields.php
|
||||
* \ingroup livraison
|
||||
* \brief Page to setup extra fields of livraison
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
$langs->load("sendings");
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label=ExtraFields::$type2label;
|
||||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='livraisondet'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("Receivings");
|
||||
|
||||
llxHeader('',$langs->trans("SendingsSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), 0, 'sending');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -505,7 +505,6 @@ if ($action == 'edit')
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -662,7 +661,6 @@ else
|
||||
// Run the test to connect
|
||||
if ($action == 'testconnect')
|
||||
{
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
|
||||
|
||||
// If we use SSL/TLS
|
||||
@ -688,7 +686,6 @@ else
|
||||
// Show email send test form
|
||||
if ($action == 'test' || $action == 'testhtml')
|
||||
{
|
||||
print '<br>';
|
||||
print load_fiche_titre($action == 'testhtml'?$langs->trans("DoTestSendHTML"):$langs->trans("DoTestSend"));
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
|
||||
@ -142,10 +142,10 @@ foreach ($modulesdir as $dir)
|
||||
|
||||
if (! $objMod->numero > 0)
|
||||
{
|
||||
dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR);
|
||||
dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR);
|
||||
}
|
||||
$j = $objMod->numero;
|
||||
|
||||
|
||||
$modulequalified=1;
|
||||
|
||||
// We discard modules according to features level (PS: if module is activated we always show it)
|
||||
@ -161,17 +161,25 @@ foreach ($modulesdir as $dir)
|
||||
{
|
||||
$modules[$i] = $objMod;
|
||||
$filename[$i]= $modName;
|
||||
|
||||
|
||||
$special = $objMod->special;
|
||||
$familykey = $objMod->family;
|
||||
|
||||
// Gives the possibility to the module, to provide his own family info and position of this family
|
||||
if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
|
||||
$familyinfo = array_merge($familyinfo, $objMod->familyinfo);
|
||||
$familykey = key($objMod->familyinfo);
|
||||
} else {
|
||||
$familykey = $objMod->family;
|
||||
}
|
||||
|
||||
$moduleposition = ($objMod->module_position?$objMod->module_position:'500');
|
||||
if ($moduleposition == 500 && ($objMod->isCoreOrExternalModule() == 'external'))
|
||||
{
|
||||
$moduleposition = 800;
|
||||
}
|
||||
|
||||
|
||||
if ($special == 1) $familykey='interface';
|
||||
|
||||
|
||||
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
|
||||
$dirmod[$i] = $dir;
|
||||
// Set categ[$i]
|
||||
@ -323,7 +331,7 @@ if ($mode != 'marketplace')
|
||||
$objMod = $modules[$key];
|
||||
|
||||
$special = $objMod->special;
|
||||
|
||||
|
||||
//print $objMod->name." - ".$key." - ".$objMod->special.' - '.$objMod->version."<br>";
|
||||
//if (($mode != (isset($specialtostring[$special])?$specialtostring[$special]:'unknown') && $mode != 'expdev')
|
||||
if (($special >= 4 && $mode != 'expdev')
|
||||
|
||||
@ -93,7 +93,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -107,7 +107,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -94,7 +94,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -108,7 +108,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
/* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -26,6 +26,7 @@ require '../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("salaries");
|
||||
@ -75,6 +76,7 @@ if ($action == 'update')
|
||||
llxHeader('',$langs->trans('SalariesSetup'));
|
||||
|
||||
$form = new Form($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup');
|
||||
@ -105,7 +107,14 @@ foreach ($list as $key)
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -115,7 +124,7 @@ print "</table>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -381,7 +381,9 @@ foreach ($dirmodels as $reldir)
|
||||
print "<td>\n";
|
||||
require_once $dir.$file;
|
||||
$module = new $classname($db,$specimenthirdparty);
|
||||
print $module->description;
|
||||
if (method_exists($module,'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
// Active
|
||||
|
||||
@ -392,7 +392,8 @@ foreach ($dirmodels as $reldir)
|
||||
print "<td>\n";
|
||||
require_once $dir.$file;
|
||||
$module = new $classname($db,$specimenthirdparty);
|
||||
print $module->description;
|
||||
if (method_exists($module,'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
print "</td>\n";
|
||||
|
||||
// Active
|
||||
|
||||
@ -97,7 +97,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -111,7 +111,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -97,7 +97,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -111,7 +111,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -93,7 +93,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -107,7 +107,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -94,7 +94,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -108,7 +108,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -297,7 +297,7 @@ jQuery(document).ready(function() {
|
||||
var compjsstring;
|
||||
getjsurl = $.ajax({
|
||||
type: "GET",
|
||||
url: \''.DOL_URL_ROOT.'/core/js/lib_head.js\',
|
||||
url: \''.DOL_URL_ROOT.'/core/js/lib_rare.js\',
|
||||
cache: false,
|
||||
/* async: false, */
|
||||
/* crossDomain: true,*/
|
||||
|
||||
@ -26,7 +26,8 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
$langs->load('admin');
|
||||
|
||||
@ -112,6 +113,7 @@ if ($action == 'update') {
|
||||
|
||||
llxHeader();
|
||||
$form=new Form($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans('TaxSetup'),$linkback,'title_setup');
|
||||
@ -212,7 +214,14 @@ foreach ($list as $key)
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ $page = GETPOST('page','int');
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="date";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (! $user->admin)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -39,7 +40,7 @@ $page = GETPOST("page",'int');
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="date";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
@ -417,8 +418,14 @@ function backup_tables($outputfile, $tables='*')
|
||||
global $errormsg;
|
||||
|
||||
// Set to UTF-8
|
||||
$db->query('SET NAMES utf8');
|
||||
$db->query('SET CHARACTER SET utf8');
|
||||
if(is_a($db, 'DoliDBMysqli')) {
|
||||
/** @var DoliDBMysqli $db */
|
||||
$db->db->set_charset('utf8');
|
||||
} else {
|
||||
/** @var DoliDB $db */
|
||||
$db->query('SET NAMES utf8');
|
||||
$db->query('SET CHARACTER SET utf8');
|
||||
}
|
||||
|
||||
//get all of the tables
|
||||
if ($tables == '*')
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -33,15 +33,73 @@ $langs->load("errors");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
$action=GETPOST('action');
|
||||
$id=GETPOST('rowid','int');
|
||||
$action=GETPOST('action','alpha');
|
||||
$langcode=GETPOST('langcode','alpha');
|
||||
$transkey=GETPOST('transkey','alpha');
|
||||
$transvalue=GETPOST('transvalue','alpha');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// None
|
||||
|
||||
if ($action == 'add' || (GETPOST('add') && $action != 'update'))
|
||||
{
|
||||
$error=0;
|
||||
|
||||
if (empty($langcode))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Language")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($transkey == '')
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Key")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($transvalue == '')
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Value")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUE ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')";
|
||||
$result = $db->query($sql);
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
$action="";
|
||||
$transkey="";
|
||||
$transvalue="";
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete line from delete picto
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."overwrite_trans WHERE rowid = ".$db->escape($id);
|
||||
$result = $db->query($sql);
|
||||
if ($result >= 0)
|
||||
{
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -58,11 +116,121 @@ print $langs->trans("TranslationDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print $langs->trans("CurrentUserLanguage").': <strong>'.$langs->defaultlang.'</strong><br>';
|
||||
print img_warning().' '.$langs->trans("SomeTranslationAreUncomplete").'<br>';
|
||||
print '<br>';
|
||||
|
||||
print img_warning().' '.$langs->trans("SomeTranslationAreUncomplete").'<br>';
|
||||
$urlwikitranslatordoc='http://wiki.dolibarr.org/index.php/Translator_documentation';
|
||||
print $langs->trans("SeeAlso").': <a href="'.$urlwikitranslatordoc.'" target="_blank">'.$urlwikitranslatordoc.'</a><br>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("TranslationOverwriteDesc",$langs->transnoentitiesnoconv("Language"),$langs->transnoentitiesnoconv("Key"),$langs->transnoentitiesnoconv("Value"))."<br>\n";
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Language").'</td>';
|
||||
print '<td>'.$langs->trans("Key").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
if (! empty($conf->multicompany->enabled) && !$user->entity) print '<td>'.$langs->trans("Entity").'</td>';
|
||||
print '<td align="center"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
// Line to add new record
|
||||
$var=false;
|
||||
print "\n";
|
||||
|
||||
print '<tr '.$bc[$var].'><td><input type="text" class="flat" size="24" name="langcode" value="'.GETPOST('langcode').'"></td>'."\n";
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="30" name="transkey" value="">';
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="flat" size="40" name="transvalue" value="">';
|
||||
print '</td>';
|
||||
// Limit to superadmin
|
||||
if (! empty($conf->multicompany->enabled) && !$user->entity)
|
||||
{
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
}
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="add">';
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Show constants
|
||||
$sql = "SELECT";
|
||||
$sql.= " rowid";
|
||||
$sql.= ", lang";
|
||||
$sql.= ", transkey";
|
||||
$sql.= ", transvalue";
|
||||
//$sql.= ", entity";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans";
|
||||
$sql.= " WHERE 1 = 1";
|
||||
//$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")";
|
||||
//if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug
|
||||
//else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
||||
//if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
|
||||
//$sql.= " ORDER BY entity, name ASC";
|
||||
$sql.= " ORDER BY lang ASC, transkey ASC";
|
||||
|
||||
dol_syslog("translation::select from table", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
$var=false;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
print "\n";
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
print '<td>'.$obj->lang.'</td>'."\n";
|
||||
print '<td>'.$obj->transkey.'</td>'."\n";
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
/*print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
|
||||
print '<input type="hidden" name="const['.$i.'][lang]" value="'.$obj->lang.'">';
|
||||
print '<input type="hidden" name="const['.$i.'][name]" value="'.$obj->transkey.'">';
|
||||
print '<input type="text" id="value_'.$i.'" class="flat inputforupdate" size="30" name="const['.$i.'][value]" value="'.dol_escape_htmltag($obj->transvalue).'">';
|
||||
*/
|
||||
print $obj->transvalue;
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=delete'.((empty($user->entity) && $debug)?'&debug=1':'').'">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
print "\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -85,7 +85,7 @@ if (GETPOST('submitthirdparty') && GETPOST('submitthirdparty'))
|
||||
|
||||
if (empty($forbarcode) || empty($fk_barcode_type))
|
||||
{
|
||||
setEventMessages($langs->trans("DefinitionOfBarCodeForProductNotComplete",$thirdpartytmp->getNomUrl()), null, 'warnings');
|
||||
setEventMessages($langs->trans("DefinitionOfBarCodeForThirdpartyNotComplete",$thirdpartytmp->getNomUrl()), null, 'warnings');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -387,11 +387,11 @@ print '<br>';
|
||||
|
||||
if ($producttmp->id > 0)
|
||||
{
|
||||
print $langs->trans("BarCodeDataForProduct",$producttmp->getNomUrl(1)).'<br>';
|
||||
print $langs->trans("BarCodeDataForProduct",'').' '.$producttmp->getNomUrl(1).'<br>';
|
||||
}
|
||||
if ($thirdpartytmp->id > 0)
|
||||
{
|
||||
print $langs->trans("BarCodeDataForThirdparty",$thirdpartytmp->getNomUrl(1)).'<br>';
|
||||
print $langs->trans("BarCodeDataForThirdparty",'').' '.$thirdpartytmp->getNomUrl(1).'<br>';
|
||||
}
|
||||
|
||||
print '<div class="tagtable">';
|
||||
|
||||
@ -24,12 +24,19 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php';
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
||||
|
||||
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
||||
unset($_SESSION['serObjFacturation']);
|
||||
|
||||
$hookmanager->initHooks(array('cashdeskTplTicket'));
|
||||
|
||||
require ('tpl/ticket.tpl.php');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$obj_facturation);
|
||||
if (empty($reshook))
|
||||
{
|
||||
require ('tpl/ticket.tpl.php');
|
||||
}
|
||||
|
||||
|
||||
$_SESSION['serObjFacturation'] = serialize($obj_facturation);
|
||||
|
||||
@ -86,8 +86,8 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
@ -100,7 +100,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@ -1305,7 +1305,7 @@ class Categorie extends CommonObject
|
||||
if (is_numeric( $type )) {
|
||||
// We want to reverse lookup
|
||||
$map_type = array_flip( $this->MAP_ID );
|
||||
$type = $map_type;
|
||||
$type = $map_type[$type];
|
||||
dol_syslog( get_class( $this ) . "::rechercher(): numeric types are deprecated, please use string instead",
|
||||
LOG_WARNING );
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@ $ref=GETPOST('ref');
|
||||
$type=GETPOST('type');
|
||||
$action=GETPOST('action');
|
||||
$confirm=GETPOST('confirm');
|
||||
$cancel=GETPOST('cancel');
|
||||
|
||||
$socid=GETPOST('socid','int');
|
||||
$label=GETPOST('label');
|
||||
@ -54,6 +55,10 @@ if ($id == "")
|
||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||
|
||||
$object = new Categorie($db);
|
||||
if ($id > 0)
|
||||
{
|
||||
$result=$object->fetch($id);
|
||||
}
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
@ -61,52 +66,56 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categorycard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Action mise a jour d'une categorie
|
||||
if ($action == 'update' && $user->rights->categorie->creer)
|
||||
{
|
||||
$categorie = new Categorie($db);
|
||||
$result=$categorie->fetch($id);
|
||||
|
||||
$categorie->label = $label;
|
||||
$categorie->description = dol_htmlcleanlastbr($description);
|
||||
$categorie->color = $color;
|
||||
$categorie->socid = ($socid ? $socid : 'null');
|
||||
$categorie->visible = $visible;
|
||||
$object->label = $label;
|
||||
$object->description = dol_htmlcleanlastbr($description);
|
||||
$object->color = $color;
|
||||
$object->socid = ($socid ? $socid : 'null');
|
||||
$object->visible = $visible;
|
||||
|
||||
if ($parent != "-1")
|
||||
$categorie->fk_parent = $parent;
|
||||
$object->fk_parent = $parent;
|
||||
else
|
||||
$categorie->fk_parent = "";
|
||||
$object->fk_parent = "";
|
||||
|
||||
|
||||
if (empty($categorie->label))
|
||||
if (empty($object->label))
|
||||
{
|
||||
$error++;
|
||||
$action = 'edit';
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
}
|
||||
if (! $error && empty($categorie->error))
|
||||
if (! $error && empty($object->error))
|
||||
{
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error && $categorie->update($user) > 0)
|
||||
if (! $error && $object->update($user) > 0)
|
||||
{
|
||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id.'&type='.$type);
|
||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($categorie->error, $categorie->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($categorie->error, $categorie->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +185,7 @@ print '</table>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
print '<div class="center"><input type="submit" class="button" name"submit" value="'.$langs->trans("Modify").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -146,6 +146,7 @@ foreach($fulltree as $key => $val)
|
||||
{
|
||||
$categstatic->id=$val['id'];
|
||||
$categstatic->ref=$val['label'];
|
||||
$categstatic->color=$val['color'];
|
||||
$categstatic->type=$type;
|
||||
$li=$categstatic->getNomUrl(1,'',60);
|
||||
$desc=dol_htmlcleanlastbr($val['description']);
|
||||
@ -153,8 +154,8 @@ foreach($fulltree as $key => $val)
|
||||
$data[] = array(
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_parent'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.$li.
|
||||
'</td><td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color?' style="background: #'.$categstatic->color.';"':' style="background: #aaa"').'>'.$li.'</span></td>'.
|
||||
'<td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
|
||||
'<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'.
|
||||
'</tr></table>'
|
||||
);
|
||||
|
||||
@ -158,10 +158,23 @@ print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
print $object->label;
|
||||
print '<td width="20%" class="notopnoleft">';
|
||||
$ways = $object->print_all_ways();
|
||||
print $langs->trans("Ref").'</td><td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||
foreach ($ways as $way)
|
||||
{
|
||||
print $way."<br>\n";
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td width="20%" class="notopnoleft">';
|
||||
print $langs->trans("Description").'</td><td>';
|
||||
print dol_htmlentitiesbr($object->description);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
if ($action == 'edit')
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@ -294,6 +294,7 @@ else
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
|
||||
// List of products or services (type is type of category)
|
||||
if ($object->type == Categorie::TYPE_PRODUCT)
|
||||
{
|
||||
@ -339,7 +340,7 @@ if ($object->type == Categorie::TYPE_PRODUCT)
|
||||
$var=!$var;
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $prod->getNomUrl(1,'category');
|
||||
print $prod->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td valign="top">'.$prod->label."</td>\n";
|
||||
// Link to delete from category
|
||||
@ -390,7 +391,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER)
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1,'category_supplier');
|
||||
print $soc->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
@ -444,7 +445,7 @@ if($object->type == Categorie::TYPE_CUSTOMER)
|
||||
$var=!$var;
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1,'category');
|
||||
print $soc->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
@ -497,7 +498,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
$member->ref=$member->login;
|
||||
print $member->getNomUrl(1,0,'category');
|
||||
print $member->getNomUrl(1,0);
|
||||
print "</td>\n";
|
||||
print '<td valign="top">'.$member->lastname."</td>\n";
|
||||
print '<td valign="top">'.$member->firstname."</td>\n";
|
||||
@ -526,7 +527,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
|
||||
}
|
||||
}
|
||||
|
||||
//Categorie contact
|
||||
// Categorie contact
|
||||
if($object->type == Categorie::TYPE_CONTACT)
|
||||
{
|
||||
$contacts = $object->getObjectsInCateg("contact");
|
||||
|
||||
@ -651,7 +651,7 @@ if ($action == 'create')
|
||||
{
|
||||
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
|
||||
$default=(empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)?'':$conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT);
|
||||
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):($object->type_code?$object->type_code:$default), "actioncode","systemauto");
|
||||
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):($object->type_code?$object->type_code:$default), "actioncode", "systemauto", 0, -1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -755,7 +755,7 @@ if ($action == 'create')
|
||||
{
|
||||
|
||||
$events=array();
|
||||
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||
//For external user force the company to user company
|
||||
if (!empty($user->societe_id)) {
|
||||
print $form->select_thirdparty_list($user->societe_id,'socid','',1,1,0,$events);
|
||||
@ -1081,8 +1081,10 @@ if ($id > 0)
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Thirdparty - Contact
|
||||
|
||||
@ -157,7 +157,17 @@ class ActionComm extends CommonObject
|
||||
|
||||
var $actions=array();
|
||||
|
||||
// Fields for emails
|
||||
var $email_msgid;
|
||||
var $email_from;
|
||||
var $email_sender;
|
||||
var $email_to;
|
||||
var $email_tocc;
|
||||
var $email_tobcc;
|
||||
var $email_subject;
|
||||
var $errors_to;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -411,6 +421,20 @@ class ActionComm extends CommonObject
|
||||
|
||||
$this->id=0;
|
||||
|
||||
if (!is_object($fuser))
|
||||
{
|
||||
if ($fuser > 0)
|
||||
{
|
||||
$u = new User($db);
|
||||
$u->fetch($fuser);
|
||||
$fuser = $u;
|
||||
}
|
||||
else
|
||||
{
|
||||
$fuser = $user;
|
||||
}
|
||||
}
|
||||
|
||||
// Create clone
|
||||
$result=$this->add($fuser);
|
||||
if ($result < 0) $error++;
|
||||
@ -834,7 +858,7 @@ class ActionComm extends CommonObject
|
||||
if (! empty($elementtype))
|
||||
{
|
||||
if ($elementtype == 'project') $sql.= ' AND a.fk_project = '.$fk_element;
|
||||
else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'";
|
||||
else $sql.= " AND a.fk_element = ".(int) $fk_element." AND a.elementtype = '".$elementtype."'";
|
||||
}
|
||||
if (! empty($filter)) $sql.= $filter;
|
||||
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
|
||||
@ -872,7 +896,7 @@ class ActionComm extends CommonObject
|
||||
*/
|
||||
function load_board($user)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
$sql = "SELECT a.id, a.datep as dp";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
|
||||
|
||||
@ -58,7 +58,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page","int");
|
||||
if ($page == -1) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="a.datec";
|
||||
@ -87,11 +87,18 @@ $pid=GETPOST("projectid","int",3);
|
||||
$status=GETPOST("status");
|
||||
$type=GETPOST("type");
|
||||
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
$actioncode=GETPOST("actioncode","array",3) ? GETPOST("actioncode","array",3):(GETPOST("actioncode")=='0'?'0':'');
|
||||
if(is_array($actioncode))$actioncode =implode(',', $actioncode);
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('actioncode','array'))
|
||||
{
|
||||
$actioncode=GETPOST('actioncode','array',3);
|
||||
if (! count($actioncode)) $actioncode='0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||
|
||||
|
||||
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
|
||||
|
||||
@ -1171,14 +1178,14 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
|
||||
// Line with td contains all div of each events
|
||||
print '<tr height="'.$minheight.'"><td valign="top" colspan="2" class="sortable" style="padding-bottom: 2px;">';
|
||||
print '<div style="width: 100%; position: relative;">';
|
||||
print '<div style="width: 100%; position: relative;">';
|
||||
|
||||
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
|
||||
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
|
||||
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
|
||||
|
||||
$nextindextouse=count($colorindexused); // At first run this is 0, so fist user has 0, next 1, ...
|
||||
//print $nextindextouse;
|
||||
//print $nextindextouse;
|
||||
|
||||
foreach ($eventarray as $daykey => $notused)
|
||||
{
|
||||
@ -1191,23 +1198,23 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
{
|
||||
if ($i < $maxprint || $maxprint == 0 || ! empty($conf->global->MAIN_JS_SWITCH_AGENDA))
|
||||
{
|
||||
$keysofuserassigned=array_keys($event->userassigned);
|
||||
$keysofuserassigned=array_keys($event->userassigned);
|
||||
|
||||
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
|
||||
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
|
||||
|
||||
// Define $color (Hex string like '0088FF') and $cssclass of event
|
||||
$color=-1; $colorindex=-1;
|
||||
if (in_array($user->id, $keysofuserassigned))
|
||||
{
|
||||
$nummytasks++; $cssclass='family_mytasks';
|
||||
if (in_array($user->id, $keysofuserassigned))
|
||||
{
|
||||
$nummytasks++; $cssclass='family_mytasks';
|
||||
|
||||
if (empty($cacheusers[$event->userownerid]))
|
||||
{
|
||||
$newuser=new User($db);
|
||||
$newuser->fetch($event->userownerid);
|
||||
$cacheusers[$event->userownerid]=$newuser;
|
||||
}
|
||||
//var_dump($cacheusers[$event->userownerid]->color);
|
||||
if (empty($cacheusers[$event->userownerid]))
|
||||
{
|
||||
$newuser=new User($db);
|
||||
$newuser->fetch($event->userownerid);
|
||||
$cacheusers[$event->userownerid]=$newuser;
|
||||
}
|
||||
//var_dump($cacheusers[$event->userownerid]->color);
|
||||
|
||||
// We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
|
||||
if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
|
||||
@ -1221,7 +1228,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
}
|
||||
$numicals[dol_string_nospecial($event->icalname)]++;
|
||||
}
|
||||
$color=$event->icalcolor;
|
||||
$color=($event->icalcolor?$event->icalcolor:-1);
|
||||
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
|
||||
}
|
||||
else if ($event->type_code == 'BIRTHDAY')
|
||||
@ -1229,20 +1236,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
$numbirthday++; $colorindex=2; $cssclass='family_birthday unmovable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$numother++; $cssclass='family_other';
|
||||
{
|
||||
$numother++;
|
||||
$color=($event->icalcolor?$event->icalcolor:-1);
|
||||
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
|
||||
|
||||
if (empty($cacheusers[$event->userownerid]))
|
||||
{
|
||||
$newuser=new User($db);
|
||||
$newuser->fetch($event->userownerid);
|
||||
$cacheusers[$event->userownerid]=$newuser;
|
||||
}
|
||||
//var_dump($cacheusers[$event->userownerid]->color);
|
||||
if (empty($cacheusers[$event->userownerid]))
|
||||
{
|
||||
$newuser=new User($db);
|
||||
$newuser->fetch($event->userownerid);
|
||||
$cacheusers[$event->userownerid]=$newuser;
|
||||
}
|
||||
//var_dump($cacheusers[$event->userownerid]->color);
|
||||
|
||||
// We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
|
||||
if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
|
||||
}
|
||||
}
|
||||
if ($color == -1) // Color was not forced. Set color according to color index.
|
||||
{
|
||||
// Define color index if not yet defined
|
||||
@ -1253,14 +1262,14 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
}
|
||||
else
|
||||
{
|
||||
$colorindex=$nextindextouse;
|
||||
$colorindexused[$idusertouse]=$colorindex;
|
||||
$colorindex=$nextindextouse;
|
||||
$colorindexused[$idusertouse]=$colorindex;
|
||||
if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color
|
||||
}
|
||||
//print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'<br>';
|
||||
// Define color
|
||||
// Define color
|
||||
$color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||
}
|
||||
}
|
||||
$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
|
||||
|
||||
// Defined style to disable drag and drop feature
|
||||
|
||||
@ -43,6 +43,7 @@ $pid=GETPOST("projectid",'int',3);
|
||||
$status=GETPOST("status",'alpha');
|
||||
$type=GETPOST('type');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('actioncode','array'))
|
||||
{
|
||||
$actioncode=GETPOST('actioncode','array',3);
|
||||
@ -50,12 +51,13 @@ if (GETPOST('actioncode','array'))
|
||||
}
|
||||
else
|
||||
{
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||
|
||||
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear'));
|
||||
$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear'));
|
||||
$dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GETPOST('dateendyear'));
|
||||
if (empty($actioncode) && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
|
||||
|
||||
@ -74,7 +76,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
if (! $sortorder)
|
||||
{
|
||||
@ -164,7 +166,7 @@ llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
$listofextcals=array();
|
||||
|
||||
$param='';
|
||||
if ($actioncode) $param.="&actioncode=".$actioncode;
|
||||
if ($actioncode != '') $param.="&actioncode=".$actioncode;
|
||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
if ($filtert) $param.="&filtert=".$filtert;
|
||||
@ -287,6 +289,7 @@ if ($resql)
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
|
||||
@ -297,6 +300,11 @@ if ($resql)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
print '<td class="liste_titre"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" name="search_type" value="'.$search_type.'"></td>';
|
||||
}
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $form->select_date($datestart, 'datestart', 0, 0, 1, '', 1, 0, 1);
|
||||
print '</td>';
|
||||
@ -316,6 +324,10 @@ if ($resql)
|
||||
$now=dol_now();
|
||||
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||
$caction=new CActionComm($db);
|
||||
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0));
|
||||
|
||||
$var=true;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
@ -341,6 +353,13 @@ if ($resql)
|
||||
print $actionstatic->getNomUrl(1,28);
|
||||
print '</td>';
|
||||
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
$labeltype=$obj->type_code;
|
||||
if (! empty($arraylist[$labeltype])) $labeltype=$arraylist[$labeltype];
|
||||
print '<td>'.dol_trunc($labeltype,24).'</td>';
|
||||
}
|
||||
|
||||
// Start date
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->dp),"dayhour");
|
||||
|
||||
975
htdocs/comm/action/pertype.php
Normal file
@ -0,0 +1,975 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/action/pertype.php
|
||||
* \ingroup agenda
|
||||
* \brief Tab of calendar events per type
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
|
||||
|
||||
if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3;
|
||||
|
||||
$filter=GETPOST("filter",'',3);
|
||||
$filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3);
|
||||
$usergroup = GETPOST("usergroup","int",3);
|
||||
//if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id;
|
||||
//$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
||||
$showbirthday = 0;
|
||||
|
||||
// If not choice done on calendar owner, we filter on user.
|
||||
if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS))
|
||||
{
|
||||
$filtert=$user->id;
|
||||
}
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page","int");
|
||||
if ($page == -1) { $page = 0; }
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="a.datec";
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid","int");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
||||
if ($socid < 0) $socid='';
|
||||
|
||||
$canedit=1;
|
||||
if (! $user->rights->agenda->myactions->read) accessforbidden();
|
||||
if (! $user->rights->agenda->allactions->read) $canedit=0;
|
||||
if (! $user->rights->agenda->allactions->read || $filter =='mine') // If no permission to see all, we show only affected to me
|
||||
{
|
||||
$filtert=$user->id;
|
||||
}
|
||||
|
||||
//$action=GETPOST('action','alpha');
|
||||
$action='show_pertype';
|
||||
//$year=GETPOST("year");
|
||||
$year=GETPOST("year","int")?GETPOST("year","int"):date("Y");
|
||||
$month=GETPOST("month","int")?GETPOST("month","int"):date("m");
|
||||
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
|
||||
$day=GETPOST("day","int")?GETPOST("day","int"):date("d");
|
||||
$pid=GETPOST("projectid","int",3);
|
||||
$status=GETPOST("status");
|
||||
$type=GETPOST("type");
|
||||
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('actioncode','array'))
|
||||
{
|
||||
$actioncode=GETPOST('actioncode','array',3);
|
||||
if (! count($actioncode)) $actioncode='0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||
|
||||
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear'));
|
||||
if ($dateselect > 0)
|
||||
{
|
||||
$day=GETPOST('dateselectday');
|
||||
$month=GETPOST('dateselectmonth');
|
||||
$year=GETPOST('dateselectyear');
|
||||
}
|
||||
|
||||
$tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS;
|
||||
$tmparray=explode('-',$tmp);
|
||||
$begin_h = GETPOST('begin_h')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
|
||||
$end_h = GETPOST('end_h')?GETPOST('end_h'):($tmparray[1] != '' ? $tmparray[1] : 18);
|
||||
if ($begin_h < 0 || $begin_h > 23) $begin_h = 9;
|
||||
if ($end_h < 1 || $end_h > 24) $end_h = 18;
|
||||
if ($end_h <= $begin_h) $end_h = $begin_h + 1;
|
||||
|
||||
$tmp=empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)?'1-5':$conf->global->MAIN_DEFAULT_WORKING_DAYS;
|
||||
$tmparray=explode('-',$tmp);
|
||||
$begin_d = 1;
|
||||
$end_d = 53;
|
||||
|
||||
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
|
||||
|
||||
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
||||
$action='show_month'; $day='';
|
||||
} // View by month
|
||||
if (GETPOST('viewweek') || $action == 'show_week') {
|
||||
$action='show_week'; $week=($week?$week:date("W")); $day=($day?$day:date("d"));
|
||||
} // View by week
|
||||
if (GETPOST('viewday') || $action == 'show_day') {
|
||||
$action='show_day'; $day=($day?$day:date("d"));
|
||||
} // View by day
|
||||
if (GETPOST('viewyear') || $action == 'show_year') {
|
||||
$action='show_year';
|
||||
} // View by year
|
||||
|
||||
|
||||
$langs->load("users");
|
||||
$langs->load("agenda");
|
||||
$langs->load("other");
|
||||
$langs->load("commercial");
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('agenda'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action =='delete_action')
|
||||
{
|
||||
$event = new ActionComm($db);
|
||||
$event->fetch($actionid);
|
||||
$result=$event->delete();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
|
||||
$form=new Form($db);
|
||||
$companystatic=new Societe($db);
|
||||
|
||||
$now=dol_now();
|
||||
$nowarray=dol_getdate($now);
|
||||
$nowyear=$nowarray['year'];
|
||||
$nowmonth=$nowarray['mon'];
|
||||
$nowday=$nowarray['mday'];
|
||||
|
||||
|
||||
// Define list of all external calendars (global setup)
|
||||
$listofextcals=array();
|
||||
|
||||
$prev = dol_get_first_day($year, $month);
|
||||
$first_day = 1;
|
||||
$first_month = 1;
|
||||
$first_year = $year;
|
||||
|
||||
$week = $prev['week'];
|
||||
|
||||
$day = (int) $day;
|
||||
$next = dol_get_next_day($day, $month, $year);
|
||||
$next_year = year + 1;
|
||||
$next_month = $month;
|
||||
$next_day = $day;
|
||||
|
||||
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
|
||||
|
||||
$tmpday = $first_day;
|
||||
//print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day;
|
||||
//print 'xx'.$next_year.'-'.$next_month.'-'.$next_day;
|
||||
|
||||
$title=$langs->trans("DoneAndToDoActions");
|
||||
if ($status == 'done') $title=$langs->trans("DoneActions");
|
||||
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
||||
|
||||
$param='';
|
||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
|
||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
if ($filtert) $param.="&filtert=".$filtert;
|
||||
if ($usergroup) $param.="&usergroup=".$usergroup;
|
||||
if ($socid) $param.="&socid=".$socid;
|
||||
if ($showbirthday) $param.="&showbirthday=1";
|
||||
if ($pid) $param.="&projectid=".$pid;
|
||||
if ($type) $param.="&type=".$type;
|
||||
if ($action == 'show_day' || $action == 'show_week' || $action == 'show_month' || $action != 'show_peruser' || $action != 'show_pertype') $param.='&action='.$action;
|
||||
$param.="&maxprint=".$maxprint;
|
||||
|
||||
$prev = dol_get_first_day($year, 1);
|
||||
$prev_year = $year - 1;
|
||||
$prev_month = $month;
|
||||
$prev_day = $day;
|
||||
$first_day = 1;
|
||||
$first_month= 1;
|
||||
$first_year = $year;
|
||||
|
||||
$week = $prev['week'];
|
||||
|
||||
$day = (int) $day;
|
||||
$next = dol_get_next_day(31, 12, $year);
|
||||
$next_year = $year + 1;
|
||||
$next_month = $month;
|
||||
$next_day = $day;
|
||||
|
||||
// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
|
||||
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
|
||||
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd');
|
||||
//print $firstday.'-'.$first_month.'-'.$first_year;
|
||||
//print dol_print_date($firstdaytoshow,'dayhour');
|
||||
//print dol_print_date($lastdaytoshow,'dayhour');
|
||||
|
||||
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
|
||||
|
||||
$tmpday = $first_day;
|
||||
|
||||
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
||||
$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y")."</span> \n";
|
||||
$nav.="<a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\">".img_next($langs->trans("Next"))."</a>\n";
|
||||
$nav.=" (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
||||
$picto='calendarweek';
|
||||
|
||||
$nav.=' <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||
$nav.='<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
$nav.='<input type="hidden" name="action" value="' . $action . '">';
|
||||
$nav.='<input type="hidden" name="usertodo" value="' . $filtert . '">';
|
||||
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';
|
||||
$nav.='<input type="hidden" name="actioncode" value="' . $actioncode . '">';
|
||||
$nav.='<input type="hidden" name="status" value="' . $status . '">';
|
||||
$nav.='<input type="hidden" name="socid" value="' . $socid . '">';
|
||||
$nav.='<input type="hidden" name="projectid" value="' . $projectid . '">';
|
||||
$nav.='<input type="hidden" name="begin_h" value="' . $begin_h . '">';
|
||||
$nav.='<input type="hidden" name="end_h" value="' . $end_h . '">';
|
||||
$nav.='<input type="hidden" name="begin_d" value="' . $begin_d . '">';
|
||||
$nav.='<input type="hidden" name="end_d" value="' . $end_d . '">';
|
||||
$nav.='<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
|
||||
|
||||
$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
|
||||
$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
|
||||
$nav.='</form>';
|
||||
|
||||
// Must be after the nav definition
|
||||
$param.='&year='.$year.'&month='.$month.($day?'&day='.$day:'');
|
||||
//print 'x'.$param;
|
||||
|
||||
|
||||
|
||||
|
||||
$tabactive='cardpertype';
|
||||
|
||||
$paramnoaction=preg_replace('/action=[a-z_]+/','',$param);
|
||||
|
||||
$head = calendars_prepare_head($paramnoaction);
|
||||
|
||||
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
||||
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup);
|
||||
dol_fiche_end();
|
||||
|
||||
$showextcals=$listofextcals;
|
||||
// Legend
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
$s='';
|
||||
$s.='<script type="text/javascript">' . "\n";
|
||||
$s.='jQuery(document).ready(function () {' . "\n";
|
||||
$s.='jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n";
|
||||
$s.='jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
|
||||
$s.='jQuery(".family_birthday").toggle();' . "\n";
|
||||
if ($action=="show_week" || $action=="show_month" || empty($action))
|
||||
{
|
||||
$s.='jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
|
||||
$s.='var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n";
|
||||
}
|
||||
$s.='});' . "\n";
|
||||
$s.='</script>' . "\n";
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
$s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> ' . $langs->trans("LocalAgenda").' </div>';
|
||||
if (is_array($showextcals) && count($showextcals) > 0)
|
||||
{
|
||||
foreach ($showextcals as $val)
|
||||
{
|
||||
$htmlname = md5($val['name']);
|
||||
$s.='<script type="text/javascript">' . "\n";
|
||||
$s.='jQuery(document).ready(function () {' . "\n";
|
||||
$s.=' jQuery("#check_ext' . $htmlname . '").click(function() {';
|
||||
$s.=' /* alert("'.$htmlname.'"); */';
|
||||
$s.=' jQuery(".family_ext' . $htmlname . '").toggle();';
|
||||
$s.=' });' . "\n";
|
||||
$s.='});' . "\n";
|
||||
$s.='</script>' . "\n";
|
||||
$s.='<div class="nowrap float"><input type="checkbox" id="check_ext' . $htmlname . '" name="check_ext' . $htmlname . '" checked> ' . $val ['name'] . ' </div>';
|
||||
}
|
||||
}
|
||||
|
||||
//$s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' </div>';
|
||||
|
||||
// Calendars from hooks
|
||||
$parameters=array(); $object=null;
|
||||
$reshook=$hookmanager->executeHooks('addCalendarChoice',$parameters,$object,$action);
|
||||
if (empty($reshook))
|
||||
{
|
||||
$s.= $hookmanager->resPrint;
|
||||
}
|
||||
elseif ($reshook > 1)
|
||||
{
|
||||
$s = $hookmanager->resPrint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$link='';
|
||||
print load_fiche_titre($s, $link.' '.$nav, '');
|
||||
|
||||
|
||||
// Get event in an array
|
||||
$eventarray=array();
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($usergroup > 0) $sql.=" DISTINCT";
|
||||
$sql.= ' a.id, a.label,';
|
||||
$sql.= ' a.datep,';
|
||||
$sql.= ' a.datep2,';
|
||||
$sql.= ' a.percent,';
|
||||
$sql.= ' a.fk_user_author,a.fk_user_action,';
|
||||
$sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,';
|
||||
$sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype,';
|
||||
$sql.= ' ca.code, ca.color';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
// We must filter on assignement table
|
||||
if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
|
||||
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
|
||||
$sql.= ' WHERE a.fk_action = ca.id';
|
||||
$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
|
||||
if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
|
||||
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
||||
if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid;
|
||||
// We must filter on assignement table
|
||||
if ($filtert > 0 || $usergroup > 0) $sql.= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
if ($action == 'show_day')
|
||||
{
|
||||
$sql.= " AND (";
|
||||
$sql.= " (a.datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'";
|
||||
$sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')";
|
||||
$sql.= " OR ";
|
||||
$sql.= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'";
|
||||
$sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')";
|
||||
$sql.= " OR ";
|
||||
$sql.= " (a.datep < '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'";
|
||||
$sql.= " AND a.datep2 > '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')";
|
||||
$sql.= ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
// To limit array
|
||||
$sql.= " AND (";
|
||||
$sql.= " (a.datep BETWEEN '".$db->idate(dol_mktime(0,0,0,1,1,$year)-(60*60*24*7))."'"; // Start 7 days before
|
||||
$sql.= " AND '".$db->idate(dol_mktime(23,59,59,12,31,$year)+(60*60*24*7))."')"; // End 7 days after
|
||||
$sql.= " OR ";
|
||||
$sql.= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,1,1,$year)-(60*60*24*7))."'";
|
||||
$sql.= " AND '".$db->idate(dol_mktime(23,59,59,12,31,$year)+(60*60*24*7))."')";
|
||||
$sql.= " OR ";
|
||||
$sql.= " (a.datep < '".$db->idate(dol_mktime(0,0,0,12,1,$year)-(60*60*24*7))."'";
|
||||
$sql.= " AND a.datep2 > '".$db->idate(dol_mktime(23,59,59,12,31,$year)+(60*60*24*7))."')";
|
||||
$sql.= ')';
|
||||
}
|
||||
if ($type) $sql.= " AND ca.id = ".$type;
|
||||
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
||||
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
||||
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
||||
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
||||
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
||||
// We must filter on assignement table
|
||||
if ($filtert > 0 || $usergroup > 0)
|
||||
{
|
||||
$sql.= " AND (";
|
||||
if ($filtert > 0) $sql.= "ar.fk_element = ".$filtert;
|
||||
if ($usergroup > 0) $sql.= ($filtert>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup;
|
||||
$sql.= ")";
|
||||
}
|
||||
// Sort on date
|
||||
$sql.= ' ORDER BY fk_user_action, datep'; //fk_user_action
|
||||
//print $sql;
|
||||
|
||||
dol_syslog("comm/action/index.php", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
// Discard auto action if option is on
|
||||
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO')
|
||||
{
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Create a new object action
|
||||
$event=new ActionComm($db);
|
||||
$event->id=$obj->id;
|
||||
$event->datep=$db->jdate($obj->datep); // datep and datef are GMT date
|
||||
$event->datef=$db->jdate($obj->datep2);
|
||||
$event->type_code=$obj->code;
|
||||
$event->type_color=$obj->color;
|
||||
//$event->libelle=$obj->label; // deprecated
|
||||
$event->label=$obj->label;
|
||||
$event->percentage=$obj->percent;
|
||||
//$event->author->id=$obj->fk_user_author; // user id of creator
|
||||
$event->authorid=$obj->fk_user_author; // user id of creator
|
||||
$event->userownerid=$obj->fk_user_action; // user id of owner
|
||||
$event->fetch_userassigned(); // This load $event->userassigned
|
||||
$event->priority=$obj->priority;
|
||||
$event->fulldayevent=$obj->fulldayevent;
|
||||
$event->location=$obj->location;
|
||||
$event->transparency=$obj->transparency;
|
||||
|
||||
$event->socid=$obj->fk_soc;
|
||||
$event->contactid=$obj->fk_contact;
|
||||
//$event->societe->id=$obj->fk_soc; // deprecated
|
||||
//$event->contact->id=$obj->fk_contact; // deprecated
|
||||
|
||||
$event->fk_element=$obj->fk_element;
|
||||
$event->elementtype=$obj->elementtype;
|
||||
|
||||
// Defined date_start_in_calendar and date_end_in_calendar property
|
||||
// They are date start and end of action but modified to not be outside calendar view.
|
||||
if ($event->percentage <= 0)
|
||||
{
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
|
||||
else $event->date_end_in_calendar=$event->datep;
|
||||
}
|
||||
else
|
||||
{
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
|
||||
else $event->date_end_in_calendar=$event->datep;
|
||||
}
|
||||
// Define ponctual property
|
||||
if ($event->date_start_in_calendar == $event->date_end_in_calendar)
|
||||
{
|
||||
$event->ponctuel=1;
|
||||
}
|
||||
|
||||
// Check values
|
||||
if ($event->date_end_in_calendar < $firstdaytoshow ||
|
||||
$event->date_start_in_calendar >= $lastdaytoshow)
|
||||
{
|
||||
// This record is out of visible range
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
|
||||
if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1);
|
||||
|
||||
// Add an entry in actionarray for each day
|
||||
$daycursor=$event->date_start_in_calendar;
|
||||
$annee = date('Y',$daycursor);
|
||||
$mois = date('m',$daycursor);
|
||||
$jour = date('d',$daycursor);
|
||||
|
||||
// Loop on each day covered by action to prepare an index to show on calendar
|
||||
$loop=true; $j=0;
|
||||
$daykey=dol_mktime(0,0,0,$mois,$jour,$annee);
|
||||
do
|
||||
{
|
||||
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'<br>';
|
||||
|
||||
$eventarray[$daykey][]=$event;
|
||||
$j++;
|
||||
|
||||
$daykey+=60*60*24;
|
||||
if ($daykey > $event->date_end_in_calendar) $loop=false;
|
||||
}
|
||||
while ($loop);
|
||||
|
||||
//print 'Event '.$i.' id='.$event->id.' (start='.dol_print_date($event->datep).'-end='.dol_print_date($event->datef);
|
||||
//print ' startincalendar='.dol_print_date($event->date_start_in_calendar).'-endincalendar='.dol_print_date($event->date_end_in_calendar).') was added in '.$j.' different index key of array<br>';
|
||||
}
|
||||
$i++;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$maxnbofchar=18;
|
||||
$cachethirdparties=array();
|
||||
$cachecontacts=array();
|
||||
|
||||
// Define theme_datacolor array
|
||||
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
||||
if (is_readable($color_file))
|
||||
{
|
||||
include_once $color_file;
|
||||
}
|
||||
if (! is_array($theme_datacolor)) $theme_datacolor=array(array(120,130,150), array(200,160,180), array(190,190,220));
|
||||
|
||||
|
||||
$newparam=$param; // newparam is for birthday links
|
||||
$newparam=preg_replace('/showbirthday=/i','showbirthday_=',$newparam); // To avoid replacement when replace day= is done
|
||||
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
|
||||
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
|
||||
$newparam=preg_replace('/day=[0-9]+&?/i','',$newparam);
|
||||
$newparam=preg_replace('/month=[0-9]+&?/i','',$newparam);
|
||||
$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam);
|
||||
$newparam=preg_replace('/viewweek=[0-9]+&?/i','',$newparam);
|
||||
$newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter
|
||||
$newparam.='&viewweek=1';
|
||||
|
||||
echo '<form id="move_event" action="" method="POST"><input type="hidden" name="action" value="mupdate">';
|
||||
echo '<input type="hidden" name="backtopage" value="'.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'">';
|
||||
echo '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
echo '<input type="hidden" name="newdate" id="newdate">' ;
|
||||
echo '</form>';
|
||||
|
||||
|
||||
// Line header with list of days
|
||||
|
||||
//print "begin_d=".$begin_d." end_d=".$end_d;
|
||||
|
||||
|
||||
echo '<table width="100%" class="nocellnopadd cal_month">';
|
||||
|
||||
echo '<tr class="liste_titre">';
|
||||
echo '<td></td>';
|
||||
$i=0; // 0 = sunday,
|
||||
echo '<td align="center" colspan="'.($end_d - $begin_d).'">';
|
||||
echo $langs->trans("Year");
|
||||
print "<br>";
|
||||
print $year;
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo '<tr class="liste_titre">';
|
||||
echo '<td></td>';
|
||||
$i=0;
|
||||
for ($h = $begin_d; $h < $end_d; $h++)
|
||||
{
|
||||
echo '<td align="center">';
|
||||
print '<small style="font-family: courier">'.sprintf("%02d",$h).'</small>';
|
||||
print "</td>";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
|
||||
$typeofevents=array();
|
||||
|
||||
// Load array of colors by type
|
||||
$colorsbytype=array();
|
||||
$labelbytype=array();
|
||||
$sql="SELECT code, color, libelle FROM ".MAIN_DB_PREFIX."c_actioncomm";
|
||||
$resql=$db->query($sql);
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$colorsbytype[$obj->code]=$obj->color;
|
||||
$labelbytype[$obj->code]=$obj->libelle;
|
||||
}
|
||||
|
||||
// Loop on each user to show calendar
|
||||
$todayarray=dol_getdate($now,'fast');
|
||||
$sav = $tmpday;
|
||||
$showheader = true;
|
||||
$var = false;
|
||||
foreach ($typeofevents as $typeofevent)
|
||||
{
|
||||
$var = ! $var;
|
||||
echo "<tr>";
|
||||
echo '<td class="cal_current_month cal_peruserviewname'.($var?' cal_impair':'').'">' . $username->getNomUrl(1). '</td>';
|
||||
$tmpday = $sav;
|
||||
|
||||
// Lopp on each day of week
|
||||
$i = 0;
|
||||
for ($iter_day = 0; $iter_day < 8; $iter_day++)
|
||||
{
|
||||
if (($i + 1) < $begin_d || ($i + 1) > $end_d)
|
||||
{
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Show days of the current week
|
||||
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');
|
||||
$tmparray = dol_getdate($curtime,'fast');
|
||||
$tmpday = $tmparray['mday'];
|
||||
$tmpmonth = $tmparray['mon'];
|
||||
$tmpyear = $tmparray['year'];
|
||||
|
||||
$style='cal_current_month';
|
||||
if ($iter_day == 6) $style.=' cal_other_month';
|
||||
$today=0;
|
||||
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
|
||||
if ($today) $style='cal_today_peruser';
|
||||
|
||||
show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var);
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo "</tr>\n";
|
||||
$showheader = false;
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
|
||||
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
$langs->load("commercial");
|
||||
print '<br>'.$langs->trans("Legend").': <br>';
|
||||
foreach($colorsbytype as $code => $color)
|
||||
{
|
||||
if ($color)
|
||||
{
|
||||
print '<div style="float: left; padding: 2px; margin-right: 6px;"><div style="'.($color?'background: #'.$color.';':'').'width:16px; float: left; margin-right: 4px;"> </div>';
|
||||
print $langs->trans("Action".$code)!="Action".$code?$langs->trans("Action".$code):$labelbytype[$code];
|
||||
//print $code;
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
//$color=sprintf("%02x%02x%02x",$theme_datacolor[0][0],$theme_datacolor[0][1],$theme_datacolor[0][2]);
|
||||
print '<div style="float: left; padding: 2px; margin-right: 6px;"><div class="peruser_busy" style="width:16px; float: left; margin-right: 4px;"> </div>';
|
||||
print $langs->trans("Other");
|
||||
print '</div>';
|
||||
/* TODO Show this if at least one cumulated event
|
||||
print '<div style="float: left; padding: 2px; margin-right: 6px;"><div style="background: #222222; width:16px; float: left; margin-right: 4px;"> </div>';
|
||||
print $langs->trans("SeveralEvents");
|
||||
print '</div>';
|
||||
*/
|
||||
}
|
||||
|
||||
// Add js code to manage click on a box
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery(".onclickopenref").click(function() {
|
||||
var ref=$(this).attr(\'ref\');
|
||||
var res = ref.split("_");
|
||||
var userid = res[1];
|
||||
var year = res[2];
|
||||
var month = res[3];
|
||||
var day = res[4];
|
||||
var hour = res[5];
|
||||
var min = res[6];
|
||||
var ids = res[7];
|
||||
if (ids == \'none\') /* No event */
|
||||
{
|
||||
/* alert(\'no event\'); */
|
||||
url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day).'"
|
||||
window.location.href = url;
|
||||
}
|
||||
else if (ids.indexOf(",") > -1) /* There is several events */
|
||||
{
|
||||
/* alert(\'several events\'); */
|
||||
url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
|
||||
window.location.href = url;
|
||||
}
|
||||
else /* One event */
|
||||
{
|
||||
/* alert(\'one event\'); */
|
||||
url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=view&id="+ids
|
||||
window.location.href = url;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Show event line of a particular day for a user
|
||||
*
|
||||
* @param string $username Login
|
||||
* @param int $day Day
|
||||
* @param int $month Month
|
||||
* @param int $year Year
|
||||
* @param int $monthshown Current month shown in calendar view
|
||||
* @param string $style Style to use for this day
|
||||
* @param array $eventarray Array of events
|
||||
* @param int $maxprint Nb of actions to show each day on month view (0 means no limit)
|
||||
* @param int $maxnbofchar Nb of characters to show for event line
|
||||
* @param string $newparam Parameters on current URL
|
||||
* @param int $showinfo Add extended information (used by day view)
|
||||
* @param int $minheight Minimum height for each event. 60px by default.
|
||||
* @param boolean $showheader Show header
|
||||
* @param array $colorsbytype Array with colors by type
|
||||
* @param bool $var true or false for alternat style on tr/td
|
||||
* @return void
|
||||
*/
|
||||
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
|
||||
{
|
||||
global $db;
|
||||
global $user, $conf, $langs, $hookmanager, $action;
|
||||
global $filter, $filtert, $status, $actioncode; // Filters used into search form
|
||||
global $theme_datacolor; // Array with a list of different we can use (come from theme)
|
||||
global $cachethirdparties, $cachecontacts, $colorindexused;
|
||||
global $begin_h, $end_h;
|
||||
|
||||
$cases1 = array(); // Color first half hour
|
||||
$cases2 = array(); // Color second half hour
|
||||
|
||||
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
|
||||
|
||||
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
|
||||
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
|
||||
|
||||
$nextindextouse=count($colorindexused); // At first run, this is 0, so fist user has 0, next 1, ...
|
||||
//if ($username->id && $day==1) var_dump($eventarray);
|
||||
|
||||
// We are in a particular day for $username, now we scan all events
|
||||
foreach ($eventarray as $daykey => $notused)
|
||||
{
|
||||
$annee = date('Y',$daykey);
|
||||
$mois = date('m',$daykey);
|
||||
$jour = date('d',$daykey);
|
||||
//print $annee.'-'.$mois.'-'.$jour.' '.$year.'-'.$month.'-'.$day."<br>\n";
|
||||
|
||||
if ($day==$jour && $month==$mois && $year==$annee) // Is it the day we are looking for when calling function ?
|
||||
{
|
||||
// Scan all event for this date
|
||||
foreach ($eventarray[$daykey] as $index => $event)
|
||||
{
|
||||
//var_dump($event);
|
||||
|
||||
$keysofuserassigned=array_keys($event->userassigned);
|
||||
if (! in_array($username->id,$keysofuserassigned)) continue; // We discard record if event is from another user than user we want to show
|
||||
//if ($username->id != $event->userownerid) continue; // We discard record if event is from another user than user we want to show
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formatEvent',$parameters,$event,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
|
||||
|
||||
// Define $color (Hex string like '0088FF') and $cssclass of event
|
||||
$color=-1; $cssclass=''; $colorindex=-1;
|
||||
if (in_array($user->id, $keysofuserassigned))
|
||||
{
|
||||
$nummytasks++; $cssclass='family_mytasks';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $color=$event->type_color;
|
||||
}
|
||||
else if ($event->type_code == 'ICALEVENT')
|
||||
{
|
||||
$numical++;
|
||||
if (! empty($event->icalname))
|
||||
{
|
||||
if (! isset($numicals[dol_string_nospecial($event->icalname)])) {
|
||||
$numicals[dol_string_nospecial($event->icalname)] = 0;
|
||||
}
|
||||
$numicals[dol_string_nospecial($event->icalname)]++;
|
||||
}
|
||||
|
||||
$color=$event->icalcolor;
|
||||
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
|
||||
}
|
||||
else if ($event->type_code == 'BIRTHDAY')
|
||||
{
|
||||
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$numother++; $cssclass='family_other';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $color=$event->type_color;
|
||||
}
|
||||
|
||||
if ($color < 0) // Color was not forced. Set color according to color index.
|
||||
{
|
||||
// Define color index if not yet defined
|
||||
$idusertouse=($event->userownerid?$event->userownerid:0);
|
||||
if (isset($colorindexused[$idusertouse]))
|
||||
{
|
||||
$colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user
|
||||
}
|
||||
else
|
||||
{
|
||||
$colorindex=$nextindextouse;
|
||||
$colorindexused[$idusertouse]=$colorindex;
|
||||
if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color
|
||||
}
|
||||
// Define color
|
||||
$color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||
}
|
||||
//$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
|
||||
|
||||
// Define all rects with event (cases1 is first half hour, cases2 is second half hour)
|
||||
for ($h = $begin_h; $h < $end_h; $h++)
|
||||
{
|
||||
//if ($username->id == 1 && $day==1) print 'h='.$h;
|
||||
$newcolor = ''; //init
|
||||
if (empty($event->fulldayevent))
|
||||
{
|
||||
$a = dol_mktime((int) $h,0,0,$month,$day,$year,false,0);
|
||||
$b = dol_mktime((int) $h,30,0,$month,$day,$year,false,0);
|
||||
$c = dol_mktime((int) $h+1,0,0,$month,$day,$year,false,0);
|
||||
|
||||
$dateendtouse=$event->date_end_in_calendar;
|
||||
if ($dateendtouse==$event->date_start_in_calendar) $dateendtouse++;
|
||||
|
||||
//print dol_print_date($event->date_start_in_calendar,'dayhour').'-'.dol_print_date($a,'dayhour').'-'.dol_print_date($b,'dayhour').'<br>';
|
||||
|
||||
if ($event->date_start_in_calendar < $b && $dateendtouse > $a)
|
||||
{
|
||||
$busy=$event->transparency;
|
||||
$cases1[$h][$event->id]['busy']=$busy;
|
||||
$cases1[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour');
|
||||
if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar)
|
||||
{
|
||||
$tmpa=dol_getdate($event->date_start_in_calendar,true);
|
||||
$tmpb=dol_getdate($event->date_end_in_calendar,true);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour');
|
||||
else $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour');
|
||||
}
|
||||
$cases1[$h][$event->id]['string'].=' - '.$event->label;
|
||||
$cases1[$h][$event->id]['typecode']=$event->type_code;
|
||||
if ($event->socid)
|
||||
{
|
||||
//$cases1[$h][$event->id]['string'].='xxx';
|
||||
}
|
||||
$cases1[$h][$event->id]['color']=$color;
|
||||
}
|
||||
if ($event->date_start_in_calendar < $c && $dateendtouse > $b)
|
||||
{
|
||||
$busy=$event->transparency;
|
||||
$cases2[$h][$event->id]['busy']=$busy;
|
||||
$cases2[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour');
|
||||
if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar)
|
||||
{
|
||||
$tmpa=dol_getdate($event->date_start_in_calendar,true);
|
||||
$tmpb=dol_getdate($event->date_end_in_calendar,true);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour');
|
||||
else $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour');
|
||||
}
|
||||
$cases2[$h][$event->id]['string'].=' - '.$event->label;
|
||||
$cases2[$h][$event->id]['typecode']=$event->type_code;
|
||||
if ($event->socid)
|
||||
{
|
||||
//$cases2[$h][$event->id]['string'].='xxx';
|
||||
}
|
||||
$cases2[$h][$event->id]['color']=$color;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$busy=$event->transparency;
|
||||
$cases1[$h][$event->id]['busy']=$busy;
|
||||
$cases2[$h][$event->id]['busy']=$busy;
|
||||
$cases1[$h][$event->id]['string']=$event->label;
|
||||
$cases2[$h][$event->id]['string']=$event->label;
|
||||
$cases1[$h][$event->id]['typecode']=$event->type_code;
|
||||
$cases2[$h][$event->id]['typecode']=$event->type_code;
|
||||
$cases1[$h][$event->id]['color']=$color;
|
||||
$cases2[$h][$event->id]['color']=$color;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
break; // We found the date we were looking for. No need to search anymore.
|
||||
}
|
||||
}
|
||||
|
||||
for ($h = $begin_h; $h < $end_h; $h++)
|
||||
{
|
||||
$color1='';$color2='';
|
||||
$style1='';$style2='';
|
||||
$string1=' ';$string2=' ';
|
||||
$title1='';$title2='';
|
||||
if (isset($cases1[$h]) && $cases1[$h] != '')
|
||||
{
|
||||
//$title1.=count($cases1[$h]).' '.(count($cases1[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
|
||||
if (count($cases1[$h]) > 1) $title1.=count($cases1[$h]).' '.(count($cases1[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
|
||||
$string1=' ';
|
||||
if (empty($conf->global->AGENDA_NO_TRANSPARENT_ON_NOT_BUSY)) $style1='peruser_notbusy';
|
||||
else $style1='peruser_busy';
|
||||
foreach($cases1[$h] as $id => $ev)
|
||||
{
|
||||
if ($ev['busy']) $style1='peruser_busy';
|
||||
}
|
||||
}
|
||||
if (isset($cases2[$h]) && $cases2[$h] != '')
|
||||
{
|
||||
//$title2.=count($cases2[$h]).' '.(count($cases2[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
|
||||
if (count($cases2[$h]) > 1) $title2.=count($cases2[$h]).' '.(count($cases2[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
|
||||
$string2=' ';
|
||||
if (empty($conf->global->AGENDA_NO_TRANSPARENT_ON_NOT_BUSY)) $style2='peruser_notbusy';
|
||||
else $style2='peruser_busy';
|
||||
foreach($cases2[$h] as $id => $ev)
|
||||
{
|
||||
if ($ev['busy']) $style2='peruser_busy';
|
||||
}
|
||||
}
|
||||
|
||||
$ids1='';$ids2='';
|
||||
if (count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',',array_keys($cases1[$h]));
|
||||
if (count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',',array_keys($cases2[$h]));
|
||||
|
||||
if ($h == $begin_h) echo '<td class="'.$style.'_peruserleft cal_peruser'.($var?' cal_impair '.$style.'_impair':'').'">';
|
||||
else echo '<td class="'.$style.' cal_peruser'.($var?' cal_impair '.$style.'_impair':'').'">';
|
||||
if (count($cases1[$h]) == 1) // only 1 event
|
||||
{
|
||||
$output = array_slice($cases1[$h], 0, 1);
|
||||
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
|
||||
if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
|
||||
if ($output[0]['color']) $color1 = $output[0]['color'];
|
||||
}
|
||||
else if (count($cases1[$h]) > 1)
|
||||
{
|
||||
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
|
||||
$color1='222222';
|
||||
}
|
||||
|
||||
if (count($cases2[$h]) == 1) // only 1 event
|
||||
{
|
||||
$output = array_slice($cases2[$h], 0, 1);
|
||||
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
|
||||
if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
|
||||
if ($output[0]['color']) $color2 = $output[0]['color'];
|
||||
}
|
||||
else if (count($cases2[$h]) > 1)
|
||||
{
|
||||
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
|
||||
$color2='222222';
|
||||
}
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr><td '.($color1?'style="background: #'.$color1.';"':'').'class="'.($style1?$style1.' ':'').'onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_00_'.($ids1?$ids1:'none').'"'.($title1?' title="'.$title1.'"':'').'>';
|
||||
print $string1;
|
||||
print '</td><td '.($color2?'style="background: #'.$color2.';"':'').'class="'.($style2?$style2.' ':'').'onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_30_'.($ids2?$ids2:'none').'"'.($title2?' title="'.$title2.'"':'').'>';
|
||||
print $string2;
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
@ -55,7 +55,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page","int");
|
||||
if ($page == -1) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="a.datec";
|
||||
@ -85,7 +85,17 @@ $pid=GETPOST("projectid","int",3);
|
||||
$status=GETPOST("status");
|
||||
$type=GETPOST("type");
|
||||
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':'');
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('actioncode','array'))
|
||||
{
|
||||
$actioncode=GETPOST('actioncode','array',3);
|
||||
if (! count($actioncode)) $actioncode='0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||
|
||||
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear'));
|
||||
if ($dateselect > 0)
|
||||
@ -111,7 +121,6 @@ if ($begin_d < 1 || $begin_d > 7) $begin_d = 1;
|
||||
if ($end_d < 1 || $end_d > 7) $end_d = 7;
|
||||
if ($end_d < $begin_d) $end_d = $begin_d + 1;
|
||||
|
||||
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
|
||||
|
||||
@ -278,7 +287,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param);
|
||||
$head = calendars_prepare_head($paramnoaction);
|
||||
|
||||
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
||||
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, 'systemauto');
|
||||
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup);
|
||||
dol_fiche_end();
|
||||
|
||||
$showextcals=$listofextcals;
|
||||
@ -677,7 +686,7 @@ else
|
||||
// Load array of colors by type
|
||||
$colorsbytype=array();
|
||||
$labelbytype=array();
|
||||
$sql="SELECT code, color, libelle FROM ".MAIN_DB_PREFIX."c_actioncomm";
|
||||
$sql="SELECT code, color, libelle FROM ".MAIN_DB_PREFIX."c_actioncomm ORDER BY position";
|
||||
$resql=$db->query($sql);
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
{
|
||||
|
||||
@ -41,7 +41,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
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";
|
||||
if (! $sortfield) $sortfield="a.datep";
|
||||
|
||||
@ -87,8 +87,8 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
@ -101,7 +101,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -94,7 +94,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -108,7 +108,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -34,7 +34,7 @@ $page=GETPOST('page', 'int');
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="p.name";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
$type=GETPOST('type', 'alpha');
|
||||
@ -51,10 +51,10 @@ $result = restrictedArea($user, 'societe',$socid,'');
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('','Contacts');
|
||||
llxHeader('',$langs->trans("Contacts"));
|
||||
|
||||
if ($type == "c" || $type == "p")
|
||||
{
|
||||
@ -68,8 +68,7 @@ if ($type == "f")
|
||||
}
|
||||
|
||||
/*
|
||||
* Mode liste
|
||||
*
|
||||
* List mode
|
||||
*/
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm";
|
||||
|
||||
@ -37,6 +37,7 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn
|
||||
if (! $user->rights->societe->lire) accessforbidden();
|
||||
|
||||
$langs->load("commercial");
|
||||
$langs->load("propal");
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$bid=GETPOST('bid', 'int');
|
||||
@ -114,7 +115,7 @@ if (count($listofsearchfields))
|
||||
foreach($listofsearchfields as $key => $value)
|
||||
{
|
||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr>';
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -32,7 +32,7 @@ $result=restrictedArea($user,'mailing');
|
||||
|
||||
$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;
|
||||
|
||||