diff --git a/.travis.yml b/.travis.yml index 5b07b06f696..98ebd9ceea3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,7 @@ before_script: - pyrus install pear/PHP_CodeSniffer - phpenv rehash - which phpcs + - phpcs --version - phpcs -i - echo Create dir $(pwd)/htdocs/documents - sudo mkdir -p $(pwd)/htdocs/documents/admin/temp; @@ -106,10 +107,10 @@ script: # - cat upgrade2.log - cd ../.. - date - - php -d zend.enable_gc=0 /usr/bin/phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php + - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php - date # - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php 2>&1 - - php -d zend.enable_gc=0 /usr/bin/phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ . 2>&1 + - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/htdocs/conf/conf.php,/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ . 2>&1 - date after_script: diff --git a/ChangeLog b/ChangeLog index e845af8b952..75c284c0283 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,18 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.8 compared to 3.7.* ***** +For users: +- New: + +For translators: +- Update language files. +- New: When a translation is not available we always jump to en_US and only en_US. + +For developers: +- New: Function yn can show a visual checkbox + + ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: - New: Match other auth system: Login can be done entering login or user @@ -103,6 +115,7 @@ For users: - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown +- Fix: datepicker first day of week can be monday by setting into display setup For users, new experimental module (need to set feature level of instance to experimental to see them): - New: Module Accounting Expert to manage accountancy @@ -322,6 +335,14 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 +Fix: Can't update phone_pro from web service +Fix: Some security holes. +Fix: copy extrafields when creating order from proposal. +Fix: report on action was not filtering by environment. +Fix: Avoid missing class error. +Fix: Add function dolEscapeXML. +Fix: Bad days and month reported by function. +Fix: Bad margin calculation. ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: Holiday module was broken. Initializaion of amount of holidays failed. diff --git a/build/debian/README.howto b/build/debian/README.howto index d44e2b692a6..6d5280e56c1 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -108,13 +108,31 @@ http://bugs.debian.org/package severity 123 xxx +##### Update but tracker system + +To set status of a bug to "pending" +> bts tag 999999 +pending + +or replay to email 999999@bugs.debian.org + submitter of bug +With a message starting with: + +Control: tag -1 +pending +Thanks. Fixed into git. + +or replay to email control@bugs.debian.org +With only message +tag 729538 +pending + + + ##### Testing a package into unstable env -Check you have a mysql server available from another interface than localhost +Check you have a mysql server available from another interface than "localhost". Comment line in /etc/mysql/my.cnf if required and restart mysql #bind-address = 127.0.0.1 -Create a chroot called "unstable-amd64-sbuild" +Create a chroot called "unstable-amd64-sbuild". +Chroot env is stored into /srv/chroot directory. > sudo sbuild-createchroot --keyring= unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian Pour lister les env chroot @@ -122,6 +140,7 @@ Pour lister les env chroot Puis pour se connecter et préparer l'environnement > schroot -c name_of_chroot +> cat /etc/debian_chroot to check which debian branch we are into > vi /usr/sbin/policy-rc.d and replace return code 101 (not allowed) into 0 (ok) > apt-get install links mysql-client @@ -135,7 +154,10 @@ Pour tester un package > dpkg -i dolibarr*.deb ou pour avoir des traces: dpkg -D77777 -i dolibarr*.deb > apt-get install -f -Puis http://localhost/dolibarr/ (cela peut etre appeler depuis le hote). +If there is a problem launching apache, because port is already used, change it into your chroot install with +> vi /etc/apache2/ports.conf +Then restart. +Then you can call/test dolibarr with http://localhost:port/dolibarr/ (It can be also called from host). @@ -202,23 +224,6 @@ http://packages.qa.debian.org/t/tcpdf.html * Package will be into release when test will be moved as stable. - -##### Update but tracker system -To set status of a bug to pending -> bts tag 999999 +pending - -or replay to email 999999@bugs.debian.org + submitter of bug -With a message starting with: -Control: tag -1 +pending -and then a text like: -Thanks. Fixed into git. - -or replay to email control@bugs.debian.org -With only message -tag 729538 +pending - - - ##### Create/Maintain dolibarr package To update dolibarr debian package @@ -257,7 +262,7 @@ x.y.z+dfsgw Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit * Add an entry into debian/changelog -> dch -v x.y.z+dfsg-w "My comment" will add entry. +> dch -v x.y.z+dfsgw-v "My comment" will add entry. For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increaed for each new import) Then modify changelog to replace "version" or "unstable" with "UNRELEASED". Then check/modify also the user/date signature: diff --git a/build/debian/changelog b/build/debian/changelog index d3772a76785..e8ea7be4823 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -3,81 +3,4 @@ dolibarr (3.7.0-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. - -- Laurent Destailleur (eldy) Tue, 21 Oct 2014 12:00:00 +0100 - -dolibarr (3.6.1-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Tue, 23 Sep 2014 12:00:00 +0100 - -dolibarr (3.6.0-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Tue, 15 July 2014 12:00:00 +0100 - -dolibarr (3.5.5-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Tue, 8 July 2014 12:00:00 +0100 - -dolibarr (3.5.4-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Tue, 1 July 2014 12:00:00 +0100 - -dolibarr (3.5.3-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Fri, 2 May 2014 12:00:00 +0100 - -dolibarr (3.5.2-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Fri, 14 March 2014 12:00:00 +0100 - -dolibarr (3.5.1-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Fri, 7 Feb 2014 12:00:00 +0100 - -dolibarr (3.5.0-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Fri, 31 Jan 2014 12:00:00 +0100 - -dolibarr (3.4.2-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * Maintenance release. - - -- Laurent Destailleur (eldy) Mon, 30 Dec 2013 12:00:00 +0100 - -dolibarr (3.4.1-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * Maintenance release. - - -- Laurent Destailleur (eldy) Mon, 27 Apr 2013 12:00:00 +0100 - -dolibarr (3.4.0-3) UNRELEASED; urgency=low - - [ Laurent Destailleur (eldy) ] - * Maintenance release. - - -- Laurent Destailleur (eldy) Mon, 22 Apr 2013 12:00:00 +0100 + -- Laurent Destailleur (eldy) Tue, 21 Oct 2014 12:00:00 +0100 \ No newline at end of file diff --git a/build/obs/README b/build/obs/README index 8fc4c27d9b2..cf312fc0e68 100644 --- a/build/obs/README +++ b/build/obs/README @@ -14,7 +14,7 @@ https://build.opensuse.org Packaging rules: http://en.opensuse.org/Portal:Packaging Add attributes: -OBS:Screenshots URL of screenshot +OBS:Screenshots URL of screenshot http://www.dolibarr.org/images/dolibarr_screenshot1.png OBS:QualityCategory Development|Testing|Stable|Private OBS:Maintained 1 @@ -29,12 +29,18 @@ To submit a snapshot for building, we should have a service file with content How to have such a service file created automatically ? -Click on "Add file", then select mode "Upload From: Remote URL" -Enter the Remote URL that should looks like this: http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-x.y.v-3.src.rpm -Then add into advanded - attributes +Go into project you want to update. It mught be: +- openSUSE Build Service > Projects > Application:ERP:Dolibarr > dolibarr +- or your private project + +Once logged, click on "Add file" in section "Source Files", then select mode "Upload From: Remote URL" +Keep empty for "Filename", choose "Remote URL" and enter into last field, URL that should looks like this: +http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-x.y.v-0.3.src.rpm + +Then add into Advanded - Attributes OBS:Screenshots http://www.dolibarr.org/images/dolibarr_screenshot1.png -OBS:QualityCategory Testing +OBS:QualityCategory Stable|Testing|Development|Private # Move project into official directory diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 1007c84eb96..37bcdf8e96b 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -340,21 +340,3 @@ fi * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release - -* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 -- Upstream release - -* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 -- Upstream release - -* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 -- Upstream release - -* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 -- Upstream release - -* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 -- Upstream release - -* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 -- Initial version (#723326) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 5fd9a74f1a6..812e0d3a1c0 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -577,20 +577,3 @@ fi * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release -* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 -- Upstream release - -* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 -- Upstream release - -* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 -- Upstream release - -* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 -- Upstream release - -* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 -- Upstream release - -* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 -- Initial version (#723326) diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index c6fda416db0..5a81827f5fa 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -346,20 +346,3 @@ fi * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release -* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 -- Upstream release - -* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 -- Upstream release - -* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 -- Upstream release - -* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 -- Upstream release - -* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 -- Upstream release - -* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 -- Initial version (#723326) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 935ebf2e6df..5d1e1e19765 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -357,20 +357,3 @@ fi * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release -* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 -- Upstream release - -* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 -- Upstream release - -* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 -- Upstream release - -* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 -- Upstream release - -* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 -- Upstream release - -* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 -- Initial version (#723326) diff --git a/dev/codesniffer/README b/dev/codesniffer/README index b06a2b1e5f6..8a68d8a1140 100755 --- a/dev/codesniffer/README +++ b/dev/codesniffer/README @@ -1,9 +1,12 @@ README (English) -------------------------------- -This directory contains ruleset files to use to -develop Dolibarr EPR & CRM with Eclipse. +This directory contains ruleset files to use to develop Dolibarr EPR & CRM. -Note: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with: +To install/upgrade phpcs: +> sudo pear upgrade PHP_CodeSniffer + +Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with: * tab value to 4 -* path of code sniffer standard to dev/codesniffer \ No newline at end of file +* path of code sniffer standard to dev/codesniffer + diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 7e3057a6675..ffbc1bace39 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -6,6 +6,7 @@ */conf.php */includes/* */documents/* + */dev/vagrant/* */custom/* */nltechno* @@ -169,6 +170,40 @@ 0 + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + 0 + + + 0 + + + 0 + + + 0 + + $out.=' '; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index e45fffff759..413dc3d1544 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -520,118 +520,105 @@ class FormCompany * @param string $htmlname Name of HTML form * @param array $limitto Disable answers that are not id in this array list * @param int $forceid This is to force another object id than object->id - * @param array $events More js events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param string $moreparam String with more param to add into url when noajax search is used. * @return int The selected third party ID */ - function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $events=array(), $moreparam='') + function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $moreparam='') { global $conf, $langs; - // On recherche les societes - $sql = "SELECT s.rowid, s.nom as name FROM"; - $sql.= " ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; - if ($selected && $conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $sql.= " AND s.rowid = ".$selected; + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) + { + // Use Ajax search + $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); + + $socid=0; $name=''; + if ($selected > 0) + { + $tmpthirdparty=new Societe($this->db); + $result = $tmpthirdparty->fetch($selected); + if ($result > 0) + { + $socid = $selected; + $name = $tmpthirdparty->name; + } + } + + // Refresh contacts list on thirdparty list change + $htmloption=''; + + $events=array(); + $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); + if (count($events)) // If there is some ajax events to run once selection is done, we add code here to run events + { + print ''; + } + + print "\n".''."\n"; + print ''; + print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength); + return $socid; + } else { + // Search to list thirdparties + $sql = "SELECT s.rowid, s.nom as name FROM"; + $sql.= " ".MAIN_DB_PREFIX."societe as s"; + $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; // For ajax search we limit here. For combo list, we limit later - if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT - && is_array($limitto) && count($limitto)) + if (is_array($limitto) && count($limitto)) { $sql.= " AND s.rowid IN (".join(',',$limitto).")"; } - } - $sql.= " ORDER BY s.nom ASC"; + $sql.= " ORDER BY s.nom ASC"; - $resql = $this->db->query($sql); - if ($resql) - { - if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) + $resql = $this->db->query($sql); + if ($resql) { - // Use Ajax search - $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); - - $socid=0; - if ($selected) - { - $obj = $this->db->fetch_object($resql); - $socid = $obj->rowid?$obj->rowid:''; - } - - // We recall a page after a small delay when a new input has been selected - $htmloption=''; - //$javaScript = "window.location=\'".$_SERVER['PHP_SELF']."?".$var_id."=".($forceid>0?$forceid:$object->id)."&".$htmlname."=\' + document.getElementById(\'".$htmlname."\').value;"; - //$htmloption.= 'onChange="ac_delay(\''.$javaScript.'\',\'500\');"'; // When we select with mouse - //$htmloption.= 'onKeyUp="if (event.keyCode== 13) { ac_delay(\''.$javaScript.'\',\'500\'); }"'; // When we select with keyboard - - if (count($events)) // If there is some ajax events to run once selection is done, we add code here to run events - { - print ''; - } - - print "\n".''."\n"; - //print ''; - //print ''; - //print ''; - //print '
'; - if ($obj->rowid == 0) - { - print ''; - } - else - { - print ''; - } - print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength); - //print '
'; - //print "\n"; - return $socid; - } - else - { - // No Ajax search print '\n"; return $firstCompany; } - } - else - { - dol_print_error($this->db); + else + { + dol_print_error($this->db); + print 'Error sql'; + } } } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 9160213667b..5081af493d5 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -133,9 +133,10 @@ class FormFile if ($perm) { $langs->load('other'); - $out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); - $out .= ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); - $out .= ')'; + //$out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); + $out .= ' '; + $out.=info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); + //$out .= ')'; } } else @@ -270,13 +271,13 @@ class FormFile if (! empty($iconPDF)) { return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir); } - + $printer=0; if (in_array($modulepart,array('facture','propal','proposal','order','commande','expedition'))) // This feature is implemented only for such elements { $printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled))?true:false; } - + $hookmanager->initHooks(array('formfile')); $forname='builddoc'; $out=''; @@ -779,7 +780,7 @@ class FormFile if ($nboffiles > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - $var=false; + $var=true; foreach($filearray as $key => $file) // filearray must be only files here { if ($file['name'] != '.' @@ -1100,6 +1101,8 @@ class FormFile global $bc; global $sortfield, $sortorder; + $langs->load("link"); + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; $link = new Link($this->db); $links = array(); @@ -1161,7 +1164,7 @@ class FormFile $nboflinks = count($links); if ($nboflinks > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - $var = false; + $var = true; foreach ($links as $link) { $var =! $var; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 1ed76cddd9b..c7f953dbbfc 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -560,13 +560,13 @@ class FormOther * * @param string $set_color Pre-selected color * @param string $prefix Name of HTML field - * @param string $form_name Name of form + * @param string $form_name Deprecated. Not used. * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @return void * @deprecated */ - function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') + function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='') { print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors); } @@ -576,13 +576,13 @@ class FormOther * * @param string $set_color Pre-selected color * @param string $prefix Name of HTML field - * @param string $form_name Name of form + * @param string $form_name Deprecated. Not used. * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @param string $morecss Add css style into input field * @return void */ - function selectColor($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='', $morecss='') + function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='') { global $langs,$conf; diff --git a/htdocs/core/class/mobiledetect.class.php b/htdocs/core/class/mobiledetect.class.php index 72d192a7614..297058698aa 100644 --- a/htdocs/core/class/mobiledetect.class.php +++ b/htdocs/core/class/mobiledetect.class.php @@ -637,6 +637,11 @@ class MobileDetect return null; } + /** + * getMobileHeaders + * + * @return string mobile Headers + */ public function getMobileHeaders() { return self::$mobileHeaders; diff --git a/htdocs/core/class/openid.class.php b/htdocs/core/class/openid.class.php index 5165dcb4994..a5e01998ecd 100644 --- a/htdocs/core/class/openid.class.php +++ b/htdocs/core/class/openid.class.php @@ -247,6 +247,12 @@ class SimpleOpenID } } + /** + * array2url + * + * @param array $arr An array + * @return boolean|string false if KO, string of url if OK + */ function array2url($arr) { // converts associated array to URL Query String if (!is_array($arr)){ @@ -259,6 +265,14 @@ class SimpleOpenID return $query; } + /** + * FSOCK_Request + * + * @param string $url URL + * @param string $method Method + * @param string $params Params + * @return boolean|unknown + */ function FSOCK_Request($url, $method="GET", $params = "") { $fp = fsockopen("ssl://www.myopenid.com", 443, $errno, $errstr, 3); // Connection timeout is 3 seconds @@ -283,6 +297,14 @@ class SimpleOpenID } } + /** + * CURL_Request + * + * @param string $url URL + * @param string $method Method + * @param string $params Params + * @return boolean|unknown + */ function CURL_Request($url, $method="GET", $params = "") { // Remember, SSL MUST BE SUPPORTED if (is_array($params)) $params = $this->array2url($params); @@ -305,6 +327,12 @@ class SimpleOpenID return $response; } + /** + * HTML2OpenIDServer + * + * @param string $content Content + * @return array Array of servers + */ function HTML2OpenIDServer($content) { $get = array(); diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 7e0333bc5aa..7c5c4898fce 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -2,6 +2,7 @@ /* Copyright (C) phpBSM * Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2014 Juanjo Menent * * This file is a modified version of datepicker.php from phpBSM to fix some * bugs, to add new features and to dramatically increase speed. @@ -39,6 +40,7 @@ require_once '../main.inc.php'; if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php $langs->load("main"); +$langs->load("agenda"); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); @@ -57,7 +59,7 @@ if (GETPOST('mode') && GETPOST('mode') == 'test') } else { - print 'Calendar'; + print ''.$langs->trans("Calendar").''; } // Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) @@ -183,6 +185,19 @@ function displayBox($selectedDate,$month,$year) onClick="loadMonth('','','','','defaultlang ?>')">>> + global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1; + if($startday==1) + {?> + trans("ShortMonday") ?> + trans("ShortTuesday") ?> + trans("ShortWednesday") ?> + trans("ShortThursday") ?> + trans("ShortFriday") ?> + trans("ShortSaturday") ?> + trans("ShortSunday") ?> + trans("ShortSunday") ?> trans("ShortMonday") ?> trans("ShortTuesday") ?> @@ -190,6 +205,8 @@ function displayBox($selectedDate,$month,$year) trans("ShortThursday") ?> trans("ShortFriday") ?> trans("ShortSaturday") ?> + ' ; diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index 6369ac9d3ae..fad4926bc4e 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -53,6 +53,13 @@ function GetFolders( $resourceType, $currentFolder ) echo "" ; } +/** + * GetFoldersAndFiles + * + * @param string $resourceType Resource type + * @param string $currentFolder Current folder + * @return void + */ function GetFoldersAndFiles( $resourceType, $currentFolder ) { // Map the virtual path to the local server path. diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.php b/htdocs/core/filemanagerdol/connectors/php/connector.php index 810f75601b6..23d4eb79d77 100644 --- a/htdocs/core/filemanagerdol/connectors/php/connector.php +++ b/htdocs/core/filemanagerdol/connectors/php/connector.php @@ -35,13 +35,18 @@ if ( !$Config['Enabled'] ) DoResponse(); +/** + * DoResponse + * + * @return void + */ function DoResponse() { if (!isset($_GET)) { global $_GET; } if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) ) - return ; + return; // Get the main request informaiton. $sCommand = $_GET['Command'] ; @@ -60,7 +65,7 @@ function DoResponse() if ( $sCommand == 'FileUpload' ) { FileUpload($sResourceType, $sCurrentFolder, $sCommand); - return ; + return; } CreateXmlHeader($sCommand, $sResourceType, $sCurrentFolder); @@ -70,16 +75,16 @@ function DoResponse() { case 'GetFolders' : GetFolders($sResourceType, $sCurrentFolder); - break ; + break; case 'GetFoldersAndFiles' : GetFoldersAndFiles($sResourceType, $sCurrentFolder); - break ; + break; case 'CreateFolder' : CreateFolder($sResourceType, $sCurrentFolder); - break ; + break; } CreateXmlFooter(); - exit ; + exit; } diff --git a/htdocs/core/filemanagerdol/connectors/php/io.php b/htdocs/core/filemanagerdol/connectors/php/io.php index 4183b0e0573..7f3dd4738db 100644 --- a/htdocs/core/filemanagerdol/connectors/php/io.php +++ b/htdocs/core/filemanagerdol/connectors/php/io.php @@ -115,11 +115,18 @@ function ServerMapFolder($resourceType, $folderPath, $sCommand) return CombinePaths($sResourceTypePath, $folderPath); } -function GetParentFolder( $folderPath ) +/** + * GetParentFolder + * + * @param string $folderPath Folder path + * @return string Parent folder + */ +function GetParentFolder($folderPath) { $sPattern = "-[/\\\\][^/\\\\]+[/\\\\]?$-" ; return preg_replace($sPattern, '', $folderPath); } + /** * CreateServerFolder * diff --git a/htdocs/core/filemanagerdol/connectors/php/upload.php b/htdocs/core/filemanagerdol/connectors/php/upload.php index cf329590aed..664ffbf2bdb 100644 --- a/htdocs/core/filemanagerdol/connectors/php/upload.php +++ b/htdocs/core/filemanagerdol/connectors/php/upload.php @@ -27,7 +27,14 @@ require 'util.php'; require 'io.php'; require 'commands.php'; -function SendError( $number, $text ) +/** + * SendError + * + * @param string $number Number + * @param string $text Text + * @return void + */ +function SendError($number, $text) { SendUploadResults($number, '', '', $text); } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 3966b29f874..df7c09d9274 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -323,34 +323,23 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0) if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works) if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; - /* Some properties for combobox: - minLengthToAutocomplete: 2, - comboboxContainerClass: "comboboxContainer", - comboboxValueContainerClass: "comboboxValueContainer", - comboboxValueContentClass: "comboboxValueContent", - comboboxDropDownClass: "comboboxDropDownContainer", - comboboxDropDownButtonClass: "comboboxDropDownButton", - comboboxDropDownItemClass: "comboboxItem", - comboboxDropDownItemHoverClass: "comboboxItemHover", - comboboxDropDownGroupItemHeaderClass: "comboboxGroupItemHeader", - comboboxDropDownGroupItemContainerClass: "comboboxGroupItemContainer", - animationType: "slide", - width: "500px" */ - $msg = ' -
+