diff --git a/ChangeLog b/ChangeLog index cd9397939f5..de1482ea183 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,65 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 15.0.0 compared to 14.0.0 ***** + +For developers: +--------------- + +WARNING: + +Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook. +* Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale. +* The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param). + + + +***** ChangeLog for 14.0.2 compared to 14.0.1 ***** + +FIX: #18353 Invoice list translation issue +FIX: #18375 SQL Error on tasks statistics +FIX: #18465 +FIX: #18484 +FIX: #18531 +FIX: #18542 REST API: set global $user variable to DolibarrApiAccess::user. +FIX: #18544 Shipment REST API: load thirdparty object into the shipment before validating. +FIX: #18544 Shipment rest api: load thirdparty object when validating +FIX: #18565 +FIX: #18589 #18617 +FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility +FIX: #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary. +FIX: Accountancy - Some problems of length with general & subledger account +FIX: add DISTINCT +FIX: Add option $noescapecommand in executeCLI for better compatibility +FIX: Add token to remove error when removing widget +FIX: Add token when remove the last widget on home page +FIX: an approved holiday can be canceled by an admin. +FIX: better sql request +FIX: change LOG_DEBUG with LOG_WARNING in syslog and remove sql error in syslog (already done) +FIX: Collapsing of extrafields has disappeared. +FIX: Date of payment of subscription must not be set to 1970-01-01. +FIX: Export of website generates a package that contains a sql error +FIX: Field already present in SQL request +FIX: increase maxlength of password input +FIX: invoice fetch not found syslog debug level instead of error +FIX: Invoice list - Wrong name for column total_tva +FIX: invoice validation: when checking if any vat rate has a negative amount, prevent false positives with -1E-14 amounts +FIX: Manage credit note on situation invoice for calculate margin +FIX: Menu List of project was not visible. +FIX: migration script +FIX: multicompany transverse mode compatibility +FIX: option "Default value for field 'Refuse bulk emailings'" +FIX: Recommended session.cookie_samesite must be 'Lax' not 'Strict'. +FIX: Relative discount with high nb of decimals +FIX: salary extrafields don't work and table is not well named +FIX: Supplier invoice list - Wrong language key used +FIX: wrong table_element_line +FIX: wrong users count in multicompany transverse mode +FIX: #yogosha6944 Protection against traversal path. + + ***** ChangeLog for 14.0.1 compared to 14.0.0 ***** FIX: $conf->task used but it does not exist, use $conf->projet instead @@ -42,19 +101,6 @@ FIX: using Tulip, deposit mask was not saved FIX: #yogosha6907 -***** ChangeLog for 15.0.0 compared to 14.0.0 ***** - -For developers: ---------------- - -WARNING: - -Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook. -* Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale. - - - ***** ChangeLog for 14.0.0 compared to 13.0.0 ***** For users: diff --git a/README.md b/README.md index 834cc09236e..2cfe4138d62 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ If you don't have time to install it yourself, you can try some commercial 'read Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! -- At first make a backup of your Dolibarr files & than [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) +- At first make a backup of your Dolibarr files & then [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) - Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process. diff --git a/SECURITY.md b/SECURITY.md index 7d65b7e98e4..61f4a392db8 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,11 +4,11 @@ This file contains some policies about the security reports on Dolibarr ERP CRM ## Supported Versions for security reports -| Version | Supported | -| --------- | ------------------ | -| <= 12.* | :x: | -| >= 13.* | :white_check_mark: | - +| Version | Supported | +| ---------- | ---------------------- | +| <= 14.0.1 | :x: | +| >= 14.0.2+ | :white_check_mark: except CSRF attacks| +| >= develop | :white_check_mark: | ## Reporting a Vulnerability @@ -54,7 +54,7 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us * $dolibarr_main_prod must be set to 1 into conf.php * $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value) * $dolibarr_main_force_https must be set to something else than 0. -* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be set to 1 soon by default) +* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 2 into backoffice menu Home - Setup - Other (this protection should be set to 2 soon by default) * The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools) * ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities). * The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer). @@ -90,9 +90,8 @@ Scope is the web application (back office) and the APIs. * Clickjacking/UI redressing * Physical or social engineering attempts or issues that require physical access to a victim’s computer/device * Presence of autocomplete attribute on web forms -* Vulnerabilities affecting outdated browsers or platforms +* Vulnerabilities affecting outdated browsers or platforms, or vulnerabilities inside browsers themself. * Logout and other instances of low-severity Cross-Site Request Forgery -* Missing cookie flags * Missing security-related HTTP headers which do not lead directly to a vulnerability * Reports from automated web vulnerability scanners (Acunetix, Vega, etc.) that have not been validated * Invalid or missing SPF (Sender Policy Framework) records (Incomplete or missing SPF/DKIM/DMARC) diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile index dca74e9e720..eb8e3ade6dc 100644 --- a/build/docker/Dockerfile +++ b/build/docker/Dockerfile @@ -57,7 +57,6 @@ RUN echo "host mail" >> /etc/msmtprc RUN echo "from local@localdomain.com" >> /etc/msmtprc RUN echo "domain localhost.localdomain" >> /etc/msmtprc RUN echo "sendmail_path=/usr/bin/msmtp -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini -RUN echo "localhost localhost.localdomain" >> /etc/hosts EXPOSE 80 diff --git a/build/docker/docker-compose.yml b/build/docker/docker-compose.yml index 2167f069f25..b72118de5fb 100644 --- a/build/docker/docker-compose.yml +++ b/build/docker/docker-compose.yml @@ -46,6 +46,8 @@ services: networks: - internal-pod - external-pod + extra_hosts: + - "localhost.localdomain:127.0.0.1" mail: image: maildev/maildev diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 8e7ef3ef46c..7065e20f92b 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -239,10 +239,18 @@ fclose($fp); if (empty($buildzip)) { print "File ".$outputfile." generated\n"; } else { - $result = dol_compress_file($outputfile, $outputfile.'.zip'); - if ($result > 0) { - dol_delete_file($outputfile); - print "File ".$outputfile.".zip generated\n"; + if ($buildzip == '1' || $buildzip == 'zip') { + $result = dol_compress_file($outputfile, $outputfile.'.zip', 'zip'); + if ($result > 0) { + dol_delete_file($outputfile); + print "File ".$outputfile.".zip generated\n"; + } + } elseif ($buildzip == '2' || $buildzip == 'gz') { + $result = dol_compress_file($outputfile, $outputfile.'.gz', 'gz'); + if ($result > 0) { + dol_delete_file($outputfile); + print "File ".$outputfile.".gz generated\n"; + } } } diff --git a/dev/examples/ldap/ldapsearch_sample1.txt b/dev/examples/ldap/ldapsearch_sample1.txt index 5f667ffd7a4..a02ad632cd0 100644 --- a/dev/examples/ldap/ldapsearch_sample1.txt +++ b/dev/examples/ldap/ldapsearch_sample1.txt @@ -3,11 +3,26 @@ # # Use this sample to search into a ldap # -# ldapsearch -h hostname -x -# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra" -# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)" -# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)" + +# Anonymous access +# ldapsearch -h hostname -p 389 +# +# Login access (using a Bind DN) +# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# +# Login access in SSL (using a Bind DN) +# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local +# If it fails, you may try to use "hostname" that is real name of certificate. +# You must also check that /etc/ldap/ldap.conf contains the line TLS_CACERT /etc/ssl/certs/ca-certificates.crt + +# What to search +# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local" +# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra" +# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)" # # Example to test a ldap search: -# ldapsearch -h hostname -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password +# ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password diff --git a/dev/initdemo/initdemopassword.sh b/dev/initdemo/initdemopassword.sh index 933c3b1afa2..37264fb8e4d 100755 --- a/dev/initdemo/initdemopassword.sh +++ b/dev/initdemo/initdemopassword.sh @@ -171,7 +171,10 @@ if [ $res -ne 0 ]; then fi if [ -s "$mydir/initdemopostsql.sql" ]; then + echo A file initdemopostsql.sql was found, we execute it. mysql -P$port $base < "$mydir/initdemopostsql.sql" +else + echo No file initdemopostsql.sql found, we extra sql action done. fi diff --git a/dev/tools/github_authors_peryear.sh b/dev/tools/github_authors_and_commits_peryear.sh similarity index 100% rename from dev/tools/github_authors_peryear.sh rename to dev/tools/github_authors_and_commits_peryear.sh diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 86efee3a04a..cd48526e62b 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -61,7 +61,7 @@ $object = new AccountingAccount($db); */ if (GETPOST('cancel', 'alpha')) { - $urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1); + $urltogo = $backtopage ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php'; header("Location: ".$urltogo); exit; } @@ -121,7 +121,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) { } if (!$error) { setEventMessages("RecordCreatedSuccessfully", null, 'mesgs'); - $urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1); + $urltogo = $backtopage ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php'; header("Location: " . $urltogo); exit; } diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 4be890de7d5..2e369e19de1 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -811,7 +811,7 @@ if ($resql) { // Modify link if ($canbemodified) { - print '
| '; print $langs->trans('DatePointOfTax'); print ' | '; - print 'id.'">'.img_edit($langs->trans('SetDate'), 1).' | '; + print 'id.'">'.img_edit($langs->trans('SetDate'), 1).' | '; print '
| '.$langs->trans("Description").' | '; @@ -319,7 +330,7 @@ if (!empty($withproject)) { print " | "; } - print '|||||||||||||||
| '; + print ' | ||||||||||||||||
| '; $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : ''); $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp"); print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext); @@ -336,15 +347,15 @@ if (!empty($withproject)) { print " | ||||||||||||||||
| '; - print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); + print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); print ' | '; - print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); print " | |||||||||||||||
| '; - print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); + print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); print ' | '; - print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); print " | |||||||||||||||
| '.$langs->trans("EventOrganizationICSLink").' | '; @@ -353,7 +364,7 @@ if (!empty($withproject)) { $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // Show message - $message = 'entity : ""); + $message = 'entity : ""); $message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').''; print $message; @@ -366,7 +377,7 @@ if (!empty($withproject)) { //print ''; print ' | ';
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id;
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print ' ';
//print '';
@@ -382,8 +393,8 @@ if (!empty($withproject)) {
print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
//print '';
print ' | ';
- $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$projectstatic->id.'&type=global';
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
+ $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$projectstatic->id.'&type=global';
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print ' ';
//print '';
@@ -410,8 +421,10 @@ if (!empty($withproject)) {
if ($action == 'create') {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")), '', 'object_'.$object->picto);
- print ' ';
$morehtmlref .= ' ';
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $moreparam);
print '';
print ' ';
print '';
print '
| '; @@ -1892,7 +1899,7 @@ if ($action == 'create') { print ' | '; if ($action != 'editshipping_method_id') { - print 'id.'">'.img_edit($langs->trans('SetSendingMethod'), 1).' | '; + print 'id.'">'.img_edit($langs->trans('SetSendingMethod'), 1).' | '; } print '||||||||||
| '; print $langs->trans('PaymentMode'); print ' | '; - if ($action != 'editmode' && $object->statut == Expedition::STATUS_VALIDATED) print 'id.'">'.img_edit($langs->trans('SetMode'),1).' | '; + if ($action != 'editmode' && $object->statut == Expedition::STATUS_VALIDATED) print 'id.'">'.img_edit($langs->trans('SetMode'),1).' | '; print '
__(Hello)__,
\n__(YourPartnershipWillSoonBeCanceledContent)__
| '.$langs->trans("Type").' | '; +print ' | ||
| '.$langs->trans("Type").' | '; print img_picto('', dol_buildpath('/opensurvey/img/'.($type == 'classic' ? 'chart-32.png' : 'calendar-32.png'), 1), 'width="16"', 1); print ' '.$langs->trans($type == 'classic' ? "TypeClassic" : "TypeDate").' | ||
| '; $adresseadmin = $object->mail_admin; -print $langs->trans("Title").' | '; +print $langs->trans("Title").' | '; if ($action == 'edit') { print ''; } else { @@ -242,7 +245,7 @@ if ($action == 'edit') { print ' | |
| '.$langs->trans("Description").' | '; +print ' | ||
| '.$langs->trans("Description").' | '; if ($action == 'edit') { $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%'); $doleditor->Create(0, ''); @@ -254,17 +257,17 @@ print ' | ||
| '.$langs->trans("EMail").' | '; + print ' | ||
| '.$langs->trans("EMail").' | '; if ($action == 'edit') { print ''; } else { - print dol_print_email($object->mail_admin, 0, 0, 1); + print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1); } print ' | ||
| '.$langs->trans('ToReceiveEMailForEachVote').' | '; +print ' | ||
| '.$langs->trans('ToReceiveEMailForEachVote').' | '; if ($action == 'edit') { print 'mailsonde ? 'checked="checked"' : '').'">'; } else { @@ -280,7 +283,7 @@ if ($action == 'edit') { print ' | ||
| '.$langs->trans('CanComment').' | '; +print ' | ||
| '.$langs->trans('CanComment').' | '; if ($action == 'edit') { print 'allow_comments ? 'checked="checked"' : '').'">'; } else { @@ -289,7 +292,7 @@ if ($action == 'edit') { print ' | ||
| '.$langs->trans('CanSeeOthersVote').' | '; +print ' | ||
| '.$langs->trans('CanSeeOthersVote').' | '; if ($action == 'edit') { print 'allow_spy ? 'checked="checked"' : '').'">'; } else { @@ -297,8 +300,16 @@ if ($action == 'edit') { } print ' | ||
| '.$langs->trans('ExpireDate').' | '; +print ' | ||
| '.$langs->trans('ExpireDate').' | '; if ($action == 'edit') { print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0); } else { @@ -311,7 +322,7 @@ print ' | ||
| '; -print $langs->trans("Author").' | '; +print $langs->trans("Author").' | '; if ($object->fk_user_creat) { print $userstatic->getLoginUrl(1); } else { @@ -320,7 +331,7 @@ if ($object->fk_user_creat) { print ' | |
| '.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' | '; +print ' | ||
| '.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' | '; // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); @@ -336,8 +347,10 @@ if ($action != 'edit') { print ' | ||
| '.$langs->trans("Type").' | '; +print ' | ||
| '.$langs->trans("Type").' | '; print img_picto('', dol_buildpath('/opensurvey/img/'.($type == 'classic' ? 'chart-32.png' : 'calendar-32.png'), 1), 'width="16"', 1); print ' '.$langs->trans($type == 'classic' ? "TypeClassic" : "TypeDate").' | ||
| '; $adresseadmin = $object->mail_admin; -print $langs->trans("Title").' | '; +print $langs->trans("Title").' | '; if ($action == 'edit') { print ''; } else { @@ -476,8 +477,39 @@ if ($action == 'edit') { } print ' | |
| '.$langs->trans("Description").' | '; +if ($action == 'edit') { + $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%'); + $doleditor->Create(0, ''); +} else { + print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)); +} +print ' | ||
| '.$langs->trans("EMail").' | '; + if ($action == 'edit') { + print ''; + } else { + print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1); + } + print ' | ||
| '.$langs->trans('ExpireDate').' | '; +print ' | ||
| '.$langs->trans('ExpireDate').' | '; if ($action == 'edit') { print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0); } else { @@ -490,7 +522,7 @@ print ' | ||
| '; -print $langs->trans("Author").' | '; +print $langs->trans("Author").' | '; if ($object->fk_user_creat) { print $userstatic->getLoginUrl(1); } else { @@ -499,7 +531,7 @@ if ($object->fk_user_creat) { print ' | |
| '.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' | '; +print ' | ||
| '.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' | '; // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); @@ -521,8 +553,10 @@ if ($action != 'edit') { print ' | ||
| '; - print $langs->trans("Usage"); - print ' | '; - print '';
- if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
- print 'usage_opportunity ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectFollowOpportunity");
- print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
- print ' '; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + print $langs->trans("Usage"); + print ' | '; + print '';
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+ print 'usage_opportunity ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowOpportunity");
+ print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
+ print ' '; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print ' '; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print ' '; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Visibility").' | ';
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index aa9d9a8a437..6f670af2bb6 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -223,7 +223,7 @@ if ($resql) {
print ' ';
print '
';
+ print ' ';
+ print '';
- $head = task_prepare_head($object);
+ print '
'.$langs->trans("Ref").' | ';
- print ''.$langs->trans("Label").' | ';
- print ''.$langs->trans("Project").' | ';
- print $projectstatic->getNomUrl(1);
- print ' | '.$langs->trans("ThirdParty").' | ';
- if ($projectstatic->societe->id) {
- print $projectstatic->societe->getNomUrl(1);
- } else {
- print ' ';
- }
- print ' | ';
+ print ''; + } + + /* + * Actions + */ + /*print ' ';
+
+ if ($user->rights->projet->all->creer || $user->rights->projet->creer)
+ {
+ if ($projectstatic->public || $userWrite > 0)
+ {
+ print ''.$langs->trans('AddTask').'';
+ }
+ else
+ {
+ print ''.$langs->trans('AddTask').'';
+ }
+ }
+ else
+ {
+ print ''.$langs->trans('AddTask').'';
+ }
+
+ print ' ';
+ */
+
+ // To verify role of users
+ //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
+ //$arrayofuseridoftask=$object->getListContactId('internal');
+
+ $head = task_prepare_head($object);
+
+ if ($action == 'edit' && $user->rights->projet->creer) {
+ print '
';
- $morehtmlref .= $langs->trans("Project").': ';
- $morehtmlref .= $projectstatic->getNomUrl(1);
- $morehtmlref .= ' ';
- }
-
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
-
- print ''; - - // Third party - $morehtmlref .= $langs->trans("ThirdParty").': '; - if (!empty($projectstatic->thirdparty)) { - $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); - } - $morehtmlref .= ' ';
- print ' ';
- print '';
-
- print dol_get_fiche_end();
+ $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id);
}
+ $morehtmlref = '';
- if ($action != 'edit') {
- /*
- * Actions
- */
+ // Project
+ if (empty($withproject)) {
+ $morehtmlref .= '';
-
- print '';
- print ' ';
-
- print '
';
-
- print '';
- print ' ';
- print '
';
+ $morehtmlref .= $langs->trans("Project").': ';
+ $morehtmlref .= $projectstatic->getNomUrl(1);
+ $morehtmlref .= ' ';
+ print '';
+
+ print dol_get_fiche_end();
+ }
+
+
+ if ($action != 'edit') {
+ /*
+ * Actions
+ */
+
+ print ''; - print ' ';
+ // Third party
+ $morehtmlref .= $langs->trans("ThirdParty").': ';
+ if (!empty($projectstatic->thirdparty)) {
+ $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
+ }
+ $morehtmlref .= ' ';
+ }
- $parameters = array();
- $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
- // modified by hook
- if (empty($reshook)) {
- // Modify
- if ($user->rights->projet->creer) {
- print ''.$langs->trans('Modify').'';
- } else {
- print ''.$langs->trans('Modify').'';
- }
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
- // Delete
- if ($user->rights->projet->supprimer) {
- if (!$object->hasChildren() && !$object->hasTimeSpent()) {
- print ''.$langs->trans('Delete').'';
- } else {
- print ''.$langs->trans('Delete').'';
- }
- } else {
- print ''.$langs->trans('Delete').'';
- }
+ print '';
+ print ' ';
+
+ print '';
- print ' ';
+ print '';
+ print '
';
+
+ print '';
+ print ' ';
+ print '
';
+
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
+ // modified by hook
+ if (empty($reshook)) {
+ // Modify
+ if ($user->rights->projet->creer) {
+ print ''.$langs->trans('Modify').'';
+ } else {
+ print ''.$langs->trans('Modify').'';
}
- print ' ';
}
+
+ print '';
- print ''; // ancre
+ // Delete
+ if ($user->rights->projet->supprimer) {
+ if (!$object->hasChildren() && !$object->hasTimeSpent()) {
+ print ''.$langs->trans('Delete').'';
+ } else {
+ print ''.$langs->trans('Delete').'';
+ }
+ } else {
+ print ''.$langs->trans('Delete').'';
+ }
- /*
- * Generated documents
- */
- $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
- $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
- $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = ($user->rights->projet->lire);
- $delallowed = ($user->rights->projet->creer);
-
- print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
-
- print ' ';
-
- // List of actions on element
- include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
- $formactions = new FormActions($db);
- $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
- $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject);
-
- print ' ';
+ print ''; // ancre
+
+ /*
+ * Generated documents
+ */
+ $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
+ $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
+ $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
+ $genallowed = ($user->rights->projet->lire);
+ $delallowed = ($user->rights->projet->creer);
+
+ print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
+
+ print ' ';
+
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
+ $formactions = new FormActions($db);
+ $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
+ $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject);
+
+ print ' ';
- $nboftasks = $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
+ $nboftasks = $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, 'progress');
print ' | ';
}
@@ -1387,7 +1401,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
}
print '';
- print '';
+ $form->buttonsSaveCancel();
+ print '';
print '';
print ' | ';
@@ -1722,18 +1737,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) {
if ($conf->MAIN_FEATURES_LEVEL >= 2) {
print ' ';
- print 'fk_task.'&action=splitline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
+ print 'fk_task.'&action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
print img_split();
print '';
}
print ' ';
- print 'fk_task.'&action=editline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
+ print 'fk_task.'&action=editline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
print img_edit();
print '';
print ' ';
- print 'fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
+ print 'fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
print img_delete('default', 'class="pictodelete paddingleft"');
print '';
diff --git a/htdocs/public/eventorganization/attendee_registration.php b/htdocs/public/eventorganization/attendee_register.php
similarity index 70%
rename from htdocs/public/eventorganization/attendee_registration.php
rename to htdocs/public/eventorganization/attendee_register.php
index 385152e420a..a454f214316 100644
--- a/htdocs/public/eventorganization/attendee_registration.php
+++ b/htdocs/public/eventorganization/attendee_register.php
@@ -16,7 +16,7 @@
*/
/**
- * \file htdocs/public/eventorganization/attendee_registration.php
+ * \file htdocs/public/eventorganization/attendee_register.php
* \ingroup project
* \brief Example of form to subscribe to an event
*
@@ -64,19 +64,21 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
global $dolibarr_main_instance_unique_id;
global $dolibarr_main_url_root;
// Init vars
$errmsg = '';
-$num = 0;
$error = 0;
$backtopage = GETPOST('backtopage', 'alpha');
$action = GETPOST('action', 'aZ09');
$email = GETPOST("email");
$societe = GETPOST("societe");
+$emailcompany = GETPOST("emailcompany");
+$note_public = GETPOST('note_public', "nohtml");
// Getting id from Post and decoding it
$type = GETPOST('type', 'aZ09');
@@ -234,7 +236,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
// If the price has been set, name is required for the invoice
if (!GETPOST("societe") && !empty(floatval($project->price_registration))) {
$error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."\n"; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Company"))." \n"; } if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { $error++; @@ -251,10 +253,10 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $confattendee = new ConferenceOrBoothAttendee($db); if ($type == 'global') { - $filter = array('t.fk_project'=>$id, 'customsql'=>'t.email="'.$email.'"'); + $filter = array('t.fk_project'=>((int) $id), 'customsql'=>'t.email="'.$db->escape($email).'"'); } if ($action == 'conf') { - $filter = array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"'); + $filter = array('t.fk_actioncomm'=>((int) $id), 'customsql'=>'t.email="'.$db->escape($email).'"'); } // Check if there is already an attendee into table eventorganization_conferenceorboothattendee for same event (or conference/booth) @@ -269,6 +271,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $confattendee->email = $email; $confattendee->fk_project = $project->id; $confattendee->fk_actioncomm = $id; + $confattendee->note_public = $note_public; $resultconfattendee = $confattendee->create($user); if ($resultconfattendee < 0) { $error++; @@ -279,50 +282,130 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // At this point, we have an existing $confattendee. It may not be linked to a thirdparty. //var_dump($confattendee); - // If the attendee has already been paid - if (!empty($confattendee->date_subscription)) { - $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + // If the registration has already been paid for this attendee + if (!empty($confattendee->date_subscription) && !empty($confattendee->amount)) { + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'master'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); + + $mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorder", $email); + setEventMessages($mesg, null, 'mesgs'); + + $db->commit(); + Header("Location: ".$redirection); exit; } + $resultfetchthirdparty = 0; + + $genericcompanyname = $langs->trans('EventParticipant').' '.($emailcompany ? $emailcompany : $email); // Keep this label simple so we can retreive same thirdparty for another event + // Getting the thirdparty or creating it $thirdparty = new Societe($db); + $contact = new Contact($db); // Fetch using fk_soc if the attendee was already found if (!empty($confattendee->fk_soc) && $confattendee->fk_soc > 0) { $resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc); } else { if (empty($conf->global->EVENTORGANIZATION_DISABLE_RETREIVE_THIRDPARTY_FROM_NAME)) { - // Fetch using the input field by user if we just created the attendee - if (!empty($societe)) { - $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email); - if ($resultfetchthirdparty <= 0) { - // Need to create a new one (not found or multiple with the same name/email) - $resultfetchthirdparty = 0; - } else { - // We found an unique result with that name/email, so we set the fk_soc of attendee + // Fetch using the field input by end user if we have just created the attendee + if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($emailcompany)) { + $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $emailcompany); + if ($resultfetchthirdparty > 0) { + // We found a unique result with the name + emailcompany, so we set the fk_soc of attendee $confattendee->fk_soc = $thirdparty->id; $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email); } - } else { - // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences) - $resultfetchthirdparty = 0; } - } else { - $resultfetchthirdparty = 0; + // Fetch using the field input by end user if we have just created the attendee + if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($email) && $email != $emailcompany) { + $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email); + if ($resultfetchthirdparty > 0) { + // We found a unique result with the name + email, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email); + } + } + } + if ($resultfetchthirdparty <= 0 && !empty($emailcompany)) { + // Try to find thirdparty from the email only + $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $emailcompany); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that email only, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email); + } + } + if ($resultfetchthirdparty <= 0 && !empty($email) && $email != $emailcompany) { + // Try to find thirdparty from the email only + $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that email only, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email); + } + } + if ($resultfetchthirdparty <= 0 && !empty($genericcompanyname)) { + // Try to find thirdparty from the generic mail only + $resultfetchthirdparty = $thirdparty->fetch('', $genericcompanyname, '', '', '', '', '', '', '', '', ''); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that name + email, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email); + } + } + + // TODO Add more tests on a VAT number, profid or a name ? + + if ($resultfetchthirdparty <= 0 && !empty($email)) { + // Try to find the thirdparty from the contact + $resultfetchcontact = $contact->fetch('', null, '', $email); + if ($resultfetchcontact > 0 && $contact->fk_soc > 0) { + $thirdparty->fetch($contact->fk_soc); + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + $resultfetchthirdparty = 1; + } + } + + if ($resultfetchthirdparty <= 0 && !empty($societe)) { + // Try to find thirdparty from the company name only + $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', ''); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that name only, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = "ErrorSeveralCompaniesWithNameContactUs"; + } } } + // If price is empty, no need to create a thirdparty, so we force $resultfetchthirdparty as if we have already found thirdp party. + if (empty(floatval($project->price_registration))) { + $resultfetchthirdparty = 1; + } + if ($resultfetchthirdparty < 0) { + // If an error was found $error++; $errmsg .= $thirdparty->error; - } elseif ($resultfetchthirdparty == 0) { + } elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected // Creation of a new thirdparty if (!empty($societe)) { $thirdparty->name = $societe; } else { - $thirdparty->name = $email; + $thirdparty->name = $genericcompanyname; } $thirdparty->address = GETPOST("address"); $thirdparty->zip = GETPOST("zipcode"); @@ -331,7 +414,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $thirdparty->fournisseur = 0; $thirdparty->country_id = GETPOST("country_id", 'int'); $thirdparty->state_id = GETPOST("state_id", 'int'); - $thirdparty->email = $email; + $thirdparty->email = ($emailcompany ? $emailcompany : $email); // Load object modCodeTiers $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); @@ -359,6 +442,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + // Update attendee country to match country of thirdparty $confattendee->fk_soc = $thirdparty->id; $confattendee->update($user); } @@ -366,10 +450,13 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen } if (!$error) { + // If the registration needs a payment if (!empty(floatval($project->price_registration))) { $outputlangs = $langs; + // TODO Use default language of $thirdparty->default_lang to build $outputlang + // Get product to use for invoice $productforinvoicerow = new Product($db); $productforinvoicerow->id = 0; @@ -378,35 +465,47 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); } + // Create invoice if ($resultprod < 0) { $error++; $errmsg .= $productforinvoicerow->error; } else { $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $confattendee->cond_reglement_id; - $facture->fk_project = $project->id; + if (empty($confattendee->fk_invoice)) { + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $confattendee->cond_reglement_id; + $facture->fk_project = $project->id; + $facture->status = Facture::STATUS_DRAFT; - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($confattendee->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); if (empty($facture->cond_reglement_id)) { - $error++; - $confattendee->error = 'ErrorNoPaymentTermRECEPFound'; - $confattendee->errors[] = $confattendee->error; + $paymenttermstatic = new PaymentTerm($confattendee->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $confattendee->error = 'ErrorNoPaymentTermRECEPFound'; + $confattendee->errors[] = $confattendee->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $confattendee->error = $facture->error; + $confattendee->errors = $facture->errors; + $error++; + } else { + $confattendee->fk_invoice = $resultfacture; + $confattendee->update($user); } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $confattendee->error = $facture->error; - $confattendee->errors = $facture->errors; - $error++; } else { - $facture->add_object_linked($confattendee->element, $confattendee->id); + $facture->fetch($confattendee->fk_invoice); } + + // Add link between invoice and the attendee registration + /*if (!$error) { + $facture->add_object_linked($confattendee->element, $confattendee->id); + }*/ } if (!$error) { @@ -417,19 +516,24 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $date_start = $project->date_start; $date_end = $project->date_end; - $result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $confattendee->error = $facture->error; - $confattendee->errors = $facture->errors; - $error++; + // If there is no lines yet, we add one + if (empty($facture->lines)) { + $result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $confattendee->error = $facture->error; + $confattendee->errors = $facture->errors; + $error++; + } } } if (!$error) { $db->commit(); - // Registration was recorded and invoice was generated, so we send an email + // Registration was recorded and invoice was generated, but payment not yet done. // TODO + // Send an email to says registration shas been received and that we are waiting for the payment. + // Should send email template (EventOrganizationEmailRegistrationEvent) saved into conf EVENTORGANIZATION_TEMPLATE_EMAIL_REGISTRATION_EVENT. // Now we redirect to the payment page $sourcetouse = 'organizedeventregistration'; @@ -442,6 +546,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $redirection .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } + Header("Location: ".$redirection); exit; } else { @@ -585,24 +690,40 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print '
'.$langs->trans("Company").' | ';
+print img_picto('', 'company', 'class="pictofixedwidth"');
+print ' | '.$langs->trans('UserTitle').' | ';
print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').' | '.$langs->trans("Lastname").' * | '.$langs->trans("Firstname").' * | '.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').' | ';
+//print img_picto('', 'email', 'class="pictofixedwidth"');
+print ' | '.$langs->trans("Login").' * | '.$langs->trans("Password").' * | '.$langs->trans("PasswordAgain").' * | '.$langs->trans("Gender").' | ';
print '';
$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"));
print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1);
print ' | '.$langs->trans("Company").' | '.$langs->trans("Address").' | '."\n";
print ' | '.$langs->trans('Country').' | ';
-$country_id = GETPOST('country_id');
+print img_picto('', 'country', 'class="pictofixedwidth"');
+$country_id = GETPOST('country_id', 'int');
if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) {
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
}
@@ -644,14 +658,6 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
}
print ' | '.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').' | '.$langs->trans("Login").' * | '.$langs->trans("Password").' * | '.$langs->trans("PasswordAgain").' * | '.$langs->trans("DateOfBirth").' | ';
print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0);
@@ -669,7 +675,8 @@ print ' | '.$langs->trans("Comments").' | ';
print '';
print ' | '.$langs->trans("TurnoverOrBudget").' * | ';
@@ -712,6 +719,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
';
print ' | ', $langs->transnoentities('EmailSomeoneVoted', $nom, getUrlSondage($numsondage, true))); + $link = getUrlSondage($numsondage, true); + $link = ''.$link.''; + $body = str_replace('\n', ' ', $langs->transnoentities('EmailSomeoneVoted', $nom, $link)); //var_dump($body);exit; $cmailfile = new CMailFile("[".$application."] ".$langs->trans("Poll").': '.$object->title, $email, $conf->global->MAIN_MAIL_EMAIL_FROM, $body, null, null, null, '', '', 0, -1); @@ -272,7 +274,13 @@ $toutsujet = str_replace("°", "'", $toutsujet); print ' '.$langs->trans("YouAreInivitedToVote").' ';
-print $langs->trans("OpenSurveyHowTo").''; +print $langs->trans("OpenSurveyHowTo").' '; +if (empty($object->allow_spy)) { + print ''.$langs->trans("YourVoteIsPrivate").' '; +} else { + print $form->textwithpicto(''.$langs->trans("YourVoteIsPublic").'', $langs->trans("CanSeeOthersVote")).' '; +} +print ' '; print ' '."\n";
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 702c910ea01..059042399a2 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -115,6 +115,8 @@ if (!$action) {
if ($source == 'organizedeventregistration') {
// Finding the Attendee
+ $attendee = new ConferenceOrBoothAttendee($db);
+
$invoiceid = GETPOST('ref', 'int');
$invoice = new Facture($db);
@@ -123,14 +125,28 @@ if ($source == 'organizedeventregistration') {
if ($resultinvoice <= 0) {
setEventMessages(null, $invoice->errors, "errors");
} else {
+ /*
+ $attendeeid = 0;
+
$invoice->fetchObjectLinked();
$linkedAttendees = $invoice->linkedObjectsIds['conferenceorboothattendee'];
if (is_array($linkedAttendees)) {
$linkedAttendees = array_values($linkedAttendees);
+ $attendeeid = $linkedAttendees[0];
+ }*/
+ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
+ $sql .= " WHERE fk_invoice = ".((int) $invoiceid);
+ $resql = $db->query($sql);
+ if ($resql) {
+ $obj = $db->fetch_object($resql);
+ if ($obj) {
+ $attendeeid = $obj->rowid;
+ }
+ }
- $attendee = new ConferenceOrBoothAttendee($db);
- $resultattendee = $attendee->fetch($linkedAttendees[0]);
+ if ($attendeeid > 0) {
+ $resultattendee = $attendee->fetch($attendeeid);
if ($resultattendee <= 0) {
setEventMessages(null, $attendee->errors, "errors");
@@ -1834,12 +1850,13 @@ if ($source == 'organizedeventregistration') {
// Debitor
print ' '.$langs->trans("Attendee");
print ' | ';
- print $thirdparty->name;
+ print $attendee->email;
+ print ($thirdparty->name ? ' ('.$thirdparty->name.')' : '');
print '';
print ' | '; print $conf->global->$key; } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 3317288a4e1..4f25a281890 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -340,6 +340,7 @@ if (empty($reshook)) { $eatby = "dlc".$i; $sellby = "dluo".$i; $batch = "batch".$i; + $cost_price = "cost_price".$i; if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) { $ent = "entl".$i; @@ -364,8 +365,11 @@ if (empty($reshook)) { $sellby = GETPOST($sellby, 'alpha'); $eatbydate = str_replace('/', '-', $eatby); $sellbydate = str_replace('/', '-', $sellby); - - $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), price2num(GETPOST($cost_price, 'double'), 'MU')); + } else { + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); + } if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -914,7 +918,7 @@ if ($action == 'create') { $ent = "entrepot_".$reg[1].'_'.$reg[2]; $pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount $fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2]; - $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int')); + $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' => GETPOST($ent, 'int'), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' => GETPOST('comment'), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int')); } // with batch module enabled @@ -929,13 +933,13 @@ if ($action == 'create') { $ent = 'entrepot_'.$reg[1].'_'.$reg[2]; $pu = 'pu_'.$reg[1].'_'.$reg[2]; $lot = 'lot_number_'.$reg[1].'_'.$reg[2]; - $dDLUO = dol_mktime(12, 0, 0, $_POST['dluo_'.$reg[1].'_'.$reg[2].'month'], $_POST['dluo_'.$reg[1].'_'.$reg[2].'day'], $_POST['dluo_'.$reg[1].'_'.$reg[2].'year']); - $dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1].'_'.$reg[2].'month'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'day'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'year']); + $dDLUO = dol_mktime(12, 0, 0, GETPOST('dluo_'.$reg[1].'_'.$reg[2].'month', 'int'), GETPOST('dluo_'.$reg[1].'_'.$reg[2].'day', 'int'), GETPOST('dluo_'.$reg[1].'_'.$reg[2].'year', 'int')); + $dDLC = dol_mktime(12, 0, 0, GETPOST('dlc_'.$reg[1].'_'.$reg[2].'month', 'int'), GETPOST('dlc_'.$reg[1].'_'.$reg[2].'day', 'int'), GETPOST('dlc_'.$reg[1].'_'.$reg[2].'year', 'int')); $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; - $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); + $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' =>GETPOST($ent, 'int'), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' =>GETPOST('comment'), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); } - // If create form is coming from same page post was sent but an error occured + // If create form is coming from same page, it means that post was sent but an error occured if (preg_match('/^productid([0-9]+)$/i', $key, $reg)) { $numAsked++; @@ -951,7 +955,7 @@ if ($action == 'create') { $dDLUO = dol_mktime(12, 0, 0, GETPOST('dluo'.$reg[1].'month', 'int'), GETPOST('dluo'.$reg[1].'day', 'int'), GETPOST('dluo'.$reg[1].'year', 'int')); $dDLC = dol_mktime(12, 0, 0, GETPOST('dlc'.$reg[1].'month', 'int'), GETPOST('dlc'.$reg[1].'day', 'int'), GETPOST('dlc'.$reg[1].'year', 'int')); $fk_commandefourndet = 'fk_commandefournisseurdet'.$reg[1]; - $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST($comment), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); + $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' =>GETPOST($ent, 'int'), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' =>GETPOST($comment), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); } } @@ -989,6 +993,9 @@ if ($action == 'create') { print ' '.$langs->trans("QtyOrdered").' | ';
print ''.$langs->trans("QtyReceived").' | ';
print ''.$langs->trans("QtyToReceive");
+ if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
+ print ' | '.$langs->trans("ByingPrice").' | ';
+ }
if (empty($conf->productbatch->enabled)) {
print ' ('.$langs->trans("Fill").''; print ' / '.$langs->trans("Reset").')'; @@ -1118,6 +1125,7 @@ if ($action == 'create') { $stock = + $product->stock_warehouse[$dispatchLines[$indiceAsked]['ent']]->real; // Convert to number $deliverableQty = $dispatchLines[$indiceAsked]['qty']; + $cost_price = $dispatchLines[$indiceAsked]['pu']; // Quantity to send print ' ';
@@ -1132,6 +1140,12 @@ if ($action == 'create') {
}
print ' | ';
+ if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
+ print '';
+ print '';
+ print ' | ';
+ }
+
// Stock
if (!empty($conf->stock->enabled)) {
print '';
@@ -1317,7 +1331,7 @@ if ($action == 'create') {
$morehtmlref .= ' | ';
if ($action != 'editdate_livraison') {
- print ''.$langs->trans('Project').' '; if (0) { // Do not change on reception if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -1394,7 +1408,7 @@ if ($action == 'create') { print ' id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).' | ';
+ print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).' | ';
}
print '';
@@ -1527,7 +1541,7 @@ if ($action == 'create') {
print ' | ';
if ($action != 'editshipping_method_id') {
- print 'id.'">'.img_edit($langs->trans('SetReceptionMethod'), 1).' | ';
+ print 'id.'">'.img_edit($langs->trans('SetReceptionMethod'), 1).' | ';
}
print '';
@@ -1565,7 +1579,7 @@ if ($action == 'create') {
print $langs->trans('IncotermLabel');
print ' | ';
if ($user->rights->reception->creer) {
- print ''.img_edit().'';
+ print ''.img_edit().'';
} else {
print ' ';
}
@@ -1920,10 +1934,10 @@ if ($action == 'create') {
} elseif ($object->statut == Reception::STATUS_DRAFT) {
// edit-delete buttons
print ' | ';
- print 'id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_edit().'';
+ print 'id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_edit().'';
print ' | ';
print '';
- print 'id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().'';
+ print 'id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().'';
print ' | ';
// Display lines extrafields
@@ -1990,9 +2004,9 @@ if ($action == 'create') {
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
if ($object->statut == Reception::STATUS_CLOSED && $user->rights->reception->creer) {
if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
- print 'id.'&action=reopen">'.$langs->trans("ClassifyUnbilled").'';
+ print 'id.'&action=reopen&token='.newToken().'">'.$langs->trans("ClassifyUnbilled").'';
} else {
- print 'id.'&action=reopen">'.$langs->trans("ReOpen").'';
+ print 'id.'&action=reopen&token='.newToken().'">'.$langs->trans("ReOpen").'';
}
}
@@ -2026,12 +2040,12 @@ if ($action == 'create') {
$label = "ClassifyBilled";
$paramaction = 'classifybilled';
}
- print 'id.'&action='.$paramaction.'">'.$langs->trans($label).'';
+ print 'id.'&action='.$paramaction.'&token='.newToken().'">'.$langs->trans($label).'';
}
}
if ($user->rights->reception->supprimer) {
- print 'id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'';
+ print 'id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'';
}
}
diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php
index add1be5e831..278263669ea 100644
--- a/htdocs/reception/class/reception.class.php
+++ b/htdocs/reception/class/reception.class.php
@@ -561,7 +561,8 @@ class Reception extends CommonObject
// TODO in future, reception lines may not be linked to order line
$sql = "SELECT cd.fk_product, cd.subprice,";
$sql .= " ed.rowid, ed.qty, ed.fk_entrepot,";
- $sql .= " ed.eatby, ed.sellby, ed.batch";
+ $sql .= " ed.eatby, ed.sellby, ed.batch,";
+ $sql .= " ed.cost_price";
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd,";
$sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed";
$sql .= " WHERE ed.fk_reception = ".((int) $this->id);
@@ -589,7 +590,11 @@ class Reception extends CommonObject
// line without batch detail
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record.
- $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref));
+ if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
+ $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref));
+ } else {
+ $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref));
+ }
if ($result < 0) {
$error++;
$this->errors[] = $mouvS->error;
@@ -601,7 +606,11 @@ class Reception extends CommonObject
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record.
// Note: ->fk_origin_stock = id into table llx_product_batch (may be rename into llx_product_stock_batch in another version)
- $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
+ if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
+ $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
+ } else {
+ $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
+ }
if ($result < 0) {
$error++;
$this->errors[] = $mouvS->error;
@@ -704,9 +713,10 @@ class Reception extends CommonObject
* @param integer $eatby eat-by date
* @param integer $sellby sell-by date
* @param string $batch Lot number
+ * @param double $cost_price Line cost
* @return int <0 if KO, index of line if OK
*/
- public function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '')
+ public function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '', $cost_price = 0)
{
global $conf, $langs, $user;
@@ -746,8 +756,8 @@ class Reception extends CommonObject
$line->eatby = $eatby;
$line->sellby = $sellby;
$line->status = 1;
+ $line->cost_price = $cost_price;
$line->fk_reception = $this->id;
-
$this->lines[$num] = $line;
return $num;
diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php
index ddc28c72896..498b67d1593 100644
--- a/htdocs/reception/contact.php
+++ b/htdocs/reception/contact.php
@@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ''.$langs->trans('Project').' '; if (0) { // Do not change on reception if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 76eb78b856a..b7f3f577ce2 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -579,43 +579,43 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } if ($sall) { - $param .= "&sall=".urlencode($sall); + $param .= "&sall=".urlencode($sall); } if ($search_ref_rcp) { - $param .= "&search_ref_rcp=".urlencode($search_ref_rcp); + $param .= "&search_ref_rcp=".urlencode($search_ref_rcp); } if ($search_ref_liv) { - $param .= "&search_ref_liv=".urlencode($search_ref_liv); + $param .= "&search_ref_liv=".urlencode($search_ref_liv); } if ($search_company) { - $param .= "&search_company=".urlencode($search_company); + $param .= "&search_company=".urlencode($search_company); } if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); + $param .= '&optioncss='.urlencode($optioncss); } if ($search_billed != '' && $search_billed >= 0) { - $param .= "&search_billed=".urlencode($search_billed); + $param .= "&search_billed=".urlencode($search_billed); } if ($search_town) { - $param .= "&search_town=".urlencode($search_town); + $param .= "&search_town=".urlencode($search_town); } if ($search_zip) { - $param .= "&search_zip=".urlencode($search_zip); + $param .= "&search_zip=".urlencode($search_zip); } if ($search_state) { - $param .= "&search_state=".urlencode($search_state); + $param .= "&search_state=".urlencode($search_state); } if ($search_status != '') { - $param .= "&search_status=".urlencode($search_status); + $param .= "&search_status=".urlencode($search_status); } if ($search_country) { - $param .= "&search_country=".urlencode($search_country); + $param .= "&search_country=".urlencode($search_country); } if ($search_type_thirdparty) { - $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty); + $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty); } if ($search_ref_supplier) { - $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); + $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); } // Add $param from extra fields foreach ($search_array_options as $key => $val) { @@ -891,7 +891,7 @@ while ($i < min($num, $limit)) { // Ref if (!empty($arrayfields['e.ref']['checked'])) { - print " ";
+ print ' | ';
print $reception->getNomUrl(1);
$filename = dol_sanitizeFileName($reception->ref);
$filedir = $conf->reception->dir_output.'/'.dol_sanitizeFileName($reception->ref);
@@ -904,10 +904,10 @@ while ($i < min($num, $limit)) {
}
}
- // Ref customer
+ // Ref supplier
if (!empty($arrayfields['e.ref_supplier']['checked'])) {
- print " | ";
- print $obj->ref_supplier;
+ print ' | ';
+ print dol_escape_htmltag($obj->ref_supplier);
print " | \n";
if (!$i) {
$totalarray['nbfield']++;
@@ -916,7 +916,7 @@ while ($i < min($num, $limit)) {
// Third party
if (!empty($arrayfields['s.nom']['checked'])) {
- print '';
+ print ' | ';
print $companystatic->getNomUrl(1);
print ' | ';
if (!$i) {
@@ -925,8 +925,8 @@ while ($i < min($num, $limit)) {
}
// Town
if (!empty($arrayfields['s.town']['checked'])) {
- print '';
- print $obj->town;
+ print ' | ';
+ print dol_escape_htmltag($obj->town);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -934,8 +934,8 @@ while ($i < min($num, $limit)) {
}
// Zip
if (!empty($arrayfields['s.zip']['checked'])) {
- print '';
- print $obj->zip;
+ print ' | ';
+ print dol_escape_htmltag($obj->zip);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -943,7 +943,7 @@ while ($i < min($num, $limit)) {
}
// State
if (!empty($arrayfields['state.nom']['checked'])) {
- print "".$obj->state_name." | \n";
+ print "".dol_escape_htmltag($obj->state_name)." | \n";
if (!$i) {
$totalarray['nbfield']++;
}
@@ -952,7 +952,7 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['country.code_iso']['checked'])) {
print '';
$tmparray = getCountry($obj->fk_pays, 'all');
- print $tmparray['label'];
+ print dol_escape_htmltag($tmparray['label']);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php
index bbf2c80be2f..a75dd432082 100644
--- a/htdocs/reception/note.php
+++ b/htdocs/reception/note.php
@@ -129,7 +129,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ''.$langs->trans('Project').' '; if (0) { // Do not change on reception if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php index 39a5a24347d..41ebc02747f 100644 --- a/htdocs/reception/tpl/linkedobjectblock.tpl.php +++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php @@ -69,7 +69,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { // For now, receptions must stay linked to order, so link is not deletable if ($object->element != 'order_supplier') { ?> - id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php index 6da39445f7f..b6f03d38b76 100644 --- a/htdocs/recruitment/admin/setup.php +++ b/htdocs/recruitment/admin/setup.php @@ -255,7 +255,7 @@ if ($action == 'edit') { print ' ';
- print ''.$langs->trans("Modify").'';
+ print ''.$langs->trans("Modify").'';
print ' ';
}
}
@@ -459,13 +459,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print '';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '';
print ' | ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
print " | ";
}
@@ -475,9 +475,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($conf->global->$constforvar == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
- print 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
+ print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
} else {
- print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
}
print '';
diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php
index 2bcddf58964..60bd0494ebc 100644
--- a/htdocs/recruitment/admin/setup_candidatures.php
+++ b/htdocs/recruitment/admin/setup_candidatures.php
@@ -252,7 +252,7 @@ if ($action == 'edit') {
print '';
- print ''.$langs->trans("Modify").'';
+ print ''.$langs->trans("Modify").'';
print ' ';
}
}
@@ -457,13 +457,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print '';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '';
print ' | ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
print " | ";
}
@@ -473,9 +473,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($conf->global->$constforvar == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
- print 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
+ print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
} else {
- print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
}
print '';
diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php
index 37635d27048..fa7df34af14 100644
--- a/htdocs/recruitment/class/recruitmentcandidature.class.php
+++ b/htdocs/recruitment/class/recruitmentcandidature.class.php
@@ -893,7 +893,7 @@ class RecruitmentCandidature extends CommonObject
$this->lines = array();
$objectline = new RecruitmentCandidatureLine($this->db);
- $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_recruitmentcandidature = '.$this->id));
+ $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_recruitmentcandidature = '.((int) $this->id)));
if (is_numeric($result)) {
$this->error = $this->error;
diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
index 192d1d4c526..ce96d1cd67b 100644
--- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
+++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
@@ -36,7 +36,7 @@ class mod_recruitmentcandidature_standard extends ModeleNumRefRecruitmentCandida
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
- public $prefix = 'JOC';
+ public $prefix = 'JOA';
/**
* @var string Error code (or message)
diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php
index 01ac72065ea..79795472b4e 100644
--- a/htdocs/recruitment/recruitmentcandidature_agenda.php
+++ b/htdocs/recruitment/recruitmentcandidature_agenda.php
@@ -186,7 +186,7 @@ if ($object->id > 0) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php
index db51171a04a..0406c5bc65c 100644
--- a/htdocs/recruitment/recruitmentcandidature_card.php
+++ b/htdocs/recruitment/recruitmentcandidature_card.php
@@ -482,7 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= ''.$langs->trans('Project') . ' '; if ($permissiontoadd) { - //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; + //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; $morehtmlref .= ' : '; if ($action == 'classify') { //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -558,7 +558,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Modify if ($permissiontoadd) { - print 'id.'&action=edit">'.$langs->trans("Modify").''."\n"; + print 'id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans('Modify').''."\n"; } @@ -567,7 +567,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($object->status == $object::STATUS_DRAFT) { if ($permissiontoadd) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print ''.$langs->trans("Validate").''; + print ''.$langs->trans("Validate").''; } else { $langs->load("errors"); print ''.$langs->trans("Validate").''; @@ -620,7 +620,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print 'id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').''."\n"; + print 'id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 2e8c29cf2fe..dcd29c88118 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -167,7 +167,7 @@ if ($object->id) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 70b5366aec7..d2315b1f756 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -338,7 +338,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/recruitment/recruitmentcandidature_card.php', 1).'?id='.$id); + header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentcandidature_card.php?id='.$id); exit; } diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php index 19808ca1b59..ead2df3c973 100644 --- a/htdocs/recruitment/recruitmentcandidature_note.php +++ b/htdocs/recruitment/recruitmentcandidature_note.php @@ -140,7 +140,7 @@ if ($id > 0 || !empty($ref)) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index 253bf2a7e0c..4c3e642a224 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -184,7 +184,7 @@ if ($object->id > 0) { $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php index e5740fb203c..4295ce73284 100644 --- a/htdocs/recruitment/recruitmentjobposition_applications.php +++ b/htdocs/recruitment/recruitmentjobposition_applications.php @@ -148,14 +148,14 @@ if ($reshook < 0) { if (empty($reshook)) { $error = 0; - $backurlforlist = dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1); + $backurlforlist = DOL_URL_ROOT.'/recruitment/recruitmentjobposition_list.php'; if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/recruitment/recruitmentjobposition_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/recruitment/recruitmentjobposition_card.php?id='.($id > 0 ? $id : '__ID__'); } } } @@ -352,7 +352,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; } $morehtmlref .= ' : '; if ($action == 'classify') { diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index e2a848e9760..3fa7617f55c 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -379,7 +379,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; } $morehtmlref .= ' : '; if ($action == 'classify') { @@ -457,7 +457,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Modify if ($permissiontoadd) { - print 'id.'&action=edit">'.$langs->trans("Modify").''."\n"; + print 'id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans('Modify').''."\n"; } @@ -466,7 +466,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($object->status == $object::STATUS_DRAFT) { if ($permissiontoadd) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print ''.$langs->trans("Validate").''; + print ''.$langs->trans("Validate").''; } else { $langs->load("errors"); print ''.$langs->trans("Validate").''; @@ -505,7 +505,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print 'id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').''."\n"; + print 'id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index 43d80901f3d..14355aeb0e3 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -165,7 +165,7 @@ if ($object->id) { $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 8f45caed040..0544cdb160f 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -359,7 +359,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/recruitment/recruitmentjobposition_card.php', 1).'?id='.$id); + header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentjobposition_card.php?id='.$id); exit; } diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php index dc7cdaef4ae..2645980f7bb 100644 --- a/htdocs/recruitment/recruitmentjobposition_note.php +++ b/htdocs/recruitment/recruitmentjobposition_note.php @@ -143,7 +143,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 88b3d0fdb03..989aa4ccf91 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -339,7 +339,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) { // Edit resource if ($user->rights->resource->write) { print ' ';
- print ''.$langs->trans('Modify').'';
+ print ''.$langs->trans('Modify').'';
print ' ';
}
}
@@ -347,7 +347,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) {
// Delete resource
if ($user->rights->resource->delete) {
print '';
- print ''.$langs->trans('Delete').'';
+ print ''.$langs->trans('Delete').'';
print ' ';
}
}
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 7020beced48..a0f80d7b27c 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -974,7 +974,7 @@ class Dolresource extends CommonObject
$linkstart = '';
$linkend = '';
- /*$linkstart = '';
+ /*$linkstart = '';
$linkend = '';*/
$result .= $linkstart;
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index 4d0736c5f64..4a51f1dfbb3 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -502,7 +502,7 @@ if (!$ret) {
$morehtmlref .= ''.$langs->trans('Project').' '; if ($user->rights->commande->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 699b0ec35ba..900c8017f55 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -628,12 +628,12 @@ if ($action == 'create') { } } ); - + } else { alert("'.$langs->trans("FillFieldFirst").'"); } }); - + })'; print ''; } @@ -732,7 +732,7 @@ if ($id) { $morehtmlref .= ' '.$langs->trans('Project').' '; if ($user->rights->salaries->write) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -814,7 +814,7 @@ if ($id) { print $langs->trans('DefaultPaymentMode'); print ''; if ($action != 'editmode') - print ' id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
+ print 'id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
print ' | '; @@ -832,7 +832,7 @@ if ($id) { print $langs->trans('DefaultBankAccount'); print ' | '; if ($action != 'editbankaccount' && $user->rights->salaries->write) { - print ' | id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | '; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | '; } print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans('ThirdPartyType').' | '; if ($action != 'editthirdpartytype' && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).' | '; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).' | '; } print '
| '.$langs->trans('IncotermLabel').' | '; if ($action != 'editincoterm' && $user->rights->societe->creer) { - print 'id.'&action=editincoterm">'.img_edit('', 1).' | '; + print 'id.'&action=editincoterm&token='.newToken().'">'.img_edit('', 1).' | '; } print '
| '.$langs->trans('ParentCompany').' | '; if ($action != 'editparentcompany' && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).' | '; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).' | '; } print '