diff --git a/.travis.yml b/.travis.yml index e7895e21cb0..d660f89e79d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -289,7 +289,7 @@ script: # Ensure we catch errors set -e #parallel-lint --exclude htdocs/includes --blame . - parallel-lint --exclude htdocs/includes/sabre --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame . + parallel-lint --exclude htdocs/includes/sabre --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame . set +e echo diff --git a/ChangeLog b/ChangeLog index 0bc9d008ea8..d609b7a347a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,20 +5,111 @@ English Dolibarr ChangeLog ***** ChangeLog for 9.0.0 compared to 8.0.0 ***** For Users: -NEW: Stable module: Website -NEW: Stable module: WebDAV -NEW: Stable module: Module Builder +NEW: Stable module: DAV (WebDAV only for the moment) NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more services. +NEW: Stable module "Module Builder" +NEW: Stable module: Website NEW: Experimental module "TakePos" NEW: Experimental module "Ticket" +NEW: Experimental module "Data Privacy" +NEW: Experimental module "Email Collector" NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making Android application like DoliDroid able to provide native features for multicompany module. -NEW: Compatibility with PHP 7.3 +NEW: Compatibility with PHP 7.3 => +NEW: Add admin page for modulebuilder +NEW: Add civility in list of members. Close #9251 +NEW: Add configuration to disable "customer/prospect" thirdparty type +NEW: Add CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY and CONTRACT_HIDE_UNSELECTABLES by SELECT_HIDE_UNSELECTABLES +NEW: Add __DAY_TEXT__ and __MONTH_TEXT__ substitutions vars +NEW: Add due date column in payment lists +NEW: Add email in event history, for reminder email of expired subsription +NEW: Add event tab on resource record +NEW: Add FEC Export in accountancy +NEW: Add filter on staff range in list of thirdparties +NEW: Add a first complete template of website +NEW: Add format code into exported filename of ledger +NEW: Add hidden option EXPENSEREPORT_DEFAULT_VALIDATOR_UNCHANGEABLE +NEW: Add hidden option MAIN_DOCUMENTS_DESCRIPTION_FIRST +NEW: Add link to inventory code +NEW: Add more common social networks fields for business +NEW: Add option PDF_DISABLE_MYCOMPANY_LOGO to disable logo on PDF +NEW: add option PROPOSAL_AUTO_ADD_AUTHOR_AS_CONTACT +NEW: Add option to display thirdparty adress in combolist +NEW: Add option to swap sender/recipient address on PDF +NEW: Add option to display thirdparty adress in combolist +NEW: Add project on pament of salaries +NEW: Add SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME and +NEW: Add somes hooks in bank planned entries +NEW: Add supplier ref in item reception page +NEW: Advanced permission to ignore price min +NEW: Allow to enter a timespent with a numeric value +NEW: Automatic position of scroll when creating an extrafield +NEW: Can add autorefresh=X in any URLs to refresh page after X seconds +NEW: can add project's task to agenda on create event form +NEW: Can delete a website in experimental website module +NEW: Can disable meteo on smartphone only +NEW: Can export/import a website template +NEW: Can filter on EEC, not EEC, etc... in binding step of accountancy +NEW: Can mix offset before and after with rules for due date of invoices +NEW: Can record the supplier product description +NEW: Can select several prospect level in thirdparty filter. +NEW: Can set 2 url in url field of thirdparty +NEW: Can set if a field is mandatory on form level. +NEW: Can set the default focus of each page. +NEW: Add category filter on user list +NEW: Change forgotten password link in general parameters +NEW: Child label of variants change if parent label changes +NEW: Compatibility with new Paybox HMAC requirement +NEW: Each user can set its prefered default calendar page +NEW: Enhancement in process to make manual bank conciliation +NEW: Enhancement in the generic file manager +NEW: Extrafield totalizable +NEW: Hidden conf INVOICE_USE_DEFAULT_DOCUMENT +NEW: hidden conf to search product by supplier ref +NEW: hidden constant to be able to use a thirdparty for donation +NEW: hidden option to define an invoice template for each invoice type +NEW: Highlight lines on lists when they are checked +NEW: Notification module support expense report+holiday validation and approval +NEW: On customer/supplier card, add simple tooltip to amount boxes +NEW: Page to check if the operations/items created between two dates have attached item(s) and possibility to download all attachements +NEW: possibility to add all rights of all modules in one time +NEW: redirect if only one result on global search on card +NEW: Permission to ignore price min +NEW: Can build an archive of full documents directory from backup page +NEW: tag odt line_product_ref_fourn for supplier doc lines +NEW: The binding step in accountancy has a country filter with autocompletion +NEW: Top menu is always on screen with MD theme. +NEW: Withdraw request massaction can include already partially paid invoices For developers: -* Code changes to be more compatible with PSR2 -* Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that) +NEW: Add lib for multiselect with checkboxes +NEW: Add function isValidMXRecord +NEW: Add hook changeRoundingMode in update_price +NEW: Add hook formconfirm to contractcard +NEW: Add hook for virtual stock +NEW: ADD url to see the last version of a external module +NEW: Can enable a module, even external module, from command line +NEW: Can set a tooltip help text on extrafields +NEW: Add product search from barcode via REST api +NEW: can add documents on agenda events using API REST +NEW: Can set the datestart and dateend of cron job into module descriptor +NEW: Close #9296 Add field ref_ext into llx_categorie +NEW: move ticket dictionary in API /setup +NEW: PHPUnitTest on Loan class #3163 +NEW: Code changes to be more compatible with PSR2 +NEW: Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that) +NEW: Add agenda documents in API REST +NEW: Add "checked" field for new list engine compatibility +NEW: REST API improvements +NEW: Save external payment IDs into table of payment +NEW: triggers add commercial and del commercial +NEW: #9236 Allow to import shipment lines via API +NEW: ADD civility list in API +NEW: support selllist in the module builder +NEW: optional param to show a specific extrafield +NEW: hook formConfirm always called if hooked +NEW: hook on dispatch order fourn WARNING: diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile index caa7b0c436a..0d5918c3f4c 100644 --- a/build/docker/Dockerfile +++ b/build/docker/Dockerfile @@ -3,18 +3,30 @@ FROM php:7.0-apache ENV HOST_USER_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' -RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \ +RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libldap2-dev \ && rm -rf /var/lib/apt/lists/* \ && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ && docker-php-ext-install gd \ && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ && docker-php-ext-install ldap \ && docker-php-ext-install mysqli \ - && apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev + && apt-get purge -y libjpeg-dev libldap2-dev COPY docker-run.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/docker-run.sh +RUN pecl install xdebug-2.5.5 && docker-php-ext-enable xdebug +RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.remote_autostart=0' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.default_enable=0' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.remote_host=docker.for.mac.host.internal' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.remote_port=9000' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.remote_connect_back=0' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.profiler_enable=0' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> /usr/local/etc/php/php.ini + + EXPOSE 80 ENTRYPOINT ["docker-run.sh"] diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 589e2a3f55c..a28fc430caa 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "7.0.0", "6.0.5", "5.0.7" ); +return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" ); } sub script_dolibarr_release @@ -263,15 +263,16 @@ if ($upgrade) { local @params = ( [ "action", "upgrade" ], [ "versionfrom", $upgrade->{'version'} ], [ "versionto", $ver ], + [ "installlock", "444" ], ); local $p = $ver >= 3.8 ? "step5" : "etape5"; local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); - # Remove the installation directory. - local $dinstall = "$opts->{'dir'}/install"; - $dinstall =~ s/\/$//; - $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); + # Remove the installation directory. (deprecated) + # local $dinstall = "$opts->{'dir'}/install"; + # $dinstall =~ s/\/$//; + # $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); } else { @@ -306,15 +307,18 @@ else { [ "login", "admin" ], [ "pass", $dompass ], [ "pass_verif", $dompass ], + [ "installlock", "444" ], ); local $p = $ver >= 3.8 ? "step5" : "etape5"; local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); - # Remove the installation directory and protect config file. - local $dinstall = "$opts->{'dir'}/install"; - $dinstall =~ s/\/$//; - $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); + # Remove the installation directory (deprecated) + # local $dinstall = "$opts->{'dir'}/install"; + # $dinstall =~ s/\/$//; + # $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); + + # Protect config file &set_permissions_as_domain_user($d, 0644, $cfile); &set_permissions_as_domain_user($d, 0755, $cfiledir); } @@ -386,6 +390,8 @@ sub script_dolibarr_check_latest { local ($ver) = @_; local @vers = &osdn_package_versions("dolibarr", + $ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" : + $ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 6.0 ? "dolibarr\\-(6\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" : diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 74958d606ec..33fdb675ac0 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2014 Florian Henry +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2014 Florian Henry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +41,7 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $rowid = GETPOST('rowid', 'int'); $cancel = GETPOST('cancel','alpha'); +$accountingaccount = GETPOST('accountingaccount','alpha'); // Security check @@ -229,7 +230,7 @@ if ($action == 'create') { // Account number print '' . $langs->trans("AccountNumber") . ''; - print ''; + print ''; // Label print '' . $langs->trans("Label") . ''; diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index e807d1acced..de7fa495770 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -58,7 +58,7 @@ $pagenext = $page + 1; $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); -$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); +$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); if ($search_accountancy_code_start == - 1) { @@ -127,7 +127,6 @@ if (! empty($search_accountancy_code_end)) { $param .= '&search_accountancy_code_end=' . $search_accountancy_code_end; } - /* * Action */ @@ -154,7 +153,7 @@ if ($action == 'export_csv') $type_export = 'balance'; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; - $result = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter); + $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -266,7 +265,7 @@ if ($action != 'export_csv') $description = $object->get_compte_desc($line->numero_compte); // Search description of the account $root_account_description = $object->get_compte_racine($line->numero_compte); if (empty($description)) { - $link = '' . img_edit_add() . ''; + $link = '' . img_edit_add() . ''; } print ''; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 6074a49f537..70934e01ed6 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -817,7 +817,7 @@ class BookKeeping extends CommonObject $num = $this->db->num_rows($resql); $i = 0; - while ($obj = $this->db->fetch_object($resql) && (empty($limit) || $i < min($limit, $num))) { + while (($obj = $this->db->fetch_object($resql)) && (empty($limit) || $i < min($limit, $num))) { $line = new BookKeepingLine(); $line->id = $obj->rowid; @@ -866,14 +866,13 @@ class BookKeeping extends CommonObject /** * Load object in memory from the database * - * @param string $sortorder Sort Order - * @param string $sortfield Sort field - * @param int $limit offset limit - * @param int $offset offset limit - * @param array $filter filter array - * @param string $filtermode filter mode (AND or OR) - * - * @return int <0 if KO, >0 if OK + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit Offset limit + * @param int $offset Offset limit + * @param array $filter Filter array + * @param string $filtermode Filter mode (AND or OR) + * @return int <0 if KO, >0 if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { @@ -932,7 +931,7 @@ class BookKeeping extends CommonObject } } } - $sql.= ' WHERE entity IN (' . getEntity('accountancy') . ')'; + $sql.= ' WHERE t.entity IN (' . getEntity('accountancy') . ')'; if (count($sqlwhere) > 0) { $sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere); } @@ -950,7 +949,8 @@ class BookKeeping extends CommonObject $num = $this->db->num_rows($resql); $i = 0; - while ($obj = $this->db->fetch_object($resql) && (empty($limit) || $i < min($limit, $num))) { + while (($obj = $this->db->fetch_object($resql)) && (empty($limit) || $i < min($limit, $num))) + { $line = new BookKeepingLine(); $line->id = $obj->rowid; @@ -989,8 +989,7 @@ class BookKeeping extends CommonObject } else { $this->errors[] = 'Error ' . $this->db->lasterror(); dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); - - return - 1; + return -1; } } @@ -1067,6 +1066,7 @@ class BookKeeping extends CommonObject $line->numero_compte = $obj->numero_compte; $line->debit = $obj->debit; $line->credit = $obj->credit; + $this->lines[] = $line; $i++; @@ -1577,7 +1577,7 @@ class BookKeeping extends CommonObject $result = $this->db->query($sql); if ($result) { - while ( $obj = $this->db->fetch_object($result) ) { + while ($obj = $this->db->fetch_object($result)) { $line = new BookKeepingLine(); @@ -1641,7 +1641,7 @@ class BookKeeping extends CommonObject $this->linesexport = array (); $num = $this->db->num_rows($resql); - while ( $obj = $this->db->fetch_object($resql) ) { + while ($obj = $this->db->fetch_object($resql)) { $line = new BookKeepingLine(); $line->id = $obj->rowid; diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 3122526061b..b0ad8150ad4 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -211,7 +211,7 @@ class Lettering extends BookKeeping } if (count($ids) > 1) { - $result = $this->updatelettrage($ids); + $result = $this->updateLettering($ids); } } } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 347c29fc30d..b77759b98a3 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1286,8 +1286,11 @@ else $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1); $c = new Categorie($db); $cats = $c->containing($object->id, Categorie::TYPE_MEMBER); - foreach ($cats as $cat) { - $arrayselected[] = $cat->id; + $arrayselected = array(); + if (is_array($cats)) { + foreach ($cats as $cat) { + $arrayselected[] = $cat->id; + } } print $form->multiselectarray('memcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); print ""; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 9d6c5d02bb4..cee9ce36edd 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -59,6 +59,9 @@ class Adherent extends CommonObject public $mesgs; + /** + * @var string login of member + */ public $login; //! Clear password in memory @@ -68,29 +71,70 @@ class Adherent extends CommonObject //! Encrypted password in database (always defined) public $pass_indatabase_crypted; + /** + * @var string company name + * @deprecated + */ public $societe; /** - * @var Societe $company {@type Societe} + * @var string company name */ public $company; + /** + * @var int Thirdparty ID + */ + public $fk_soc; + /** * @var string Address */ public $address; - public $zip; + /** + * @var string zipcode + */ + public $zip; + + /** + * @var string town + */ public $town; - public $state_id; // Id of department - public $state_code; // Code of department - public $state; // Label of department + /** + * @var int Id of state + */ + public $state_id; + /** + * @var string Code of state + */ + public $state_code; + + /** + * @var string Label of state + */ + public $state; + + /** + * @var string email + */ public $email; - public $skype; - public $twitter; + /** + * @var string skype account + */ + public $skype; + + /** + * @var string twitter account + */ + public $twitter; + + /** + * @var string facebook account + */ public $facebook; /** @@ -120,8 +164,12 @@ class Adherent extends CommonObject public $morphy; public $public; - public $statut; // -1:brouillon, 0:resilie, >=1:valide,paye - public $photo; + + // -1:brouillon, 0:resilie, >=1:valide,paye + // def in common object + //public $statut; + + public $photo; public $datec; public $datem; @@ -129,21 +177,20 @@ class Adherent extends CommonObject public $birth; - public $note_public; - public $note_private; + /** + * @var int id type member + */ + public $typeid; - public $typeid; // Id type adherent - public $type; // Libelle type adherent + /** + * @var string label type member + */ + public $type; public $need_subscription; public $user_id; public $user_login; - /** - * @var int Thirdparty ID - */ - public $fk_soc; - public $datefin; // From member table // Fields loaded by fetch_subscriptions() @@ -155,7 +202,10 @@ class Adherent extends CommonObject public $last_subscription_amount; public $subscriptions=array(); - public $oldcopy; // To contains a clone of this when we need to save old properties of object + /** + * @var Adherent To contains a clone of this when we need to save old properties of object + */ + public $oldcopy; /** * @var int Entity @@ -593,11 +643,11 @@ class Adherent extends CommonObject $luser->societe_id=$this->societe; $luser->birth=$this->birth; - $luser->address=$this->address; - $luser->zip=$this->zip; - $luser->town=$this->town; - $luser->country_id=$this->country_id; - $luser->state_id=$this->state_id; + $luser->address=$this->address; + $luser->zip=$this->zip; + $luser->town=$this->town; + $luser->country_id=$this->country_id; + $luser->state_id=$this->state_id; $luser->email=$this->email; $luser->skype=$this->skype; @@ -2656,7 +2706,7 @@ class Adherent extends CommonObject $this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Adherent")); return 0; } - + $now = dol_now(); $nbok = 0; $nbko = 0; @@ -2760,9 +2810,9 @@ class Adherent extends CommonObject $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); $actionmsg = dol_concatdesc($actionmsg, $message); } - + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - + // Insert record of emails sent $actioncomm = new ActionComm($this->db); @@ -2787,10 +2837,10 @@ class Adherent extends CommonObject $actioncomm->email_tobcc = $sendtobcc; $actioncomm->email_subject = $subject; $actioncomm->errors_to = ''; - + $actioncomm->fk_element = $adherent->id; $actioncomm->elementtype = $adherent->element; - + $actioncomm->extraparams = $extraparams; $actioncomm->create($user); diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 497d4748da8..031e4200268 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -397,7 +397,7 @@ print '

'; */ //if (! empty($conf->global->MAIN_FEATURES_LEVEL)) //{ -print load_fiche_titre($langs->trans("BankAccountReleveModule"), '', ''); +print load_fiche_titre($langs->trans("Other"), '', ''); print "\n"; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 431d93e2a96..6cf9c84d265 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -63,7 +63,7 @@ if ($action == 'setcoder') $resql=$db->query($sqlp); if (! $resql) dol_print_error($db); } -else if ($action == 'update') +elseif ($action == 'update') { $location = GETPOST('GENBARCODE_LOCATION','alpha'); $res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity); @@ -71,17 +71,8 @@ else if ($action == 'update') $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity); $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha'); $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity); -} -else if ($action == 'updateengine') -{ - // TODO Update engines. -} -if ($action && $action != 'setcoder' && $action != 'setModuleOptions') -{ - if (! $res > 0) $error++; - - if (! $error) + if ($res > 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } @@ -90,6 +81,42 @@ if ($action && $action != 'setcoder' && $action != 'setModuleOptions') setEventMessages($langs->trans("Error"), null, 'errors'); } } +elseif ($action == 'updateengine') +{ + $sql = "SELECT rowid, coder"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; + $sql.= " WHERE entity = ".$conf->entity; + $sql.= " ORDER BY code"; + + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + if (GETPOST('coder'.$obj->rowid, 'alpha')) + { + $coder = GETPOST('coder'.$obj->rowid,'alpha'); + $code_id = $obj->rowid; + + $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type"; + $sqlp.= " SET coder = '" . $coder."'"; + $sqlp.= " WHERE rowid = ". $code_id; + $sqlp.= " AND entity = ".$conf->entity; + + $upsql=$db->query($sqlp); + if (! $upsql) dol_print_error($db); + } + + $i++; + } + } +} + /* * View @@ -161,9 +188,12 @@ foreach($dirbarcode as $reldir) print '
'; print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'',''); -//print ""; -//print ''; -//print ""; +if (empty($conf->use_javascript_ajax)) +{ + print ''; + print ''; + print ''; +} print '
'; print ''; @@ -258,10 +288,9 @@ print "
\n"; if (empty($conf->use_javascript_ajax)) { - // TODO Implement code behind action updateengine - //print '
'; + print '
'; + print ''; } -//print ''; print "
"; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 945656962ea..a9068544e35 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -11,6 +11,7 @@ * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2018 Frédéric France * * 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 @@ -995,7 +996,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') print ''; if (! empty($conf->global->MAIN_MULTILANGS)) { - $selectedlang = GETPOSTISSET('langcode','aZ09')?GETPOST('langcode','aZ09'):$langs->defaultlang; + $selectedlang = GETPOSTISSET('langcode')?GETPOST('langcode', 'aZ09'):$langs->defaultlang; if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]}; print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150'); } diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index a68a4bda5a6..f724bd9e50c 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -129,4 +129,4 @@ print ''; // End of page llxFooter(); -$db->close();; +$db->close(); diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 3c242e8048f..55be556afb9 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -517,7 +517,6 @@ print '
';
2 -
trans("BackupDesc2",DOL_DATA_ROOT).'
'; @@ -525,6 +524,13 @@ print $langs->trans("BackupDescX").'

'; ?> +
+ +trans("BackupDumpWizard")); +?> +
" />

+ '; diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 734e9d31f67..49a4daa3b3f 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -304,7 +304,7 @@ if (GETPOST('withtab','alpha')) dol_fiche_head($head, 'fingerprints', '', -1); } -print ''.$langs->trans("FingerprintsDesc")."
\n"; +print ''.$langs->trans("FingerprintsDesc")."
\n"; print '
'; @@ -342,7 +342,7 @@ for ($month = 1 ; $month <= 12 ; $month++) } $retstring.=""; print $retstring; -print ''; +print ''; print ''; print ''; if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) print ' | '.$langs->trans('DownloadBlockChain').''; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index fb662706ed4..a73731699f2 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1280,7 +1280,7 @@ $db->close(); function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $nonew=0) { global $user, $conf, $langs; - global $action, $filter, $filtert, $status, $actioncode; // Filters used into search form + global $action, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form global $theme_datacolor; global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused; @@ -1639,6 +1639,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''.img_picto("all","1downarrow_selected.png").' ...'; print ' +'.(count($eventarray[$daykey])-$maxprint); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index f98ab3ed82a..57337226f40 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -234,7 +234,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; $sql = "SELECT"; if ($usergroup > 0) $sql.=" DISTINCT"; -$sql.= " s.nom as societe, s.rowid as socid, s.client,"; +$sql.= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,"; $sql.= " a.id, a.label, a.datep as dp, a.datep2 as dp2,"; $sql.= ' a.fk_user_author,a.fk_user_action,'; $sql.= " a.fk_contact, a.note, a.percent as percent,"; @@ -605,11 +605,13 @@ if ($resql) // Third party if (! empty($arrayfields['s.nom']['checked'])) { print ''; - if ($obj->socid) + if ($obj->socid > 0) { $societestatic->id=$obj->socid; $societestatic->client=$obj->client; $societestatic->name=$obj->societe; + $societestatic->email=$obj->socemail; + print $societestatic->getNomUrl(1,'',28); } else print ' '; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 0fcdcd47546..196d6f50451 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -14,6 +14,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -438,38 +439,40 @@ class Propal extends CommonObject global $mysoc, $conf, $langs; dol_syslog(get_class($this)."::addline propalid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type, fk_remise_except=".$fk_remise_except); - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - - // Clean parameters - if (empty($remise_percent)) $remise_percent=0; - if (empty($qty)) $qty=0; - if (empty($info_bits)) $info_bits=0; - if (empty($rang)) $rang=0; - if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; - - $remise_percent=price2num($remise_percent); - $qty=price2num($qty); - $pu_ht=price2num($pu_ht); - $pu_ht_devise=price2num($pu_ht_devise); - $pu_ttc=price2num($pu_ttc); - $txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' - $txlocaltax1=price2num($txlocaltax1); - $txlocaltax2=price2num($txlocaltax2); - $pa_ht=price2num($pa_ht); - if ($price_base_type=='HT') - { - $pu=$pu_ht; - } - else - { - $pu=$pu_ttc; - } - - // Check parameters - if ($type < 0) return -1; - if ($this->statut == self::STATUS_DRAFT) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + + // Clean parameters + if (empty($remise_percent)) $remise_percent=0; + if (empty($qty)) $qty=0; + if (empty($info_bits)) $info_bits=0; + if (empty($rang)) $rang=0; + if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; + + $remise_percent=price2num($remise_percent); + $qty=price2num($qty); + $pu_ht=price2num($pu_ht); + $pu_ht_devise=price2num($pu_ht_devise); + $pu_ttc=price2num($pu_ttc); + if (!preg_match('/\((.*)\)/', $txtva)) { + $txtva = price2num($txtva); // $txtva can have format '5,1' or '5.1' or '5.1(XXX)', we must clean only if '5,1' + } + $txlocaltax1=price2num($txlocaltax1); + $txlocaltax2=price2num($txlocaltax2); + $pa_ht=price2num($pa_ht); + if ($price_base_type=='HT') + { + $pu=$pu_ht; + } + else + { + $pu=$pu_ttc; + } + + // Check parameters + if ($type < 0) return -1; + $this->db->begin(); $product_type=$type; @@ -2432,7 +2435,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ - function cloture($user, $statut, $note, $notrigger=0) + function cloture($user, $statut, $note="", $notrigger=0) { global $langs,$conf; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 61ad93660b6..98ff1c45194 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -11,7 +11,7 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016-2018 Ferran Marcet - * Copyright (C) 2017 Charlene Benke + * Copyright (C) 2017-2018 Charlene Benke * Copyright (C) 2018 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify @@ -175,9 +175,6 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab } } -$object = new Propal($db); // To be passed as parameter of executeHooks that need - - /* * Actions */ @@ -425,13 +422,13 @@ if ($resql) $num = $db->num_rows($resql); $arrayofselected=is_array($toselect)?$toselect:array(); - - if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) + + if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - + header("Location: ".DOL_URL_ROOT.'/comm/propal/card.php?id='.$id); exit; } @@ -469,7 +466,7 @@ if ($resql) 'builddoc'=>$langs->trans("PDFMerge"), ); if ($user->rights->propal->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); - if ($user->rights->propal->cloturer) $arrayofmassactions['closed']=$langs->trans("Closed"); + if ($user->rights->propal->cloturer) $arrayofmassactions['closed']=$langs->trans("Close"); if (in_array($massaction, array('presend','predelete','closed'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 3dc168f14c5..5b3f8006345 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -9,8 +9,8 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2016-2017 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2016-2018 Ferran Marcet * * 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 @@ -1312,45 +1312,47 @@ class Commande extends CommonOrder $logtext.= ", date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit, origin=$origin, origin_id=$origin_id, pu_ht_devise=$pu_ht_devise"; dol_syslog(get_class($this).$logtext, LOG_DEBUG); - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - - // Clean parameters - if (empty($remise_percent)) $remise_percent=0; - if (empty($qty)) $qty=0; - if (empty($info_bits)) $info_bits=0; - if (empty($rang)) $rang=0; - if (empty($txtva)) $txtva=0; - if (empty($txlocaltax1)) $txlocaltax1=0; - if (empty($txlocaltax2)) $txlocaltax2=0; - if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; - if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0; - - $remise_percent=price2num($remise_percent); - $qty=price2num($qty); - $pu_ht=price2num($pu_ht); - $pu_ht_devise=price2num($pu_ht_devise); - $pu_ttc=price2num($pu_ttc); - $pa_ht=price2num($pa_ht); - $txtva = price2num($txtva); - $txlocaltax1 = price2num($txlocaltax1); - $txlocaltax2 = price2num($txlocaltax2); - if ($price_base_type=='HT') - { - $pu=$pu_ht; - } - else - { - $pu=$pu_ttc; - } - $label=trim($label); - $desc=trim($desc); - - // Check parameters - if ($type < 0) return -1; - if ($this->statut == self::STATUS_DRAFT) { - $this->db->begin(); + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + + // Clean parameters + if (empty($remise_percent)) $remise_percent=0; + if (empty($qty)) $qty=0; + if (empty($info_bits)) $info_bits=0; + if (empty($rang)) $rang=0; + if (empty($txtva)) $txtva=0; + if (empty($txlocaltax1)) $txlocaltax1=0; + if (empty($txlocaltax2)) $txlocaltax2=0; + if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; + if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0; + + $remise_percent=price2num($remise_percent); + $qty=price2num($qty); + $pu_ht=price2num($pu_ht); + $pu_ht_devise=price2num($pu_ht_devise); + $pu_ttc=price2num($pu_ttc); + $pa_ht=price2num($pa_ht); + if (!preg_match('/\((.*)\)/', $txtva)) { + $txtva = price2num($txtva); // $txtva can have format '5,1' or '5.1' or '5.1(XXX)', we must clean only if '5,1' + } + $txlocaltax1 = price2num($txlocaltax1); + $txlocaltax2 = price2num($txlocaltax2); + if ($price_base_type=='HT') + { + $pu=$pu_ht; + } + else + { + $pu=$pu_ttc; + } + $label=trim($label); + $desc=trim($desc); + + // Check parameters + if ($type < 0) return -1; + + $this->db->begin(); $product_type=$type; if (!empty($fk_product)) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 55e6e2f8ff5..f26d7b86b44 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -401,7 +401,7 @@ if ($resql) $arrayofselected=is_array($toselect)?$toselect:array(); - if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) + if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) { $obj = $db->fetch_object($resql); $id = $obj->rowid; @@ -410,7 +410,7 @@ if ($resql) } llxHeader('',$title,$help_url); - + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); @@ -479,8 +479,8 @@ if ($resql) print ''; print ''; print ''; - - + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit); $topicmail="SendOrderRef"; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 94885ab118b..f20925d7c12 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -634,7 +634,7 @@ if ($resql) } // Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not) - if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE == 1) + if (! empty($conf->global->BANK_REPORT_LAST_NUM_RELEVE)) { print ' '."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("websiteetup"), $help_url, '', 0, 0, $arrayofjs, $arrayofcss, '', '', ''."\n".'
'); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("WebsiteSetup"), $help_url, '', 0, 0, $arrayofjs, $arrayofcss, '', '', ''."\n".'
'); print "\n".'
'; @@ -1647,7 +1672,7 @@ print '
'; if (count($object->records) > 0) // There is at least one web site { // ***** Part for web sites - + print ''; print '
'; print $langs->trans("Website").' : '; print '
'; @@ -1807,6 +1832,7 @@ if (count($object->records) > 0) // There is at least one web site { print '
'; // Close current websitebar to open a new one + print ''; print '
'; print '
'; @@ -2408,8 +2434,8 @@ if ($action == 'editmeta' || $action == 'createcontainer') print $langs->trans("URL"); print ''; print info_admin($langs->trans("OnlyEditionOfSourceForGrabbedContentFuture"), 0, 0, 'warning'); - print ' '; - print ' '.$langs->trans("GrabImagesInto"); + print ' '; + print '
'.$langs->trans("GrabImagesInto"); print ' '; print $langs->trans("ImagesShouldBeSavedInto").' '; $arraygrabimagesinto=array('root'=>$langs->trans("WebsiteRootOfImages"), 'subpage'=>$langs->trans("SubdirOfPage")); @@ -2732,7 +2758,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa $objectpage->fetch($pageid); $jscontent = @file_get_contents($filejs); - $out = ''."\n"; + $out = ''."\n"; // Include a html so we can benefit of the header of page. // Note: We can't use iframe as it can be used to include another external html file @@ -2742,6 +2768,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa $out .= "