From c735653180965a040d1356def8722ae0789b3b8d Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 26 Jul 2018 13:49:12 +0200 Subject: [PATCH 001/982] add postgresql to test + add test on installation process --- .travis.yml | 69 +++++++++++++++++++++++++++++++++------- htdocs/install/step1.php | 1 + htdocs/install/step2.php | 9 ++++++ 3 files changed, 68 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 10a2b6e8347..a4d6dbc92d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,16 +64,6 @@ matrix: - php: nightly # We exclude some combinations not usefull to save Travis CPU exclude: - - php: '5.4' - env: DB=postgresql - - php: '5.5' - env: DB=postgresql - - php: '5.6' - env: DB=postgresql - - php: '7.0' - env: DB=postgresql - - php: '7.1' - env: DB=postgresql - php: hhvm env: DB=postgresql - php: nightly @@ -201,7 +191,7 @@ before_script: mysql -e 'CREATE DATABASE IF NOT EXISTS travis;' mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;' mysql -e 'FLUSH PRIVILEGES;' - mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql + #mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql fi if [ "$DB" = 'postgresql' ]; then #pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql @@ -298,6 +288,63 @@ script: # TODO: Check CSS (csslint?) +- | + export INSTALL_FORCED_FILE=htdocs/install/install.forced.php + echo "Setting up Dolibarr $INSTALL_FORCED_FILE" + # Ensure we catch errors + set +e + echo ' $INSTALL_FORCED_FILE + echo '$'force_install_noedit=2';' >> $INSTALL_FORCED_FILE + if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then + echo '$'force_install_type=\'mysqli\'';' >> $INSTALL_FORCED_FILE + fi + if [ "$DB" = 'postgresql' ]; then + echo '$'force_install_type=\'pgsql\'';' >> $INSTALL_FORCED_FILE + fi + echo '$'force_install_dbserver=\'127.0.0.1\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_database=\'travis\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_databaselogin=\'travis\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_databasepass=\'\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_port=\'5432\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_prefix=\'llx_\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_createdatabase=false';' >> $INSTALL_FORCED_FILE + echo '$'force_install_createuser=false';' >> $INSTALL_FORCED_FILE + echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE + echo '$'force_install_main_data_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $INSTALL_FORCED_FILE + # TODO: SQLite + #cat $INSTALL_FORCED_FILE + echo "Installation test" + cd htdocs/install + php step1.php $TRAVIS_BUILD_DIR/htdocs > $TRAVIS_BUILD_DIR/install.log + php step2.php set >> $TRAVIS_BUILD_DIR/install.log + if [ "$?" -ne "0" ]; then + echo "SORRY, AN ERROR OCCURED DURING INSTALLATION PROCESS" + exit 1 + fi + cd ../.. + rm $INSTALL_FORCED_FILE + #cat $TRAVIS_BUILD_DIR/install.log + set +e + echo + + - | + echo "Setting up database to test migrations" + if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then + echo "MySQL" + mysql -e 'DROP DATABASE IF EXISTS travis;' + mysql -e 'CREATE DATABASE IF NOT EXISTS travis;' + mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;' + mysql -e 'FLUSH PRIVILEGES;' + mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql + fi + if [ "$DB" = 'postgresql' ]; then + #pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql + #pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr + pgloader mysql://root@127.0.0.1/travis postgresql:///travis + fi + # TODO: SQLite + echo + - | echo "Upgrading Dolibarr" # Ensure we catch errors diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 838ef34afa3..add57f5d853 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -82,6 +82,7 @@ if (@file_exists($forcedfile)) { // If forced install is enabled, let's replace post values. These are empty because form fields are disabled. if ($force_install_noedit) { $main_dir = detect_dolibarr_main_document_root(); + if (!empty($argv[1])) $main_dir = $argv[1]; // override when executing the script in command line if (!empty($force_install_main_data_root)) { $main_data_dir = $force_install_main_data_root; } else { diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 44661c191d7..e0e7d71c25d 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -65,6 +65,8 @@ if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.fo if (@file_exists($forcedfile)) { $useforcedwizard = true; include_once $forcedfile; + // test for travis + if (!empty($argv[1]) && $argv[1] == "set") $action = "set"; } dolibarr_install_syslog("--- step2: entering step2.php page"); @@ -620,8 +622,15 @@ else print 'Parameter action=set not defined'; } +$ret=0; +if (! $ok && isset($argv[1])) $ret=1; +dol_syslog("Exit ".$ret); + dolibarr_install_syslog("--- step2: end"); pFooter($ok?0:1,$setuplang); if (isset($db) && is_object($db)) $db->close(); + +// Return code if ran from command line +if ($ret) exit($ret); From 9a080a5d62b34dfef364f4d9cf44c350fca398df Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 26 Jul 2018 13:53:44 +0200 Subject: [PATCH 002/982] add sourceline for fastcgi --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a4d6dbc92d2..99bdd8f083f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ addons: - apache2 # mod_php is not supported by Travis. Add fcgi. We install FPM later on. - libapache2-mod-fastcgi + - sourceline: 'deb http://http.us.debian.org/debian main non-free' # We need pgloader for import mysql database into pgsql - pgloader From c8b035659cb21e2c7dd0f72cca6dd9bae5a7ce67 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 26 Jul 2018 14:04:22 +0200 Subject: [PATCH 003/982] add sourceline for fastcgi on the right place --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99bdd8f083f..9c7f562de23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,13 +21,13 @@ addons: - postgresql - sourceline: 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' - key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc' + - sourceline: 'deb http://http.us.debian.org/debian main non-free' packages: # We need a webserver to test the webservices # Let's install Apache with. - apache2 # mod_php is not supported by Travis. Add fcgi. We install FPM later on. - libapache2-mod-fastcgi - - sourceline: 'deb http://http.us.debian.org/debian main non-free' # We need pgloader for import mysql database into pgsql - pgloader From 45bef65fc9ea75786b1dd371c408883348aae42f Mon Sep 17 00:00:00 2001 From: atm-greg Date: Tue, 25 Sep 2018 14:47:13 +0200 Subject: [PATCH 004/982] add hook on commongeneratedocument --- htdocs/core/class/commonobject.class.php | 462 ++++++++++++----------- 1 file changed, 234 insertions(+), 228 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b99c2f8ccd8..7e18e208173 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4057,236 +4057,242 @@ abstract class CommonObject */ protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null) { - global $conf, $langs, $user; - + global $conf, $langs, $user, $hookmanager; + $srctemplatepath=''; - - // Increase limit for PDF build - $err=error_reporting(); - error_reporting(0); - @set_time_limit(120); - error_reporting($err); - - // If selected model is a filename template (then $modele="modelname" or "modelname:filename") - $tmp=explode(':',$modele,2); - if (! empty($tmp[1])) + + $parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams); + $reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + if(empty($reshook)) { - $modele=$tmp[0]; - $srctemplatepath=$tmp[1]; - } - - // Search template files - $file=''; $classname=''; $filefound=0; - $dirmodels=array('/'); - if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels,$conf->modules_parts['models']); - foreach($dirmodels as $reldir) - { - foreach(array('doc','pdf') as $prefix) - { - if (in_array(get_class($this), array('Adherent'))) $file = $prefix."_".$modele.".class.php"; // Member module use prefix_module.class.php - else $file = $prefix."_".$modele.".modules.php"; - - // On verifie l'emplacement du modele - $file=dol_buildpath($reldir.$modelspath.$file,0); - if (file_exists($file)) - { - $filefound=1; - $classname=$prefix.'_'.$modele; - break; - } - } - if ($filefound) break; - } - - // If generator was found - if ($filefound) - { - global $db; // Required to solve a conception default in commonstickergenerator.class.php making an include of code using $db - - require_once $file; - - $obj = new $classname($this->db); - - // If generator is ODT, we must have srctemplatepath defined, if not we set it. - if ($obj->type == 'odt' && empty($srctemplatepath)) - { - $varfortemplatedir=$obj->scandir; - if ($varfortemplatedir && ! empty($conf->global->$varfortemplatedir)) - { - $dirtoscan=$conf->global->$varfortemplatedir; - - $listoffiles=array(); - - // Now we add first model found in directories scanned - $listofdir=explode(',',$dirtoscan); - foreach($listofdir as $key => $tmpdir) - { - $tmpdir=trim($tmpdir); - $tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir); - if (! $tmpdir) { unset($listofdir[$key]); continue; } - if (is_dir($tmpdir)) - { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.od(s|t)$','','name',SORT_ASC,0); - if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); - } - } - - if (count($listoffiles)) - { - foreach($listoffiles as $record) - { - $srctemplatepath=$record['fullname']; - break; - } - } - } - - if (empty($srctemplatepath)) - { - $this->error='ErrorGenerationAskedForOdtTemplateWithSrcFileNotDefined'; - return -1; - } - } - - if ($obj->type == 'odt' && ! empty($srctemplatepath)) - { - if (! dol_is_file($srctemplatepath)) - { - $this->error='ErrorGenerationAskedForOdtTemplateWithSrcFileNotFound'; - return -1; - } - } - - // We save charset_output to restore it because write_file can change it if needed for - // output format that does not support UTF8. - $sav_charset_output=$outputlangs->charset_output; - - if (in_array(get_class($this), array('Adherent'))) - { - $arrayofrecords = array(); // The write_file of templates of adherent class need this var - $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, $moreparams); - } - else - { - $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); - } - // After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index. - - if ($resultwritefile > 0) - { - $outputlangs->charset_output=$sav_charset_output; - - // We delete old preview - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - dol_delete_preview($this); - - // Index file in database - if (! empty($obj->result['fullpath'])) - { - $destfull = $obj->result['fullpath']; - $upload_dir = dirname($destfull); - $destfile = basename($destfull); - $rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir); - - if (! preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir - { - $filename = basename($destfile); - $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); - $rel_dir = preg_replace('/^[\\/]/', '', $rel_dir); - - include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; - $ecmfile=new EcmFiles($this->db); - $result = $ecmfile->fetch(0, '', ($rel_dir?$rel_dir.'/':'').$filename); - - // Set the public "share" key - $setsharekey = false; - if ($this->element == 'propal') - { - $useonlinesignature = $conf->global->MAIN_FEATURES_LEVEL; // Replace this with 1 when feature to make online signature is ok - if ($useonlinesignature) $setsharekey=true; - if (! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; - } - if ($this->element == 'commande' && ! empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; - if ($this->element == 'facture' && ! empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; - if ($setsharekey) - { - if (empty($ecmfile->share)) // Because object not found or share not set yet - { - require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $ecmfile->share = getRandomPassword(true); - } - } - - if ($result > 0) - { - $ecmfile->label = md5_file(dol_osencode($destfull)); // hash of file content - $ecmfile->fullpath_orig = ''; - $ecmfile->gen_or_uploaded = 'generated'; - $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content - $result = $ecmfile->update($user); - if ($result < 0) - { - setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); - } - } - else - { - $ecmfile->entity = $conf->entity; - $ecmfile->filepath = $rel_dir; - $ecmfile->filename = $filename; - $ecmfile->label = md5_file(dol_osencode($destfull)); // hash of file content - $ecmfile->fullpath_orig = ''; - $ecmfile->gen_or_uploaded = 'generated'; - $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content - $result = $ecmfile->create($user); - if ($result < 0) - { - setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); - } - } - - /*$this->result['fullname']=$destfull; - $this->result['filepath']=$ecmfile->filepath; - $this->result['filename']=$ecmfile->filename;*/ - //var_dump($obj->update_main_doc_field);exit; - - // Update the last_main_doc field into main object (if documenent generator has property ->update_main_doc_field set) - $update_main_doc_field=0; - if (! empty($obj->update_main_doc_field)) $update_main_doc_field=1; - if ($update_main_doc_field && ! empty($this->table_element)) - { - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element." SET last_main_doc = '".($ecmfile->filepath.'/'.$ecmfile->filename)."'"; - $sql.= ' WHERE rowid = '.$this->id; - $resql = $this->db->query($sql); - if (! $resql) dol_print_error($this->db); - } - } - } - else - { - dol_syslog('Method ->write_file was called on object '.get_class($obj).' and return a success but the return array ->result["fullpath"] was not set.', LOG_WARNING); - } - - // Success in building document. We build meta file. - dol_meta_create($this); - - return 1; - } - else - { - $outputlangs->charset_output=$sav_charset_output; - dol_print_error($this->db, "Error generating document for ".__CLASS__.". Error: ".$obj->error, $obj->errors); - return -1; - } - - } - else - { - $this->error=$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file); - dol_print_error('',$this->error); - return -1; + // Increase limit for PDF build + $err=error_reporting(); + error_reporting(0); + @set_time_limit(120); + error_reporting($err); + + // If selected model is a filename template (then $modele="modelname" or "modelname:filename") + $tmp=explode(':',$modele,2); + if (! empty($tmp[1])) + { + $modele=$tmp[0]; + $srctemplatepath=$tmp[1]; + } + + // Search template files + $file=''; $classname=''; $filefound=0; + $dirmodels=array('/'); + if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels,$conf->modules_parts['models']); + foreach($dirmodels as $reldir) + { + foreach(array('doc','pdf') as $prefix) + { + if (in_array(get_class($this), array('Adherent'))) $file = $prefix."_".$modele.".class.php"; // Member module use prefix_module.class.php + else $file = $prefix."_".$modele.".modules.php"; + + // On verifie l'emplacement du modele + $file=dol_buildpath($reldir.$modelspath.$file,0); + if (file_exists($file)) + { + $filefound=1; + $classname=$prefix.'_'.$modele; + break; + } + } + if ($filefound) break; + } + + // If generator was found + if ($filefound) + { + global $db; // Required to solve a conception default in commonstickergenerator.class.php making an include of code using $db + + require_once $file; + + $obj = new $classname($this->db); + + // If generator is ODT, we must have srctemplatepath defined, if not we set it. + if ($obj->type == 'odt' && empty($srctemplatepath)) + { + $varfortemplatedir=$obj->scandir; + if ($varfortemplatedir && ! empty($conf->global->$varfortemplatedir)) + { + $dirtoscan=$conf->global->$varfortemplatedir; + + $listoffiles=array(); + + // Now we add first model found in directories scanned + $listofdir=explode(',',$dirtoscan); + foreach($listofdir as $key => $tmpdir) + { + $tmpdir=trim($tmpdir); + $tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir); + if (! $tmpdir) { unset($listofdir[$key]); continue; } + if (is_dir($tmpdir)) + { + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.od(s|t)$','','name',SORT_ASC,0); + if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); + } + } + + if (count($listoffiles)) + { + foreach($listoffiles as $record) + { + $srctemplatepath=$record['fullname']; + break; + } + } + } + + if (empty($srctemplatepath)) + { + $this->error='ErrorGenerationAskedForOdtTemplateWithSrcFileNotDefined'; + return -1; + } + } + + if ($obj->type == 'odt' && ! empty($srctemplatepath)) + { + if (! dol_is_file($srctemplatepath)) + { + $this->error='ErrorGenerationAskedForOdtTemplateWithSrcFileNotFound'; + return -1; + } + } + + // We save charset_output to restore it because write_file can change it if needed for + // output format that does not support UTF8. + $sav_charset_output=$outputlangs->charset_output; + + if (in_array(get_class($this), array('Adherent'))) + { + $arrayofrecords = array(); // The write_file of templates of adherent class need this var + $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, $moreparams); + } + else + { + $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); + } + // After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index. + + if ($resultwritefile > 0) + { + $outputlangs->charset_output=$sav_charset_output; + + // We delete old preview + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + dol_delete_preview($this); + + // Index file in database + if (! empty($obj->result['fullpath'])) + { + $destfull = $obj->result['fullpath']; + $upload_dir = dirname($destfull); + $destfile = basename($destfull); + $rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir); + + if (! preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir + { + $filename = basename($destfile); + $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); + $rel_dir = preg_replace('/^[\\/]/', '', $rel_dir); + + include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; + $ecmfile=new EcmFiles($this->db); + $result = $ecmfile->fetch(0, '', ($rel_dir?$rel_dir.'/':'').$filename); + + // Set the public "share" key + $setsharekey = false; + if ($this->element == 'propal') + { + $useonlinesignature = $conf->global->MAIN_FEATURES_LEVEL; // Replace this with 1 when feature to make online signature is ok + if ($useonlinesignature) $setsharekey=true; + if (! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; + } + if ($this->element == 'commande' && ! empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; + if ($this->element == 'facture' && ! empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; + if ($setsharekey) + { + if (empty($ecmfile->share)) // Because object not found or share not set yet + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + $ecmfile->share = getRandomPassword(true); + } + } + + if ($result > 0) + { + $ecmfile->label = md5_file(dol_osencode($destfull)); // hash of file content + $ecmfile->fullpath_orig = ''; + $ecmfile->gen_or_uploaded = 'generated'; + $ecmfile->description = ''; // indexed content + $ecmfile->keyword = ''; // keyword content + $result = $ecmfile->update($user); + if ($result < 0) + { + setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); + } + } + else + { + $ecmfile->entity = $conf->entity; + $ecmfile->filepath = $rel_dir; + $ecmfile->filename = $filename; + $ecmfile->label = md5_file(dol_osencode($destfull)); // hash of file content + $ecmfile->fullpath_orig = ''; + $ecmfile->gen_or_uploaded = 'generated'; + $ecmfile->description = ''; // indexed content + $ecmfile->keyword = ''; // keyword content + $result = $ecmfile->create($user); + if ($result < 0) + { + setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); + } + } + + /*$this->result['fullname']=$destfull; + $this->result['filepath']=$ecmfile->filepath; + $this->result['filename']=$ecmfile->filename;*/ + //var_dump($obj->update_main_doc_field);exit; + + // Update the last_main_doc field into main object (if documenent generator has property ->update_main_doc_field set) + $update_main_doc_field=0; + if (! empty($obj->update_main_doc_field)) $update_main_doc_field=1; + if ($update_main_doc_field && ! empty($this->table_element)) + { + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element." SET last_main_doc = '".($ecmfile->filepath.'/'.$ecmfile->filename)."'"; + $sql.= ' WHERE rowid = '.$this->id; + $resql = $this->db->query($sql); + if (! $resql) dol_print_error($this->db); + } + } + } + else + { + dol_syslog('Method ->write_file was called on object '.get_class($obj).' and return a success but the return array ->result["fullpath"] was not set.', LOG_WARNING); + } + + // Success in building document. We build meta file. + dol_meta_create($this); + + return 1; + } + else + { + $outputlangs->charset_output=$sav_charset_output; + dol_print_error($this->db, "Error generating document for ".__CLASS__.". Error: ".$obj->error, $obj->errors); + return -1; + } + + } + else + { + $this->error=$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file); + dol_print_error('',$this->error); + return -1; + } } } From 4e4a6294f698f7497aa88f6b6eba6ceb378be0d5 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Tue, 25 Sep 2018 15:18:10 +0200 Subject: [PATCH 005/982] missing return --- htdocs/core/class/commonobject.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7e18e208173..a5c92d07d86 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4294,6 +4294,7 @@ abstract class CommonObject return -1; } } + else return $reshook; } /** From 9f890c28ddbb052551bb78e14bd56ffcec23e57b Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 29 Oct 2018 15:37:17 +0100 Subject: [PATCH 006/982] add ability to edit price ht before adding a line --- htdocs/core/tpl/objectline_create.tpl.php | 18 ++++++++++++++++-- htdocs/langs/en_US/admin.lang | 1 + htdocs/product/admin/product.php | 11 +++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 23640216cd9..5430eb0ad46 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -646,8 +646,19 @@ jQuery(document).ready(function() { setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva jQuery('#trlinefordates').show(); - + global->EDIT_PREDEF_PRICEHT)) + { + ?> + // get the HT price for the product and display it + $.post('/product/ajax/products.php?action=fetch', { 'id': $(this).val(), 'socid' : socid; ?> }, function(data) { + jQuery("#price_ht").val(data.price_ht); + }, + 'json'); + rights->margins->creer) { $langs->load('stocks'); @@ -831,7 +842,10 @@ function setforpredef() { jQuery("#prod_entry_mode_free").prop('checked',false).change(); jQuery("#prod_entry_mode_predef").prop('checked',true).change(); - jQuery("#price_ht").val('').hide(); + global->EDIT_PREDEF_PRICEHT)) + {?> + jQuery("#price_ht").val('').hide(); + jQuery("#multicurrency_price_ht").hide(); jQuery("#price_ttc").hide(); // May no exists jQuery("#fourn_ref").hide(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 190b7cded97..ba6989d6288 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1447,6 +1447,7 @@ ServiceSetup=Services module setup ProductServiceSetup=Products and Services modules setup NumberOfProductShowInSelect=Max number of products in combos select lists (0=no limit) ViewProductDescInFormAbility=Display product descriptions in forms (otherwise as popup tooltip) +EditPredifinedPriceHTAbility=Add the ability to edit price ht before adding a line on documents MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal ViewProductDescInThirdpartyLanguageAbility=Display products descriptions in the language of the third party UseSearchToSelectProductTooltip=Also if you have a large number of products (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 45f938431c3..a8116314dda 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -155,6 +155,9 @@ if ($action == 'other') $resql_new = $db->query($sql_new); } } + + $value = GETPOST('activate_EditPredifinedPriceHT','alpha'); + $res = dolibarr_set_const($db, "EDIT_PREDEF_PRICEHT", $value,'chaine',0,'',$conf->entity); } if ($action == 'specimen') // For products @@ -675,6 +678,14 @@ if (! empty($conf->fournisseur->enabled)) print ''; } +// Activate price ht edition for predefined product on line add +print ''; +print ''.$langs->trans("EditPredifinedPriceHTAbility").''; +print ''; +print $form->selectyesno("activate_EditPredifinedPriceHT",$conf->global->EDIT_PREDEF_PRICEHT,1); +print ''; +print ''; + if (! empty($conf->global->PRODUCT_CANVAS_ABILITY)) { // Add canvas feature From 3bd1563052243ccd7552fe4ff6876366913abf1e Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 29 Oct 2018 16:46:06 +0100 Subject: [PATCH 007/982] fix travis white_space error --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 5430eb0ad46..458872cf99b 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -646,7 +646,7 @@ jQuery(document).ready(function() { setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva jQuery('#trlinefordates').show(); - global->EDIT_PREDEF_PRICEHT)) { ?> From b6deda1111fd654086f6faf7d3dc6a0227e55b39 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Mon, 18 Feb 2019 12:28:18 +0100 Subject: [PATCH 008/982] FIX credit note used on list --- .../fourn/class/fournisseur.facture.class.php | 21 +++++++++++++++++++ htdocs/fourn/facture/list.php | 6 ++++++ 2 files changed, 27 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 086f154184d..4ad0b221c36 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2574,6 +2574,27 @@ class FactureFournisseur extends CommonInvoice return ($this->statut == self::STATUS_VALIDATED) && ($this->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)); } + + /** + * Is credit note used + * + * @return bool + */ + public function isCreditNoteUsed() + { + global $db; + + $isUsed = false; + + $sql = "SELECT fk_invoice_supplier FROM ".MAIN_DB_PREFIX."societe_remise_except WHERE fk_invoice_supplier_source=".$this->id; + $resql = $db->query($sql); + if(!empty($resql)){ + $obj = $db->fetch_object($resql); + if(!empty($obj->fk_invoice_supplier))$isUsed=true; + } + + return $isUsed; + } } diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 98a6956a809..b53a07104c7 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -833,6 +833,7 @@ if ($resql) $facturestatic->date_echeance = $db->jdate($obj->datelimite); $facturestatic->statut = $obj->fk_statut; + $thirdparty->id=$obj->socid; $thirdparty->name=$obj->name; $thirdparty->client=$obj->client; @@ -850,6 +851,11 @@ if ($resql) $totalpay = $paiement + $totalcreditnotes + $totaldeposits; $remaintopay = $obj->total_ttc - $totalpay; + //If invoice has been converted and the conversion has been used, we dont have remain to pay on invoice + if($facturestatic->type == FactureFournisseur::TYPE_CREDIT_NOTE && $facturestatic->statut == FactureFournisseur::STATUS_CLOSED) { + if($facturestatic->isCreditNoteUsed())$remaintopay=0; + } + print ''; if (! empty($arrayfields['f.ref']['checked'])) { From 785092544115056183e718a831e3ac419c4b797e Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Fri, 22 Feb 2019 15:10:41 +0100 Subject: [PATCH 009/982] FIX amount opened on thirdparty card dont care of credit note not converted --- htdocs/societe/class/societe.class.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 412bf46b082..b894504bb10 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3727,7 +3727,7 @@ class Societe extends CommonObject $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); */ - if ($mode == 'supplier') $sql = "SELECT rowid, total_ht as total_ht, total_ttc, paye, fk_statut, close_code FROM ".MAIN_DB_PREFIX.$table." as f"; + if ($mode == 'supplier') $sql = "SELECT rowid, total_ht as total_ht, total_ttc, paye, type, fk_statut, close_code FROM ".MAIN_DB_PREFIX.$table." as f"; else $sql = "SELECT rowid, total as total_ht, total_ttc, paye, fk_statut, close_code FROM ".MAIN_DB_PREFIX.$table." as f"; $sql .= " WHERE fk_soc = ". $this->id; if ($mode == 'supplier') { @@ -3754,7 +3754,13 @@ class Societe extends CommonObject $tmpobject=new Facture($this->db); } while($obj=$this->db->fetch_object($resql)) { - $tmpobject->id=$obj->rowid; + $tmpobject->id=$obj->rowid; + + $paiement = $tmpobject->getSommePaiement(); + $creditnotes = $tmpobject->getSumCreditNotesUsed(); + $deposits = $tmpobject->getSumDepositsUsed(); + + if ($obj->fk_statut != 0 // Not a draft && ! ($obj->fk_statut == 3 && $obj->close_code == 'replaced') // Not a replaced invoice ) @@ -3768,11 +3774,14 @@ class Societe extends CommonObject && $obj->fk_statut != 2) // Not classified as paid //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason { - $paiement = $tmpobject->getSommePaiement(); - $creditnotes = $tmpobject->getSumCreditNotesUsed(); - $deposits = $tmpobject->getSumDepositsUsed(); + $outstandingOpened+=$obj->total_ttc - $paiement - $creditnotes - $deposits; } + + if($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $obj->fk_statut == FactureFournisseur::STATUS_CLOSED && !$tmpobject->isCreditNoteUsed()) { //if credit note is converted but not used + + $outstandingOpened+=$obj->total_ttc-$paiement; + } } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } From dc7a2fbb30e34b04a5cc88af5ac6234c8be56911 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Mon, 25 Feb 2019 10:01:26 +0100 Subject: [PATCH 010/982] FIX placement function --- htdocs/societe/class/societe.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index b894504bb10..7d54e7ad01e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3756,9 +3756,7 @@ class Societe extends CommonObject while($obj=$this->db->fetch_object($resql)) { $tmpobject->id=$obj->rowid; - $paiement = $tmpobject->getSommePaiement(); - $creditnotes = $tmpobject->getSumCreditNotesUsed(); - $deposits = $tmpobject->getSumDepositsUsed(); + if ($obj->fk_statut != 0 // Not a draft @@ -3774,12 +3772,15 @@ class Societe extends CommonObject && $obj->fk_statut != 2) // Not classified as paid //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason { + $paiement = $tmpobject->getSommePaiement(); + $creditnotes = $tmpobject->getSumCreditNotesUsed(); + $deposits = $tmpobject->getSumDepositsUsed(); $outstandingOpened+=$obj->total_ttc - $paiement - $creditnotes - $deposits; } if($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $obj->fk_statut == FactureFournisseur::STATUS_CLOSED && !$tmpobject->isCreditNoteUsed()) { //if credit note is converted but not used - + if(empty($paiement)) $paiement = $tmpobject->getSommePaiement(); $outstandingOpened+=$obj->total_ttc-$paiement; } } From 3215e066e49b74e71a51ab2f4b1ecd2477396f09 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Mar 2019 10:00:44 +0100 Subject: [PATCH 011/982] copy linked categories when cloning a product --- htdocs/langs/en_US/products.lang | 1 + htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/card.php | 14 ++++++++++++++ htdocs/product/class/product.class.php | 26 ++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 401ccc5462e..9c96f12c589 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -147,6 +147,7 @@ RowMaterial=Raw Material CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s? CloneContentProduct=Clone all main information of product/service +CloneCategoriesProduct=Clone tags/categories linked ClonePricesProduct=Clone prices CloneCompositionProduct=Clone virtual product/service CloneCombinationsProduct=Clone product variants diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 77ad53a3eff..2339a0c921f 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -146,6 +146,7 @@ RowMaterial=Matière première CloneProduct=Cloner produit/service ConfirmCloneProduct=Êtes-vous sûr de vouloir cloner le produit ou service %s ? CloneContentProduct=Cloner les informations générales du produit/service +CloneCategoriesProduct=Cloner les catégories associées ClonePricesProduct=Cloner les prix CloneCompositionProduct=Cloner le produits packagés CloneCombinationsProduct=Cloner les variantes diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 18ea87cb03a..e433b9a6558 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -520,6 +520,19 @@ if (empty($reshook)) } } + if (GETPOST('clone_categories')) + { + $result = $object->clone_categories($originalId, $id); + + if ($result < 1) + { + $db->rollback(); + setEventMessage($langs->trans('ErrorProductClone'), null, 'errors'); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$originalId); + exit; + } + } + // $object->clone_fournisseurs($originalId, $id); $db->commit(); @@ -1982,6 +1995,7 @@ $formquestionclone=array( 'text' => $langs->trans("ConfirmClone"), array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1), + array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true), ); if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 51a5d7c72d0..3466625dfe5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3611,6 +3611,32 @@ class Product extends CommonObject return 1; } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * copy related categories to another product + * + * @param int $fromId Id produit source + * @param int $toId Id produit cible + * @return int < 0 si erreur, > 0 si ok + */ + function clone_categories($fromId, $toId) + { + $this->db->begin(); + + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'categorie_product (fk_categorie, fk_product)'; + $sql.= " SELECT fk_categorie, $toId FROM ".MAIN_DB_PREFIX."categorie_product"; + $sql.= " WHERE fk_product = '".$fromId."'"; + + if (! $this->db->query($sql)) + { + $this->db->rollback(); + return -1; + } + + $this->db->commit(); + return 1; + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Recopie les fournisseurs et prix fournisseurs d'un produit/service sur un autre From 08d517c053ebb4f8bd87d6edd3301505ce745c17 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Mar 2019 10:35:27 +0100 Subject: [PATCH 012/982] custom content was deleted --- htdocs/custom/.gitignore | 4 ++++ htdocs/custom/README.md | 22 ++++++++++++++++++++++ htdocs/custom/index.html | 0 3 files changed, 26 insertions(+) create mode 100644 htdocs/custom/.gitignore create mode 100644 htdocs/custom/README.md create mode 100644 htdocs/custom/index.html diff --git a/htdocs/custom/.gitignore b/htdocs/custom/.gitignore new file mode 100644 index 00000000000..9420e8c61eb --- /dev/null +++ b/htdocs/custom/.gitignore @@ -0,0 +1,4 @@ +/* +!.gitignore +!README.md +!index.html diff --git a/htdocs/custom/README.md b/htdocs/custom/README.md new file mode 100644 index 00000000000..3a486e5a4a8 --- /dev/null +++ b/htdocs/custom/README.md @@ -0,0 +1,22 @@ +# DOLIBARR ERP & CRM custom directory for external modules. + +This directory is dedicated to store external modules. +To use it, just copy here the directory of the module into this directory. + +Note: On linux or MAC systems, it is better to unzip/store the external module directory into +a different place than this directory and just adding a symbolic link here to the htdocs directory +of the module. + +For example on Linux OS: Get the module from the command +mkdir ~/git; cd ~/git +git clone https://git.framasoft.org/p/newmodule/newmodule.git +Then create the symbolic link +ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule + +WARNING !!! +Check also that the /custom directory is active by adding into dolibarr conf/conf.php file the following +two lines, so dolibarr will also scan /custom directory to find external external modules: + +$dolibarr_main_url_root_alt='/custom'; +$dolibarr_main_document_root_alt='/path_to_dolibarr/htdocs/custom/'; + diff --git a/htdocs/custom/index.html b/htdocs/custom/index.html new file mode 100644 index 00000000000..e69de29bb2d From 7bc0260661a138193afa4a442a22dfdef51dc029 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 18 Mar 2019 14:15:55 +0100 Subject: [PATCH 013/982] begin factorization of categories cloning --- htdocs/langs/en_US/categories.lang | 1 + htdocs/langs/fr_FR/categories.lang | 1 + htdocs/product/card.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index eb34e302cad..dd446249ebe 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -88,3 +88,4 @@ AddProductServiceIntoCategory=Add the following product/service ShowCategory=Show tag/category ByDefaultInList=By default in list ChooseCategory=Choose category +CloneCategoriesProduct=Clone tags/categories linked diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index b65024a5217..9d58f0ff40d 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -88,3 +88,4 @@ AddProductServiceIntoCategory=Ajouter le produit/service suivant ShowCategory=Afficher tag/catégorie ByDefaultInList=Par défaut dans la liste ChooseCategory=Choisissez une catégorie +CloneCategories=Cloner les catégories associées diff --git a/htdocs/product/card.php b/htdocs/product/card.php index e433b9a6558..9becc71bbb8 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1995,7 +1995,7 @@ $formquestionclone=array( 'text' => $langs->trans("ConfirmClone"), array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1), - array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), + array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategories"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true), ); if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) From 61f9aac887f9755531884043abe5a11e091e51d3 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 18 Mar 2019 14:16:41 +0100 Subject: [PATCH 014/982] begin factorization of categories cloning --- htdocs/langs/en_US/products.lang | 1 - htdocs/langs/fr_FR/products.lang | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 9c96f12c589..401ccc5462e 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -147,7 +147,6 @@ RowMaterial=Raw Material CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s? CloneContentProduct=Clone all main information of product/service -CloneCategoriesProduct=Clone tags/categories linked ClonePricesProduct=Clone prices CloneCompositionProduct=Clone virtual product/service CloneCombinationsProduct=Clone product variants diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 2339a0c921f..77ad53a3eff 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -146,7 +146,6 @@ RowMaterial=Matière première CloneProduct=Cloner produit/service ConfirmCloneProduct=Êtes-vous sûr de vouloir cloner le produit ou service %s ? CloneContentProduct=Cloner les informations générales du produit/service -CloneCategoriesProduct=Cloner les catégories associées ClonePricesProduct=Cloner les prix CloneCompositionProduct=Cloner le produits packagés CloneCombinationsProduct=Cloner les variantes From f167ad910e280172e2384b771593f999424d02db Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Apr 2019 11:30:51 +0200 Subject: [PATCH 015/982] camelCase and generic cloneCategories function --- htdocs/core/class/commonobject.class.php | 31 ++++++++++++++++++++++++ htdocs/langs/en_US/products.lang | 1 + htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/card.php | 4 +-- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e962e59264c..ccf255af4d7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7517,4 +7517,35 @@ abstract class CommonObject } } } + + /** + * copy related categories to another object + * + * @param int $fromId Id object source + * @param int $toId Id object cible + * @param string $type Type of category ('product', ...) + * @return int < 0 si erreur, > 0 si ok + */ + function cloneCategories($fromId, $toId, $type='') + { + $this->db->begin(); + + if (empty($type)) $type = $this->table_element; + + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $categorystatic = new Categorie($this->db); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_" . $categorystatic->MAP_CAT_TABLE[$type] . " (fk_categorie, fk_product)"; + $sql.= " SELECT fk_categorie, $toId FROM ".MAIN_DB_PREFIX."categorie_" . $categorystatic->MAP_CAT_TABLE[$type]; + $sql.= " WHERE fk_product = '".$fromId."'"; + + if (! $this->db->query($sql)) + { + $this->db->rollback();die($sql); + return -1; + } + + $this->db->commit(); + return 1; + } } diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 401ccc5462e..62c22548f36 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -148,6 +148,7 @@ CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s? CloneContentProduct=Clone all main information of product/service ClonePricesProduct=Clone prices +CloneCategoriesProduct=Clone tags/categories linked CloneCompositionProduct=Clone virtual product/service CloneCombinationsProduct=Clone product variants ProductIsUsed=This product is used diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 77ad53a3eff..be288c604af 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -147,6 +147,7 @@ CloneProduct=Cloner produit/service ConfirmCloneProduct=Êtes-vous sûr de vouloir cloner le produit ou service %s ? CloneContentProduct=Cloner les informations générales du produit/service ClonePricesProduct=Cloner les prix +CloneCategoriesProduct=Cloner les catégories associées CloneCompositionProduct=Cloner le produits packagés CloneCombinationsProduct=Cloner les variantes ProductIsUsed=Ce produit est utilisé diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 9becc71bbb8..5354fcde70f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -522,7 +522,7 @@ if (empty($reshook)) if (GETPOST('clone_categories')) { - $result = $object->clone_categories($originalId, $id); + $result = $object->cloneCategories($originalId, $id); if ($result < 1) { @@ -1995,7 +1995,7 @@ $formquestionclone=array( 'text' => $langs->trans("ConfirmClone"), array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1), - array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategories"), 'value' => 1), + array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true), ); if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) From d0fcece6130dcfb99504a5a824c8414879d23055 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Apr 2019 11:34:23 +0200 Subject: [PATCH 016/982] dont make generic translations --- htdocs/langs/en_US/categories.lang | 1 - htdocs/langs/fr_FR/categories.lang | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index dd446249ebe..eb34e302cad 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -88,4 +88,3 @@ AddProductServiceIntoCategory=Add the following product/service ShowCategory=Show tag/category ByDefaultInList=By default in list ChooseCategory=Choose category -CloneCategoriesProduct=Clone tags/categories linked diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 9d58f0ff40d..b65024a5217 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -88,4 +88,3 @@ AddProductServiceIntoCategory=Ajouter le produit/service suivant ShowCategory=Afficher tag/catégorie ByDefaultInList=Par défaut dans la liste ChooseCategory=Choisissez une catégorie -CloneCategories=Cloner les catégories associées From 45b3a0588f6b02b6bffdfcc2cdc5856d243a3281 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Apr 2019 11:40:57 +0200 Subject: [PATCH 017/982] remove old dev --- htdocs/product/class/product.class.php | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3466625dfe5..0087be5eab5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3612,31 +3612,6 @@ class Product extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * copy related categories to another product - * - * @param int $fromId Id produit source - * @param int $toId Id produit cible - * @return int < 0 si erreur, > 0 si ok - */ - function clone_categories($fromId, $toId) - { - $this->db->begin(); - - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'categorie_product (fk_categorie, fk_product)'; - $sql.= " SELECT fk_categorie, $toId FROM ".MAIN_DB_PREFIX."categorie_product"; - $sql.= " WHERE fk_product = '".$fromId."'"; - - if (! $this->db->query($sql)) - { - $this->db->rollback(); - return -1; - } - - $this->db->commit(); - return 1; - } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Recopie les fournisseurs et prix fournisseurs d'un produit/service sur un autre From 8e2ef8e56cf807e56e3ef949142dfd7c95e25af5 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Apr 2019 11:42:12 +0200 Subject: [PATCH 018/982] remove old dev --- htdocs/product/class/product.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 0087be5eab5..51a5d7c72d0 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3611,7 +3611,6 @@ class Product extends CommonObject return 1; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Recopie les fournisseurs et prix fournisseurs d'un produit/service sur un autre From 6deba39c6a9d67826297d7422f8130bb95133b35 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Fri, 12 Apr 2019 10:16:13 +0200 Subject: [PATCH 019/982] FIX credit note can be split --- htdocs/core/class/commoninvoice.class.php | 23 ++++++++++++ htdocs/core/class/discount.class.php | 43 +++++++++++++++++++++++ htdocs/fourn/facture/list.php | 7 ++-- htdocs/societe/class/societe.class.php | 8 ++--- 4 files changed, 75 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 3aa8eb4e1ab..35ec6ad283e 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -195,6 +195,29 @@ abstract class CommonInvoice extends CommonObject } } + /** + * Return amount (with tax) of all converted amount for this credit note + * + * @param int $multicurrency Return multicurrency_amount instead of amount + * @return int <0 if KO, Sum of credit notes and deposits amount otherwise + */ + function getSumFromThisCreditNotesNotUsed($multicurrency=0) + { + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + + $discountstatic=new DiscountAbsolute($this->db); + $result=$discountstatic->getSumFromThisCreditNotesNotUsed($this, $multicurrency); + if ($result >= 0) + { + return $result; + } + else + { + $this->error=$discountstatic->error; + return -1; + } + } + /** * Renvoie tableau des ids de facture avoir issus de la facture * diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index cfe7ac24dea..2e99a83ec42 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -568,6 +568,49 @@ class DiscountAbsolute return -1; } } + /** + * Return amount (with tax) of all converted amount for this credit note + * + * @param CommonInvoice $invoice Object invoice + * @param int $multicurrency Return multicurrency_amount instead of amount + * @return int <0 if KO, Sum of credit notes and deposits amount otherwise + */ + function getSumFromThisCreditNotesNotUsed($invoice, $multicurrency=0) + { + dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG); + + if ($invoice->element == 'facture' || $invoice->element == 'invoice') + { + $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc'; + $sql.= ' WHERE rc.fk_facture IS NULL AND rc.fk_facture_source = '.$invoice->id; + } + else if ($invoice->element == 'invoice_supplier') + { + $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc'; + $sql.= ' WHERE rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_source = '.$invoice->id; + } + else + { + $this->error=get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter"; + dol_print_error($this->error); + return -1; + } + + $resql=$this->db->query($sql); + if ($resql) + { + $obj = $this->db->fetch_object($resql); + if ($multicurrency) return $obj->multicurrency_amount; + else return $obj->amount; + } + else + { + $this->error = $this->db->lasterror(); + return -1; + } + } /** * Return clickable ref of object (with picto or not) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 3e1827d6818..d8e18257d23 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -852,8 +852,11 @@ if ($resql) $remaintopay = $obj->total_ttc - $totalpay; //If invoice has been converted and the conversion has been used, we dont have remain to pay on invoice - if($facturestatic->type == FactureFournisseur::TYPE_CREDIT_NOTE && $facturestatic->statut == FactureFournisseur::STATUS_CLOSED) { - if($facturestatic->isCreditNoteUsed())$remaintopay=0; + if($facturestatic->type == FactureFournisseur::TYPE_CREDIT_NOTE) { + + if($facturestatic->isCreditNoteUsed()){ + $remaintopay=-$facturestatic->getSumFromThisCreditNotesNotUsed(); + } } print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 7d54e7ad01e..87c4956e48e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3778,11 +3778,11 @@ class Societe extends CommonObject $outstandingOpened+=$obj->total_ttc - $paiement - $creditnotes - $deposits; } + + //if credit note is converted but not used + if($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $tmpobject->isCreditNoteUsed())$outstandingOpened-=$tmpobject->getSumFromThisCreditNotesNotUsed(); + - if($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $obj->fk_statut == FactureFournisseur::STATUS_CLOSED && !$tmpobject->isCreditNoteUsed()) { //if credit note is converted but not used - if(empty($paiement)) $paiement = $tmpobject->getSommePaiement(); - $outstandingOpened+=$obj->total_ttc-$paiement; - } } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } From 7a651b50719a74bfcd795b8a59efc18933230f15 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Fri, 26 Apr 2019 13:53:22 +0200 Subject: [PATCH 020/982] New: Add ref_client field on template invoice --- .../facture/class/facture-rec.class.php | 6 ++++- htdocs/compta/facture/class/facture.class.php | 1 + htdocs/compta/facture/fiche-rec.php | 22 ++++++++++++++++--- .../install/mysql/migration/9.0.0-10.0.0.sql | 1 + .../install/mysql/tables/llx_facture_rec.sql | 1 + 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 89f324d2450..eba6fa42288 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -77,6 +77,7 @@ class FactureRec extends CommonInvoice public $total; public $db_table; public $propalid; + public $ref_client; public $date_last_gen; public $date_when; @@ -166,6 +167,7 @@ class FactureRec extends CommonInvoice $sql.= ", fk_account"; $sql.= ", fk_cond_reglement"; $sql.= ", fk_mode_reglement"; + $sql.= ", ref_client"; $sql.= ", usenewprice"; $sql.= ", frequency"; $sql.= ", unit_frequency"; @@ -194,6 +196,7 @@ class FactureRec extends CommonInvoice $sql.= ", ".(! empty($facsrc->fk_account)?"'".$facsrc->fk_account."'":"null"); $sql.= ", ".($facsrc->cond_reglement_id > 0 ? $this->db->escape($facsrc->cond_reglement_id) : "null"); $sql.= ", ".($facsrc->mode_reglement_id > 0 ? $this->db->escape($facsrc->mode_reglement_id) : "null"); + $sql.= ",'".$this->db->escape($this->ref_client)."'"; $sql.= ", ".$this->usenewprice; $sql.= ", ".$this->frequency; $sql.= ", '".$this->db->escape($this->unit_frequency)."'"; @@ -382,7 +385,7 @@ class FactureRec extends CommonInvoice $sql.= ', f.note_private, f.note_public, f.fk_user_author'; $sql.= ', f.modelpdf'; $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet as fk_project'; - $sql.= ', f.fk_account'; + $sql.= ', f.fk_account, f.ref_client'; $sql.= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.usenewprice, f.auto_validate'; $sql.= ', f.generate_pdf'; $sql.= ", f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc"; @@ -1127,6 +1130,7 @@ class FactureRec extends CommonInvoice $facture->brouillon = 1; $facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; + $facture->ref_client = $facturerec->ref_client; $invoiceidgenerated = $facture->create($user); if ($invoiceidgenerated <= 0) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c2dc89c903e..9e9005d471d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -358,6 +358,7 @@ class Facture extends CommonInvoice $this->socid = $_facrec->socid; // Invoice created on same thirdparty than template $this->entity = $_facrec->entity; // Invoice created in same entity than template + $this->ref_client = $_facrec->ref_client; // Fields coming from GUI (priority on template). TODO Value of template should be used as default value on GUI so we can use here always value from GUI $this->fk_project = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_project; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index fa8af87ac29..25144edbcb3 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -174,6 +174,7 @@ if (empty($reshook)) if (! $error) { $object->titre = GETPOST('titre', 'alpha'); + $object->ref_client = GETPOST('ref_client', 'alpha'); $object->note_private = GETPOST('note_private', 'none'); $object->note_public = GETPOST('note_public', 'none'); $object->modelpdf = GETPOST('modelpdf', 'alpha'); @@ -274,7 +275,7 @@ if (empty($reshook)) { $object->setProject(GETPOST('projectid', 'int')); } - // Set bank account + // Set titre elseif ($action == 'setref' && $user->rights->facture->creer) { //var_dump(GETPOST('ref', 'alpha'));exit; @@ -286,6 +287,15 @@ if (empty($reshook)) } else dol_print_error($db, $object->error, $object->errors); } + elseif ($action == 'setref_client' && $user->rights->facture->creer) + { + $result=$object->setValueFrom('ref_client', GETPOST('ref_client', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY'); + if ($result > 0) + { + $object->ref_client = GETPOST('ref_client', 'alpha'); + } + else dol_print_error($db, $object->error, $object->errors); + } // Set bank account elseif ($action == 'setbankaccount' && $user->rights->facture->creer) { @@ -997,6 +1007,11 @@ if ($action == 'create') print ''; print ''; + // Ref Client + print ''.$langs->trans("RefCustomer").''; + print ''; + print ''; + // Third party print ''.$langs->trans("Customer").''.$object->thirdparty->getNomUrl(1, 'customer').''; print ''; @@ -1229,8 +1244,9 @@ else $morehtmlref.='
'; // Ref customer - //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', 0, 1); - //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1); + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1); + $morehtmlref.='
'; // Thirdparty $morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index 9aa395c22d6..49a19de5316 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -297,3 +297,4 @@ ALTER TABLE llx_inventorydet DROP COLUMN pmp; ALTER TABLE llx_inventorydet DROP COLUMN pa; ALTER TABLE llx_inventorydet DROP COLUMN new_pmp; +ALTER TABLE llx_facture_rec ADD COLUMN ref_client varchar(255) after suspended; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql index 1add07c6e8c..2c1c2514488 100644 --- a/htdocs/install/mysql/tables/llx_facture_rec.sql +++ b/htdocs/install/mysql/tables/llx_facture_rec.sql @@ -29,6 +29,7 @@ create table llx_facture_rec tms timestamp, -- date creation/modification suspended integer DEFAULT 0, -- 1=suspended + ref_client varchar(255), -- reference for customer amount double(24,8) DEFAULT 0 NOT NULL, remise real DEFAULT 0, From be17e31be18e8bf2e126262f870b6b724b679a0b Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 2 May 2019 11:04:55 +0200 Subject: [PATCH 021/982] New: Add ref_client field on template invoice --- htdocs/compta/facture/fiche-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 25144edbcb3..fa71bdd7f2e 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1009,7 +1009,7 @@ if ($action == 'create') // Ref Client print ''.$langs->trans("RefCustomer").''; - print ''; + print ''; print ''; // Third party From aef850f6d3c5af5f6b98d5b6a882480eff045891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 19 May 2019 21:12:22 +0200 Subject: [PATCH 022/982] zapier for dolibarr --- dev/examples/zapier/.gitignore | 7 + dev/examples/zapier/.travis.yml | 7 + dev/examples/zapier/action.json | 56 ++ dev/examples/zapier/authentication.js | 76 ++ dev/examples/zapier/creates/thirdparty.js | 83 ++ dev/examples/zapier/index.js | 72 ++ dev/examples/zapier/package-lock.json | 405 +++++++++ dev/examples/zapier/package.json | 24 + dev/examples/zapier/resources/resources.js | 0 dev/examples/zapier/searches/thirdparty.js | 66 ++ dev/examples/zapier/test/index.js | 17 + dev/examples/zapier/triggers/action.js | 156 ++++ dev/examples/zapier/triggers/order.js | 148 ++++ dev/examples/zapier/triggers/thirdparty.js | 175 ++++ htdocs/core/modules/modZapier.class.php | 375 +++++++++ ...face_99_modZapier_ZapierTriggers.class.php | 567 +++++++++++++ htdocs/langs/en_US/zapier.lang | 53 ++ htdocs/langs/fr_FR/zapier.lang | 48 ++ htdocs/zapier/admin/about.php | 76 ++ htdocs/zapier/admin/setup.php | 124 +++ htdocs/zapier/class/api_zapier.class.php | 382 +++++++++ htdocs/zapier/class/hook.class.php | 773 ++++++++++++++++++ htdocs/zapier/hook_agenda.php | 261 ++++++ htdocs/zapier/hook_card.php | 471 +++++++++++ htdocs/zapier/hook_document.php | 166 ++++ htdocs/zapier/hook_list.php | 642 +++++++++++++++ htdocs/zapier/hook_note.php | 164 ++++ htdocs/zapier/img/object_hook.png | Bin 0 -> 360 bytes .../zapier/img/object_zapierfordolibarr.png | Bin 0 -> 360 bytes htdocs/zapier/img/zapier.png | Bin 0 -> 683 bytes htdocs/zapier/lib/zapier.lib.php | 58 ++ htdocs/zapier/lib/zapier_hook.lib.php | 83 ++ htdocs/zapier/sql/llx_zapier_hook.key.sql | 22 + htdocs/zapier/sql/llx_zapier_hook.sql | 29 + .../sql/llx_zapier_hook_extrafields.sql | 23 + htdocs/zapier/zapierindex.php | 238 ++++++ 36 files changed, 5847 insertions(+) create mode 100644 dev/examples/zapier/.gitignore create mode 100644 dev/examples/zapier/.travis.yml create mode 100644 dev/examples/zapier/action.json create mode 100644 dev/examples/zapier/authentication.js create mode 100644 dev/examples/zapier/creates/thirdparty.js create mode 100644 dev/examples/zapier/index.js create mode 100644 dev/examples/zapier/package-lock.json create mode 100644 dev/examples/zapier/package.json create mode 100644 dev/examples/zapier/resources/resources.js create mode 100644 dev/examples/zapier/searches/thirdparty.js create mode 100644 dev/examples/zapier/test/index.js create mode 100644 dev/examples/zapier/triggers/action.js create mode 100644 dev/examples/zapier/triggers/order.js create mode 100644 dev/examples/zapier/triggers/thirdparty.js create mode 100644 htdocs/core/modules/modZapier.class.php create mode 100644 htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php create mode 100644 htdocs/langs/en_US/zapier.lang create mode 100644 htdocs/langs/fr_FR/zapier.lang create mode 100644 htdocs/zapier/admin/about.php create mode 100644 htdocs/zapier/admin/setup.php create mode 100644 htdocs/zapier/class/api_zapier.class.php create mode 100644 htdocs/zapier/class/hook.class.php create mode 100644 htdocs/zapier/hook_agenda.php create mode 100644 htdocs/zapier/hook_card.php create mode 100644 htdocs/zapier/hook_document.php create mode 100644 htdocs/zapier/hook_list.php create mode 100644 htdocs/zapier/hook_note.php create mode 100644 htdocs/zapier/img/object_hook.png create mode 100644 htdocs/zapier/img/object_zapierfordolibarr.png create mode 100644 htdocs/zapier/img/zapier.png create mode 100644 htdocs/zapier/lib/zapier.lib.php create mode 100644 htdocs/zapier/lib/zapier_hook.lib.php create mode 100644 htdocs/zapier/sql/llx_zapier_hook.key.sql create mode 100644 htdocs/zapier/sql/llx_zapier_hook.sql create mode 100644 htdocs/zapier/sql/llx_zapier_hook_extrafields.sql create mode 100644 htdocs/zapier/zapierindex.php diff --git a/dev/examples/zapier/.gitignore b/dev/examples/zapier/.gitignore new file mode 100644 index 00000000000..d81e057e6d3 --- /dev/null +++ b/dev/examples/zapier/.gitignore @@ -0,0 +1,7 @@ +build +docs +node_modules +*.log +.environment +.env +.zapierapprc diff --git a/dev/examples/zapier/.travis.yml b/dev/examples/zapier/.travis.yml new file mode 100644 index 00000000000..5b8db5906a8 --- /dev/null +++ b/dev/examples/zapier/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - 8.10.0 +before_script: 'npm install -g zapier-platform-cli' +script: 'zapier test' +notifications: + email: false diff --git a/dev/examples/zapier/action.json b/dev/examples/zapier/action.json new file mode 100644 index 00000000000..e3aa4e69881 --- /dev/null +++ b/dev/examples/zapier/action.json @@ -0,0 +1,56 @@ +{ + "table_rowid": "id", + "id": 6764, + "ref": null, + "type_id": "5", + "type_code": "AC_RDV", + "type": null, + "type_color": null, + "code": null, + "label": "azerty", + "datec": null, + "datem": null, + "authorid": null, + "usermodid": null, + "datep": 1555365600, + "datef": 1555538399, + "durationp": 172799, + "fulldayevent": 1, + "punctual": 1, + "percentage": "-1", + "location": "", + "transparency": 1, + "priority": 0, + "userassigned": { + "1": { + "id": "1", + "transparency": 1 + } + }, + "userownerid": "1", + "userdoneid": null, + "usertodo": null, + "userdone": null, + "socid": null, + "contactid": null, + "elementtype": "", + "icalname": null, + "icalcolor": null, + "actions": [], + "email_msgid": null, + "email_from": null, + "email_sender": null, + "email_to": null, + "email_tocc": null, + "email_tobcc": null, + "email_subject": null, + "errors_to": null, + "import_key": null, + "linkedObjectsIds": null, + "fk_project": 0, + "modelpdf": null, + "note_public": null, + "note_private": null, + "note": "wxcvbn", + "duree": 0 +} \ No newline at end of file diff --git a/dev/examples/zapier/authentication.js b/dev/examples/zapier/authentication.js new file mode 100644 index 00000000000..8c373d0b78b --- /dev/null +++ b/dev/examples/zapier/authentication.js @@ -0,0 +1,76 @@ +const testAuth = (z , bundle) => { + const url = bundle.authData.url+'/api/index.php/login'; + // Normally you want to make a request to an endpoint that is either specifically designed to test auth, or one that + // every user will have access to, such as an account or profile endpoint like /me. + // In this example, we'll hit httpbin, which validates the Authorization Header against the arguments passed in the URL path + const promise = z.request({ + url: url, + }); + + // This method can return any truthy value to indicate the credentials are valid. + // Raise an error to show + return promise.then((response) => { + if (response.status === 401) { + throw new Error('The Session Key you supplied is invalid'); + } + return response; + }); +}; + +const getSessionKey = (z, bundle) => { + const url = bundle.authData.url + '/api/index.php/login'; + + const promise = z.request({ + method: 'POST', + url: url, + body: { + login: bundle.authData.login, + password: bundle.authData.password, + } + }); + + return promise.then((response) => { + if (response.status === 401) { + throw new Error('The login/password you supplied is invalid'); + } + const json = JSON.parse(response.content); + return { + sessionKey: json.success.token || 'secret' + }; + }); +}; + +module.exports = { + type: 'session', + // Define any auth fields your app requires here. The user will be prompted to enter this info when + // they connect their account. + fields: [ + { + key: 'url', + label: 'Url of service', + required: true, + type: 'string' + }, + { + key: 'login', + label: 'Login', + required: true, + type: 'string' + }, + { + key: 'password', + label: 'Password', + required: true, + type: 'password' + } + ], + // The test method allows Zapier to verify that the credentials a user provides are valid. We'll execute this + // method whenever a user connects their account for the first time. + test: testAuth, + // The method that will exchange the fields provided by the user for session credentials. + sessionConfig: { + perform: getSessionKey + }, + // assuming "login" is a key returned from the test + connectionLabel: '{{login}}' +}; diff --git a/dev/examples/zapier/creates/thirdparty.js b/dev/examples/zapier/creates/thirdparty.js new file mode 100644 index 00000000000..05928c3f15b --- /dev/null +++ b/dev/examples/zapier/creates/thirdparty.js @@ -0,0 +1,83 @@ +// create a particular thirdparty by name +const createThirdparty = async (z, bundle) => { + const apiurl = bundle.authData.url + '/api/index.php/thirdparties'; + + const response = await z.request({ + method: 'POST', + url: apiurl, + body: JSON.stringify({ + name: bundle.inputData.name, + name_alias: bundle.inputData.name_alias, + address: bundle.inputData.address, + zip: bundle.inputData.zip, + town: bundle.inputData.town, + email: bundle.inputData.email, + client: bundle.inputData.client, + fournisseur: bundle.inputData.fournisseur, + code_client: bundle.inputData.code_client, + code_fournisseur: bundle.inputData.code_fournisseur, + sens: 'fromzapier' + }) + }); + const result = z.JSON.parse(response.content); + // api returns an integer when ok, a json when ko + return result.response || {id: response}; +}; + +module.exports = { + key: 'thirdparty', + noun: 'Thirdparty', + + display: { + label: 'Create Thirdparty', + description: 'Creates a thirdparty.' + }, + + operation: { + inputFields: [ + {key: 'name', required: true}, + {key: 'name_alias', required: false}, + {key: 'address', required: false}, + {key: 'zip', required: false}, + {key: 'town', required: false}, + {key: 'email', required: false}, + {key: 'client', type: 'integer', required: false}, + {key: 'fournisseur', type: 'integer', required: false}, + {key: 'code_client', required: false}, + {key: 'code_fournisseur', required: false} + ], + perform: createThirdparty, + + sample: { + id: 1, + name: 'DUPOND', + name_alias: 'DUPOND Ltd', + address: 'Rue des Canaries', + zip: '34090', + town: 'MONTPELLIER', + phone: '0123456789', + fax: '2345678901', + email: 'robot@domain.com', + client: 1, + fournisseur: 0, + code_client: 'CU1903-1234', + code_fournisseur: 'SU1903-2345' + }, + + outputFields: [ + {key: 'id', label: 'ID'}, + {key: 'name', label: 'Name'}, + {key: 'name_alias', label: 'Name alias'}, + {key: 'address', label: 'Address'}, + {key: 'zip', label: 'Zip'}, + {key: 'town', label: 'Town'}, + {key: 'phone', label: 'Phone'}, + {key: 'fax', label: 'Fax'}, + {key: 'email', label: 'Email'}, + {key: 'client', label: 'Customer/Prospect 0/1/2/3'}, + {key: 'fournisseur', label: 'Supplier 0/1'}, + {key: 'code_client', label: 'Customer code'}, + {key: 'code_fournisseur', label: 'Supplier code'} + ] + } +}; \ No newline at end of file diff --git a/dev/examples/zapier/index.js b/dev/examples/zapier/index.js new file mode 100644 index 00000000000..cd62d6cd7ee --- /dev/null +++ b/dev/examples/zapier/index.js @@ -0,0 +1,72 @@ +const triggerThirdparty = require('./triggers/thirdparty'); +const triggerOrder = require('./triggers/order'); +const triggerAction = require('./triggers/action'); + +const searchThirdparty = require('./searches/thirdparty'); + +const createThirdparty = require('./creates/thirdparty'); + +const authentication = require('./authentication'); + +// To include the session key header on all outbound requests, simply define a function here. +// It runs runs before each request is sent out, allowing you to make tweaks to the request in a centralized spot +const includeSessionKeyHeader = (request, z, bundle) => { + if (bundle.authData.sessionKey) { + request.headers = request.headers || {}; + request.headers['DOLAPIKEY'] = bundle.authData.sessionKey; + } + return request; +}; + +// If we get a response and it is a 401, we can raise a special error telling Zapier to retry this after another exchange. +const sessionRefreshIf401 = (response, z, bundle) => { + if (bundle.authData.sessionKey) { + if (response.status === 401) { + throw new z.errors.RefreshAuthError('Session apikey needs refreshing.'); + } + } + return response; +}; + +// We can roll up all our behaviors in an App. +const App = { + // This is just shorthand to reference the installed dependencies you have. Zapier will + // need to know these before we can upload + version: require('./package.json').version, + platformVersion: require('zapier-platform-core').version, + + authentication: authentication, + + // beforeRequest & afterResponse are optional hooks into the provided HTTP client + beforeRequest: [ + includeSessionKeyHeader + ], + + afterResponse: [ + sessionRefreshIf401 + ], + + // If you want to define optional resources to simplify creation of triggers, searches, creates - do that here! + resources: { + }, + + // If you want your trigger to show up, you better include it here! + triggers: { + [triggerThirdparty.key]: triggerThirdparty, + [triggerOrder.key]: triggerOrder, + [triggerAction.key]: triggerAction + }, + + // If you want your searches to show up, you better include it here! + searches: { + [searchThirdparty.key]: searchThirdparty, + }, + + // If you want your creates to show up, you better include it here! + creates: { + [createThirdparty.key]: createThirdparty, + } +}; + +// Finally, export the app. +module.exports = App; diff --git a/dev/examples/zapier/package-lock.json b/dev/examples/zapier/package-lock.json new file mode 100644 index 00000000000..7483948d5b8 --- /dev/null +++ b/dev/examples/zapier/package-lock.json @@ -0,0 +1,405 @@ +{ + "name": "Dolibarr", + "version": "1.0.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "8.10.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.20.tgz", + "integrity": "sha512-M7x8+5D1k/CuA6jhiwuSCmE8sbUWJF0wYsjcig9WrXvwUI5ArEoUBdOXpV4JcEMrLp02/QbDjw+kI+vQeKyQgg==", + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "bluebird": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", + "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "dotenv": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz", + "integrity": "sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow==" + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "requires": { + "iconv-lite": "~0.4.13" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "json-tryparse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/json-tryparse/-/json-tryparse-1.0.5.tgz", + "integrity": "sha1-Khy6CLTjEjNo+p+2o01GQwBFeyc=" + }, + "jsonschema": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.1.1.tgz", + "integrity": "sha1-PO3o4+QR03eHLu+8n98mODy8Ptk=" + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "mime-db": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" + }, + "mime-types": { + "version": "2.1.22", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", + "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "requires": { + "mime-db": "~1.38.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node-fetch": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.1.tgz", + "integrity": "sha512-j8XsFGCLw79vWXkZtMSmmLaOk9z5SQ9bV/tkbZVCqvgwzrjAGq66igobLofHtF63NvMTp2WjytpsNTGKa+XRIQ==", + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + }, + "should": { + "version": "13.2.3", + "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", + "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", + "dev": true, + "requires": { + "should-equal": "^2.0.0", + "should-format": "^3.0.3", + "should-type": "^1.4.0", + "should-type-adaptors": "^1.0.1", + "should-util": "^1.0.0" + } + }, + "should-equal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", + "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", + "dev": true, + "requires": { + "should-type": "^1.4.0" + } + }, + "should-format": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", + "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", + "dev": true, + "requires": { + "should-type": "^1.3.0", + "should-type-adaptors": "^1.0.1" + } + }, + "should-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", + "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=", + "dev": true + }, + "should-type-adaptors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", + "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", + "dev": true, + "requires": { + "should-type": "^1.3.0", + "should-util": "^1.0.0" + } + }, + "should-util": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz", + "integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "zapier-platform-core": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/zapier-platform-core/-/zapier-platform-core-8.0.1.tgz", + "integrity": "sha512-vuAe7JkFQ88AeQ//NwwNEh8ZjiZr30GRWtwYo7Wo/nx1cqZwq+CRc9zJU2WRrhJfJOtOOTUF6w+pArBTtMOC5A==", + "requires": { + "@types/node": "8.10.20", + "bluebird": "3.5.0", + "content-disposition": "0.5.2", + "dotenv": "5.0.1", + "form-data": "2.3.2", + "lodash": "4.17.11", + "node-fetch": "1.7.1", + "oauth-sign": "0.9.0", + "semver": "5.6.0", + "zapier-platform-schema": "8.0.1" + } + }, + "zapier-platform-schema": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/zapier-platform-schema/-/zapier-platform-schema-8.0.1.tgz", + "integrity": "sha512-97KJ0xVLtpU4BiXVaMTPQpiA0T6CQIEzWfzAWwJAWbu5336+6DMFUzDWN4bANBeD3CIsRHHPcZkP8n/17U05ag==", + "requires": { + "jsonschema": "1.1.1", + "lodash": "4.17.10" + }, + "dependencies": { + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + } + } + } + } +} diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json new file mode 100644 index 00000000000..30ea4939915 --- /dev/null +++ b/dev/examples/zapier/package.json @@ -0,0 +1,24 @@ +{ + "name": "Dolibarr", + "version": "1.0.2", + "description": "An app for connecting Dolibarr to the Zapier platform.", + "repository": "frederic34/ZapierForDolibarr", + "homepage": "https://netlogic-dev.fr/", + "author": "Frédéric France ", + "license": "BSD-3-Clause", + "main": "index.js", + "scripts": { + "test": "mocha --recursive" + }, + "engines": { + "node": "8.10.0", + "npm": ">=5.6.0" + }, + "dependencies": { + "zapier-platform-core": "8.0.1" + }, + "devDependencies": { + "mocha": "^5.2.0", + "should": "^13.2.0" + } +} diff --git a/dev/examples/zapier/resources/resources.js b/dev/examples/zapier/resources/resources.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dev/examples/zapier/searches/thirdparty.js b/dev/examples/zapier/searches/thirdparty.js new file mode 100644 index 00000000000..c71c2965789 --- /dev/null +++ b/dev/examples/zapier/searches/thirdparty.js @@ -0,0 +1,66 @@ +module.exports = { + key: 'thirdparty', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Thirdparty', + display: { + label: 'Find a Thirdparty', + description: 'Search for thirdparty.' + }, + + // `operation` is where we make the call to your API to do the search + operation: { + // This search only has one search field. Your searches might have just one, or many + // search fields. + inputFields: [ + { + key: 'name', + type: 'string', + label: 'Name', + helpText: 'Name to limit to the search to (i.e. The company or %company%).' + } + ], + + perform: (z, bundle) => { + const url = bundle.authData.url + '/api/index.php/thirdparties/'; + + // Put the search value in a query param. The details of how to build + // a search URL will depend on how your API works. + const options = { + params: { + sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'" + } + }; + + return z.request(url, options).then(response => JSON.parse(response.content)); + }, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + name: 'DOE', + firstname: 'John', + authorId: 1, + directions: '1. Boil Noodles\n2.Serve with sauce', + style: 'italian' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + {key: 'id', label: 'ID'}, + {key: 'createdAt', label: 'Created At'}, + {key: 'name', label: 'Name'}, + {key: 'firstname', label: 'Firstname'}, + {key: 'directions', label: 'Directions'}, + {key: 'authorId', label: 'Author ID'}, + {key: 'style', label: 'Style'} + ] + } +}; diff --git a/dev/examples/zapier/test/index.js b/dev/examples/zapier/test/index.js new file mode 100644 index 00000000000..220e48f540f --- /dev/null +++ b/dev/examples/zapier/test/index.js @@ -0,0 +1,17 @@ +require('should'); + +const zapier = require('zapier-platform-core'); + +// Use this to make test calls into your app: +const App = require('../index'); +const appTester = zapier.createAppTester(App); + +describe('My App', () => { + + it('should test something', (done) => { + const x = 1; + x.should.eql(1); + done(); + }); + +}); diff --git a/dev/examples/zapier/triggers/action.js b/dev/examples/zapier/triggers/action.js new file mode 100644 index 00000000000..d387d88ec1f --- /dev/null +++ b/dev/examples/zapier/triggers/action.js @@ -0,0 +1,156 @@ +const subscribeHook = (z, bundle) => { + // `z.console.log()` is similar to `console.log()`. + z.console.log('suscribing hook!'); + + // bundle.targetUrl has the Hook URL this app should call when an action is created. + const data = { + url: bundle.targetUrl, + event: bundle.event, + module: 'action', + action: bundle.inputData.action + }; + + const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: url, + method: 'POST', + body: JSON.stringify(data) + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const unsubscribeHook = (z, bundle) => { + // bundle.subscribeData contains the parsed response JSON from the subscribe + // request made initially. + z.console.log('unsuscribing hook!'); + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + method: 'DELETE', + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const getAction = (z, bundle) => { + // bundle.cleanedRequest will include the parsed JSON object (if it's not a + // test poll) and also a .querystring property with the URL's query string. + const action = { + id: bundle.cleanedRequest.id, + ref: bundle.cleanedRequest.ref, + ref_client: bundle.cleanedRequest.ref_client, + name: bundle.cleanedRequest.name, + firstname: bundle.cleanedRequest.firstname, + usertodo__name: bundle.cleanedRequest.usertodo__name, + location: bundle.cleanedRequest.location, + label: bundle.cleanedRequest.label, + authorId: bundle.cleanedRequest.authorId, + createdAt: bundle.cleanedRequest.createdAt, + module: bundle.cleanedRequest.module, + datep: bundle.cleanedRequest.datep, + datef: bundle.cleanedRequest.datef, + fulldayevent: bundle.cleanedRequest.fulldayevent, + transparency: bundle.cleanedRequest.transparency, + icalname: bundle.cleanedRequest.icalname, + icalcolor: bundle.cleanedRequest.icalcolor, + note: bundle.cleanedRequest.note, + note_public: bundle.cleanedRequest.note_public, + note_private: bundle.cleanedRequest.note_private, + action: bundle.cleanedRequest.action + }; + + return [action]; +}; + +const getFallbackRealAction = (z, bundle) => { + // For the test poll, you should get some real data, to aid the setup process. + const module = bundle.inputData.module; + const options = { + url: bundle.authData.url + '/api/index.php/agendaevents/0', + }; + + return z.request(options).then((response) => [JSON.parse(response.content)]); +}; + +// const getActionsChoices = (z, bundle) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const module = bundle.inputData.module; +// const options = { +// url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/actions', +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; + +// We recommend writing your actions separate like this and rolling them +// into the App definition at the end. +module.exports = { + key: 'action', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Action', + display: { + label: 'New Agenda', + description: 'Trigger when a new agenda with action is done in Dolibarr.' + }, + + // `operation` is where the business logic goes. + operation: { + + // `inputFields` can define the fields a user could provide, + // we'll pass them in as `bundle.inputData` later. + inputFields: [ + { + key: 'action', + type: 'string', + helpText: 'Which action of agenda this should trigger on.', + choices: { + create: "Create", + modify: "Modify", + delete: "Delete", + } + } + ], + + type: 'hook', + + performSubscribe: subscribeHook, + performUnsubscribe: unsubscribeHook, + + perform: getAction, + performList: getFallbackRealAction, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + name: 'Best Spagetti Ever', + authorId: 1, + action: 'create' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + {key: 'id', label: 'ID'}, + {key: 'createdAt', label: 'Created At'}, + {key: 'name', label: 'Name'}, + {key: 'usertodo__name', label: 'UserToDo Name'}, + {key: 'authorId', label: 'Author ID'}, + {key: 'action', label: 'Action'} + ] + } +}; diff --git a/dev/examples/zapier/triggers/order.js b/dev/examples/zapier/triggers/order.js new file mode 100644 index 00000000000..6262d734edc --- /dev/null +++ b/dev/examples/zapier/triggers/order.js @@ -0,0 +1,148 @@ +const subscribeHook = (z, bundle) => { + // `z.console.log()` is similar to `console.log()`. + z.console.log('suscribing hook!'); + + // bundle.targetUrl has the Hook URL this app should call when an action is created. + const data = { + url: bundle.targetUrl, + event: bundle.event, + module: 'order', + action: bundle.inputData.action + }; + + const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: url, + method: 'POST', + body: JSON.stringify(data) + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const unsubscribeHook = (z, bundle) => { + // bundle.subscribeData contains the parsed response JSON from the subscribe + // request made initially. + z.console.log('unsuscribing hook!'); + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + method: 'DELETE', + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const getOrder = (z, bundle) => { + // bundle.cleanedRequest will include the parsed JSON object (if it's not a + // test poll) and also a .querystring property with the URL's query string. + const order = { + id: bundle.cleanedRequest.id, + ref: bundle.cleanedRequest.ref, + ref_client: bundle.cleanedRequest.ref_client, + name: bundle.cleanedRequest.name, + firstname: bundle.cleanedRequest.firstname, + directions: bundle.cleanedRequest.directions, + authorId: bundle.cleanedRequest.authorId, + createdAt: bundle.cleanedRequest.createdAt, + note_public: bundle.cleanedRequest.note_public, + note_private: bundle.cleanedRequest.note_private, + action: bundle.cleanedRequest.action + }; + + return [order]; +}; + +const getFallbackRealOrder = (z, bundle) => { + // For the test poll, you should get some real data, to aid the setup process. + const module = bundle.inputData.module; + const options = { + url: bundle.authData.url + '/api/index.php/orders/0', + }; + + return z.request(options).then((response) => [JSON.parse(response.content)]); +}; + +// const getActionsChoices = (z, bundle) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const module = bundle.inputData.module; +// const options = { +// url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/orders', +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; + +// We recommend writing your orders separate like this and rolling them +// into the App definition at the end. +module.exports = { + key: 'order', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Order', + display: { + label: 'New Order', + description: 'Trigger when a new order with action is done in Dolibarr.' + }, + + // `operation` is where the business logic goes. + operation: { + + // `inputFields` can define the fields a user could provide, + // we'll pass them in as `bundle.inputData` later. + inputFields: [ + { + key: 'action', + type: 'string', + helpText: 'Which action of order this should trigger on.', + choices: { + create: "Create", + modify: "Modify", + validate: "Validate", + } + } + ], + + type: 'hook', + + performSubscribe: subscribeHook, + performUnsubscribe: unsubscribeHook, + + perform: getOrder, + performList: getFallbackRealOrder, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + name: 'Best Spagetti Ever', + authorId: 1, + directions: '1. Boil Noodles\n2.Serve with sauce', + action: 'create' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + {key: 'id', label: 'ID'}, + {key: 'createdAt', label: 'Created At'}, + {key: 'name', label: 'Name'}, + {key: 'directions', label: 'Directions'}, + {key: 'authorId', label: 'Author ID'}, + {key: 'module', label: 'Module'}, + {key: 'action', label: 'Action'} + ] + } +}; diff --git a/dev/examples/zapier/triggers/thirdparty.js b/dev/examples/zapier/triggers/thirdparty.js new file mode 100644 index 00000000000..4b13e23ff1c --- /dev/null +++ b/dev/examples/zapier/triggers/thirdparty.js @@ -0,0 +1,175 @@ +const subscribeHook = (z, bundle) => { + // `z.console.log()` is similar to `console.log()`. + z.console.log('suscribing hook!'); + + // bundle.targetUrl has the Hook URL this app should call when an action is created. + const data = { + url: bundle.targetUrl, + event: bundle.event, + module: 'company', + action: bundle.inputData.action + }; + + const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: url, + method: 'POST', + body: JSON.stringify(data) + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const unsubscribeHook = (z, bundle) => { + // bundle.subscribeData contains the parsed response JSON from the subscribe + // request made initially. + z.console.log('unsuscribing hook!'); + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + method: 'DELETE', + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const getThirdparty = (z, bundle) => { + // bundle.cleanedRequest will include the parsed JSON object (if it's not a + // test poll) and also a .querystring property with the URL's query string. + const thirdparty = { + id: bundle.cleanedRequest.id, + name: bundle.cleanedRequest.name, + name_alias: bundle.cleanedRequest.name_alias, + firstname: bundle.cleanedRequest.firstname, + address: bundle.cleanedRequest.address, + zip: bundle.cleanedRequest.zip, + town: bundle.cleanedRequest.town, + email: bundle.cleanedRequest.email, + client: bundle.cleanedRequest.client, + fournisseur: bundle.cleanedRequest.fournisseur, + code_client: bundle.cleanedRequest.code_client, + code_fournisseur: bundle.cleanedRequest.code_fournisseur, + authorId: bundle.cleanedRequest.authorId, + createdAt: bundle.cleanedRequest.createdAt, + action: bundle.cleanedRequest.action + }; + + return [thirdparty]; +}; + +const getFallbackRealThirdparty = (z, bundle) => { + // For the test poll, you should get some real data, to aid the setup process. + const module = bundle.inputData.module; + const options = { + url: bundle.authData.url + '/api/index.php/thirdparties/0', + }; + + return z.request(options).then((response) => [JSON.parse(response.content)]); +}; + +// const getModulesChoices = (z/*, bundle*/) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const options = { +// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; +// const getModulesChoices = () => { + +// return { +// orders: "Order", +// invoices: "Invoice", +// thirdparties: "Thirdparty", +// contacts: "Contacts" +// }; +// }; + +// const getActionsChoices = (z, bundle) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const module = bundle.inputData.module; +// const options = { +// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; + +// We recommend writing your triggers separate like this and rolling them +// into the App definition at the end. +module.exports = { + key: 'thirdparty', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Thirdparty', + display: { + label: 'New Thirdparty', + description: 'Trigger when a new thirdpaty action is done in Dolibarr.' + }, + + // `operation` is where the business logic goes. + operation: { + + // `inputFields` can define the fields a user could provide, + // we'll pass them in as `bundle.inputData` later. + inputFields: [ + { + key: 'action', + type: 'string', + helpText: 'Which action of thirdparty this should trigger on.', + choices: { + create: "Create", + modify: "Modify", + validate: "Validate", + } + } + ], + + type: 'hook', + + performSubscribe: subscribeHook, + performUnsubscribe: unsubscribeHook, + + perform: getThirdparty, + performList: getFallbackRealThirdparty, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + name: 'DOE', + name_alias: 'DOE Ltd', + firstname: 'John', + authorId: 1, + action: 'create' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + {key: 'id', label: 'ID'}, + {key: 'createdAt', label: 'Created At'}, + {key: 'name', label: 'Name'}, + {key: 'name_alias', label: 'Name alias'}, + {key: 'firstname', label: 'Firstame'}, + {key: 'authorId', label: 'Author ID'}, + {key: 'action', label: 'Action'}, + {key: 'client', label: 'Customer/Prospect 0/1/2/3'}, + {key: 'fournisseur', label: 'Supplier 0/1'}, + {key: 'code_client', label: 'Customer code'}, + {key: 'code_fournisseur', label: 'Supplier code'} + ] + } +}; diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php new file mode 100644 index 00000000000..7f7ee47ba1e --- /dev/null +++ b/htdocs/core/modules/modZapier.class.php @@ -0,0 +1,375 @@ + + * Copyright (C) 2019 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +/** + * \defgroup zapier Module Zapier + * \brief Zapier module descriptor. + * + * \file htdocs/zapier/core/modules/modZapier.class.php + * \ingroup zapier + * \brief Description and activation file for module Zapier + */ +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; + +/** + * Description and activation class for module Zapier + */ +class modZapier extends DolibarrModules +{ + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + global $langs,$conf; + + $this->db = $db; + // Id for module (must be unique). + // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). + $this->numero = 792000; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module + // Key text used to identify module (for permissions, menus, etc...) + $this->rights_class = 'zapier'; + // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...' + // It is used to group modules by family in module setup page + $this->family = "interface"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = 100; + // Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this) + //$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily"))); + // Module label (no space allowed), used if translation string 'ModuleZapierName' not found (Zapier is name of module). + $this->name = preg_replace('/^mod/i', '', get_class($this)); + // Module description, used if translation string 'ModuleZapierDesc' not found (Zapier is name of module). + $this->description = "ZapierDescription"; + // Used only if file README.md and README-LL.md not found. + $this->descriptionlong = "Zapier description (Long)"; + // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' + $this->version = 'development'; + //Url to the file with your last numberversion of this module + //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; + // Key used in llx_const table to save module status enabled/disabled (where ZAPIERFORDOLIBARR is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Name of image file used for this module. + // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' + // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' + $this->picto = 'technic'; + // Define some features supported by module (triggers, login, substitutions, menus, css, etc...) + $this->module_parts = array( + // Set this to 1 if module has its own trigger directory (core/triggers) + 'triggers' => 1, + // Set this to 1 if module has its own login method file (core/login) + 'login' => 0, + // Set this to 1 if module has its own substitution function file (core/substitutions) + 'substitutions' => 0, + // Set this to 1 if module has its own menus handler directory (core/menus) + 'menus' => 0, + // Set this to 1 if module overwrite template dir (core/tpl) + 'tpl' => 0, + // Set this to 1 if module has its own barcode directory (core/modules/barcode) + 'barcode' => 0, + // Set this to 1 if module has its own models directory (core/modules/xxx) + 'models' => 0, + // Set this to 1 if module has its own theme directory (theme) + 'theme' => 0, + // Set this to relative path of css file if module has its own css file + 'css' => array( + // '/zapier/css/zapier.css.php', + ), + // Set this to relative path of js file if module must load a js on all pages + 'js' => array( + // '/zapier/js/zapier.js.php', + ), + // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all' + 'hooks' => array( + // 'data' => array( + // 'hookcontext1', + // 'hookcontext2', + // ), + // 'entity' => '0', + ), + // Set this to 1 if feature of module are opened to external users + 'moduleforexternal' => 0, + ); + // Data directories to create when module is enabled. + // Example: this->dirs = array("/zapier/temp","/zapier/subdir"); + $this->dirs = array("/zapier/temp"); + // Config pages. Put here list of php page, stored into zapier/admin directory, to use to setup module. + $this->config_page_url = array("setup.php@zapier"); + // Dependencies + // A condition to hide module + $this->hidden = false; + // List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) + $this->depends = array(); + // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) + $this->requiredby = array(); + // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) + $this->conflictwith = array(); + $this->langfiles = array("zapier@zapier"); + // Minimum version of PHP required by module + //$this->phpmin = array(5, 5); + // Minimum version of Dolibarr required by module + $this->need_dolibarr_version = array(10, 0); + // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) + $this->warnings_activation = array(); + // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) + $this->warnings_activation_ext = array(); + // $this->automatic_activation = array( + // 'FR'=>'ZapierWasAutomaticallyActivatedBecauseOfYourCountryChoice', + // ); + // If true, can't be disabled + // $this->always_enabled = true; + // Constants + // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) + // Example: $this->const=array( + // 1 => array('ZAPIERFORDOLIBARR_MYNEWCONST1', 'chaine', 'myvalue', 'This is a constant to add', 1), + // 2 => array('ZAPIERFORDOLIBARR_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1) + // ); + $this->const = array( + // 1 => array('ZAPIERFORDOLIBARR_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) + ); + // Some keys to add into the overwriting translation tables + /*$this->overwrite_translation = array( + 'en_US:ParentCompany'=>'Parent company or reseller', + 'fr_FR:ParentCompany'=>'Maison mère ou revendeur' + )*/ + if (! isset($conf->zapier) || ! isset($conf->zapier->enabled)) { + $conf->zapier=new stdClass(); + $conf->zapier->enabled=0; + } + // Array to add new pages in new tabs + $this->tabs = array(); + // Example: + // $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@zapier:$user->rights->zapier->read:/zapier/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1 + // $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@zapier:$user->rights->othermodule->read:/zapier/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. + // $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname + // + // Where objecttype can be + // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) + // 'contact' to add a tab in contact view + // 'contract' to add a tab in contract view + // 'group' to add a tab in group view + // 'intervention' to add a tab in intervention view + // 'invoice' to add a tab in customer invoice view + // 'invoice_supplier' to add a tab in supplier invoice view + // 'member' to add a tab in fundation member view + // 'opensurveypoll' to add a tab in opensurvey poll view + // 'order' to add a tab in customer order view + // 'order_supplier' to add a tab in supplier order view + // 'payment' to add a tab in payment view + // 'payment_supplier' to add a tab in supplier payment view + // 'product' to add a tab in product view + // 'propal' to add a tab in propal view + // 'project' to add a tab in project view + // 'stock' to add a tab in stock view + // 'thirdparty' to add a tab in third party view + // 'user' to add a tab in user view + // Dictionaries + $this->dictionaries=array(); + /* Example: + $this->dictionaries=array( + 'langs'=>'mylangfile@zapier', + // List of tables we want to see into dictonnary editor + 'tabname'=>array(MAIN_DB_PREFIX."table1",MAIN_DB_PREFIX."table2",MAIN_DB_PREFIX."table3"), + // Label of tables + 'tablib'=>array("Table1","Table2","Table3"), + // Request to select fields + 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'), + // Sort order + 'tabsqlsort'=>array("label ASC","label ASC","label ASC"), + // List of fields (result of select to show dictionary) + 'tabfield'=>array("code,label","code,label","code,label"), + // List of fields (list of fields to edit a record) + 'tabfieldvalue'=>array("code,label","code,label","code,label"), + // List of fields (list of fields for insert) + 'tabfieldinsert'=>array("code,label","code,label","code,label"), + // Name of columns with primary key (try to always name it 'rowid') + 'tabrowid'=>array("rowid","rowid","rowid"), + // Condition to show each dictionary + 'tabcond'=>array($conf->zapier->enabled,$conf->zapier->enabled,$conf->zapier->enabled) + ); + */ + // Boxes/Widgets + // Add here list of php file(s) stored in zapier/core/boxes that contains class to show a widget. + $this->boxes = array( + // 0 => array( + // 'file' => 'zapierwidget1.php@zapier', + // 'note' => 'Widget provided by Zapier', + // 'enabledbydefaulton' => 'Home', + // ), + //1=>array('file'=>'zapierwidget2.php@zapier','note'=>'Widget provided by Zapier'), + //2=>array('file'=>'zapierwidget3.php@zapier','note'=>'Widget provided by Zapier') + ); + // Cronjobs (List of cron jobs entries to add when module is enabled) + // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week + $this->cronjobs = array( + // 0 => array( + // 'label' => 'MyJob label', + // 'jobtype' => 'method', + // 'class' => '/zapier/class/myobject.class.php', + // 'objectname' => 'MyObject', + // 'method' => 'doScheduledJob', + // 'parameters' => '', + // 'comment' => 'Comment', + // 'frequency' => 2, + // 'unitfrequency' => 3600, + // 'status' => 0, + // 'test' => '$conf->zapier->enabled', + // 'priority' => 50, + // ), + ); + // Example: $this->cronjobs=array( + // 0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>'$conf->zapier->enabled', 'priority'=>50), + // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>'$conf->zapier->enabled', 'priority'=>50) + // ); + // Permissions + // Permission array used by this module + $this->rights = array(); + + $r=0; + // Permission id (must not be already used) + $this->rights[$r][0] = $this->numero + $r; + // Permission label + $this->rights[$r][1] = 'Read myobject of Zapier'; + // Permission by default for new user (0/1) + $this->rights[$r][3] = 1; + // In php code, permission will be checked by test if ($user->rights->zapier->level1->level2) + $this->rights[$r][4] = 'read'; + // In php code, permission will be checked by test if ($user->rights->zapier->level1->level2) + $this->rights[$r][5] = ''; + $r++; + $this->rights[$r][0] = $this->numero + $r; + $this->rights[$r][1] = 'Create/Update myobject of Zapier'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'write'; + $this->rights[$r][5] = ''; + $r++; + $this->rights[$r][0] = $this->numero + $r; + $this->rights[$r][1] = 'Delete myobject of Zapier'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'delete'; + $this->rights[$r][5] = ''; + + // Main menu entries + $this->menu = array(); // List of menus to add + $r=0; + + // Add here entries to declare new menus + // $this->menu[$r++]=array( + // 'fk_menu' => '', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + // 'type' => 'top', // This is a Top menu entry + // 'titre' => 'Zapier', + // 'mainmenu' => 'zapier', + // 'leftmenu' => '', + // 'url' => '/zapier/zapierindex.php', + // 'langs' => 'zapier@zapier', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + // 'position' => 1000+$r, + // 'enabled' => '$conf->zapier->enabled', // Define condition to show or hide menu entry. Use '$conf->zapier->enabled' if entry must be visible if module is enabled. + // 'perms' => '1', // Use 'perms'=>'$user->rights->zapier->level1->level2' if you want your menu with a permission rules + // 'target' => '', + // 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both + // ); + + /* + $this->menu[$r++]=array( + 'fk_menu'=>'fk_mainmenu=zapier', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'List MyObject', + 'mainmenu'=>'zapier', + 'leftmenu'=>'zapier_myobject_list', + 'url'=>'/zapier/myobject_list.php', + 'langs'=>'zapier@zapier', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000+$r, + 'enabled'=>'$conf->zapier->enabled', // Define condition to show or hide menu entry. Use '$conf->zapier->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'$user->rights->zapier->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); + $this->menu[$r++]=array( + 'fk_menu'=>'fk_mainmenu=zapier,fk_leftmenu=zapier', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'New MyObject', + 'mainmenu'=>'zapier', + 'leftmenu'=>'zapier_myobject_new', + 'url'=>'/zapier/myobject_page.php?action=create', + 'langs'=>'zapier@zapier', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000+$r, + 'enabled'=>'$conf->zapier->enabled', // Define condition to show or hide menu entry. Use '$conf->zapier->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'$user->rights->zapier->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); + */ + // Exports + $r=1; + /* EXPORT */ + /* + $langs->load("zapier@zapier"); + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='MyObjectLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_icon[$r]='myobject@zapier'; + $keyforclass = 'MyObject'; $keyforclassfile='/mymobule/class/myobject.class.php'; $keyforelement='myobject'; + include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; + $keyforselect='myobject'; $keyforaliasextra='extra'; $keyforelement='myobject'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + //$this->export_dependencies_array[$r]=array('mysubobject'=>'ts.rowid', 't.myfield'=>array('t.myfield2','t.myfield3')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields) + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'myobject as t'; + $this->export_sql_end[$r] .=' WHERE 1 = 1'; + $this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('myobject').')'; + $r++; */ + } + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function init($options = '') + { + $result = $this->_load_tables('/zapier/sql/'); + if ($result < 0) return -1; // Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default') + + // Create extrafields + //include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + //$extrafields = new ExtraFields($this->db); + //$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'zapier@zapier', '$conf->zapier->enabled'); + //$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'zapier@zapier', '$conf->zapier->enabled'); + //$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'zapier@zapier', '$conf->zapier->enabled'); + //$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'zapier@zapier', '$conf->zapier->enabled'); + //$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'zapier@zapier', '$conf->zapier->enabled'); + $sql = array(); + return $this->_init($sql, $options); + } + + /** + * Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function remove($options = '') + { + $sql = array(); + return $this->_remove($sql, $options); + } +} diff --git a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php new file mode 100644 index 00000000000..ae08b55d651 --- /dev/null +++ b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php @@ -0,0 +1,567 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file core/triggers/interface_99_modZapier_ZapierTriggers.class.php + * \ingroup zapier + * \brief Example trigger. + * + * + * \remarks You can create other triggers by copying this one. + * - File name should be either: + * - interface_99_modZapier_MyTrigger.class.php + * - interface_99_all_MyTrigger.class.php + * - The file must stay in core/triggers + * - The class name must be InterfaceMytrigger + * - The constructor method must be named InterfaceMytrigger + * - The name property name must be MyTrigger + */ + +require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; + + +/** + * Class of triggers for Zapier module + */ +class InterfaceZapierTriggers extends DolibarrTriggers +{ + /** + * @var DoliDB Database handler + */ + protected $db; + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + + $this->name = preg_replace('/^Interface/i', '', get_class($this)); + $this->family = "demo"; + $this->description = "Zapier triggers."; + // 'development', 'experimental', 'dolibarr' or version + $this->version = 'development'; + $this->picto = 'zapier@zapier'; + } + + /** + * Trigger name + * + * @return string Name of trigger file + */ + public function getName() + { + return $this->name; + } + + /** + * Trigger description + * + * @return string Description of trigger file + */ + public function getDesc() + { + return $this->description; + } + + + /** + * Function called when a Dolibarrr business event is done. + * All functions "runTrigger" are triggered if file + * is inside directory core/triggers + * + * @param string $action Event action code + * @param CommonObject $object Object + * @param User $user Object user + * @param Translate $langs Object langs + * @param Conf $conf Object conf + * @return int <0 if KO, 0 if no triggered ran, >0 if OK + */ + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) + { + global $db; + if (empty($conf->zapier->enabled)) { + // Module not active, we do nothing + return 0; + } + $logtriggeraction = false; + if ($action!='') { + $actions = explode('_', $action); + $sql = 'SELECT rowid, url FROM '.MAIN_DB_PREFIX.'zapier_hook WHERE'; + $sql .= ' module="'.$db->escape(strtolower($actions[0])).'" AND action="'.$db->escape(strtolower($actions[1])).'"'; + //setEventMessages($sql, null); + } + + switch ($action) { + + // Users + //case 'USER_CREATE': + //case 'USER_MODIFY': + //case 'USER_NEW_PASSWORD': + //case 'USER_ENABLEDISABLE': + //case 'USER_DELETE': + //case 'USER_SETINGROUP': + //case 'USER_REMOVEFROMGROUP': + + case 'USER_LOGIN': + //$logtriggeraction = true; + break; + case 'USER_LOGIN_FAILED': + //$logtriggeraction = true; + break; + case 'USER_LOGOUT': + //$logtriggeraction = true; + break; + // Warning: To increase performances, this action is triggered only if constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1. + //case 'USER_UPDATE_SESSION': + + case 'DOSSIERISOLATION_CREATE': + //$logtriggeraction = true; + break; + case 'DOSSIERISOLATION_MODIFY': + //$logtriggeraction = true; + break; + case 'DOSSIERISOLATION_DELETE': + //$logtriggeraction = true; + break; + + // Actions + case 'ACTION_MODIFY': + //$logtriggeraction = true; + break; + case 'ACTION_CREATE': + $resql = $db->query($sql); + // TODO voir comment regrouper les webhooks en un post + while ($resql && $obj = $db->fetch_array($resql)) { + $cleaned = cleanObjectDatas(dol_clone($object)); + $cleaned = cleanAgendaEventsDatas($cleaned); + $json = json_encode($cleaned); + // call the zapierPostWebhook() function + zapierPostWebhook($obj['url'], $json); + //setEventMessages($obj['url'], null); + } + $logtriggeraction = true; + break; + case 'ACTION_DELETE': + //$logtriggeraction = true; + break; + + // Groups + //case 'GROUP_CREATE': + //case 'GROUP_MODIFY': + //case 'GROUP_DELETE': + + // Companies + case 'COMPANY_CREATE': + $resql = $db->query($sql); + while ($resql && $obj = $db->fetch_array($resql)) { + $cleaned = cleanObjectDatas(dol_clone($object)); + $json = json_encode($cleaned); + // call the zapierPostWebhook() function + zapierPostWebhook($obj['url'], $json); + } + $logtriggeraction = true; + break; + case 'COMPANY_MODIFY': + $resql = $db->query($sql); + while ($resql && $obj = $db->fetch_array($resql)) { + $cleaned = cleanObjectDatas(dol_clone($object)); + $json = json_encode($cleaned); + // call the zapierPostWebhook() function + zapierPostWebhook($obj['url'], $json); + } + $logtriggeraction = true; + break; + case 'COMPANY_DELETE': + //$logtriggeraction = true; + break; + + // Contacts + case 'CONTACT_CREATE': + case 'CONTACT_MODIFY': + case 'CONTACT_DELETE': + case 'CONTACT_ENABLEDISABLE': + + // Products + case 'PRODUCT_CREATE': + case 'PRODUCT_MODIFY': + case 'PRODUCT_DELETE': + case 'PRODUCT_PRICE_MODIFY': + case 'PRODUCT_SET_MULTILANGS': + case 'PRODUCT_DEL_MULTILANGS': + + //Stock mouvement + case 'STOCK_MOVEMENT': + + //MYECMDIR + case 'MYECMDIR_DELETE': + case 'MYECMDIR_CREATE': + case 'MYECMDIR_MODIFY': + + // Customer orders + case 'ORDER_CREATE': + $resql = $db->query($sql); + while ($resql && $obj = $db->fetch_array($resql)) { + $cleaned = cleanObjectDatas(dol_clone($object)); + $json = json_encode($cleaned); + // call the zapierPostWebhook() function + zapierPostWebhook($obj['url'], $json); + } + $logtriggeraction = true; + break; + case 'ORDER_CLONE': + break; + case 'ORDER_VALIDATE': + break; + case 'ORDER_DELETE': + case 'ORDER_CANCEL': + case 'ORDER_SENTBYMAIL': + case 'ORDER_CLASSIFY_BILLED': + case 'ORDER_SETDRAFT': + case 'LINEORDER_INSERT': + case 'LINEORDER_UPDATE': + case 'LINEORDER_DELETE': + + // Supplier orders + case 'ORDER_SUPPLIER_CREATE': + case 'ORDER_SUPPLIER_CLONE': + case 'ORDER_SUPPLIER_VALIDATE': + case 'ORDER_SUPPLIER_DELETE': + case 'ORDER_SUPPLIER_APPROVE': + case 'ORDER_SUPPLIER_REFUSE': + case 'ORDER_SUPPLIER_CANCEL': + case 'ORDER_SUPPLIER_SENTBYMAIL': + case 'ORDER_SUPPLIER_DISPATCH': + case 'LINEORDER_SUPPLIER_DISPATCH': + case 'LINEORDER_SUPPLIER_CREATE': + case 'LINEORDER_SUPPLIER_UPDATE': + + // Proposals + case 'PROPAL_CREATE': + case 'PROPAL_CLONE': + case 'PROPAL_MODIFY': + case 'PROPAL_VALIDATE': + case 'PROPAL_SENTBYMAIL': + case 'PROPAL_CLOSE_SIGNED': + //$logtriggeraction = true; + break; + case 'PROPAL_CLOSE_REFUSED': + //$logtriggeraction = true; + break; + case 'PROPAL_DELETE': + //$logtriggeraction = true; + break; + case 'LINEPROPAL_INSERT': + case 'LINEPROPAL_UPDATE': + case 'LINEPROPAL_DELETE': + + // SupplierProposal + case 'SUPPLIER_PROPOSAL_CREATE': + case 'SUPPLIER_PROPOSAL_CLONE': + case 'SUPPLIER_PROPOSAL_MODIFY': + case 'SUPPLIER_PROPOSAL_VALIDATE': + case 'SUPPLIER_PROPOSAL_SENTBYMAIL': + case 'SUPPLIER_PROPOSAL_CLOSE_SIGNED': + case 'SUPPLIER_PROPOSAL_CLOSE_REFUSED': + case 'SUPPLIER_PROPOSAL_DELETE': + case 'LINESUPPLIER_PROPOSAL_INSERT': + case 'LINESUPPLIER_PROPOSAL_UPDATE': + case 'LINESUPPLIER_PROPOSAL_DELETE': + + // Contracts + case 'CONTRACT_CREATE': + case 'CONTRACT_ACTIVATE': + case 'CONTRACT_CANCEL': + case 'CONTRACT_CLOSE': + case 'CONTRACT_DELETE': + case 'LINECONTRACT_INSERT': + case 'LINECONTRACT_UPDATE': + case 'LINECONTRACT_DELETE': + + // Bills + case 'BILL_CREATE': + //$logtriggeraction = true; + break; + case 'BILL_CLONE': + case 'BILL_MODIFY': + case 'BILL_VALIDATE': + case 'BILL_UNVALIDATE': + //$logtriggeraction = true; + break; + case 'BILL_SENTBYMAIL': + //$logtriggeraction = true; + break; + case 'BILL_CANCEL': + //$logtriggeraction = true; + break; + case 'BILL_DELETE': + //$logtriggeraction = true; + break; + case 'BILL_PAYED': + case 'LINEBILL_INSERT': + case 'LINEBILL_UPDATE': + case 'LINEBILL_DELETE': + + //Supplier Bill + case 'BILL_SUPPLIER_CREATE': + case 'BILL_SUPPLIER_UPDATE': + case 'BILL_SUPPLIER_DELETE': + case 'BILL_SUPPLIER_PAYED': + case 'BILL_SUPPLIER_UNPAYED': + case 'BILL_SUPPLIER_VALIDATE': + case 'BILL_SUPPLIER_UNVALIDATE': + case 'LINEBILL_SUPPLIER_CREATE': + case 'LINEBILL_SUPPLIER_UPDATE': + case 'LINEBILL_SUPPLIER_DELETE': + + // Payments + case 'PAYMENT_CUSTOMER_CREATE': + case 'PAYMENT_SUPPLIER_CREATE': + case 'PAYMENT_ADD_TO_BANK': + case 'PAYMENT_DELETE': + + // Online + case 'PAYMENT_PAYBOX_OK': + case 'PAYMENT_PAYPAL_OK': + case 'PAYMENT_STRIPE_OK': + + // Donation + case 'DON_CREATE': + case 'DON_UPDATE': + case 'DON_DELETE': + + // Interventions + case 'FICHINTER_CREATE': + case 'FICHINTER_MODIFY': + case 'FICHINTER_VALIDATE': + case 'FICHINTER_DELETE': + case 'LINEFICHINTER_CREATE': + case 'LINEFICHINTER_UPDATE': + case 'LINEFICHINTER_DELETE': + + // Members + case 'MEMBER_CREATE': + case 'MEMBER_VALIDATE': + case 'MEMBER_SUBSCRIPTION': + case 'MEMBER_MODIFY': + case 'MEMBER_NEW_PASSWORD': + case 'MEMBER_RESILIATE': + case 'MEMBER_DELETE': + + // Categories + case 'CATEGORY_CREATE': + case 'CATEGORY_MODIFY': + case 'CATEGORY_DELETE': + case 'CATEGORY_SET_MULTILANGS': + + // Projects + case 'PROJECT_CREATE': + case 'PROJECT_MODIFY': + case 'PROJECT_DELETE': + + // Project tasks + case 'TASK_CREATE': + case 'TASK_MODIFY': + case 'TASK_DELETE': + + // Task time spent + case 'TASK_TIMESPENT_CREATE': + case 'TASK_TIMESPENT_MODIFY': + case 'TASK_TIMESPENT_DELETE': + + // Shipping + case 'SHIPPING_CREATE': + case 'SHIPPING_MODIFY': + case 'SHIPPING_VALIDATE': + case 'SHIPPING_SENTBYMAIL': + case 'SHIPPING_BILLED': + case 'SHIPPING_CLOSED': + case 'SHIPPING_REOPEN': + //$logtriggeraction = true; + break; + case 'SHIPPING_DELETE': + //$logtriggeraction = true; + break; + } + if ($logtriggeraction) { + dol_syslog("Trigger '" . $this->name . "' for action '.$action.' launched by " . __FILE__ . " id=" . $object->id); + } + return 0; + } +} +/** + * Post webhook in zapier with object data + * + * @param string $url url provided by zapier + * @param string $json data to send + * @return void + */ +function zapierPostWebhook($url, $json) +{ + $headers = array('Accept: application/json', 'Content-Type: application/json'); + // TODO supprimer le webhook en cas de mauvaise réponse + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $json); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + $output = curl_exec($ch); + curl_close($ch); +} + +/** + * Clean sensible object datas + * + * @param object $toclean Object to clean + * @return array Array of cleaned object properties + */ +function cleanObjectDatas($toclean) +{ + // Remove $db object property for object + unset($toclean->db); + + // Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses + unset($toclean->linkedObjects); + + unset($toclean->lines); // should be ->lines + + unset($toclean->fields); + + unset($toclean->oldline); + + unset($toclean->error); + unset($toclean->errors); + + unset($toclean->ref_previous); + unset($toclean->ref_next); + unset($toclean->ref_int); + + unset($toclean->projet); // Should be fk_project + unset($toclean->project); // Should be fk_project + unset($toclean->author); // Should be fk_user_author + unset($toclean->timespent_old_duration); + unset($toclean->timespent_id); + unset($toclean->timespent_duration); + unset($toclean->timespent_date); + unset($toclean->timespent_datehour); + unset($toclean->timespent_withhour); + unset($toclean->timespent_fk_user); + unset($toclean->timespent_note); + + unset($toclean->statuts); + unset($toclean->statuts_short); + unset($toclean->statuts_logo); + unset($toclean->statuts_long); + + unset($toclean->element); + unset($toclean->fk_element); + unset($toclean->table_element); + unset($toclean->table_element_line); + unset($toclean->picto); + + unset($toclean->skip_update_total); + unset($toclean->context); + + // Remove the $oldcopy property because it is not supported by the JSON + // encoder. The following error is generated when trying to serialize + // it: "Error encoding/decoding JSON: Type is not supported" + // Note: Event if this property was correctly handled by the JSON + // encoder, it should be ignored because keeping it would let the API + // have a very strange behavior: calling PUT and then GET on the same + // resource would give different results: + // PUT /objects/{id} -> returns object with oldcopy = previous version of the object + // GET /objects/{id} -> returns object with oldcopy empty + unset($toclean->oldcopy); + + // If object has lines, remove $db property + if (isset($toclean->lines) && count($toclean->lines) > 0) { + $nboflines = count($toclean->lines); + for ($i=0; $i < $nboflines; $i++) { + $this->cleanObjectDatas($toclean->lines[$i]); + } + } + + // If object has linked objects, remove $db property + /* + if(isset($toclean->linkedObjects) && count($toclean->linkedObjects) > 0) { + foreach($toclean->linkedObjects as $type_object => $linked_object) { + foreach($linked_object as $toclean2clean) { + $this->cleanObjectDatas($toclean2clean); + } + } + }*/ + + return $toclean; +} + +/** + * Clean sensible object datas + * + * @param object $toclean Object to clean + * @return array Array of cleaned object properties + */ +function cleanAgendaEventsDatas($toclean) +{ + unset($toclean->usermod); + unset($toclean->libelle); + //unset($toclean->array_options); + unset($toclean->context); + unset($toclean->canvas); + unset($toclean->contact); + unset($toclean->contact_id); + unset($toclean->thirdparty); + unset($toclean->user); + unset($toclean->origin); + unset($toclean->origin_id); + unset($toclean->ref_ext); + unset($toclean->statut); + unset($toclean->country); + unset($toclean->country_id); + unset($toclean->country_code); + unset($toclean->barcode_type); + unset($toclean->barcode_type_code); + unset($toclean->barcode_type_label); + unset($toclean->barcode_type_coder); + unset($toclean->mode_reglement_id); + unset($toclean->cond_reglement_id); + unset($toclean->cond_reglement); + unset($toclean->fk_delivery_address); + unset($toclean->shipping_method_id); + unset($toclean->fk_account); + unset($toclean->total_ht); + unset($toclean->total_tva); + unset($toclean->total_localtax1); + unset($toclean->total_localtax2); + unset($toclean->total_ttc); + unset($toclean->fk_incoterms); + unset($toclean->libelle_incoterms); + unset($toclean->location_incoterms); + unset($toclean->name); + unset($toclean->lastname); + unset($toclean->firstname); + unset($toclean->civility_id); + unset($toclean->contact); + unset($toclean->societe); + + return $toclean; +} diff --git a/htdocs/langs/en_US/zapier.lang b/htdocs/langs/en_US/zapier.lang new file mode 100644 index 00000000000..2699f54b721 --- /dev/null +++ b/htdocs/langs/en_US/zapier.lang @@ -0,0 +1,53 @@ +# Copyright (C) 2019 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# Generic +# + +# Module label 'ModuleZapierForDolibarrName' +ModuleZapierForDolibarrName = ZapierForDolibarr +# Module description 'ModuleZapierForDolibarrDesc' +ModuleZapierForDolibarrDesc = ZapierForDolibarr description + +# +# Admin page +# +ZapierForDolibarrSetup = ZapierForDolibarr setup +Settings = Settings +ZapierForDolibarrSetupPage = ZapierForDolibarr setup page +ZAPIERFORDOLIBARR_MYPARAM1 = My param 1 +ZAPIERFORDOLIBARR_MYPARAM1Tooltip = My param 1 tooltip +ZAPIERFORDOLIBARR_MYPARAM2=My param 2 +ZAPIERFORDOLIBARR_MYPARAM2Tooltip=My param 2 tooltip + + +# +# About page +# +About = About +ZapierForDolibarrAbout = About ZapierForDolibarr +ZapierForDolibarrAboutPage = ZapierForDolibarr about page + +# +# Sample page +# +MyPageName = My page name + +# +# Sample widget +# +MyWidget = My widget +MyWidgetDescription = My widget description diff --git a/htdocs/langs/fr_FR/zapier.lang b/htdocs/langs/fr_FR/zapier.lang new file mode 100644 index 00000000000..78103a55bae --- /dev/null +++ b/htdocs/langs/fr_FR/zapier.lang @@ -0,0 +1,48 @@ +# Copyright (C) 2019 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# Générique +# + +# Module label 'ModuleZapierForDolibarrName' +ModuleZapierForDolibarrName = ZapierForDolibarr +# Module description 'ModuleZapierForDolibarrDesc' +ModuleZapierForDolibarrDesc = Description de ZapierForDolibarr + +# +# Page d'administration +# +ZapierForDolibarrSetup = Configuration du module ZapierForDolibarr +Settings = Réglages +ZapierForDolibarrSetupPage = Page de configuration du module ZapierForDolibarr + +# +# Page À propos +# +About = À propos +ZapierForDolibarrAbout = À propos de ZapierForDolibarr +ZapierForDolibarrAboutPage = Page à propos de ZapierForDolibarr + +# +# Page d'exemple +# +MyPageName = Nom de ma page + +# +# Box d'exemple +# +MyWidget = Mon widget +MyWidgetDescription = Description de mon widget diff --git a/htdocs/zapier/admin/about.php b/htdocs/zapier/admin/about.php new file mode 100644 index 00000000000..d875928ae8f --- /dev/null +++ b/htdocs/zapier/admin/about.php @@ -0,0 +1,76 @@ + + * Copyright (C) 2019 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file zapier/admin/about.php + * \ingroup zapier + * \brief About page of module Zapier. + */ + +// Load Dolibarr environment +require '../../main.inc.php'; + +// Libraries +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once '../lib/zapier.lib.php'; + +// Translations +$langs->loadLangs(array("errors","admin","zapier@zapier")); + +// Access control +if (! $user->admin) accessforbidden(); + +// Parameters +$action = GETPOST('action', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); + + +/* + * Actions + */ + +// None + + +/* + * View + */ + +$form = new Form($db); + +$page_name = "ZapierAbout"; +llxHeader('', $langs->trans($page_name)); + +// Subheader +$linkback = ''.$langs->trans("BackToModuleList").''; + +print load_fiche_titre($langs->trans($page_name), $linkback, 'object_zapier@zapier'); + +// Configuration header +$head = zapierAdminPrepareHead(); +dol_fiche_head($head, 'about', '', 0, 'zapier@zapier'); + +dol_include_once('/zapier/core/modules/modZapier.class.php'); +$tmpmodule = new modZapier($db); +print $tmpmodule->getDescLong(); + +// Page end +dol_fiche_end(); +llxFooter(); +$db->close(); diff --git a/htdocs/zapier/admin/setup.php b/htdocs/zapier/admin/setup.php new file mode 100644 index 00000000000..b8b203b8ab1 --- /dev/null +++ b/htdocs/zapier/admin/setup.php @@ -0,0 +1,124 @@ + + * Copyright (C) 2019 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file zapier/admin/setup.php + * \ingroup zapier + * \brief Zapier setup page. + */ + +// Load Dolibarr environment +require '../../main.inc.php'; + +// Libraries +require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; +require_once '../lib/zapier.lib.php'; + +// Translations +$langs->loadLangs(array("admin", "zapier@zapier")); + +// Access control +if (! $user->admin) accessforbidden(); + +// Parameters +$action = GETPOST('action', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); + +$arrayofparameters=array( + 'ZAPIERFORDOLIBARR_MYPARAM1'=>array('css'=>'minwidth200','enabled'=>1), + 'ZAPIERFORDOLIBARR_MYPARAM2'=>array('css'=>'minwidth500','enabled'=>1) +); + + +/* + * Actions + */ +if ((float) DOL_VERSION >= 6) { + include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +} + + +/* + * View + */ + +$page_name = "ZapierSetup"; +llxHeader('', $langs->trans($page_name)); + +// Subheader +$linkback = ''.$langs->trans("BackToModuleList").''; + +print load_fiche_titre($langs->trans($page_name), $linkback, 'object_zapier@zapier'); + +// Configuration header +$head = zapierAdminPrepareHead(); +dol_fiche_head($head, 'settings', '', -1, "zapier@zapier"); + +// Setup page goes here +echo $langs->trans("ZapierSetupPage").'

'; + + +if ($action == 'edit') { + print '
'; + print ''; + print ''; + + print ''; + print ''; + + foreach($arrayofparameters as $key => $val) { + print ''; + } + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); + print '
'; + + print '
'; + print ''; + print '
'; + + print '
'; + print '
'; +} else { + if (! empty($arrayofparameters)) { + print ''; + print ''; + + foreach($arrayofparameters as $key => $val) { + print ''; + } + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); + print '' . $conf->global->$key . '
'; + + print '
'; + print ''.$langs->trans("Modify").''; + print '
'; + } else + { + print '
'.$langs->trans("NothingToSetup"); + } +} + + +// Page end +dol_fiche_end(); + +llxFooter(); +$db->close(); diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php new file mode 100644 index 00000000000..239ee5227d6 --- /dev/null +++ b/htdocs/zapier/class/api_zapier.class.php @@ -0,0 +1,382 @@ + + * Copyright (C) 2019 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +use Luracast\Restler\RestException; + +dol_include_once('/zapier/class/hook.class.php'); + + + +/** + * \file htdocs/modulebuilder/template/class/api_zapier.class.php + * \ingroup zapier + * \brief File for API management of hook. + */ + +/** + * API class for zapier hook + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ +class ZapierApi extends DolibarrApi +{ + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + static $FIELDS = array( + 'url', + ); + + + /** + * @var Hook $hook {@type Hook} + */ + public $hook; + + /** + * Constructor + * + * @url GET / + * + */ + public function __construct() + { + global $db, $conf; + $this->db = $db; + $this->hook = new Hook($this->db); + } + + /** + * Get properties of a hook object + * + * Return an array with hook informations + * + * @param int $id ID of hook + * @return array|mixed data without useless information + * + * @url GET /hooks/{id} + * @throws RestException + */ + public function get($id) + { + if(! DolibarrApiAccess::$user->rights->zapier->read) { + throw new RestException(401); + } + + $result = $this->hook->fetch($id); + if (! $result ) { + throw new RestException(404, 'Hook not found'); + } + + if (! DolibarrApi::_checkAccessToResource('hook', $this->hook->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + return $this->_cleanObjectDatas($this->hook); + } + + + /** + * Get list of possibles choices for module + * + * Return an array with hook informations + * @param integer $id ID + * + * @return array|mixed data + * + * @url GET /getmoduleschoices/ + * @throws RestException + */ + public function getModulesChoices($id) + { + if(! DolibarrApiAccess::$user->rights->zapier->read) { + throw new RestException(401); + } + $arraychoices = array( + 'invoices' => 'Invoices', + 'orders' => 'Orders', + 'thirdparties' => 'Thirparties', + 'contacts' => 'Contacts', + ); + // $result = $this->hook->fetch($id); + // if (! $result ) { + // throw new RestException(404, 'Hook not found'); + // } + + // if (! DolibarrApi::_checkAccessToResource('hook', $this->hook->id)) { + // throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + // } + + return $arraychoices; + } + + + /** + * List hooks + * + * Get a list of hooks + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @return array Array of order objects + * + * @throws RestException + * + * @url GET /hooks/ + */ + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') + { + global $db, $conf; + + $obj_ret = array(); + + $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; + + // Set to 1 if there is a field socid in table of object + $restrictonsocid = 0; + + // If the internal user must only see his customers, force searching by him + $search_sale = 0; + if ($restrictonsocid && ! DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) { + $search_sale = DolibarrApiAccess::$user->id; + } + + $sql = "SELECT t.rowid"; + if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { + // We need these fields in order to filter by sale (including the case where the user can only see his prospects) + $sql .= ", sc.fk_soc, sc.fk_user"; + } + $sql.= " FROM ".MAIN_DB_PREFIX."hook_mytable as t"; + + if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale + $sql.= " WHERE 1 = 1"; + + // Example of use $mode + //if ($mode == 1) $sql.= " AND s.client IN (1, 3)"; + //if ($mode == 2) $sql.= " AND s.client IN (2, 3)"; + + $tmpobject = new Hook($db); + if ($tmpobject->ismultientitymanaged) { + $sql.= ' AND t.entity IN ('.getEntity('hook').')'; + } + if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { + $sql.= " AND t.fk_soc = sc.fk_soc"; + } + if ($restrictonsocid && $socid) { + $sql.= " AND t.fk_soc = ".$socid; + } + if ($restrictonsocid && $search_sale > 0) { + // Join for the needed table to filter by sale + $sql.= " AND t.rowid = sc.fk_soc"; + } + // Insert sale filter + if ($restrictonsocid && $search_sale > 0) { + $sql .= " AND sc.fk_user = ".$search_sale; + } + if ($sqlfilters) { + if (! DolibarrApi::_checkFilters($sqlfilters)) { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + + $sql.= $db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + + $sql.= $db->plimit($limit + 1, $offset); + } + + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + while ($i < $num) { + $obj = $db->fetch_object($result); + $hook_static = new Hook($db); + if ($hook_static->fetch($obj->rowid)) { + $obj_ret[] = $this->_cleanObjectDatas($hook_static); + } + $i++; + } + } else { + throw new RestException(503, 'Error when retrieve hook list'); + } + if (! count($obj_ret)) { + throw new RestException(404, 'No hook found'); + } + return $obj_ret; + } + + /** + * Create hook object + * + * @param array $request_data Request datas + * @return int ID of hook + * + * @url POST /hook/ + */ + public function post($request_data = null) + { + // $debug = '
'.print_r($request_data, true).'
'; + // $debug .= '
'.print_r(DolibarrApiAccess::$user->rights->zapier, true).'
'; + // mail('frederic.france@free.fr', 'test hook', $debug); + if (! DolibarrApiAccess::$user->rights->zapier->write) { + throw new RestException(401); + } + // Check mandatory fields + $fields = array( + 'url', + ); + $result = $this->validate($request_data, $fields); + + foreach($request_data as $field => $value) { + $this->hook->$field = $value; + } + $this->hook->fk_user = DolibarrApiAccess::$user->id; + // on crée le hook dans la base + if( ! $this->hook->create(DolibarrApiAccess::$user)) { + throw new RestException(500, "Error creating Hook", array_merge(array($this->hook->error), $this->hook->errors)); + } + return array( + 'id' => $this->hook->id, + ); + } + + /** + * Update hook + * + * @param int $id Id of hook to update + * @param array $request_data Datas + * @return int + * + * @url PUT /hooks/{id} + */ + /*public function put($id, $request_data = null) + { + if (! DolibarrApiAccess::$user->rights->zapier->write) { + throw new RestException(401); + } + + $result = $this->hook->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Hook not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('hook', $this->hook->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + foreach($request_data as $field => $value) { + if ($field == 'id') { + continue; + } + $this->hook->$field = $value; + } + + if ($this->hook->update($id, DolibarrApiAccess::$user) > 0) { + return $this->get($id); + } else { + throw new RestException(500, $this->hook->error); + } + }*/ + + /** + * Delete hook + * + * @param int $id Hook ID + * @return array + * + * @url DELETE /hook/{id} + */ + public function delete($id) + { + if (! DolibarrApiAccess::$user->rights->zapier->delete) { + throw new RestException(401); + } + $result = $this->hook->fetch($id); + if (! $result) { + throw new RestException(404, 'Hook not found'); + } + + if (! DolibarrApi::_checkAccessToResource('hook', $this->hook->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + if (! $this->hook->delete(DolibarrApiAccess::$user)) { + throw new RestException(500, 'Error when deleting Hook : '.$this->hook->error); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Hook deleted' + ) + ); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param object $object Object to clean + * @return array Array of cleaned object properties + */ + public function _cleanObjectDatas($object) + { + // phpcs:disable + $object = parent::_cleanObjectDatas($object); + + /*unset($object->note); + unset($object->address); + unset($object->barcode_type); + unset($object->barcode_type_code); + unset($object->barcode_type_label); + unset($object->barcode_type_coder);*/ + + return $object; + } + + /** + * Validate fields before create or update object + * + * @param array $data Array of data to validate + * @param array $fields Array of fields needed + * @return array + * + * @throws RestException + */ + private function validate($data, $fields) + { + $hook = array(); + foreach ($fields as $field) { + if (!isset($data[$field])) { + throw new RestException(400, $field." field missing"); + } + $hook[$field] = $data[$field]; + } + return $hook; + } +} diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php new file mode 100644 index 00000000000..4a3e670056e --- /dev/null +++ b/htdocs/zapier/class/hook.class.php @@ -0,0 +1,773 @@ + + * Copyright (C) 2019 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/modulebuilder/template/class/hook.class.php + * \ingroup zapier + * \brief This file is a CRUD class file for Hook (Create/Read/Update/Delete) + */ + +require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; + +/** + * Class for Hook + */ +class Hook extends CommonObject +{ + /** + * @var string ID to identify managed object + */ + public $element = 'hook'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'zapier_hook'; + + /** + * @var int Does hook support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + */ + public $ismultientitymanaged = 0; + + /** + * @var int Does hook support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + + /** + * @var string String with name of icon for hook. Must be the part after the 'object_' into object_hook.png + */ + public $picto = 'hook@zapier'; + + + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_DISABLED = -1; + + + /** + * 'type' if the field format ('integer', 'integer:Class:pathtoclass', 'varchar(x)', 'double(24,8)', 'text', 'html', 'datetime', 'timestamp', 'float') + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'default' is a default value for creation (can still be replaced by the global setup of default values) + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'position' is the sort order of field. + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + */ + + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + 'rowid' => array( + 'type' => 'integer', + 'label' => 'TechnicalID', + 'enabled' => 1, + 'visible' => -2, + 'noteditable' => 1, + 'notnull' => 1, + 'index' => 1, + 'position' => 1, + 'comment' => 'Id', + ), + 'entity' => array( + 'type' => 'integer', + 'label' => 'Entity', + 'enabled' => 1, + 'visible' => 0, + 'notnull' => 1, + 'default' => 1, + 'index' => 1, + 'position' => 20, + ), + 'fk_user' => array( + 'type' => 'integer', + 'label' => 'UserOwner', + 'enabled' => 1, + 'visible' => -2, + 'notnull' => 1, + 'position' => 510, + 'foreignkey' => MAIN_DB_PREFIX.'user.rowid', + ), + 'url' => array( + 'type' => 'varchar(255)', + 'label' => 'Url', + 'enabled' => 1, + 'visible' => 1, + 'position' => 30, + 'searchall' => 1, + 'css' => 'minwidth200', + 'help' => 'Hook url', + 'showoncombobox' => 1, + ), + 'module' => array( + 'type' => 'varchar(128)', + 'label' => 'Url', + 'enabled' => 1, + 'visible' => 1, + 'position' => 30, + 'searchall' => 1, + 'css' => 'minwidth200', + 'help' => 'Hook module', + 'showoncombobox' => 1, + ), + 'action' => array( + 'type' => 'varchar(128)', + 'label' => 'Url', + 'enabled' => 1, + 'visible' => 1, + 'position' => 30, + 'searchall' => 1, + 'css' => 'minwidth200', + 'help' => 'Hook action trigger', + 'showoncombobox' => 1, + ), + 'event' => array( + 'type' => 'varchar(255)', + 'label' => 'Event', + 'enabled' => 1, + 'visible' => 1, + 'position' => 30, + 'searchall' => 1, + 'css' => 'minwidth200', + 'help' => 'Event', + 'showoncombobox' => 1, + ), + 'date_creation' => array( + 'type' => 'datetime', + 'label' => 'DateCreation', + 'enabled' => 1, + 'visible' => -2, + 'notnull' => 1, + 'position' => 500, + ), + 'import_key' => array( + 'type' => 'varchar(14)', + 'label' => 'ImportId', + 'enabled' => 1, + 'visible' => -2, + 'notnull' => -1, + 'index' => 0, + 'position' => 1000, + ), + 'status' => array( + 'type' => 'integer', + 'label' => 'Status', + 'enabled' => 1, + 'visible' => 1, + 'notnull' => 1, + 'default' => 0, + 'index' => 1, + 'position' => 1000, + 'arrayofkeyval' => array( + 0 => 'Draft', + 1 => 'Active', + -1 => 'Canceled', + ), + ), + ); + + /** + * @var int ID + */ + public $rowid; + + /** + * @var string Ref + */ + public $ref; + + /** + * @var int Entity + */ + public $entity; + + /** + * @var string label + */ + public $label; + + /** + * @var string amount + */ + public $amount; + + /** + * @var int Status + */ + public $status; + + /** + * @var integer|string date_creation + */ + public $date_creation; + + /** + * @var integer tms + */ + public $tms; + + /** + * @var int ID + */ + public $fk_user_creat; + + /** + * @var int ID + */ + public $fk_user_modif; + + /** + * @var string import_key + */ + public $import_key; + + + // If this object has a subtable with lines + + /** + * @var int Name of subtable line + */ + //public $table_element_line = 'hookdet'; + + /** + * @var int Field with ID of parent key if this field has a parent + */ + //public $fk_element = 'fk_hook'; + + /** + * @var int Name of subtable class that manage subtable lines + */ + //public $class_element_line = 'MyObjectline'; + + /** + * @var array Array of child tables (child tables to delete before deleting a record) + */ + //protected $childtables=array('hookdet'); + + /** + * @var MyObjectLine[] Array of subtable lines + */ + //public $lines = array(); + + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs, $user; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { + $this->fields['rowid']['visible']=0; + } + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + $this->fields['entity']['enabled']=0; + } + + // Unset fields that are disabled + foreach($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + foreach($this->fields as $key => $val) { + if (is_array($this->fields['status']['arrayofkeyval'])) { + foreach($this->fields['status']['arrayofkeyval'] as $key2 => $val2) { + $this->fields['status']['arrayofkeyval'][$key2]=$langs->trans($val2); + } + } + } + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + public function create(User $user, $notrigger = false) + { + return $this->createCommon($user, $notrigger); + } + + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return mixed New object created, <0 if KO + */ + public function createFromClone(User $user, $fromid) + { + global $langs, $hookmanager, $extrafields; + $error = 0; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $object = new self($this->db); + + $this->db->begin(); + + // Load source object + $object->fetchCommon($fromid); + // Reset some properties + unset($object->id); + unset($object->fk_user_creat); + unset($object->import_key); + + // Clear fields + $object->ref = "copy_of_".$object->ref; + $object->title = $langs->trans("CopyOf")." ".$object->title; + // ... + // Clear extrafields that are unique + if (is_array($object->array_options) && count($object->array_options) > 0) { + $extrafields->fetch_name_optionals_label($this->element); + foreach($object->array_options as $key => $option) { + $shortkey = preg_replace('/options_/', '', $key); + if (! empty($extrafields->attributes[$this->element]['unique'][$shortkey])) { + // var_dump($key); + // var_dump($clonedObj->array_options[$key]); + // exit; + unset($object->array_options[$key]); + } + } + } + + // Create clone + $object->context['createfromclone'] = 'createfromclone'; + $result = $object->createCommon($user); + if ($result < 0) { + $error++; + $this->error = $object->error; + $this->errors = $object->errors; + } + + unset($object->context['createfromclone']); + + // End + if (!$error) { + $this->db->commit(); + return $object; + } else { + $this->db->rollback(); + return -1; + } + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null) + { + $result = $this->fetchCommon($id, $ref); + if ($result > 0 && ! empty($this->table_element_line)) { + $this->fetchLines(); + } + return $result; + } + + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + /*public function fetchLines() + { + $this->lines=array(); + + // Load lines with object MyObjectLine + + return count($this->lines)?1:0; + }*/ + + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) + * @param string $filtermode Filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') + { + global $conf; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $records=array(); + + $sql = 'SELECT'; + $sql .= ' t.rowid'; + // TODO Get all fields + $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element. ' as t'; + $sql .= ' WHERE t.entity = '.$conf->entity; + // Manage filter + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key=='t.rowid') { + $sqlwhere[] = $key . '='. $value; + } elseif (strpos($key, 'date') !== false) { + $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; + } elseif ($key=='customsql') { + $sqlwhere[] = $value; + } else { + $sqlwhere[] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\''; + } + } + } + if (count($sqlwhere) > 0) { + $sql .= ' AND (' . implode(' '.$filtermode.' ', $sqlwhere).')'; + } + + if (!empty($sortfield)) { + $sql .= $this->db->order($sortfield, $sortorder); + } + if (!empty($limit)) { + $sql .= ' ' . $this->db->plimit($limit, $offset); + } + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + + while ($obj = $this->db->fetch_object($resql)) { + $record = new self($this->db); + + $record->id = $obj->rowid; + // TODO Get other fields + + //var_dump($record->id); + $records[$record->id] = $record; + } + $this->db->free($resql); + + return $records; + } else { + $this->errors[] = 'Error ' . $this->db->lasterror(); + dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + + return -1; + } + } + + /** + * Update object into database + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function update(User $user, $notrigger = false) + { + return $this->updateCommon($user, $notrigger); + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + return $this->deleteCommon($user, $notrigger); + //return $this->deleteCommon($user, $notrigger, 1); + } + + /** + * Return a link to the object card (with optionaly the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + global $db, $conf, $langs, $hookmanager, $action; + global $dolibarr_main_authentication, $dolibarr_main_demo; + global $menumanager; + + if (! empty($conf->dol_no_mouse_hover)) { + // Force disable tooltips + $notooltip=1; + } + + $result = ''; + + $label = '' . $langs->trans("Hook") . ''; + $label.= '
'; + $label.= '' . $langs->trans('Ref') . ': ' . $this->ref; + + $url = dol_buildpath('/zapier/hook_card.php', 1).'?id='.$this->id; + + if ($option != 'nolink') { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { + $add_save_lastsearch_values=1; + } + if ($add_save_lastsearch_values) { + $url.='&save_lastsearch_values=1'; + } + } + + $linkclose=''; + if (empty($notooltip)) { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + $label=$langs->trans("ShowMyObject"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + + /* + $hookmanager->initHooks(array('hookdao')); + $parameters=array('id'=>$this->id); + $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) $linkclose = $hookmanager->resPrint; + */ + } else { + $linkclose = ($morecss?' class="'.$morecss.'"':''); + } + + $linkstart = ''; + $linkend=''; + + $result .= $linkstart; + if ($withpicto) { + $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); + } + if ($withpicto != 2) { + $result.= $this->ref; + } + $result .= $linkend; + //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + + $hookmanager->initHooks(array('hookdao')); + $parameters = array( + 'id' => $this->id, + 'getnomurl' => $result, + ); + // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + + return $result; + } + + /** + * Return label of the status + * + * @param int $mode 0 = long label + * 1 = short label + * 2 = Picto + short label + * 3 = Picto, 4=Picto + long label + * 5 = Short label + Picto + * 6 = Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + return $this->LibStatut($this->status, $mode); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0 = long label, + * 1 = short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + // phpcs:enable + if (empty($this->labelstatus)) { + global $langs; + //$langs->load("zapier@zapier"); + $this->labelstatus[1] = $langs->trans('Enabled'); + $this->labelstatus[0] = $langs->trans('Disabled'); + } + + if ($mode == 0) { + return $this->labelstatus[$status]; + } elseif ($mode == 1) { + return $this->labelstatus[$status]; + } elseif ($mode == 2) { + if ($status == 1) { + return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + } elseif ($status == 0) { + return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + } + } elseif ($mode == 3) { + if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + } elseif ($mode == 4) { + if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + } elseif ($mode == 5) { + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + } elseif ($mode == 6) { + if ($status == 1) { + return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + } elseif ($status == 0) { + return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + } + } + } + + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; + $sql.= ' fk_user_creat, fk_user_modif'; + $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; + $sql.= ' WHERE t.rowid = '.$id; + $result=$this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + + if ($obj->fk_user_valid) { + $vuser = new User($this->db); + $vuser->fetch($obj->fk_user_valid); + $this->user_validation = $vuser; + } + + if ($obj->fk_user_cloture) { + $cluser = new User($this->db); + $cluser->fetch($obj->fk_user_cloture); + $this->user_cloture = $cluser; + } + + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_validation = $this->db->jdate($obj->datev); + } + + $this->db->free($result); + } else { + dol_print_error($this->db); + } + } + + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + public function initAsSpecimen() + { + $this->initAsSpecimenCommon(); + } + + + /** + * Action executed by scheduler + * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' + * + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + //public function doScheduledJob($param1, $param2, ...) + public function doScheduledJob() + { + global $conf, $langs; + + //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; + + $error = 0; + $this->output = ''; + $this->error=''; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $now = dol_now(); + + $this->db->begin(); + + // ... + + $this->db->commit(); + + return $error; + } +} + +/** + * Class MyObjectLine. You can also remove this and generate a CRUD class for lines objects. + */ +/* +class MyObjectLine +{ + // @var int ID + public $id; + // @var mixed Sample line property 1 + public $prop1; + // @var mixed Sample line property 2 + public $prop2; +} +*/ diff --git a/htdocs/zapier/hook_agenda.php b/htdocs/zapier/hook_agenda.php new file mode 100644 index 00000000000..924db3b8632 --- /dev/null +++ b/htdocs/zapier/hook_agenda.php @@ -0,0 +1,261 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/modulebuilder/template/myobject_agenda.php + * \ingroup mymodule + * \brief Page of MyObject events + */ + +// Load Dolibarr environment +$res=0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; +while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; +// Try main.inc.php using relative path +if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; +if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; +if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; +if (! $res) die("Include of main fails"); + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +dol_include_once('/mymodule/class/myobject.class.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); + + +// Load translation files required by the page +$langs->loadLangs(array("mymodule@mymodule","other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +if (GETPOST('actioncode', 'array')) +{ + $actioncode=GETPOST('actioncode', 'array', 3); + if (! count($actioncode)) $actioncode='0'; +} +else +{ + $actioncode=GETPOST("actioncode", "alpha", 3)?GETPOST("actioncode", "alpha", 3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); +} +$search_agenda_label=GETPOST('search_agenda_label'); + +// Security check - Protection if external user +//if ($user->societe_id > 0) access_forbidden(); +//if ($user->societe_id > 0) $socid = $user->societe_id; +//$result = restrictedArea($user, 'mymodule', $id); + +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield='a.datep,a.id'; +if (! $sortorder) $sortorder='DESC'; + +// Initialize technical objects +$object=new MyObject($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('myobjectagenda','globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('myobject'); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity] . "/" . $object->id; + + + +/* + * Actions + */ + +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + // Cancel + if (GETPOST('cancel', 'alpha') && ! empty($backtopage)) + { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers + { + $actioncode=''; + $search_agenda_label=''; + } +} + + + +/* + * View + */ + +$contactstatic = new Contact($db); + +$form = new Form($db); + +if ($object->id > 0) +{ + $title=$langs->trans("Agenda"); + //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + $help_url = ''; + llxHeader('', $title, $help_url); + + if (! empty($conf->notification->enabled)) $langs->load("mails"); + $head = myobjectPrepareHead($object); + + + dol_fiche_head($head, 'agenda', $langs->trans("MyObject"), -1, 'myobject@mymodule'); + + // Object card + // ------------------------------------------------------------ + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref='
'; + /* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->mymodule->creer) + { + 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); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + }*/ + $morehtmlref.='
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
'; + print '
'; + + $object->info($object->id); + print dol_print_object_info($object, 1); + + print '
'; + + dol_fiche_end(); + + + + // Actions buttons + + $objthirdparty=$object; + $objcon=new stdClass(); + + $out=''; + $permok=$user->rights->agenda->myactions->create; + if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) + { + //$out.='trans("AddAnAction"),'filenew'); + //$out.=""; + } + + + print '
'; + + if (! empty($conf->agenda->enabled)) + { + if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) + { + print ''.$langs->trans("AddAction").''; + } + else + { + print ''.$langs->trans("AddAction").''; + } + } + + print '
'; + + if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) + { + $param='&socid='.$socid; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + + + print load_fiche_titre($langs->trans("ActionsOnMyObject"), '', ''); + + // List of all actions + $filters=array(); + $filters['search_agenda_label']=$search_agenda_label; + + // TODO Replace this with same code than into list.php + //show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php new file mode 100644 index 00000000000..283e0a29749 --- /dev/null +++ b/htdocs/zapier/hook_card.php @@ -0,0 +1,471 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/modulebuilder/template/myobject_card.php + * \ingroup mymodule + * \brief Page to create/edit/view myobject + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP','none'); // Disable all Content Security Policies + + +// Load Dolibarr environment +$res=0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; +while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; +// Try main.inc.php using relative path +if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; +if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; +if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; +if (! $res) die("Include of main fails"); + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +dol_include_once('/mymodule/class/myobject.class.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("mymodule@mymodule","other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectcard'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); + +// Initialize technical objects +$object=new MyObject($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('myobjectcard','globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label($object->table_element); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Initialize array of search criterias +$search_all=trim(GETPOST("search_all", 'alpha')); +$search=array(); +foreach($object->fields as $key => $val) +{ + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); +} + +if (empty($action) && empty($id) && empty($ref)) $action='view'; + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +// Security check - Protection if external user +//if ($user->societe_id > 0) access_forbidden(); +//if ($user->societe_id > 0) $socid = $user->societe_id; +//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0); +//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); + + +/* + * Actions + * + * Put here all code to do according to value of "action" parameter + */ + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + $error=0; + + $permissiontoadd = $user->rights->mymodule->write; + $permissiontodelete = $user->rights->mymodule->delete || ($permissiontoadd && $object->status == 0); + $backurlforlist = dol_buildpath('/mymodule/myobject_list.php', 1); + if (empty($backtopage)) { + if (empty($id)) $backtopage = $backurlforlist; + else $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).($id > 0 ? $id : '__ID__'); + } + $triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record + + // Actions cancel, add, update, delete or clone + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + + // Actions when linking object each other + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; + + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + + // Actions to send emails + $trigger_name='MYOBJECT_SENTBYMAIL'; + $autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; + $trackid='myobject'.$object->id; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; +} + + + + +/* + * View + * + * Put here all code to build page + */ + +$form=new Form($db); +$formfile=new FormFile($db); + +llxHeader('', 'MyObject', ''); + +// Example : Adding jquery code +print ''; + + +// Part to create +if ($action == 'create') +{ + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("MyObject"))); + + print '
'; + print ''; + print ''; + print ''; + + dol_fiche_head(array(), ''); + + print ''."\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; + + print '
'."\n"; + + dol_fiche_end(); + + print '
'; + print ''; + print '  '; + print ''; // Cancel for create does not post form if we don't know the backtopage + print '
'; + + print '
'; +} + +// Part to edit record +if (($id || $ref) && $action == 'edit') +{ + print load_fiche_titre($langs->trans("MyObject")); + + print '
'; + print ''; + print ''; + print ''; + print ''; + + dol_fiche_head(); + + print ''."\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; + + print '
'; + + dol_fiche_end(); + + print '
'; + print '   '; + print '
'; + + print '
'; +} + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) +{ + $res = $object->fetch_optionals(); + + $head = myobjectPrepareHead($object); + dol_fiche_head($head, 'card', $langs->trans("MyObject"), -1, 'myobject@mymodule'); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') + { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1); + } + + // Clone confirmation + if ($action == 'clone') { + // Create an array for form + $formquestion = array(); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } + + // Confirmation of action xxxx + if ($action == 'xxx') + { + $formquestion=array(); + /* + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); + */ + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); + } + + // Call Hook formConfirm + $parameters = array('lineid' => $lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; + elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref='
'; + /* + // Ref bis + $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->mymodule->write) + { + if ($action != 'classify') + $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); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=$proj->getNomUrl(); + } else { + $morehtmlref.=''; + } + } + } + */ + $morehtmlref.='
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + print '
'; + print ''."\n"; + + // Common attributes + //$keyforbreak='fieldkeytoswithonsecondcolumn'; + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
'; + print '
'; + print '
'; + + print '

'; + + dol_fiche_end(); + + + // Buttons for actions + if ($action != 'presend' && $action != 'editline') { + print '
'."\n"; + $parameters=array(); + $reshook=$hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + if (empty($reshook)) + { + // Send + print '' . $langs->trans('SendMail') . ''."\n"; + + // Modify + if ($user->rights->mymodule->write) + { + print ''.$langs->trans("Modify").''."\n"; + } + else + { + print ''.$langs->trans('Modify').''."\n"; + } + + // Clone + if ($user->rights->mymodule->write) + { + print ''; + } + + /* + if ($user->rights->mymodule->write) + { + if ($object->status == 1) + { + print ''.$langs->trans("Disable").''."\n"; + } + else + { + print ''.$langs->trans("Enable").''."\n"; + } + } + */ + + if ($user->rights->mymodule->delete) + { + print ''.$langs->trans('Delete').''."\n"; + } + else + { + print ''.$langs->trans('Delete').''."\n"; + } + } + print '
'."\n"; + } + + + // Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + if ($action != 'presend') + { + print '
'; + print ''; // ancre + + // Documents + /*$objref = dol_sanitizeFileName($object->ref); + $relativepath = $comref . '/' . $comref . '.pdf'; + $filedir = $conf->mymodule->dir_output . '/' . $objref; + $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; + $genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('mymodule', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + */ + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('myobject')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + + print '
'; + + $MAXEVENT = 10; + + $morehtmlright = ''; + $morehtmlright.= $langs->trans("SeeAll"); + $morehtmlright.= ''; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, 'myobject', $socid, 1, '', $MAXEVENT, '', $morehtmlright); + + print '
'; + } + + //Select mail models is same action as presend + /* + if (GETPOST('modelselected')) $action = 'presend'; + + // Presend form + $modelmail='inventory'; + $defaulttopic='InformationMessage'; + $diroutput = $conf->product->dir_output.'/inventory'; + $trackid = 'stockinv'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + */ +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/zapier/hook_document.php b/htdocs/zapier/hook_document.php new file mode 100644 index 00000000000..d9542daf64f --- /dev/null +++ b/htdocs/zapier/hook_document.php @@ -0,0 +1,166 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/modulebuilder/template/myobject_document.php + * \ingroup mymodule + * \brief Tab for documents linked to MyObject + */ + +// Load Dolibarr environment +$res=0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; +while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; +// Try main.inc.php using relative path +if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; +if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; +if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; +if (! $res) die("Include of main fails"); + +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +dol_include_once('/mymodule/class/myobject.class.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("mymodule@mymodule","companies","other","mails")); + + +$action=GETPOST('action', 'aZ09'); +$confirm=GETPOST('confirm'); +$id=(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$ref = GETPOST('ref', 'alpha'); + +// Security check - Protection if external user +//if ($user->societe_id > 0) access_forbidden(); +//if ($user->societe_id > 0) $socid = $user->societe_id; +//$result = restrictedArea($user, 'mymodule', $id); + +// Get parameters +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="name"; +//if (! $sortfield) $sortfield="position_name"; + +// Initialize technical objects +$object=new MyObject($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('myobjectdocument','globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('myobject'); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/myobject/" . dol_sanitizeFileName($object->id); +if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/myobject/" . dol_sanitizeFileName($object->ref); + + +/* + * Actions + */ + +include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; + + +/* + * View + */ + +$form = new Form($db); + +$title=$langs->trans("MyObject").' - '.$langs->trans("Files"); +$help_url=''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +if ($object->id) +{ + /* + * Show tabs + */ + $head = myobjectPrepareHead($object); + + dol_fiche_head($head, 'document', $langs->trans("MyObject"), -1, 'myobject@mymodule'); + + + // Build file list + $filearray=dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC), 1); + $totalsize=0; + foreach($filearray as $key => $file) + { + $totalsize+=$file['size']; + } + + // Object card + // ------------------------------------------------------------ + $linkback = '' . $langs->trans("BackToList") . ''; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
'; + + print '
'; + print ''; + + // Number of files + print ''; + + // Total size + print ''; + + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + + print '
'; + + dol_fiche_end(); + + $modulepart = 'mymodule'; + //$permission = $user->rights->mymodule->create; + $permission = 1; + //$permtoedit = $user->rights->mymodule->create; + $permtoedit = 1; + $param = '&id=' . $object->id; + + //$relativepathwithnofile='myobject/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile='myobject/' . dol_sanitizeFileName($object->ref).'/'; + + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; +} +else +{ + accessforbidden('', 0, 0); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/zapier/hook_list.php b/htdocs/zapier/hook_list.php new file mode 100644 index 00000000000..015d1d8b1cd --- /dev/null +++ b/htdocs/zapier/hook_list.php @@ -0,0 +1,642 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/modulebuilder/template/hook_list.php + * \ingroup mymodule + * \brief List page for hook + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data +//if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("XFRAMEOPTIONS_ALLOWALL")) define('XFRAMEOPTIONS_ALLOWALL',1); // Do not add the HTTP header 'X-Frame-Options: SAMEORIGIN' but 'X-Frame-Options: ALLOWALL' + +// Load Dolibarr environment +$res=0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; +while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; +// Try main.inc.php using relative path +if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; +if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; +if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; +if (! $res) die("Include of main fails"); + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once __DIR__.'/class/hook.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("mymodule@mymodule","other")); + +// The action 'add', 'create', 'edit', 'update', 'view', ... +$action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; +// The bulk action (combo box choice into lists) +$massaction = GETPOST('massaction', 'alpha'); +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'hooklist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + +$id = GETPOST('id', 'int'); + +// Load variable for pagination +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { + // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action + $page = 0; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +//if (! $sortfield) $sortfield="p.date_fin"; +//if (! $sortorder) $sortorder="DESC"; + +// Initialize technical objects +$object = new Hook($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; +// Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('hooklist')); +// Fetch optionals attributes and labels +// Load $extrafields->attributes['hook'] +$extralabels = $extrafields->fetch_name_optionals_label('hook'); +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Default sort order (if not yet defined by previous GETPOST) +if (! $sortfield) { + // Set here default search field. By default 1st field in definition. + $sortfield="t.".key($object->fields); +} +if (! $sortorder) { + $sortorder="ASC"; +} + +// Security check +$socid=0; +if ($user->societe_id > 0) { + // Protection if external user + //$socid = $user->societe_id; + accessforbidden(); +} +//$result = restrictedArea($user, 'mymodule', $id, ''); + +// Initialize array of search criterias +$search_all=trim(GETPOST("search_all", 'alpha')); +$search=array(); +foreach($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach($object->fields as $key => $val) { + if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label']; +} + +// Definition of fields for list +$arrayfields=array(); +foreach($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled'], 'position'=>$val['position']); +} +// Extra fields +if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { + foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (! empty($extrafields->attributes[$object->table_element]['list'][$key])) + $arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key])!=3 && $extrafields->attributes[$object->table_element]['perms'][$key])); + } +} +$object->fields = dol_sort_array($object->fields, 'position'); +$arrayfields = dol_sort_array($arrayfields, 'position'); + + + +/* + * Actions + */ + +if (GETPOST('cancel', 'alpha')) { + $action='list'; + $massaction=''; +} +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { + $massaction=''; +} + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) { + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) { + // All tests are required to be compatible with all browsers + foreach($object->fields as $key => $val) { + $search[$key]=''; + } + $toselect=''; + $search_array_options=array(); + } + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { + $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass='Hook'; + $objectlabel='Hook'; + $permtoread = $user->rights->mymodule->read; + $permtodelete = $user->rights->mymodule->delete; + $uploaddir = $conf->mymodule->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + + + +/* + * View + */ + +$form=new Form($db); + +$now=dol_now(); + +//$help_url="EN:Module_Hook|FR:Module_Hook_FR|ES:Módulo_Hook"; +$help_url=''; +$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Hooks")); + + +// Build and execute select +// -------------------------------------------------------------------- +$sql = 'SELECT '; +foreach($object->fields as $key => $val) { + $sql.='t.'.$key.', '; +} +// Add fields from extrafields +if (! empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + } +} +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; +$sql=preg_replace('/, $/', '', $sql); +$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; +if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; +if ($object->ismultientitymanaged == 1) { + $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; +} else { + $sql.=" WHERE 1 = 1"; +} +foreach($search as $key => $val) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search=(($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))?1:0); + if ($search[$key] != '') { + $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search)); + } +} +if ($search_all) { + $sql.= natural_search(array_keys($fieldstosearchall), $search_all); +} +// Add where from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; + +/* If a group by is required +$sql.= " GROUP BY " +foreach($object->fields as $key => $val) +{ + $sql.='t.'.$key.', '; +} +// Add fields from extrafields +if (! empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; +$sql=preg_replace('/, $/','', $sql); +*/ + +$sql.=$db->order($sortfield, $sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) { + // if total of record found is smaller than page * limit, goto and load page 0 + $page = 0; + $offset = 0; + } +} +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { + $num = $nbtotalofrecords; +} else { + $sql.= $db->plimit($limit+1, $offset); + + $resql=$db->query($sql); + if (! $resql) { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); +} + +// Direct jump if only one record found +if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".dol_buildpath('/zapierfordolibarr/hook_card.php', 1).'?id='.$id); + exit; +} + + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url); + +// Example : Adding jquery code +print ''; + +$arrayofselected=is_array($toselect)?$toselect:array(); + +$param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); +foreach($search as $key => $val) { + if (is_array($search[$key]) && count($search[$key])) { + foreach($search[$key] as $skey) { + $param.='&search_'.$key.'[]='.urlencode($skey); + } + } else { + $param.= '&search_'.$key.'='.urlencode($search[$key]); + } +} +if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; + +// List of mass actions available +$arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), +); +if ($user->rights->mymodule->delete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); +$massactionbutton=$form->selectMassAction('', $arrayofmassactions); + +print '
'; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$newcardbutton=''; +//if ($user->rights->mymodule->creer) +//{ + $newcardbutton=''.$langs->trans('New').''; + $newcardbutton.= ''; + $newcardbutton.= ''; +//} +//else +//{ +// $newcardbutton=''.$langs->trans('New').'; +// $newcardbutton.= ''; +// $newcardbutton.= ''; +//} + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit); + +// Add code for pre mass action (confirmation or email presend form) +$topicmail="SendHookRef"; +$modelmail="hook"; +$objecttmp=new Hook($db); +$trackid='xxxx'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +if ($sall) { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print '
'.$langs->trans("FilterOnInto", $sall) . join(', ', $fieldstosearchall).'
'; +} + +$moreforfilter = ''; +/*$moreforfilter.='
'; +$moreforfilter.= $langs->trans('MyFilter') . ': '; +$moreforfilter.= '
';*/ + +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; +else $moreforfilter = $hookmanager->resPrint; + +if (! empty($moreforfilter)) { + print '
'; + print $moreforfilter; + print '
'; +} + +$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; +$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; + + +// Fields title search +// -------------------------------------------------------------------- +print ''; +foreach($object->fields as $key => $val) { + $cssforfield=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) { + $cssforfield.=($cssforfield?' ':'').'center'; + } + if (in_array($val['type'], array('timestamp'))) { + $cssforfield.=($cssforfield?' ':'').'nowrap'; + } + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) { + $cssforfield.=($cssforfield?' ':'').'right'; + } + if ($key == 'status') { + $cssforfield.=($cssforfield?' ':'').'center'; + } + if (! empty($arrayfields['t.'.$key]['checked'])) { + print ''; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters=array('arrayfields'=>$arrayfields); +$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print ''; +print ''."\n"; + + +// Fields title label +// -------------------------------------------------------------------- +print ''; +foreach($object->fields as $key => $val) { + $cssforfield=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; + if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; + if ($key == 'status') { + $cssforfield.=($cssforfield?' ':'').'center'; + } + if (! empty($arrayfields['t.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield?'class="'.$cssforfield.'"':''), $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n"; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters = array( + 'arrayfields' => $arrayfields, + 'param' => $param, + 'sortfield' => $sortfield, + 'sortorder' => $sortorder, +); +$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +print ''."\n"; + + +// Detect if we need a fetch on each output line +$needToFetchEachLine=0; +if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + if (preg_match('/\$object/', $val)) { + // There is at least one compute field that use $object + $needToFetchEachLine++; + } + } +} + + +// Loop on record +// -------------------------------------------------------------------- +$i=0; +$totalarray=array(); +while ($i < min($num, $limit)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + // Store properties in $object + $object->id = $obj->rowid; + foreach($object->fields as $key => $val) { + if (isset($obj->$key)) $object->$key = $obj->$key; + } + + // Show here line of result + print ''; + foreach($object->fields as $key => $val) { + $cssforfield=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) { + $cssforfield.=($cssforfield?' ':'').'center'; + } elseif ($key == 'status') { + $cssforfield.=($cssforfield?' ':'').'center'; + } + + if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; + + if (! empty($arrayfields['t.'.$key]['checked'])) { + print ''; + if ($key == 'status') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); + else print $object->showOutputField($val, $key, $obj->$key, ''); + print ''; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; + $totalarray['val']['t.'.$key] += $obj->$key; + } + } + } + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print ''; + if (! $i) $totalarray['nbfield']++; + + print ''; + + $i++; +} + +// Show total line +if (isset($totalarray['pos'])) { + print ''; + $i=0; + while ($i < $totalarray['nbfield']) { + $i++; + if (! empty($totalarray['pos'][$i])) { + print ''; + } else { + if ($i == 1) { + if ($num < $limit) { + print ''; + } else { + print ''; + } + } else { + print ''; + } + } + } + print ''; +} + +// If no record found +if ($num == 0) { + $colspan=1; + foreach($arrayfields as $key => $val) { + if (! empty($val['checked'])) { + $colspan++; + } + } + print ''; +} + + +$db->free($resql); + +$parameters = array( + 'arrayfields' => $arrayfields, + 'sql' => $sql, +); +$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
'; +$searchpicto=$form->showFilterButtons(); +print $searchpicto; +print '
'; + if ($massactionbutton || $massaction) { + // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print '
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'.$langs->trans("NoRecordFound").'
'."\n"; +print '
'."\n"; + +print '
'."\n"; + +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + $hidegeneratedfilelistifempty=1; + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty=0; + } + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource.=str_replace('&', '&', $param); + + $filedir=$diroutputmassaction; + $genallowed=$user->rights->mymodule->read; + $delallowed=$user->rights->mymodule->create; + + print $formfile->showdocuments('massfilesarea_mymodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/zapier/hook_note.php b/htdocs/zapier/hook_note.php new file mode 100644 index 00000000000..0cbf4c40d8b --- /dev/null +++ b/htdocs/zapier/hook_note.php @@ -0,0 +1,164 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/modulebuilder/template/myobject_note.php + * \ingroup mymodule + * \brief Car with notes on MyObject + */ + +// Load Dolibarr environment +$res=0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; +while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; +// Try main.inc.php using relative path +if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; +if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; +if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; +if (! $res) die("Include of main fails"); + +dol_include_once('/mymodule/class/myobject.class.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("mymodule@mymodule","companies")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +// Initialize technical objects +$object=new MyObject($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('myobjectnote','globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('myobject'); + +// Security check - Protection if external user +//if ($user->societe_id > 0) access_forbidden(); +//if ($user->societe_id > 0) $socid = $user->societe_id; +//$result = restrictedArea($user, 'mymodule', $id); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity] . "/" . $object->id; + +$permissionnote=1; +//$permissionnote=$user->rights->mymodule->creer; // Used by the include of actions_setnotes.inc.php + + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + + +/* + * View + */ + +$form = new Form($db); + +//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; +$help_url=''; +llxHeader('', $langs->trans('MyObject'), $help_url); + +if ($id > 0 || ! empty($ref)) +{ + $object->fetch_thirdparty(); + + $head = myobjectPrepareHead($object); + + dol_fiche_head($head, 'note', $langs->trans("MyObject"), -1, 'myobject@mymodule'); + + // Object card + // ------------------------------------------------------------ + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref='
'; + /* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->mymodule->creer) + { + 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); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + }*/ + $morehtmlref.='
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + + + $cssclass="titlefield"; + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + + print '
'; + + dol_fiche_end(); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/zapier/img/object_hook.png b/htdocs/zapier/img/object_hook.png new file mode 100644 index 0000000000000000000000000000000000000000..5a307bfc62f85df909a3cf024f27ee87d44be275 GIT binary patch literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xamSQK*5Dp-y;YjHK@;M7UB8!3Q zuY)k7lg8`{prB-lYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt)eIT^vI+ zChono-m4{0gyqBiz=Ju)w^;&N<{#X1a0!1>bC%GsW3bBL=<%|p84;9-@5SwA|2OIEL% zb=QtBT0T9C&(LA{syqXqqW_DHn`b;(x5}@uA-g2{Ncy)Mhpp~Sy0eY()*3IP6|4C4 z(mDEHWvtPCEP7WZe7{4e?P9&>AE%^j|Mz!&9rL?{G_w^d>;^y&GkCiCxvX~}U&Kt)eIT^vI+ zChono-m4{0gyqBiz=Ju)w^;&N<{#X1a0!1>bC%GsW3bBL=<%|p84;9-@5SwA|2OIEL% zb=QtBT0T9C&(LA{syqXqqW_DHn`b;(x5}@uA-g2{Ncy)Mhpp~Sy0eY()*3IP6|4C4 z(mDEHWvtPCEP7WZe7{4e?P9&>AE%^j|Mz!&9rL?{G_w^d>;^y&GkCiCxvX&bpol<(u!rW?;H+EQ%enXNbFO(BxM6em zT6?Xvzwg`ooU^Y){|U(ZFQBI!m!$&}L7j!5{;fYTRT7^Ei2`otSo}~$jn`>$_0GV8{|=a0ceV}S zT##S2)dC>kW)OEac4ad=0PF{D)D5n&1&hE|5*Fn>+!87O7%&6uq>(Lac(63vU3r8dAUkz5(vJ*$kYi!M+3>2Chh&smne_ z0k^l4oC%S=;mTvomp7S=zUfMq-Pa*-4U* z(fYvM9@LwZ^Z;0LC%nYcD^%FWV(tM!t@kx*iR5*SB+L^EYlZ(WSOrixfZrRuvN}?F RO?LnQ002ovPDHLkV1iP-B{u*7 literal 0 HcmV?d00001 diff --git a/htdocs/zapier/lib/zapier.lib.php b/htdocs/zapier/lib/zapier.lib.php new file mode 100644 index 00000000000..8fc4810599d --- /dev/null +++ b/htdocs/zapier/lib/zapier.lib.php @@ -0,0 +1,58 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file zapier/lib/zapier.lib.php + * \ingroup zapier + * \brief Library files with common functions for ZapierForDolibarr + */ + +/** + * Prepare admin pages header + * + * @return array + */ +function zapierAdminPrepareHead() +{ + global $langs, $conf; + + $langs->load("zapier@zapier"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/zapier/admin/setup.php", 1); + $head[$h][1] = $langs->trans("Settings"); + $head[$h][2] = 'settings'; + $h++; + $head[$h][0] = dol_buildpath("/zapier/admin/about.php", 1); + $head[$h][1] = $langs->trans("About"); + $head[$h][2] = 'about'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@zapier:/zapier/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@zapier:/zapier/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'zapier'); + + return $head; +} diff --git a/htdocs/zapier/lib/zapier_hook.lib.php b/htdocs/zapier/lib/zapier_hook.lib.php new file mode 100644 index 00000000000..e1af0259062 --- /dev/null +++ b/htdocs/zapier/lib/zapier_hook.lib.php @@ -0,0 +1,83 @@ +. + */ + +/** + * \file htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php + * \ingroup mymodule + * \brief Library files with common functions for MyObject + */ + +/** + * Prepare array of tabs for MyObject + * + * @param MyObject $object MyObject + * @return array Array of tabs + */ +function myobjectPrepareHead($object) +{ + global $db, $langs, $conf; + + $langs->load("mymodule@mymodule"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/mymodule/myobject_card.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Card"); + $head[$h][2] = 'card'; + $h++; + + if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) + { + $nbNote = 0; + if (!empty($object->note_private)) $nbNote++; + if (!empty($object->note_public)) $nbNote++; + $head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + $head[$h][2] = 'note'; + $h++; + } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->mymodule->dir_output . "/myobject/" . dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks=Link::count($db, $object->element, $object->id); + $head[$h][0] = dol_buildpath("/mymodule/myobject_document.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + $head[$h][2] = 'document'; + $h++; + + $head[$h][0] = dol_buildpath("/mymodule/myobject_agenda.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + $head[$h][2] = 'agenda'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'myobject@mymodule'); + + return $head; +} diff --git a/htdocs/zapier/sql/llx_zapier_hook.key.sql b/htdocs/zapier/sql/llx_zapier_hook.key.sql new file mode 100644 index 00000000000..d707e6bba1a --- /dev/null +++ b/htdocs/zapier/sql/llx_zapier_hook.key.sql @@ -0,0 +1,22 @@ +-- Copyright (C) ---Put here your own copyright and developer email--- +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see http://www.gnu.org/licenses/. + + +--ALTER TABLE llx_zapierfordolibarr_hook ADD INDEX idx_fieldobject (fieldobject); + +--ALTER TABLE llx_zapierfordolibarr_hook ADD UNIQUE INDEX uk_zapierfordolibarr_hook_fieldxy(fieldx, fieldy); + +--ALTER TABLE llx_zapierfordolibarr_hook ADD CONSTRAINT llx_zapierfordolibarr_hook_fk_field FOREIGN KEY (fk_field) REFERENCES llx_zapierfordolibarr_myotherobject(rowid); + diff --git a/htdocs/zapier/sql/llx_zapier_hook.sql b/htdocs/zapier/sql/llx_zapier_hook.sql new file mode 100644 index 00000000000..829ec2bfdc4 --- /dev/null +++ b/htdocs/zapier/sql/llx_zapier_hook.sql @@ -0,0 +1,29 @@ +-- Copyright (C) ---Put here your own copyright and developer email--- +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see http://www.gnu.org/licenses/. + + +CREATE TABLE llx_zapierfordolibarr_hook( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, + url varchar(255), + event varchar(255), + module varchar(128), + action varchar(128), + status integer, + date_creation DATETIME NOT NULL, + fk_user integer NOT NULL, + tms TIMESTAMP NOT NULL, + import_key varchar(14) +) ENGINE=innodb; \ No newline at end of file diff --git a/htdocs/zapier/sql/llx_zapier_hook_extrafields.sql b/htdocs/zapier/sql/llx_zapier_hook_extrafields.sql new file mode 100644 index 00000000000..c840007412b --- /dev/null +++ b/htdocs/zapier/sql/llx_zapier_hook_extrafields.sql @@ -0,0 +1,23 @@ +-- Copyright (C) ---Put here your own copyright and developer email--- +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see http://www.gnu.org/licenses/. + +create table llx_zapierfordolibarr_hook_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + diff --git a/htdocs/zapier/zapierindex.php b/htdocs/zapier/zapierindex.php new file mode 100644 index 00000000000..6e9e0491946 --- /dev/null +++ b/htdocs/zapier/zapierindex.php @@ -0,0 +1,238 @@ + + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/zapierfordolibarr/template/zapierfordolibarrindex.php + * \ingroup zapierfordolibarr + * \brief Home page of zapierfordolibarr top menu + */ + +// Load Dolibarr environment +$res=0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; +while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; +// Try main.inc.php using relative path +if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; +if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; +if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; +if (! $res) die("Include of main fails"); + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("zapierfordolibarr@zapierfordolibarr")); + +$action=GETPOST('action', 'alpha'); + + +// Securite acces client +if (! $user->rights->zapierfordolibarr->read) accessforbidden(); +$socid=GETPOST('socid', 'int'); +if (isset($user->societe_id) && $user->societe_id > 0) +{ + $action = ''; + $socid = $user->societe_id; +} + +$max=5; +$now=dol_now(); + + +/* + * Actions + */ + +// None + + +/* + * View + */ + +$form = new Form($db); +$formfile = new FormFile($db); + +llxHeader("", $langs->trans("ZapierForDolibarrArea")); + +print load_fiche_titre($langs->trans("ZapierForDolibarrArea"), '', 'zapierfordolibarr.png@zapierfordolibarr'); + +print '
'; + + +/* BEGIN MODULEBUILDER DRAFT MYOBJECT +// Draft MyObject +if (! empty($conf->zapierfordolibarr->enabled) && $user->rights->zapierfordolibarr->read) +{ + $langs->load("orders"); + + $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; + $sql.= ", s.code_client"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; + $sql.= ", ".MAIN_DB_PREFIX."societe as s"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE c.fk_soc = s.rowid"; + $sql.= " AND c.fk_statut = 0"; + $sql.= " AND c.entity IN (".getEntity('commande').")"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql.= " AND c.fk_soc = ".$socid; + + $resql = $db->query($sql); + if ($resql) + { + $total = 0; + $num = $db->num_rows($resql); + + print ''; + print ''; + print ''; + + $var = true; + if ($num > 0) + { + $i = 0; + while ($i < $num) + { + + $obj = $db->fetch_object($resql); + print ''; + print ''; + print ''; + $i++; + $total += $obj->total_ttc; + } + if ($total>0) + { + + print '"; + } + } + else + { + + print ''; + } + print "
'.$langs->trans("DraftOrders").($num?' '.$num.'':'').'
'; + $orderstatic->id=$obj->rowid; + $orderstatic->ref=$obj->ref; + $orderstatic->ref_client=$obj->ref_client; + $orderstatic->total_ht = $obj->total_ht; + $orderstatic->total_tva = $obj->total_tva; + $orderstatic->total_ttc = $obj->total_ttc; + print $orderstatic->getNomUrl(1); + print ''; + $companystatic->id=$obj->socid; + $companystatic->name=$obj->name; + $companystatic->client=$obj->client; + $companystatic->code_client = $obj->code_client; + $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->canvas=$obj->canvas; + print $companystatic->getNomUrl(1,'customer',16); + print ''.price($obj->total_ttc).'
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("NoOrder").'

"; + + $db->free($resql); + } + else + { + dol_print_error($db); + } +} +END MODULEBUILDER DRAFT MYOBJECT */ + + +print '
'; + + +$NBMAX=3; +$max=3; + +/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT +// Last modified myobject +if (! empty($conf->zapierfordolibarr->enabled) && $user->rights->zapierfordolibarr->read) +{ + $sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas"; + $sql.= ", s.code_client"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE s.client IN (1, 2, 3)"; + $sql.= " AND s.entity IN (".getEntity($companystatic->element).")"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql.= " AND s.rowid = $socid"; + $sql .= " ORDER BY s.tms DESC"; + $sql .= $db->plimit($max, 0); + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + + print ''; + print ''; + print ''; + print ''; + print ''; + if ($num) + { + while ($i < $num) + { + $objp = $db->fetch_object($resql); + $companystatic->id=$objp->rowid; + $companystatic->name=$objp->name; + $companystatic->client=$objp->client; + $companystatic->code_client = $objp->code_client; + $companystatic->code_fournisseur = $objp->code_fournisseur; + $companystatic->canvas=$objp->canvas; + print ''; + print ''; + print '"; + print '"; + print ''; + $i++; + + + } + + $db->free($resql); + } + else + { + print ''; + } + print "
'; + if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max); + else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max); + else print $langs->trans("BoxTitleLastModifiedCustomers",$max); + print ''.$langs->trans("DateModificationShort").'
'.$companystatic->getNomUrl(1,'customer',48).''; + print $companystatic->getLibCustProspStatut(); + print "'.dol_print_date($db->jdate($objp->tms),'day')."
'.$langs->trans("None").'

"; + } +} +*/ + +print '
'; + +// End of page +llxFooter(); +$db->close(); From 872800f604225203f018ff89c8cc89a7486ffab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 19 May 2019 21:38:29 +0200 Subject: [PATCH 023/982] zapier for dolibarr --- .tx/config | 6 ++++++ htdocs/zapier/class/hook.class.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.tx/config b/.tx/config index 0044fb91f49..5c52849c29c 100644 --- a/.tx/config +++ b/.tx/config @@ -410,3 +410,9 @@ source_file = htdocs/langs/en_US/workflow.lang source_lang = en_US type = MOZILLAPROPERTIES +[dolibarr.zapier] +file_filter = htdocs/langs//zapier.lang +source_file = htdocs/langs/en_US/zapier.lang +source_lang = en_US +type = MOZILLAPROPERTIES + diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 4a3e670056e..666e3e6df57 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -111,7 +111,7 @@ class Hook extends CommonObject 'visible' => -2, 'notnull' => 1, 'position' => 510, - 'foreignkey' => MAIN_DB_PREFIX.'user.rowid', + 'foreignkey' => (MAIN_DB_PREFIX.'user.rowid'), ), 'url' => array( 'type' => 'varchar(255)', From 08b1f123b0a24a26d7adbf3a212cb1d004378e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 19 May 2019 21:49:34 +0200 Subject: [PATCH 024/982] zapier for dolibarr --- dev/examples/zapier/package.json | 8 ++++---- htdocs/zapier/class/hook.class.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json index 30ea4939915..8fbd203f962 100644 --- a/dev/examples/zapier/package.json +++ b/dev/examples/zapier/package.json @@ -1,10 +1,10 @@ { "name": "Dolibarr", - "version": "1.0.2", + "version": "1.0.0", "description": "An app for connecting Dolibarr to the Zapier platform.", - "repository": "frederic34/ZapierForDolibarr", - "homepage": "https://netlogic-dev.fr/", - "author": "Frédéric France ", + "repository": "Dolibarr/dolibarr", + "homepage": "https://www.dolibarr.fr/", + "author": "Frédéric France ", "license": "BSD-3-Clause", "main": "index.js", "scripts": { diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 666e3e6df57..81b76b1c81f 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -111,7 +111,7 @@ class Hook extends CommonObject 'visible' => -2, 'notnull' => 1, 'position' => 510, - 'foreignkey' => (MAIN_DB_PREFIX.'user.rowid'), + 'foreignkey' => 'llx_user.rowid', ), 'url' => array( 'type' => 'varchar(255)', From 7a17c43b262bfcf565fea6922b33d574020ebe4e Mon Sep 17 00:00:00 2001 From: atm-josselin Date: Mon, 24 Jun 2019 16:05:24 +0200 Subject: [PATCH 025/982] FIX : filepath of generated documents doesn't handle products with special characters --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 679989a75a0..522804b601c 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -764,7 +764,7 @@ class FormFile // Show file name with link to download $out.= ''; - $out.= ' Date: Mon, 24 Jun 2019 19:23:32 +0200 Subject: [PATCH 026/982] Update fiche-rec.php --- htdocs/compta/facture/fiche-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index fa71bdd7f2e..c9ee6e592ee 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -275,7 +275,7 @@ if (empty($reshook)) { $object->setProject(GETPOST('projectid', 'int')); } - // Set titre + // Set title/label of template invoice elseif ($action == 'setref' && $user->rights->facture->creer) { //var_dump(GETPOST('ref', 'alpha'));exit; From ecc4d4227b106a430f647fcd0b252b61120fc20b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 29 Jun 2019 10:14:46 +0200 Subject: [PATCH 027/982] translations --- .../core/modules/project/doc/pdf_baleine.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index c7005206fcc..b9ecd61c61c 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -139,15 +139,15 @@ class pdf_baleine extends ModelePDFProjects $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; // Display product-service code - // Recupere emmetteur + // Get source company $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define position of columns $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxworkload=$this->marge_gauche+120; @@ -168,7 +168,7 @@ class pdf_baleine extends ModelePDFProjects // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Fonction generant le projet sur le disque + * Function to build pdf project onto disk * * @param Project $object Object project a generer * @param Translate $outputlangs Lang output object From 05e9885ba71e6517bfc3d24f1f10ffbe9c7df839 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 29 Jun 2019 10:18:45 +0200 Subject: [PATCH 028/982] translations --- htdocs/core/modules/project/doc/pdf_beluga.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index dfbe97c3fd5..97414e745eb 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -21,7 +21,7 @@ /** * \file htdocs/core/modules/project/doc/pdf_beluga.modules.php * \ingroup project - * \brief Fichier de la classe permettant de generer les projets au modele beluga + * \brief File of class to generate project document beluga * \author Charlie Benke */ @@ -50,7 +50,7 @@ if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/com /** - * Class to manage generation of project document Baleine + * Class to manage generation of project document beluga */ class pdf_beluga extends ModelePDFProjects @@ -100,9 +100,9 @@ class pdf_beluga extends ModelePDFProjects $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; // Display product-service code // Recupere emmetteur $this->emetteur=$mysoc; From 59424f228ea2a39965198a588de580668df6a157 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 29 Jun 2019 10:21:26 +0200 Subject: [PATCH 029/982] translations --- htdocs/core/modules/project/doc/pdf_beluga.modules.php | 4 ++-- .../core/modules/project/doc/pdf_timespent.modules.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 97414e745eb..30a983f0b2e 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -104,11 +104,11 @@ class pdf_beluga extends ModelePDFProjects $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Display product-service code - // Recupere emmetteur + // Get source company $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define position of columns if ($this->orientation == 'L' || $this->orientation == 'Landscape') { $this->posxref=$this->marge_gauche+1; $this->posxdate=$this->marge_gauche+105; diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 2c69fbd6bab..99c7fe99cd9 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -71,15 +71,15 @@ class pdf_timespent extends ModelePDFProjects $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; // Display product-service code - // Recupere emmetteur + // Get source company $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define position of columns $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxtimespent=$this->marge_gauche+120; From bd43e90c2bcd59b2c6becebdf7e6fa3bf67cad54 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 29 Jun 2019 10:28:29 +0200 Subject: [PATCH 030/982] translations --- .../modules/propale/doc/pdf_azur.modules.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 54fe56421ea..6cef67a3d21 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -27,7 +27,7 @@ /** * \file htdocs/core/modules/propale/doc/pdf_azur.modules.php * \ingroup propale - * \brief Fichier de la classe permettant de generer les propales au modele Azur + * \brief File of Class to generate PDF proposal with Azur template */ require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -148,16 +148,16 @@ class pdf_azur extends ModelePDFPropales $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text - $this->option_draft_watermark = 1; //Support add of a watermark on drafts + $this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->franchise=!$mysoc->tva_assuj; From bebd219e5a522616b3d30793469ab42948dba95d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 29 Jun 2019 10:30:26 +0200 Subject: [PATCH 031/982] translations --- .../modules/propale/doc/pdf_cyan.modules.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 14a2456157a..8d0c9eea3e6 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -27,7 +27,7 @@ /** * \file htdocs/core/modules/propale/doc/pdf_cyan.modules.php * \ingroup propale - * \brief Fichier de la classe permettant de generer les propales au modele Cyan + * \brief File of Class to generate PDF proposal with Cyan template */ require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -148,16 +148,16 @@ class pdf_cyan extends ModelePDFPropales $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text - $this->option_draft_watermark = 1; //Support add of a watermark on drafts + $this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->franchise=!$mysoc->tva_assuj; From c24a95b7ad11322eede188e630ac8b38e1ca631c Mon Sep 17 00:00:00 2001 From: atm-josselin Date: Mon, 1 Jul 2019 09:31:01 +0200 Subject: [PATCH 032/982] Sanitize at creation of the product instead of the creation of the filepath --- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 522804b601c..679989a75a0 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -764,7 +764,7 @@ class FormFile // Show file name with link to download $out.= ''; - $out.= 'ref = dol_string_nospecial(trim($this->ref)); + $this->ref = dol_sanitizeFileName(dol_string_nospecial(trim($this->ref))); $this->label = trim($this->label); $this->price_ttc=price2num($this->price_ttc); $this->price=price2num($this->price); From 9c47cb6f916ed057d17ed9242139b9bd4e9e2336 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 8 Jul 2019 23:16:32 +0200 Subject: [PATCH 033/982] NEW : can choose lines while creating order from origin --- htdocs/commande/card.php | 7 +++++-- htdocs/core/class/commonobject.class.php | 11 +++++++---- htdocs/core/tpl/originproductline.tpl.php | 4 ++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 7362f30e5a8..f9fd3a716f5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -232,6 +232,7 @@ if (empty($reshook)) { $datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); + $selectedLines = GETPOST('toselect'); if ($datecommande == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), null, 'errors'); @@ -338,6 +339,8 @@ if (empty($reshook)) for($i = 0; $i < $num; $i ++) { + if(!in_array($lines[$i]->id, $selectedLines)) continue; // Skip unselected lines + $label = (! empty($lines[$i]->label) ? $lines[$i]->label : ''); $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : ''); $product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0); @@ -1870,8 +1873,6 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print '
'; - print ''; - // Show origin lines if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) { $title = $langs->trans('ProductsAndServices'); @@ -1883,6 +1884,8 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; } + + print ''; } else { // Mode view $now = dol_now(); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0a300476fb5..f3832ff2782 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4145,7 +4145,7 @@ abstract class CommonObject */ public function printOriginLinesList($restrictlist = '') { - global $langs, $hookmanager, $conf; + global $langs, $hookmanager, $conf, $form; print ''; print ''.$langs->trans('Ref').''; @@ -4158,8 +4158,9 @@ abstract class CommonObject { print ''.$langs->trans('Unit').''; } - print ''.$langs->trans('ReductionShort').''; - + print ''.$langs->trans('ReductionShort').''; + print ''.$form->showCheckAddButtons('checkforselect', 1).''; + print ''; $var = true; $i = 0; @@ -4200,7 +4201,7 @@ abstract class CommonObject */ public function printOriginLine($line, $var, $restrictlist = '', $defaulttpldir = '/core/tpl') { - global $langs, $conf; + global $langs, $conf, $selectedLines; //var_dump($line); if (!empty($line->date_start)) @@ -4222,6 +4223,8 @@ abstract class CommonObject if ($line->date_fin_reel) $date_end=$line->date_fin_reel; } + $this->tpl['id'] = $line->id; + $this->tpl['label'] = ''; if (! empty($line->fk_parent_line)) $this->tpl['label'].= img_picto('', 'rightarrow'); diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php index 2f0accd6306..e29ea678282 100644 --- a/htdocs/core/tpl/originproductline.tpl.php +++ b/htdocs/core/tpl/originproductline.tpl.php @@ -40,6 +40,10 @@ if($conf->global->PRODUCT_USE_UNITS) print ''.$langs->trans($this->tpl['unit']).''; print ''.$this->tpl['remise_percent'].''; + +$selected=1; +if (!empty($selectedLines) && !in_array($this->tpl['id'], $selectedLines)) $selected=0; +print ''; print ''."\n"; ?> From 75ae611f9e49fead3aa825249b55734a5088cab4 Mon Sep 17 00:00:00 2001 From: "atm-florian.m" Date: Wed, 10 Jul 2019 17:53:14 +0200 Subject: [PATCH 034/982] FIX: calculation of $products_dispatched After the DB retrieval method was changed from fetch_row to fetch_object, the indices used became wrong. --- htdocs/fourn/commande/dispatch.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 4b15f04faa0..e6fa2937e0b 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -482,7 +482,7 @@ if ($id > 0 || ! empty($ref)) { if ($num) { while ( $i < $num ) { $objd = $db->fetch_object($resql); - $products_dispatched[$objd->rowid] = price2num($objd->qty, 5); + $products_dispatched[$objd->fk_product] = price2num($objd->qty, 5); $i++; } } @@ -540,7 +540,7 @@ if ($id > 0 || ! empty($ref)) { if (! $objp->fk_product > 0) { $nbfreeproduct++; } else { - $remaintodispatch = price2num($objp->qty - (( float ) $products_dispatched[$objp->rowid]), 5); // Calculation of dispatched + $remaintodispatch = price2num($objp->qty - (( float ) $products_dispatched[$objp->fk_product]), 5); // Calculation of dispatched if ($remaintodispatch < 0) $remaintodispatch = 0; From b155fdc014caaeea15848605ae75e82823819c1f Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Fri, 12 Jul 2019 15:04:47 +0200 Subject: [PATCH 035/982] FIX: wrong display (and hidden input) for already dispatched quantity --- htdocs/fourn/commande/dispatch.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index e6fa2937e0b..966be778773 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -556,7 +556,7 @@ if ($id > 0 || ! empty($ref)) { print '' . "\n"; // hidden fields for js function print ''; - print ''; + print ''; print ''; $linktoprod = '' . img_object($langs->trans("ShowProduct"), 'product') . ' ' . $objp->ref . ''; @@ -598,7 +598,7 @@ if ($id > 0 || ! empty($ref)) { print '' . $objp->qty . ''; // Already dispatched - print '' . $products_dispatched[$objp->rowid] . ''; + print '' . (float) $products_dispatched[$objp->fk_product] . ''; if (! empty($conf->productbatch->enabled) && $objp->tobatch == 1) { $type = 'batch'; From 770b4197699d0a9a23ac25b99e2fc60281ba8c7b Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 18 Jul 2019 17:00:46 +0200 Subject: [PATCH 036/982] Revert "FIX: wrong display (and hidden input) for already dispatched quantity" This reverts commit b155fdc014caaeea15848605ae75e82823819c1f. --- htdocs/fourn/commande/dispatch.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 966be778773..e6fa2937e0b 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -556,7 +556,7 @@ if ($id > 0 || ! empty($ref)) { print '' . "\n"; // hidden fields for js function print ''; - print ''; + print ''; print ''; $linktoprod = '' . img_object($langs->trans("ShowProduct"), 'product') . ' ' . $objp->ref . ''; @@ -598,7 +598,7 @@ if ($id > 0 || ! empty($ref)) { print '' . $objp->qty . ''; // Already dispatched - print '' . (float) $products_dispatched[$objp->fk_product] . ''; + print '' . $products_dispatched[$objp->rowid] . ''; if (! empty($conf->productbatch->enabled) && $objp->tobatch == 1) { $type = 'batch'; From e404069d264afb2e5078aa92de029d8dd7c1da95 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 18 Jul 2019 17:00:57 +0200 Subject: [PATCH 037/982] Revert "FIX: calculation of $products_dispatched" This reverts commit 75ae611f9e49fead3aa825249b55734a5088cab4. --- htdocs/fourn/commande/dispatch.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index e6fa2937e0b..4b15f04faa0 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -482,7 +482,7 @@ if ($id > 0 || ! empty($ref)) { if ($num) { while ( $i < $num ) { $objd = $db->fetch_object($resql); - $products_dispatched[$objd->fk_product] = price2num($objd->qty, 5); + $products_dispatched[$objd->rowid] = price2num($objd->qty, 5); $i++; } } @@ -540,7 +540,7 @@ if ($id > 0 || ! empty($ref)) { if (! $objp->fk_product > 0) { $nbfreeproduct++; } else { - $remaintodispatch = price2num($objp->qty - (( float ) $products_dispatched[$objp->fk_product]), 5); // Calculation of dispatched + $remaintodispatch = price2num($objp->qty - (( float ) $products_dispatched[$objp->rowid]), 5); // Calculation of dispatched if ($remaintodispatch < 0) $remaintodispatch = 0; From dbd68027f86329bc6ad061adb9d9b870f39f807f Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 18 Jul 2019 16:57:52 +0200 Subject: [PATCH 038/982] =?UTF-8?q?New=20script=20that=20links=20"orphaned?= =?UTF-8?q?"=20dispatch=20lines=20to=20order=20lines=20(the=20"orphans"=20?= =?UTF-8?q?are=20dispatch=20lines=20that=20were=20created=20in=20old=20ver?= =?UTF-8?q?sions=20of=20Dolibarr=20which=20didn=E2=80=99t=20have=20fk=5Fco?= =?UTF-8?q?mmandefourndet=20in=20llx=5Fcommande=5Ffournisseur=5Fdispatch)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._commande_fournisseur_dispatch_3.6-9.0.php | 165 ++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php diff --git a/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php b/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php new file mode 100644 index 00000000000..fec3c82cb56 --- /dev/null +++ b/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php @@ -0,0 +1,165 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * This script is meant to be run when upgrading from a dolibarr version < 3.8 + * to a newer version. + * + * Version 3.8 introduces a new column in llx_commande_fournisseur_dispatch, which + * matches the dispatch to a specific supplier order line (so that if there are + * several with the same product, the user can specifically tell which products of + * which line were dispatched where). + * + * However when migrating, the new column has a default value of 0, which means that + * old supplier orders whose lines were dispatched using the old dolibarr version + * have unspecific dispatch lines, which are not taken into account by the new version, + * thus making the order look like it was never dispatched at all. + * + * This scripts sets this foreign key to the first matching supplier order line whose + * product (and supplier order of course) are the same as the dispatch’s. + * + * If the dispatched quantity is more than indicated on the order line (this happens if + * there are several order lines for the same product), it creates new dispatch lines + * pointing to the other order lines accordingly, until all the dispatched quantity is + * accounted for. + */ + +// Dolibarr environment +$path_dir = '../../'; +$main_inc_file = 'main.inc.php'; +while ((false == @include($path_dir . $main_inc_file)) && 3*10 > strlen($path_dir)) { + $path_dir = '../' . $path_dir; + if (strlen($path_dir) > 20) { + echo 'Error: unable to include "' . $main_inc_file . '" from any of the parent directories.'; + exit; + } +} + +// Access control +if (!$user->admin) { + accessforbidden(); +} + +echo '

Repair llx_commande_fournisseur_dispatch.fk_commandefourndet

'; +echo '

Repair in progress. This may take a while.

'; + +echo '
';
+//$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch AS dispatch SET dispatch.fk_commandefourndet =
+//           ( SELECT rowid FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet AS line
+//            WHERE line.fk_commande = dispatch.fk_commande LIMIT 1) WHERE dispatch.fk_commandefourndet = 0;';
+
+$sql_dispatch = 'SELECT * FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch WHERE COALESCE(fk_commandefourndet, 0) = 0';
+//$sql_dispatch = 'SELECT * FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch WHERE fk_commandefourndet = 0 OR fk_commandefourndet IS NULL';
+$db->begin();
+$resql_dispatch = $db->query($sql_dispatch);
+$n_processed_rows = 0;
+$errors = array();
+if ($resql_dispatch) {
+    if ($db->num_rows($resql_dispatch) == 0) {
+        echo 'Nothing to do.'; exit;
+    };
+    while ($obj_dispatch = $db->fetch_object($resql_dispatch)) {
+        $sql_line = 'SELECT line.rowid, line.qty FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet AS line'
+            .  ' WHERE line.fk_commande = ' . $obj_dispatch->fk_commande
+            .  ' AND line.fk_product = ' . $obj_dispatch->fk_product;
+        $resql_line = $db->query($sql_line);
+
+        // s’il y a plusieurs lignes avec le même produit sur cette commande fournisseur,
+        // on divise la ligne de dispatch en autant de lignes qu’on en a sur la commande pour le produit
+        // et on met la quantité de la ligne dans la limite du "budget" indiqué par dispatch.qty
+
+        $remaining_qty = $obj_dispatch->qty;
+        $first_iteration = true;
+        if (!$resql_line) {
+            echo 'Unable to find a matching supplier order line for dispatch #' . $obj_dispatch->rowid . "\n";
+            $errors[] = $sql_line;
+            $n_processed_rows++;
+            continue;
+        }
+        if ($db->num_rows($resql_line) == 0) continue;
+        while ($obj_line = $db->fetch_object($resql_line)) {
+            if (!$remaining_qty) break;
+            if (!$obj_line->rowid) {
+                continue;
+            }
+            $qty_for_line = min($remaining_qty, $obj_line->qty);
+            if ($first_iteration) {
+                $sql_attach = 'UPDATE ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch'
+                    . ' SET fk_commandefourndet = ' . $obj_line->rowid . ', qty = ' . $qty_for_line
+                    . ' WHERE rowid = ' . $obj_dispatch->rowid;
+                $first_iteration = false;
+            } else {
+                $sql_attach_values = array(
+                    $obj_dispatch->fk_commande,
+                    $obj_dispatch->fk_product,
+                    $obj_line->rowid,
+                    $qty_for_line,
+                    $obj_dispatch->fk_entrepot,
+                    $obj_dispatch->fk_user,
+                    $obj_dispatch->datec ? '"' . $db->escape($obj_dispatch->datec) . '"' : 'NULL',
+                    $obj_dispatch->comment ? '"' . $db->escape($obj_dispatch->comment) . '"' : 'NULL',
+                    $obj_dispatch->status ?: 'NULL',
+                    $obj_dispatch->tms ? '"' . $db->escape($obj_dispatch->tms) . '"': 'NULL',
+                    $obj_dispatch->batch ?: 'NULL',
+                    $obj_dispatch->eatby ? '"' . $db->escape($obj_dispatch->eatby) . '"': 'NULL',
+                    $obj_dispatch->sellby ? '"' . $db->escape($obj_dispatch->sellby) . '"': 'NULL'
+                );
+                $sql_attach_values = join(', ', $sql_attach_values);
+
+                $sql_attach = 'INSERT INTO ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch'
+                    . ' (fk_commande, fk_product, fk_commandefourndet, qty, fk_entrepot, fk_user, datec, comment, status, tms, batch, eatby, sellby)'
+                    . ' VALUES (' . $sql_attach_values . ')';
+            }
+            $resql_attach = $db->query($sql_attach);
+            if ($resql_attach) {
+                $remaining_qty -= $qty_for_line;
+            } else {
+                $errors[] = $sql_attach;
+            }
+            $first_iteration = false;
+        }
+        $n_processed_rows++;
+
+        // report progress every 256th row
+        if (!($n_processed_rows & 0xff)) {
+            echo 'Processed ' . $n_processed_rows . ' rows with ' . count($errors) . ' errors…' . "\n";
+            flush();
+            ob_flush();
+        }
+
+    }
+} else {
+    echo 'Unable to find any dispatch without an fk_commandefourndet.' . "\n";
+    echo $sql_dispatch . "\n";
+}
+echo 'Fixed ' . $n_processed_rows . ' rows with ' . count($errors) . ' errors…' . "\n";
+echo 'DONE.' . "\n";
+echo '
'; + +if (count($errors)) { + $db->rollback(); + echo 'The transaction was rolled back due to errors: nothing was changed by the script.'; +} else { + $db->commit(); +} +$db->close(); + + +echo '

SQL queries with errors:

'; +echo '
  • ' . join('
  • ', $errors) . '
'; + From c9e70ed1c1d4f544e773cc9b703aace0b712c9a4 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Mon, 22 Jul 2019 09:30:43 +0200 Subject: [PATCH 039/982] Fix problems detected by travis-ci --- .../repair_llx_commande_fournisseur_dispatch_3.6-9.0.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php b/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php index fec3c82cb56..0c4b006664c 100644 --- a/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php +++ b/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php @@ -42,7 +42,7 @@ // Dolibarr environment $path_dir = '../../'; $main_inc_file = 'main.inc.php'; -while ((false == @include($path_dir . $main_inc_file)) && 3*10 > strlen($path_dir)) { +while ((false == (@include $path_dir . $main_inc_file)) && 3*10 > strlen($path_dir)) { $path_dir = '../' . $path_dir; if (strlen($path_dir) > 20) { echo 'Error: unable to include "' . $main_inc_file . '" from any of the parent directories.'; @@ -141,7 +141,6 @@ if ($resql_dispatch) { flush(); ob_flush(); } - } } else { echo 'Unable to find any dispatch without an fk_commandefourndet.' . "\n"; From 3bdbbc714751e5369cece79cba8d1918b31614a2 Mon Sep 17 00:00:00 2001 From: Nicolas ZABOURI Date: Fri, 26 Jul 2019 17:17:59 +0200 Subject: [PATCH 040/982] NEW list of boxes area --- htdocs/core/class/infobox.class.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 1138e3a69ad..c73d32c8301 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2019 Nicolas ZABOURI * * 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 @@ -34,7 +35,33 @@ class InfoBox */ public static function getListOfPagesForBoxes() { - return array(0=>'Home'); + return array(0 => 'Home', + 1 => 'userhome', + 2 => 'membersindex', + 3 => 'thirdpartiesindex', + 4 => 'productindex', + 5 => 'productindex', + 6 => 'mrpindex', + 7 => 'commercialindex', + 8 => 'projectsindex', + 9 => 'invoiceindex', + 10 => 'hrmindex', + 11 => 'ticketsindex', + 12 => 'stockindex', + 13 => 'sendingindex', + 14 => 'receptionindex', + 15 => 'activityindex', + 16 => 'proposalindex', + 17 => 'ordersindex', + 18 => 'orderssuppliersindex', + 19 => 'contractindex', + 20 => 'interventionindex', + 21 => 'suppliersproposalsindex', + 22 => 'donationindex', + 23 => 'specialexpensesindex', + 24 => 'expensereportindex', + 25 => 'mailingindex', + 26 => 'opensurveyindex'); } /** From 3ef257f4f2a82de116588ef568046de81922e004 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Wed, 31 Jul 2019 09:21:00 +0200 Subject: [PATCH 041/982] Removed commented out code from the new migration script --- .../repair_llx_commande_fournisseur_dispatch_3.6-9.0.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php b/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php index 0c4b006664c..95cf50aabbf 100644 --- a/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php +++ b/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php @@ -59,12 +59,8 @@ echo '

Repair llx_commande_fournisseur_dispatch.fk_commandefourndet

'; echo '

Repair in progress. This may take a while.

'; echo '
';
-//$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch AS dispatch SET dispatch.fk_commandefourndet =
-//           ( SELECT rowid FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet AS line
-//            WHERE line.fk_commande = dispatch.fk_commande LIMIT 1) WHERE dispatch.fk_commandefourndet = 0;';
 
 $sql_dispatch = 'SELECT * FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch WHERE COALESCE(fk_commandefourndet, 0) = 0';
-//$sql_dispatch = 'SELECT * FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch WHERE fk_commandefourndet = 0 OR fk_commandefourndet IS NULL';
 $db->begin();
 $resql_dispatch = $db->query($sql_dispatch);
 $n_processed_rows = 0;

From b06bfef6320286b1c4294f13d0ce054698c25209 Mon Sep 17 00:00:00 2001
From: ptibogxiv 
Date: Sun, 11 Aug 2019 13:08:17 +0200
Subject: [PATCH 042/982] NEW display supplier in objectline if defined

---
 htdocs/core/tpl/objectline_view.tpl.php | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index d048b6f7c9d..988df55b61c 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -163,6 +163,23 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
 			print (! empty($line->description) && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; } } + + if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0) + { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + $productfourn = new ProductFournisseur($this->db); + $productfourn->fetch_product_fournisseur_price($line->fk_fournprice); + echo '
' . $langs->trans('Supplier') . ' : ' . $productfourn->getSocNomUrl(1, 'supplier') . ' - ' . $langs->trans('Ref') . ' : '; + // Supplier ref + if ($user->rights->produit->creer || $user->rights->service->creer) // change required right here + { + echo $productfourn->getNomUrl(); + } + else + { + echo $productfourn->ref_supplier; + } + } if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) { From 18eb2a83fe7c2d01bdb34cceec389a6f9541e1f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Aug 2019 16:41:53 +0200 Subject: [PATCH 043/982] FIX #11671 CVE-2019-15062 --- htdocs/core/actions_linkedfiles.inc.php | 8 +++----- htdocs/core/class/html.formfile.class.php | 4 ++-- htdocs/user/card.php | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 297f7821599..16ba1669337 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -118,8 +118,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') { require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; $link = new Link($db); - $link->id = $linkid; - $link->fetch(); + $link->fetch($linkid); $res = $link->delete($user); $langs->load('link'); @@ -153,8 +152,7 @@ elseif ($action == 'confirm_updateline' && GETPOST('save','alpha') && GETPOST('l require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; $langs->load('link'); $link = new Link($db); - $link->id = GETPOST('linkid', 'int'); - $f = $link->fetch(); + $f = $link->fetch(GETPOST('linkid', 'int')); if ($f) { $link->url = GETPOST('link', 'alpha'); @@ -162,7 +160,7 @@ elseif ($action == 'confirm_updateline' && GETPOST('save','alpha') && GETPOST('l { $link->url = 'http://' . $link->url; } - $link->label = GETPOST('label', 'alpha'); + $link->label = GETPOST('label', 'alphanohtml'); $res = $link->update($user); if (!$res) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 2b02ada6b47..a198fba4f98 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1757,7 +1757,7 @@ class FormFile print $langs->trans('Link') . ': '; print ''; print ''; - print $langs->trans('Label') . ': '; + print $langs->trans('Label') . ': '; print ''; print '' . dol_print_date(dol_now(), "dayhour", "tzuser") . ''; print ''; @@ -1771,7 +1771,7 @@ class FormFile print ''; print img_picto('', 'object_globe').' '; print ''; - print $link->label; + print dol_escape_htmltag($link->label); print ''; print ''."\n"; print ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index adcf094e7a4..460e345131c 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -309,12 +309,12 @@ if (empty($reshook)) { { $error = 0; - if (!$_POST["lastname"]) { + if (! GETPOST("lastname", 'alpha')) { setEventMessages($langs->trans("NameNotDefined"), null, 'errors'); $action = "edit"; // Go back to create page $error ++; } - if (!$_POST["login"]) { + if (! GETPOST("login", 'alpha')) { setEventMessages($langs->trans("LoginNotDefined"), null, 'errors'); $action = "edit"; // Go back to create page $error ++; From e15d91640bd8ca40e88e7498233353190c08a6cb Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Thu, 22 Aug 2019 09:43:04 +0200 Subject: [PATCH 044/982] Update card.php --- htdocs/commande/card.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index a44054cdfd0..c603eba168c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1758,7 +1758,14 @@ if ($action == 'create' && $usercancreate) $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + // copy from thirdparty + $tpExtrafields = new Extrafields($db); + $tpExtrafieldLabels = $tpExtrafields->fetch_name_optionals_label($soc->table_element); + if ($soc->fetch_optionals() > 0) { + $object->array_options = array_merge($object->array_options, $soc->array_options); + } + print $object->showOptionals($extrafields, 'edit'); + } // Template to use by default From 5bab233252f907a20496a164c2652e67106b2901 Mon Sep 17 00:00:00 2001 From: schhub <36532274+schhub@users.noreply.github.com> Date: Thu, 22 Aug 2019 13:19:45 +0200 Subject: [PATCH 045/982] Delete action correction for documents backup. correction of delete action always trying to delete files in document/admin/backup directory. Documents backups are stored in documents/admin/documents directory. If preg_match is too "heavy" it can be replaced by strpos. --- htdocs/admin/tools/dolibarr_export.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index c06314daa9a..f445c7eb791 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -50,11 +50,21 @@ if (! $user->admin) if ($action == 'delete') { - $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); - $ret=dol_delete_file($file, 1); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); - $action=''; + if (preg_match('#backup/#', GETPOST('urlfile', 'alpha'))) + { + $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); + $ret=dol_delete_file($file, 1); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); + } + else + { + $file=$conf->admin->dir_output.'/documents/'.basename(GETPOST('urlfile', 'alpha')); + $ret=dol_delete_file($file, 1); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); + } + $action=''; } From fa29415e6a16d5bab7afc9a9c342d75cfc6f07c3 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 22 Aug 2019 14:06:18 +0200 Subject: [PATCH 046/982] Moved repair payload from a specific script to install/repair.php --- ..._commande_fournisseur_dispatch_3.6-9.0.php | 160 ------------------ htdocs/install/repair.php | 125 ++++++++++++++ 2 files changed, 125 insertions(+), 160 deletions(-) delete mode 100644 htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php diff --git a/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php b/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php deleted file mode 100644 index 95cf50aabbf..00000000000 --- a/htdocs/fourn/commande/script/repair_llx_commande_fournisseur_dispatch_3.6-9.0.php +++ /dev/null @@ -1,160 +0,0 @@ - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * This script is meant to be run when upgrading from a dolibarr version < 3.8 - * to a newer version. - * - * Version 3.8 introduces a new column in llx_commande_fournisseur_dispatch, which - * matches the dispatch to a specific supplier order line (so that if there are - * several with the same product, the user can specifically tell which products of - * which line were dispatched where). - * - * However when migrating, the new column has a default value of 0, which means that - * old supplier orders whose lines were dispatched using the old dolibarr version - * have unspecific dispatch lines, which are not taken into account by the new version, - * thus making the order look like it was never dispatched at all. - * - * This scripts sets this foreign key to the first matching supplier order line whose - * product (and supplier order of course) are the same as the dispatch’s. - * - * If the dispatched quantity is more than indicated on the order line (this happens if - * there are several order lines for the same product), it creates new dispatch lines - * pointing to the other order lines accordingly, until all the dispatched quantity is - * accounted for. - */ - -// Dolibarr environment -$path_dir = '../../'; -$main_inc_file = 'main.inc.php'; -while ((false == (@include $path_dir . $main_inc_file)) && 3*10 > strlen($path_dir)) { - $path_dir = '../' . $path_dir; - if (strlen($path_dir) > 20) { - echo 'Error: unable to include "' . $main_inc_file . '" from any of the parent directories.'; - exit; - } -} - -// Access control -if (!$user->admin) { - accessforbidden(); -} - -echo '

Repair llx_commande_fournisseur_dispatch.fk_commandefourndet

'; -echo '

Repair in progress. This may take a while.

'; - -echo '
';
-
-$sql_dispatch = 'SELECT * FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch WHERE COALESCE(fk_commandefourndet, 0) = 0';
-$db->begin();
-$resql_dispatch = $db->query($sql_dispatch);
-$n_processed_rows = 0;
-$errors = array();
-if ($resql_dispatch) {
-    if ($db->num_rows($resql_dispatch) == 0) {
-        echo 'Nothing to do.'; exit;
-    };
-    while ($obj_dispatch = $db->fetch_object($resql_dispatch)) {
-        $sql_line = 'SELECT line.rowid, line.qty FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet AS line'
-            .  ' WHERE line.fk_commande = ' . $obj_dispatch->fk_commande
-            .  ' AND line.fk_product = ' . $obj_dispatch->fk_product;
-        $resql_line = $db->query($sql_line);
-
-        // s’il y a plusieurs lignes avec le même produit sur cette commande fournisseur,
-        // on divise la ligne de dispatch en autant de lignes qu’on en a sur la commande pour le produit
-        // et on met la quantité de la ligne dans la limite du "budget" indiqué par dispatch.qty
-
-        $remaining_qty = $obj_dispatch->qty;
-        $first_iteration = true;
-        if (!$resql_line) {
-            echo 'Unable to find a matching supplier order line for dispatch #' . $obj_dispatch->rowid . "\n";
-            $errors[] = $sql_line;
-            $n_processed_rows++;
-            continue;
-        }
-        if ($db->num_rows($resql_line) == 0) continue;
-        while ($obj_line = $db->fetch_object($resql_line)) {
-            if (!$remaining_qty) break;
-            if (!$obj_line->rowid) {
-                continue;
-            }
-            $qty_for_line = min($remaining_qty, $obj_line->qty);
-            if ($first_iteration) {
-                $sql_attach = 'UPDATE ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch'
-                    . ' SET fk_commandefourndet = ' . $obj_line->rowid . ', qty = ' . $qty_for_line
-                    . ' WHERE rowid = ' . $obj_dispatch->rowid;
-                $first_iteration = false;
-            } else {
-                $sql_attach_values = array(
-                    $obj_dispatch->fk_commande,
-                    $obj_dispatch->fk_product,
-                    $obj_line->rowid,
-                    $qty_for_line,
-                    $obj_dispatch->fk_entrepot,
-                    $obj_dispatch->fk_user,
-                    $obj_dispatch->datec ? '"' . $db->escape($obj_dispatch->datec) . '"' : 'NULL',
-                    $obj_dispatch->comment ? '"' . $db->escape($obj_dispatch->comment) . '"' : 'NULL',
-                    $obj_dispatch->status ?: 'NULL',
-                    $obj_dispatch->tms ? '"' . $db->escape($obj_dispatch->tms) . '"': 'NULL',
-                    $obj_dispatch->batch ?: 'NULL',
-                    $obj_dispatch->eatby ? '"' . $db->escape($obj_dispatch->eatby) . '"': 'NULL',
-                    $obj_dispatch->sellby ? '"' . $db->escape($obj_dispatch->sellby) . '"': 'NULL'
-                );
-                $sql_attach_values = join(', ', $sql_attach_values);
-
-                $sql_attach = 'INSERT INTO ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch'
-                    . ' (fk_commande, fk_product, fk_commandefourndet, qty, fk_entrepot, fk_user, datec, comment, status, tms, batch, eatby, sellby)'
-                    . ' VALUES (' . $sql_attach_values . ')';
-            }
-            $resql_attach = $db->query($sql_attach);
-            if ($resql_attach) {
-                $remaining_qty -= $qty_for_line;
-            } else {
-                $errors[] = $sql_attach;
-            }
-            $first_iteration = false;
-        }
-        $n_processed_rows++;
-
-        // report progress every 256th row
-        if (!($n_processed_rows & 0xff)) {
-            echo 'Processed ' . $n_processed_rows . ' rows with ' . count($errors) . ' errors…' . "\n";
-            flush();
-            ob_flush();
-        }
-    }
-} else {
-    echo 'Unable to find any dispatch without an fk_commandefourndet.' . "\n";
-    echo $sql_dispatch . "\n";
-}
-echo 'Fixed ' . $n_processed_rows . ' rows with ' . count($errors) . ' errors…' . "\n";
-echo 'DONE.' . "\n";
-echo '
'; - -if (count($errors)) { - $db->rollback(); - echo 'The transaction was rolled back due to errors: nothing was changed by the script.'; -} else { - $db->commit(); -} -$db->close(); - - -echo '

SQL queries with errors:

'; -echo '
  • ' . join('
  • ', $errors) . '
'; - diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 4d3e28a38d3..b7f3f9eb5b6 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -78,6 +78,7 @@ print 'Option rebuild_product_thumbs (0 or \'test\' or \'confirmed\') is '.(GETP print 'Option force_disable_of_modules_not_found (0 or \'test\' or \'confirmed\') is '.(GETPOST('force_disable_of_modules_not_found','alpha')?GETPOST('force_disable_of_modules_not_found','alpha'):'0').'
'."\n"; print 'Option clean_perm_table (0 or \'test\' or \'confirmed\') is '.(GETPOST('clean_perm_table','alpha')?GETPOST('clean_perm_table','alpha'):'0').'
'."\n"; print 'Option force_utf8_on_tables, for mysql/mariadb only (0 or \'test\' or \'confirmed\') is '.(GETPOST('force_utf8_on_tables','alpha')?GETPOST('force_utf8_on_tables','alpha'):'0').'
'."\n"; +print 'Option repair_link_dispatch_lines_supplier_order_lines, (0 or \'test\' or \'confirmed\') is '.(GETPOST('repair_link_dispatch_lines_supplier_order_lines','alpha')?GETPOST('repair_link_dispatch_lines_supplier_order_lines','alpha'):'0').'
'."\n"; print '
'; print ''; @@ -1122,6 +1123,130 @@ if ($ok && GETPOST('force_utf8_on_tables','alpha')) } } +// +if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) { + /* + * This script is meant to be run when upgrading from a dolibarr version < 3.8 + * to a newer version. + * + * Version 3.8 introduces a new column in llx_commande_fournisseur_dispatch, which + * matches the dispatch to a specific supplier order line (so that if there are + * several with the same product, the user can specifically tell which products of + * which line were dispatched where). + * + * However when migrating, the new column has a default value of 0, which means that + * old supplier orders whose lines were dispatched using the old dolibarr version + * have unspecific dispatch lines, which are not taken into account by the new version, + * thus making the order look like it was never dispatched at all. + * + * This scripts sets this foreign key to the first matching supplier order line whose + * product (and supplier order of course) are the same as the dispatch’s. + * + * If the dispatched quantity is more than indicated on the order line (this happens if + * there are several order lines for the same product), it creates new dispatch lines + * pointing to the other order lines accordingly, until all the dispatched quantity is + * accounted for. + */ + echo ''; + echo ''; + + $sql_dispatch = 'SELECT * FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch WHERE COALESCE(fk_commandefourndet, 0) = 0'; + $db->begin(); + $resql_dispatch = $db->query($sql_dispatch); + $n_processed_rows = 0; + $errors = array(); + if ($resql_dispatch) { + if ($db->num_rows($resql_dispatch) == 0) { + echo ''; + exit; + } + while ($obj_dispatch = $db->fetch_object($resql_dispatch)) { + $sql_line = 'SELECT line.rowid, line.qty FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet AS line' + . ' WHERE line.fk_commande = ' . $obj_dispatch->fk_commande + . ' AND line.fk_product = ' . $obj_dispatch->fk_product; + $resql_line = $db->query($sql_line); + + // s’il y a plusieurs lignes avec le même produit sur cette commande fournisseur, + // on divise la ligne de dispatch en autant de lignes qu’on en a sur la commande pour le produit + // et on met la quantité de la ligne dans la limite du "budget" indiqué par dispatch.qty + + $remaining_qty = $obj_dispatch->qty; + $first_iteration = true; + if (!$resql_line) { + echo ''; + $errors[] = $sql_line; + $n_processed_rows++; + continue; + } + if ($db->num_rows($resql_line) == 0) continue; + while ($obj_line = $db->fetch_object($resql_line)) { + if (!$remaining_qty) break; + if (!$obj_line->rowid) { + continue; + } + $qty_for_line = min($remaining_qty, $obj_line->qty); + if ($first_iteration) { + $sql_attach = 'UPDATE ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch' + . ' SET fk_commandefourndet = ' . $obj_line->rowid . ', qty = ' . $qty_for_line + . ' WHERE rowid = ' . $obj_dispatch->rowid; + $first_iteration = false; + } else { + $sql_attach_values = array( + $obj_dispatch->fk_commande, + $obj_dispatch->fk_product, + $obj_line->rowid, + $qty_for_line, + $obj_dispatch->fk_entrepot, + $obj_dispatch->fk_user, + $obj_dispatch->datec ? '"' . $db->escape($obj_dispatch->datec) . '"' : 'NULL', + $obj_dispatch->comment ? '"' . $db->escape($obj_dispatch->comment) . '"' : 'NULL', + $obj_dispatch->status ?: 'NULL', + $obj_dispatch->tms ? '"' . $db->escape($obj_dispatch->tms) . '"': 'NULL', + $obj_dispatch->batch ?: 'NULL', + $obj_dispatch->eatby ? '"' . $db->escape($obj_dispatch->eatby) . '"': 'NULL', + $obj_dispatch->sellby ? '"' . $db->escape($obj_dispatch->sellby) . '"': 'NULL' + ); + $sql_attach_values = join(', ', $sql_attach_values); + + $sql_attach = 'INSERT INTO ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch' + . ' (fk_commande, fk_product, fk_commandefourndet, qty, fk_entrepot, fk_user, datec, comment, status, tms, batch, eatby, sellby)' + . ' VALUES (' . $sql_attach_values . ')'; + } + $resql_attach = $db->query($sql_attach); + if ($resql_attach) { + $remaining_qty -= $qty_for_line; + } else { + $errors[] = $sql_attach; + } + $first_iteration = false; + } + $n_processed_rows++; + + // report progress every 256th row + if (!($n_processed_rows & 0xff)) { + echo '\n"; + flush(); + ob_flush(); + } + } + } else { + echo '\n"; + echo $sql_dispatch . "\n"; + } + echo '\n"; + echo '\n"; + + if (count($errors)) { + $db->rollback(); + echo ''; + } else { + $db->commit(); + } + $db->close(); + + echo ''; + echo ''; +} print '
Repair llx_commande_fournisseur_dispatch.fk_commandefourndet
Repair in progress. This may take a while.
Nothing to do.
Unable to find a matching supplier order line for dispatch #' . $obj_dispatch->rowid . '
Processed ' . $n_processed_rows . ' rows with ' . count($errors) . ' errors…' . "
Unable to find any dispatch without an fk_commandefourndet.' . "
Fixed ' . $n_processed_rows . ' rows with ' . count($errors) . ' errors…' . "
DONE.' . "
The transaction was rolled back due to errors: nothing was changed by the script.

SQL queries with errors:

' . join('
', $errors) . '
'; From 0be59646a848760b52d6761748187fa454617b21 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 22 Aug 2019 22:00:53 +0200 Subject: [PATCH 047/982] Update stripelive_oauthcallback.php --- htdocs/core/modules/oauth/stripelive_oauthcallback.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index cf2c2418092..bbea53f9049 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -65,7 +65,7 @@ $storage = new DoliStorage($db, $conf); // Setup the credentials for the requests $credentials = new Credentials( - $conf->global->OAUTH_STRIPE_TEST_ID, + $conf->global->OAUTH_STRIPE_LIVE_ID, $conf->global->STRIPE_LIVE_SECRET_KEY, $currentUri->getAbsoluteUri() ); From cef4bdab7b388302168fe7d778222751f032b32a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 22 Aug 2019 22:20:50 +0200 Subject: [PATCH 048/982] NEW update / delete stripe account for supplier --- htdocs/societe/paymentmodes.php | 48 ++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 9310ede87c5..cd8571fa869 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -600,6 +600,52 @@ if (empty($reshook)) $db->rollback(); } } + + if ($action == 'setkey_account_supplier') + { + $error = 0; + + $newsup = GETPOST('key_account_supplier', 'alpha'); + + $db->begin(); + + if (empty($newsup)) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".$object->id." AND service = ".$servicestatus." AND entity = ".$conf->entity; + } else { + try { + $stripesup = \Stripe\Account::retrieve($db->escape(GETPOST('key_account_supplier', 'alpha'))); + + $tokenstring['stripe_user_id'] = $stripesup->id; + $tokenstring['type'] = $stripesup->type; + $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token"; + $sql.= " SET tokenstring = '".dol_json_encode($tokenstring)."'"; + $sql.= " WHERE fk_soc = ".$object->id." AND service = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! + } + catch(Exception $e) + { + $error++; + setEventMessages($e->getMessage(), null, 'errors'); + } + } + + $resql = $db->query($sql); + $num = $db->num_rows($resql); + if (empty($num) && !empty($newsup)) + { + //TODO CREATE ACCOUNT + } + + if (! $error) + { + $stripesupplieracc = $newsup; + $db->commit(); + } + else + { + $db->rollback(); + } + } + if ($action == 'setlocalassourcedefault') // Set as default when payment mode defined locally (and may be also remotely) { try { @@ -845,7 +891,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print $form->editfieldkey("StripeConnectAccount", 'key_account_supplier', $stripesupplieracc, $object, $permissiontowrite, 'string', '', 0, 2, 'socid'); print ''; print $form->editfieldval("StripeConnectAccount", 'key_account_supplier', $stripesupplieracc, $object, $permissiontowrite, 'string', '', null, null, '', 2, '', 'socid'); - if (! empty($conf->stripe->enabled) && $stripesupplieracc && $action != 'editkey_account') + if (! empty($conf->stripe->enabled) && $stripesupplieracc && $action != 'editkey_account_supplier') { $connect=''; From 4536b8618e9eeea91c0585868e907e7f2bf40b62 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 22 Aug 2019 22:48:37 +0200 Subject: [PATCH 049/982] Update paymentmodes.php --- htdocs/societe/paymentmodes.php | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index cd8571fa869..374eff99766 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -612,27 +612,38 @@ if (empty($reshook)) if (empty($newsup)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".$object->id." AND service = ".$servicestatus." AND entity = ".$conf->entity; } else { - try { + try { $stripesup = \Stripe\Account::retrieve($db->escape(GETPOST('key_account_supplier', 'alpha'))); - $tokenstring['stripe_user_id'] = $stripesup->id; - $tokenstring['type'] = $stripesup->type; + $tokenstring['type'] = $stripesup->type; $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token"; $sql.= " SET tokenstring = '".dol_json_encode($tokenstring)."'"; $sql.= " WHERE fk_soc = ".$object->id." AND service = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! - } - catch(Exception $e) - { - $error++; - setEventMessages($e->getMessage(), null, 'errors'); - } - } + } + catch(Exception $e) + { + $error++; + setEventMessages($e->getMessage(), null, 'errors'); + } + } $resql = $db->query($sql); $num = $db->num_rows($resql); if (empty($num) && !empty($newsup)) { - //TODO CREATE ACCOUNT + try { + $stripesup = \Stripe\Account::retrieve($db->escape(GETPOST('key_account_supplier', 'alpha'))); + $tokenstring['stripe_user_id'] = $stripesup->id; + $tokenstring['type'] = $stripesup->type; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, fk_soc, entity, tokenstring)"; + $sql .= " VALUES ('".$service."', ".$object->id.", ".$conf->entity.", '".dol_json_encode($tokenstring)."')"; + } + catch(Exception $e) + { + $error++; + setEventMessages($e->getMessage(), null, 'errors'); + } + $resql = $db->query($sql); } if (! $error) From 06fdd5ddbc116a3f9894f7c25df7cfbe5265ab76 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 22 Aug 2019 22:50:41 +0200 Subject: [PATCH 050/982] Update stripelive_oauthcallback.php --- htdocs/core/modules/oauth/stripelive_oauthcallback.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index bbea53f9049..a32223105b9 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/modules/oauth/stripe_oauthcallback.php + * \file htdocs/core/modules/oauth/stripelive_oauthcallback.php * \ingroup oauth * \brief Page to get oauth callback */ @@ -45,7 +45,7 @@ $backtourl = GETPOST('backtourl', 'alpha'); $uriFactory = new \OAuth\Common\Http\Uri\UriFactory(); //$currentUri = $uriFactory->createFromSuperGlobalArray($_SERVER); //$currentUri->setQuery(''); -$currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/stripe_oauthcallback.php'); +$currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/stripelive_oauthcallback.php'); /** From 2d59f6bb3d1c17ceefa6be3e32f04e117e45f6da Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 23 Aug 2019 07:59:36 +0200 Subject: [PATCH 051/982] FIX avoid sql error if fk_project is empty during update --- .../compta/sociales/class/chargesociales.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index c3995a2202d..b08f1bda27f 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -291,17 +291,17 @@ class ChargeSociales extends CommonObject $sql.= ", date_ech='".$this->db->idate($this->date_ech)."'"; $sql.= ", periode='".$this->db->idate($this->periode)."'"; $sql.= ", amount='".price2num($this->amount,'MT')."'"; - $sql.= ", fk_projet='".$this->db->escape($this->fk_project)."'"; + $sql.= ", fk_projet=".($this->fk_project>0?$this->db->escape($this->fk_project):"NULL"); $sql.= ", fk_user_modif=".$user->id; $sql.= " WHERE rowid=".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql=$this->db->query($sql); - + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - + if (! $error) { if (! $notrigger) @@ -312,7 +312,7 @@ class ChargeSociales extends CommonObject // End call triggers } } - + // Commit or rollback if ($error) { @@ -329,8 +329,8 @@ class ChargeSociales extends CommonObject $this->db->commit(); return 1; } - - + + } /** From 9d3b4eb6994a6963c56fba85c7e32be861e5aa30 Mon Sep 17 00:00:00 2001 From: schhub <36532274+schhub@users.noreply.github.com> Date: Fri, 23 Aug 2019 08:05:44 +0200 Subject: [PATCH 052/982] Update dolibarr_export.php --- htdocs/admin/tools/dolibarr_export.php | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index f445c7eb791..d3996d44a31 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -50,21 +50,21 @@ if (! $user->admin) if ($action == 'delete') { - if (preg_match('#backup/#', GETPOST('urlfile', 'alpha'))) - { - $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); - $ret=dol_delete_file($file, 1); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); - } - else - { - $file=$conf->admin->dir_output.'/documents/'.basename(GETPOST('urlfile', 'alpha')); - $ret=dol_delete_file($file, 1); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); - } - $action=''; + if (preg_match('#backup/#', GETPOST('urlfile', 'alpha'))) + { + $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); + $ret=dol_delete_file($file, 1); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); + } + else + { + $file=$conf->admin->dir_output.'/documents/'.basename(GETPOST('urlfile', 'alpha')); + $ret=dol_delete_file($file, 1); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); + } + $action=''; } From 264763f6b7f5813293268d3d6487607737426681 Mon Sep 17 00:00:00 2001 From: schhub <36532274+schhub@users.noreply.github.com> Date: Fri, 23 Aug 2019 08:31:50 +0200 Subject: [PATCH 053/982] Update dolibarr_export.php --- htdocs/admin/tools/dolibarr_export.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index d3996d44a31..82554aaf490 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -67,7 +67,6 @@ if ($action == 'delete') $action=''; } - /* * View */ From 3c706ae28ac98e3377da27e2de7af51b027df5ff Mon Sep 17 00:00:00 2001 From: schhub <36532274+schhub@users.noreply.github.com> Date: Fri, 23 Aug 2019 08:53:43 +0200 Subject: [PATCH 054/982] Update dolibarr_export.php --- htdocs/admin/tools/dolibarr_export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 82554aaf490..65a2c40d363 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -50,7 +50,7 @@ if (! $user->admin) if ($action == 'delete') { - if (preg_match('#backup/#', GETPOST('urlfile', 'alpha'))) + if (preg_match('#backup/#', GETPOST('urlfile', 'alpha'))) { $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); $ret=dol_delete_file($file, 1); From 839ba76ae4da2ee11f544e9f6e2acb733ef691b5 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 23 Aug 2019 08:58:08 +0200 Subject: [PATCH 055/982] Update stripetest_oauthcallback.php --- htdocs/core/modules/oauth/stripetest_oauthcallback.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index eb7463749ae..55b532f231c 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/modules/oauth/stripe_oauthcallback.php + * \file htdocs/core/modules/oauth/stripetest_oauthcallback.php * \ingroup oauth * \brief Page to get oauth callback */ @@ -45,7 +45,7 @@ $backtourl = GETPOST('backtourl', 'alpha'); $uriFactory = new \OAuth\Common\Http\Uri\UriFactory(); //$currentUri = $uriFactory->createFromSuperGlobalArray($_SERVER); //$currentUri->setQuery(''); -$currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/stripe_oauthcallback.php'); +$currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/stripetest_oauthcallback.php'); /** From 55d70004b1c1ff0ca75d1d01f3a22284437281ef Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 23 Aug 2019 09:00:11 +0200 Subject: [PATCH 056/982] Update paymentmodes.php --- htdocs/societe/paymentmodes.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 374eff99766..958ba4810b7 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -612,10 +612,10 @@ if (empty($reshook)) if (empty($newsup)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".$object->id." AND service = ".$servicestatus." AND entity = ".$conf->entity; } else { - try { + try { $stripesup = \Stripe\Account::retrieve($db->escape(GETPOST('key_account_supplier', 'alpha'))); $tokenstring['stripe_user_id'] = $stripesup->id; - $tokenstring['type'] = $stripesup->type; + $tokenstring['type'] = $stripesup->type; $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token"; $sql.= " SET tokenstring = '".dol_json_encode($tokenstring)."'"; $sql.= " WHERE fk_soc = ".$object->id." AND service = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! @@ -631,8 +631,8 @@ if (empty($reshook)) $num = $db->num_rows($resql); if (empty($num) && !empty($newsup)) { - try { - $stripesup = \Stripe\Account::retrieve($db->escape(GETPOST('key_account_supplier', 'alpha'))); + try { + $stripesup = \Stripe\Account::retrieve($db->escape(GETPOST('key_account_supplier', 'alpha'))); $tokenstring['stripe_user_id'] = $stripesup->id; $tokenstring['type'] = $stripesup->type; $sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, fk_soc, entity, tokenstring)"; From c6bcf19a88075e12d457a9c5674e0b8719134346 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 23 Aug 2019 09:01:05 +0200 Subject: [PATCH 057/982] Fix phpcs --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 5dda24a763e..cf683671c5d 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -92,7 +92,7 @@ class Stripe extends CommonObject if ($fk_soc > 0) { $sql.= " AND fk_soc = ".$fk_soc; } - else { + else { $sql.= " AND fk_soc IS NULL"; } $sql.= " AND fk_user IS NULL AND fk_adherent IS NULL"; From 0afc55ab51e16c3cb9021999cb208295325813be Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 23 Aug 2019 09:08:39 +0200 Subject: [PATCH 058/982] Update paymentmodes.php --- htdocs/societe/paymentmodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 958ba4810b7..4d49fc3792a 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -610,7 +610,7 @@ if (empty($reshook)) $db->begin(); if (empty($newsup)) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".$object->id." AND service = ".$servicestatus." AND entity = ".$conf->entity; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity; } else { try { $stripesup = \Stripe\Account::retrieve($db->escape(GETPOST('key_account_supplier', 'alpha'))); @@ -618,7 +618,7 @@ if (empty($reshook)) $tokenstring['type'] = $stripesup->type; $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token"; $sql.= " SET tokenstring = '".dol_json_encode($tokenstring)."'"; - $sql.= " WHERE fk_soc = ".$object->id." AND service = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! + $sql.= " WHERE fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! } catch(Exception $e) { From f14f1c9190914fbeaeef1190558b76cd10f8b67d Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 23 Aug 2019 09:15:15 +0200 Subject: [PATCH 059/982] Fix wrong placement to print title and missing hook to print value --- htdocs/compta/paiement.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 2da6052c63f..631cc10389a 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -593,6 +593,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.$alreadypayedlabel.''; print ''.$remaindertopay.''; print ''.$langs->trans('PaymentAmount').''; + + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $facture, $action); // Note that $action and $object may have been modified by hook + print ' '; print "\n"; @@ -737,7 +741,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ""; $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook // Warning print ''; From 22c661be9f43d68614e88eec7ab6b293776d5f77 Mon Sep 17 00:00:00 2001 From: schhub <36532274+schhub@users.noreply.github.com> Date: Fri, 23 Aug 2019 10:26:07 +0200 Subject: [PATCH 060/982] Update stripe.class.php removed space in line 95 --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 5dda24a763e..cf683671c5d 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -92,7 +92,7 @@ class Stripe extends CommonObject if ($fk_soc > 0) { $sql.= " AND fk_soc = ".$fk_soc; } - else { + else { $sql.= " AND fk_soc IS NULL"; } $sql.= " AND fk_user IS NULL AND fk_adherent IS NULL"; From 73bcf3110dbf629a0030726a659aa6abd58512b3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 23 Aug 2019 13:56:04 +0200 Subject: [PATCH 061/982] NEW birthday boxe for member use new function for displays the X next birthday by date ASC --- htdocs/core/boxes/box_birthdays_members.php | 163 ++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 htdocs/core/boxes/box_birthdays_members.php diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php new file mode 100644 index 00000000000..09863046cdf --- /dev/null +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -0,0 +1,163 @@ + + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/boxes/box_adherent_birthdays.php + * \ingroup member + * \brief Box for member birthdays + */ + +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show user birthdays + */ +class box_birthdays_members extends ModeleBoxes +{ + public $boxcode="birthdays_members"; + public $boximg="object_user"; + public $boxlabel="BoxBirthdaysMembers"; + public $depends = array("adherent"); + + /** + * @var DoliDB Database handler. + */ + public $db; + + public $enabled = 1; + + public $info_box_head = array(); + public $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + global $conf, $user; + + $this->db = $db; + + $this->hidden = ! ($user->rights->adherent->lire && empty($user->socid)); + } + + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 20) + { + global $user, $langs, $db, $conf; + $langs->load("boxes"); + + $this->max=$max; + + include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $memberstatic=new Adherent($db); + + $this->info_box_head = array('text' => $langs->trans("BoxTitleMemberNextBirthdays")); + + if ($user->rights->adherent->lire) + { + $sql = "SELECT u.rowid, u.firstname, u.lastname"; + $sql.= ", u.birth"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent as u"; + $sql.= " WHERE u.entity IN (".getEntity('adherent').")"; + $sql.= " AND u.statut = 1"; + $sql.= " AND date_format(u.birth, '%m-%d') >= date_format(curdate(), '%m-%d')"; + $sql.= " ORDER BY date_format(u.birth, '%m-%d') ASC"; + $sql.= $db->plimit($max, 0); + + dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + + $line = 0; + while ($line < $num) + { + $objp = $db->fetch_object($result); + $memberstatic->id = $objp->rowid; + $memberstatic->firstname = $objp->firstname; + $memberstatic->lastname = $objp->lastname; + $memberstatic->email = $objp->email; + $dateb=$db->jdate($objp->birth); + $age = date('Y', dol_now()) - date('Y', $dateb); + + $this->info_box_contents[$line][] = array( + 'td' => '', + 'text' => $memberstatic->getNomUrl(1), + 'asis' => 1, + ); + + $this->info_box_contents[$line][] = array( + 'td' => 'class="right"', + 'text' => dol_print_date($dateb, "day") . ' - ' . $age . ' ' . $langs->trans('DurationYears') + ); + + /*$this->info_box_contents[$line][] = array( + 'td' => 'class="right" width="18"', + 'text' => $memberstatic->LibStatut($objp->status, 3) + );*/ + + $line++; + } + + if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedUsers")); + + $db->free($result); + } + else { + $this->info_box_contents[0][0] = array( + 'td' => '', + 'maxlength'=>500, + 'text' => ($db->error().' sql='.$sql) + ); + } + } + else { + $this->info_box_contents[0][0] = array( + 'td' => 'class="nohover opacitymedium left"', + 'text' => $langs->trans("ReadPermissionNotAllowed") + ); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string + * @return string + */ + public function showBox($head = null, $contents = null, $nooutput = 0) + { + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + } +} From 30b929c62111a55ee3ddffd25ee51d896c8595d4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 23 Aug 2019 13:57:22 +0200 Subject: [PATCH 062/982] Update modAdherent.class.php --- htdocs/core/modules/modAdherent.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 827928af6b6..300f071de1e 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -181,7 +181,10 @@ class modAdherent extends DolibarrModules // Boxes //------- - $this->boxes = array(0=>array('file'=>'box_members.php','enabledbydefaulton'=>'Home')); + $this->boxes = array( + 0=>array('file'=>'box_members.php','enabledbydefaulton'=>'Home'), + 2=>array('file'=>'box_birthdays_members.php','enabledbydefaulton'=>'Home') + ); // Permissions //------------ From b7e7ca46b577917416ccbf545e22024b1808df42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Aug 2019 14:01:13 +0200 Subject: [PATCH 063/982] Fix responsive --- htdocs/fourn/facture/list.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 7d51f3783c1..fa05108b05c 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2013-2019 Philippe Grand * Copyright (C) 2013 Florian Henry @@ -588,14 +588,14 @@ if ($resql) if (! empty($arrayfields['f.ref']['checked'])) { print ''; - print ''; + print ''; print ''; } // Ref supplier if (! empty($arrayfields['f.ref_supplier']['checked'])) { print ''; - print ''; + print ''; print ''; } // Type @@ -622,7 +622,7 @@ if ($resql) if (! empty($arrayfields['f.label']['checked'])) { print ''; - print ''; + print ''; print ''; } // Date invoice @@ -647,17 +647,17 @@ if ($resql) // Project if (! empty($arrayfields['p.ref']['checked'])) { - print ''; + print ''; } // Thirpdarty if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } // Town - if (! empty($arrayfields['s.town']['checked'])) print ''; + if (! empty($arrayfields['s.town']['checked'])) print ''; // Zip - if (! empty($arrayfields['s.zip']['checked'])) print ''; + if (! empty($arrayfields['s.zip']['checked'])) print ''; // State if (! empty($arrayfields['state.nom']['checked'])) { @@ -688,35 +688,35 @@ if ($resql) } if (! empty($arrayfields['f.total_ht']['checked'])) { - // Amount + // Amount without tax print ''; print ''; print ''; } if (! empty($arrayfields['f.total_vat']['checked'])) { - // Amount + // Amount vat print ''; print ''; print ''; } if (! empty($arrayfields['f.total_localtax1']['checked'])) { - // Amount + // Amount tax 1 print ''; print ''; print ''; } if (! empty($arrayfields['f.total_localtax2']['checked'])) { - // Amount + // Amount tax 2 print ''; print ''; print ''; } if (! empty($arrayfields['f.total_ttc']['checked'])) { - // Amount + // Amount inc tac print ''; print ''; print ''; @@ -776,7 +776,7 @@ if ($resql) if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); - if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); @@ -944,7 +944,7 @@ if ($resql) // Zip if (! empty($arrayfields['s.zip']['checked'])) { - print ''; + print ''; print $obj->zip; print ''; if (! $i) $totalarray['nbfield']++; From c8cf06ed2fb2caaf2bacee766304ffed2a0ab9d4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 23 Aug 2019 14:59:12 +0200 Subject: [PATCH 064/982] Update box_birthdays_members.php --- htdocs/core/boxes/box_birthdays_members.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 09863046cdf..6a36bc01ae4 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -88,7 +88,7 @@ class box_birthdays_members extends ModeleBoxes $sql.= " FROM ".MAIN_DB_PREFIX."adherent as u"; $sql.= " WHERE u.entity IN (".getEntity('adherent').")"; $sql.= " AND u.statut = 1"; - $sql.= " AND date_format(u.birth, '%m-%d') >= date_format(curdate(), '%m-%d')"; + $sql.= " AND date_format(u.birth, '%m-%d') >= date_format(curdate(), '%m-%d')"; $sql.= " ORDER BY date_format(u.birth, '%m-%d') ASC"; $sql.= $db->plimit($max, 0); From 064ab389ed0030e19514fcea944f6d64af212e03 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 24 Aug 2019 12:44:23 +0200 Subject: [PATCH 065/982] FIX wrong parameters (same error in branch 9, 10, develop) --- htdocs/compta/paiement.php | 2 +- htdocs/projet/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 4888b758cc1..aa344c3df2e 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -530,7 +530,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type,'; $sql.= ' f.datef as df, f.fk_soc as socid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; - $sql.= ' WHERE f.entity IN ('.getEntity('facture', $conf->entity).')'; + $sql.= ' WHERE f.entity IN ('.getEntity('facture').')'; $sql.= ' AND (f.fk_soc = '.$facture->socid; // Can pay invoices of all child of parent company if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS) && !empty($facture->thirdparty->parent)) { diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 906cb3783f1..4c4ae4c71cf 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -258,7 +258,7 @@ $sql = "SELECT COUNT(p.rowid) as nb, SUM(p.opp_amount)"; $sql.= ", s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; -$sql.= " WHERE p.entity IN (".getEntity('project', $conf->entity).")"; +$sql.= " WHERE p.entity IN (".getEntity('project').")"; $sql.= " AND p.fk_statut = 1"; if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; // If we have this test true, it also means projectset is not 2 if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; From 73a6b45e23ac22c070ab69c4d37e5ade23bf6c51 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 13:26:01 +0200 Subject: [PATCH 066/982] Fix load langs in takepos --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index ed3e5def318..68c7cf0ef55 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -29,7 +29,7 @@ require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -$langs->loadLangs(array("bills", "cashdesk")); +$langs->loadLangs(array("companies","commercial","bills", "cashdesk")); $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); From 686d43a12230b9673fe23b378e212999c94b533b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 13:44:21 +0200 Subject: [PATCH 067/982] NEW display membership in takepos if member link to thirdparty For some business or cases (ie: fundation), we need to know if customer is a member and membership is up to date. --- htdocs/takepos/invoice.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 17805a6b060..08822d46c6d 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -692,6 +692,29 @@ if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takep print '

'; print $langs->trans("Customer").': '.$soc->name; print '

'; + + // Module Adherent + if (! empty($conf->adherent->enabled)) + { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $langs->load("members"); + print '

'; + print $langs->trans("Member").': '; + $adh=new Adherent($db); + $result=$adh->fetch('', '', $invoice->socid); + if ($result > 0) + { + $adh->ref=$adh->getFullName($langs); + print $adh->getFullName($langs); + print '
'.$langs->trans("Type").': '.$adh->type; + print '
'.$langs->trans("SubscriptionEndDate").': '.dol_print_date($adh->datefin, 'day'); + } + else + { + print ''.$langs->trans("ThirdpartyNotLinkedToMember").''; + } + print '

'; + } } if ($action == "search") From cc1de15438d646e83c73facef96afaeaee0a61d1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 13:52:40 +0200 Subject: [PATCH 068/982] Update invoice.php --- htdocs/takepos/invoice.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 08822d46c6d..c628daa44ad 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -707,7 +707,18 @@ if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takep $adh->ref=$adh->getFullName($langs); print $adh->getFullName($langs); print '
'.$langs->trans("Type").': '.$adh->type; - print '
'.$langs->trans("SubscriptionEndDate").': '.dol_print_date($adh->datefin, 'day'); + if ($adh->datefin) + { + print dol_print_date($adh->datefin, 'day'); + if ($adh->hasDelay()) { + print " ".img_warning($langs->trans("Late")); + } + } + else + { + print $langs->trans("SubscriptionNotReceived"); + if ($adh->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated + } } else { From bb763ecb59bfafde02b8095ef4a8721dba358b86 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 14:02:25 +0200 Subject: [PATCH 069/982] Fix lang in takepos --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index e09c31664cd..4737ecbde27 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -367,7 +367,7 @@ if ($action=="valid" || $action=="history") } else { - if ($invoice->paye) $sectionwithinvoicelink.=''.$langs->trans("Payed").''; + if ($invoice->paye) $sectionwithinvoicelink.=''.$langs->trans("Paid").''; else $sectionwithinvoicelink.=$langs->trans('BillShortStatusValidated'); } $sectionwithinvoicelink.=''; From 361bb724486c81e090b704f08134fd00b5074157 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 14:17:58 +0200 Subject: [PATCH 070/982] Update invoice.php --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index c628daa44ad..663c7d4d006 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -725,7 +725,7 @@ if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takep print ''.$langs->trans("ThirdpartyNotLinkedToMember").''; } print '

'; - } + } } if ($action == "search") From d2ff37ae723fc37295b6066f0927d1fe57a285fd Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 15:00:49 +0200 Subject: [PATCH 071/982] NEW email template for Takepos (sending invoice) --- htdocs/takepos/admin/setup.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 6d33b8a19c2..23e6eb05c48 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -80,6 +80,7 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_DIRECT_PAYMENT", GETPOST('TAKEPOS_DIRECT_PAYMENT', 'int'), 'int', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity); if ($conf->global->TAKEPOS_ORDER_NOTES==1) { @@ -231,6 +232,30 @@ print ''; print $form->selectyesno("TAKEPOS_DIRECT_PAYMENT", $conf->global->TAKEPOS_DIRECT_PAYMENT, 1); print "\n"; +// Email template for send invoice +print ''; +print $langs->trans('EmailTemplate'); +print ''; +include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; +$formmail = new FormMail($db); +$nboftemplates = $formmail->fetchAllEMailTemplate('facture_send', $user, null, -1); // We set lang=null to get in priority record with no lang +//$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, ''); +$arrayofmessagename=array(); +if (is_array($formmail->lines_model)) +{ + foreach($formmail->lines_model as $modelmail) + { + //var_dump($modelmail); + $moreonlabel=''; + if (! empty($arrayofmessagename[$modelmail->label])) $moreonlabel=' ('.$langs->trans("SeveralLangugeVariatFound").')'; + $arrayofmessagename[$modelmail->label]=$langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel; + } +} +//var_dump($arraydefaultmessage); +//var_dump($arrayofmessagename); +print $form->selectarray('TAKEPOS_EMAIL_TEMPLATE_INVOICE', $arrayofmessagename, $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE, 'None', 1, 0, '', 0, 0, 0, '', '', 1); +print "\n"; + $substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2); $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); $htmltext = ''.$langs->trans("AvailableVariables").':
'; From c4b18890d952a2e1611d08b419ebf295c1db6c4c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 15:12:56 +0200 Subject: [PATCH 072/982] Update invoice.php --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 4737ecbde27..1e11161e8a1 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -511,7 +511,7 @@ print '
'.$sectionwithinvoicelink; print ''; print '' . $langs->trans('ReductionShort') . ''; print '' . $langs->trans('Qty') . ''; -print '' . $langs->trans('TotalHTShort') . ''; +print '' . $langs->trans('Total') . ''; print "\n"; if ($placeid > 0) From 2be125e647daa8680559a7900cacac959b8a89c1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 15:47:17 +0200 Subject: [PATCH 073/982] Fix display context for takepos in invoice list fix for thirdparty name and create button --- htdocs/compta/facture/list.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 284b747465d..f0c10598f82 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -605,7 +605,7 @@ if ($resql) $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; - if($user->rights->facture->creer) + if($user->rights->facture->creer && $contextpage != 'poslist') { $newcardbutton.= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/facture/card.php?action=create'); } @@ -1068,7 +1068,14 @@ if ($resql) if (! empty($arrayfields['s.nom']['checked'])) { print ''; - print $thirdpartystatic->getNomUrl(1, 'customer'); + if ($contextpage == 'poslist') + { + print $thirdpartystatic->name; + } + else + { + print $thirdpartystatic->getNomUrl(1, 'customer'); + } print ''; if (! $i) $totalarray['nbfield']++; } From 7112fcee9a6031a93294f235f132f55a3ac65906 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 15:54:14 +0200 Subject: [PATCH 074/982] Update list.php --- htdocs/compta/facture/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index f0c10598f82..653f1182d78 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -687,7 +687,7 @@ if ($resql) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + if ($massactionbutton && $contextpage != 'poslist') $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); print '
'; print ''."\n"; @@ -1237,7 +1237,7 @@ if ($resql) // Action column print '"; } + //Role + if (!empty($socid)) { + print ''; + print ''; + } + // Other attributes $parameters=array('socid' => $socid, 'objsoc' => $objsoc, 'colspan' => ' colspan="3"', 'cols' => 3); $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -1040,6 +1047,14 @@ else print ""; } + //Role + if (!empty($object->socid)) { + print ''; + print ''; + } + // Other attributes $parameters=array('colspan' => ' colspan="3"', 'cols'=>3); $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -1238,6 +1253,13 @@ else print ''; } + if (!empty($object->socid)) { + print ''; + print ''; + } + // Other attributes $cols = 3; $parameters=array('socid'=>$socid); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index db6ab29b802..d718a898f2d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -399,6 +399,14 @@ class Contact extends CommonObject } } + if (! $error) { + $result=$this->updateRoles(); + if ($result < 0) + { + $error++; + } + } + if (! $error && $this->user_id > 0) { $tmpobj = new User($this->db); @@ -861,6 +869,11 @@ class Contact extends CommonObject // fetch optionals attributes and labels $this->fetch_optionals(); + $resultRole=$this->fetchRoles(); + if ($resultRole<0) { + return $resultRole; + } + return 1; } else @@ -995,6 +1008,20 @@ class Contact extends CommonObject } } + if (! $error) + { + // Remove Roles + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_contacts WHERE fk_socpeople = ".$this->id; + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) + { + $error++; + $this->error .= $this->db->lasterror(); + $errorflag=-1; + } + } + if (! $error) { // Remove category @@ -1458,14 +1485,13 @@ class Contact extends CommonObject * @return float|int * @throws Exception */ - public function fetchRole() + public function fetchRoles() { - global $langs; $error= 0; $num=0; - $sql ="SELECT tc.rowid, tc.element, tc.source, tc.code, tc.libelle"; + $sql ="SELECT tc.rowid, tc.element, tc.source, tc.code, tc.libelle, sc.rowid as contactroleid"; $sql.=" FROM ".MAIN_DB_PREFIX."societe_contacts as sc "; $sql.=" INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql.=" ON tc.rowid = sc.fk_c_type_contact"; @@ -1482,11 +1508,13 @@ class Contact extends CommonObject if ($num > 0) { while ($obj = $this->db->fetch_object($resql)) { $transkey="TypeContact_".$obj->element."_".$obj->source."_".$obj->code; - $this->roles[$this->id]=array('id'=>$obj->rowid,'element'=>$obj->element,'source'=>$obj->source,'code'=>$obj->code,'label'=>($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle)); + $libelle_element = $langs->trans('ContactDefault_'.$obj->element); + $this->roles[$obj->contactroleid]=array('id'=>$obj->rowid,'element'=>$obj->element,'source'=>$obj->source,'code'=>$obj->code,'label'=>$libelle_element. ' - '.($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle)); } } } else { $error++; + $this->error=$this->db->lasterror(); $this->errors[]=$this->db->lasterror(); } @@ -1497,4 +1525,61 @@ class Contact extends CommonObject } } + /** + * Updates Roles + * + * @return float|int + * @throws Exception + */ + public function updateRoles() + { + global $conf; + + $error=0; + + $this->db->begin(); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_contacts WHERE fk_soc=".$this->socid; + + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); + $result = $this->db->query($sql); + if (!$result) { + $this->errors[]=$this->db->lasterror().' sql='.$sql; + $error++; + } else { + if (count($this->roles)>0) { + foreach ($this->roles as $keyRoles => $valRoles) { + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_contacts"; + $sql .= " (entity,"; + $sql .= "date_creation,"; + $sql .= "fk_soc,"; + $sql .= "fk_c_type_contact,"; + $sql .= "fk_socpeople) "; + $sql .= " VALUES (" . $conf->entity . ","; + $sql .= "'" . $this->db->idate(dol_now()) . "',"; + $sql .= $this->socid . ", "; + $sql .= $valRoles . " , " ; + $sql .= $this->id; + $sql .= ")"; + dol_syslog(get_class($this) . "::".__METHOD__, LOG_DEBUG); + + $result = $this->db->query($sql); + if (!$result) + { + $this->errors[]=$this->db->lasterror().' sql='.$sql; + $error++; + } + } + } + } + if (empty($error)) { + $this->db->commit(); + return 1; + } else { + $this->error=implode(' ', $this->errors); + $this->db->rollback(); + return $error*-1; + } + } + } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index b0db8b0affb..585d6db499d 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -84,6 +84,7 @@ $search_zip=GETPOST('search_zip', 'alpha'); $search_town=GETPOST('search_town', 'alpha'); $search_import_key=GETPOST("search_import_key", "alpha"); $search_country=GETPOST("search_country", 'intcomma'); +$search_roles=GETPOST("search_roles", 'array'); if ($search_status=='') $search_status=1; // always display active customer first @@ -242,6 +243,7 @@ if (empty($reshook)) $search_import_key=''; $toselect=''; $search_array_options=array(); + $search_roles=array(); } // Mass actions @@ -334,6 +336,9 @@ if (strlen($search_linkedin)) $sql.= natural_search('p.linkedin', $search_ if (strlen($search_email)) $sql.= natural_search('p.email', $search_email); if (strlen($search_zip)) $sql.= natural_search("p.zip", $search_zip); if (strlen($search_town)) $sql.= natural_search("p.town", $search_town); +if (count($search_roles)>0) { + $sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".implode(',', $search_roles)."))"; +} if ($search_no_email != '' && $search_no_email >= 0) $sql.= " AND p.no_email = ".$db->escape($search_no_email); if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status); @@ -438,6 +443,7 @@ if ($search_status != '') $param.='&search_status='.urlencode($search_status if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv); if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key); if ($optioncss != '') $param.='&optioncss='.$optioncss; +if (count($search_roles)>0) $param.=implode('&search_roles[]=', $search_roles); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -510,6 +516,10 @@ if (! empty($conf->categorie->enabled)) $moreforfilter.=$formother->select_categories(Categorie::TYPE_SUPPLIER, $search_categ_supplier, 'search_categ_supplier', 1); $moreforfilter.=''; } + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('Roles'). ': '; + $moreforfilter.=$form->showRoles("search_roles", $objecttmp, 'edit', $search_roles); + $moreforfilter.='
'; } if ($moreforfilter) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0eea968ecd2..716b615f503 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1226,9 +1226,6 @@ abstract class CommonObject // phpcs:enable global $langs; - if (empty($order)) $order='position'; - if ($order == 'position') $order.=',code'; - $tab = array(); $sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle, tc.position, tc.element"; $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc"; @@ -1262,11 +1259,11 @@ abstract class CommonObject { $obj = $this->db->fetch_object($resql); - $libelle_element = $langs->trans('ContactDefault_'.ucfirst($obj->element)); + $libelle_element = $langs->trans('ContactDefault_'.$obj->element); $transkey="TypeContact_".$this->element."_".$source."_".$obj->code; $libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle); if (empty($option)) $tab[$obj->rowid]=$libelle_element.' - '.$libelle_type; - else $tab[$obj->code]=$libelle_element.' - '.$libelle_type; + else $tab[$obj->rowid]=$libelle_element.' - '.$libelle_type; $i++; } return $tab; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5ee969a73a0..4eca1ef0f85 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6484,6 +6484,46 @@ class Form return 'ErrorBadValueForParameterRenderMode'; // Should not happened } + /** + * showContactRoles on view and edit mode + * + * @param string $htmlname Html component name and id + * @param Contact $contact Contact Obejct + * @param string $rendermode view, edit + * @param array $selected $key=>$val $val is selected Roles for input mode + * @return string String with contacts roles + */ + public function showRoles($htmlname = '', Contact $contact, $rendermode = 'view', $selected = array()) + { + if ($rendermode === 'view') { + $toprint = array(); + foreach ($contact->roles as $key => $val) { + $toprint[] = '
  • ' . $val['label'] . '
  • '; + } + return '
      ' . implode(' ', $toprint) . '
    '; + } + + if ($rendermode === 'edit') + { + $contactType=$contact->listeTypeContacts('external', '', 1); + + if (count($selected)>0) { + $newselected=array(); + foreach($selected as $key=>$val) { + if (is_array($val) && array_key_exists('id', $val) && in_array($val['id'], array_keys($contactType))) { + $newselected[]=$val['id']; + } else { + break; + } + } + if (count($newselected)>0) $selected=$newselected; + } + return $this->multiselectarray($htmlname, $contactType, $selected); + } + + return 'ErrorBadValueForParameterRenderMode'; // Should not happened + } + /** * Show linked object block. diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index cfc1fcfb30f..14b20bbe46b 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -869,7 +869,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if ($search_status=='') $search_status=1; // always display active customer first $search_name = GETPOST("search_name", 'alpha'); $search_addressphone = GETPOST("search_addressphone", 'alpha'); - $search_role = GETPOST("search_role", 'array'); + $search_roles = GETPOST("search_roles", 'array'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="t.lastname"; @@ -898,7 +898,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), - 'sc.role'=>array('label'=>"Role", 'checked'=>1, 'position'=>40), + 'sc.role'=>array('label'=>"Roles", 'checked'=>1, 'position'=>40), 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'), ); // Extra fields @@ -929,7 +929,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') { $search_status = ''; $search_name = ''; - $search_role = ''; + $search_roles = array(); $search_addressphone = ''; $search_array_options=array(); @@ -971,7 +971,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $param="socid=".urlencode($object->id); if ($search_status != '') $param.='&search_status='.urlencode($search_status); - if (count($search_role)>0) $param.=implode('&search_role[]=', $search_role); + if (count($search_roles)>0) $param.=implode('&search_roles[]=', $search_roles); if ($search_name != '') $param.='&search_name='.urlencode($search_name); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); // Add $param from extra fields @@ -982,14 +982,11 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $sql .= " t.civility as civility_id, t.address, t.zip, t.town"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)"; - if (count($search_role)>0) { - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_contacts as sc on (sc.fk_socpeople = t.rowid)"; - } $sql .= " WHERE t.fk_soc = ".$object->id; if ($search_status!='' && $search_status != '-1') $sql .= " AND t.statut = ".$db->escape($search_status); if ($search_name) $sql .= natural_search(array('t.lastname', 't.firstname'), $search_name); - if (count($search_role)>0) { - $sql .= ' AND sc.fk_c_type_contact IN ('.implode(',',$search_role).')'; + if (count($search_roles)>0) { + $sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".implode(',', $search_roles)."))"; } // Add where from extra fields $extrafieldsobjectkey=$contactstatic->table_element; @@ -1020,8 +1017,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if (in_array($key, array('lastname','name'))) print ''; elseif (in_array($key, array('statut'))) print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0, 1),'1'=>$contactstatic->LibStatut(1, 1)), $search_status); elseif (in_array($key, array('role'))) { - $contactType=$contactstatic->listeTypeContacts('external', '', 1); - print $form->multiselectarray('search_role', $contactType, $search_role); + print $form->showRoles("search_roles", $contactstatic, 'edit', $search_roles); } print ''; } @@ -1052,9 +1048,12 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; if ($key == 'status' || $key == 'statut') $align.=($align?' ':'').'center'; if ($key == 'role') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked']) || ! empty($arrayfields['sc.'.$key]['checked'])) { + if (! empty($arrayfields['t.'.$key]['checked'])) { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; } + if (! empty($arrayfields['sc.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'sc.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; + } } // Extra fields $extrafieldsobjectkey=$contactstatic->table_element; @@ -1101,7 +1100,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $contactstatic->setGenderFromCivility(); $contactstatic->fetch_optionals(); - $resultRole=$contactstatic->fetchRole(); + $resultRole=$contactstatic->fetchRoles(); if ($resultRole<0) { setEventMessages(null, $contactstatic->errors,'errors'); } @@ -1153,9 +1152,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if (! empty($arrayfields['sc.role']['checked'])) { print ''; } From b9e3ba25036f7ba54ac63fcaa60da593a4cdfe0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 22:13:57 +0200 Subject: [PATCH 292/982] Fix backtourl --- htdocs/ecm/dir_card.php | 13 ++++++++----- htdocs/ecm/file_card.php | 2 -- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index a279c228646..b6cb7dbfb7f 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -151,7 +151,10 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') if ($action == 'confirm_deletedir' && $confirm == 'yes') { $backtourl = DOL_URL_ROOT."/ecm/index.php"; - if ($module == 'medias') $backtourl = DOL_URL_ROOT."/website/index.php?file_manager=1"; + if ($module == 'medias') + { + $backtourl = DOL_URL_ROOT."/website/index.php?file_manager=1"; + } $deletedirrecursive = (GETPOST('deletedirrecursive', 'alpha') == 'on' ? 1 : 0); @@ -381,7 +384,7 @@ dol_banner_tab($object, '', $morehtml, 0, '', '', $morehtmlref); print '
    '; print '
    '; -print '
    '; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + if (($massactionbutton || $massaction) && $contextpage != 'poslist') // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { $selected=0; if (in_array($obj->id, $arrayofselected)) $selected=1; From 7b5c9818f7b25b623a68b472f7f79a3083d1898d Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 15:58:33 +0200 Subject: [PATCH 075/982] Fix context display with takepos societe/list.php --- htdocs/societe/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index daff9aec557..8f352a21b28 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -670,7 +670,7 @@ if ($moreforfilter) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields -if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); +if ($massactionbutton && $contextpage != 'poslist') $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); if (empty($arrayfields['customerorsupplier']['checked'])) print ''; @@ -1287,7 +1287,7 @@ while ($i < min($num, $limit)) // Action column print ''; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + if (($massactionbutton || $massaction) && $contextpage != 'poslist') // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { $selected=0; if (in_array($obj->rowid, $arrayofselected)) $selected=1; From dbcead47e1eaf8c972b0850704eafe7409341cd1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 16:05:21 +0200 Subject: [PATCH 076/982] Update list.php --- htdocs/societe/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index daff9aec557..ebf03cb2d3d 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -199,7 +199,7 @@ $arrayfields=array( 's.idprof5'=>array('label'=>"ProfId5Short", 'checked'=>$checkedprofid5), 's.idprof6'=>array('label'=>"ProfId6Short", 'checked'=>$checkedprofid6), 's.tva_intra'=>array('label'=>"VATIntraShort", 'checked'=>0), - 'customerorsupplier'=>array('label'=>'Nature', 'checked'=>1), + 'customerorsupplier'=>array('label'=>'Type', 'checked'=>1), 's.fk_prospectlevel'=>array('label'=>"ProspectLevelShort", 'checked'=>$checkprospectlevel), 's.fk_stcomm'=>array('label'=>"StatusProsp", 'checked'=>$checkstcomm), 's2.nom'=>array('label'=>'ParentCompany', 'checked'=>0), From 5d0dbea920d8f794df01f92cf8976498d77bb9a9 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 24 Aug 2019 16:44:06 +0200 Subject: [PATCH 077/982] Control errors before validate invoice in TakePOS --- htdocs/langs/en_US/cashdesk.lang | 2 ++ htdocs/takepos/invoice.php | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 628de17efcc..856cf1de0d2 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -72,3 +72,5 @@ BasicPhoneLayout=Use basic layout for phones SetupOfTerminalNotComplete=Setup of terminal %s is not complete DirectPayment=Direct payment DirectPaymentButton=Direct cash payment button +InvoiceIsAlreadyValidated=Invoice is already validated +NoLinesToBill=No lines to bill diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 17805a6b060..0176330db0a 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -161,7 +161,17 @@ if ($action == 'valid' && $user->rights->facture->creer) $invoice->update($user); } - if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1") + if ($invoice->statut != Facture::STATUS_DRAFT) + { + dol_syslog("Sale already validated"); + dol_htmloutput_errors($langs->trans("InvoiceIsAlreadyValidated", "TakePos"), null, 1); + } + else if (count($invoice->lines)==0) + { + dol_syslog("Sale without lines"); + dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1); + } + else if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1") { $invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]}); } From 07244f002b7c8e37f690fb20201b67106ffda0df Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 24 Aug 2019 18:11:47 +0200 Subject: [PATCH 078/982] else if to elseif --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 0176330db0a..c03ec826d6d 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -166,12 +166,12 @@ if ($action == 'valid' && $user->rights->facture->creer) dol_syslog("Sale already validated"); dol_htmloutput_errors($langs->trans("InvoiceIsAlreadyValidated", "TakePos"), null, 1); } - else if (count($invoice->lines)==0) + elseif (count($invoice->lines)==0) { dol_syslog("Sale without lines"); dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1); } - else if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1") + elseif (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1") { $invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]}); } From 4040693823c01ded9f86f065de5d659926ce37d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Aug 2019 18:12:20 +0200 Subject: [PATCH 079/982] FIX Use a SCA ready workflow with Stripe module --- htdocs/core/class/conf.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 3088d8a95ce..d64033d969d 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -569,6 +569,9 @@ class Conf // By default, we show state code in combo list if (! isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE=1; + // Use a SCA ready workflow with Stripe module + if (! isset($this->global->STRIPE_USE_NEW_CHECKOUT)) $this->global->STRIPE_USE_NEW_CHECKOUT=1; + // Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal" if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later. if (! empty($this->modules_parts['moduleforexternal'])) // Module part to include an external module into the MAIN_MODULES_FOR_EXTERNAL list From 6a906a6064b89cb7bf770ef9480f44a6a115c70c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Aug 2019 16:38:09 +0200 Subject: [PATCH 080/982] Rename module_part parameter into modulepart into document APIs --- htdocs/api/class/api_documents.class.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 48d6bf5b903..1b98ad5f2ec 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -56,7 +56,7 @@ class Documents extends DolibarrApi * Note that, this API is similar to using the wrapper link "documents.php" to download a file (used for * internal HTML links of documents into application), but with no need to have a session cookie (the token is used instead). * - * @param string $module_part Name of module or area concerned by file download ('facture', ...) + * @param string $modulepart Name of module or area concerned by file download ('facture', ...) * @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf) * @return array List of documents * @@ -67,11 +67,11 @@ class Documents extends DolibarrApi * * @url GET /download */ - public function index($module_part, $original_file = '') + public function index($modulepart, $original_file = '') { global $conf, $langs; - if (empty($module_part)) { + if (empty($modulepart)) { throw new RestException(400, 'bad value for parameter modulepart'); } if (empty($original_file)) { @@ -81,7 +81,7 @@ class Documents extends DolibarrApi //--- Finds and returns the document $entity=$conf->entity; - $check_access = dol_check_secure_access_document($module_part, $original_file, $entity, DolibarrApiAccess::$user, '', 'read'); + $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, DolibarrApiAccess::$user, '', 'read'); $accessallowed = $check_access['accessallowed']; $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; $original_file = $check_access['original_file']; @@ -98,6 +98,7 @@ class Documents extends DolibarrApi if (! file_exists($original_file_osencoded)) { + dol_syslog("Try to download not found file ".$original_file_osencoded, LOG_WARNING); throw new RestException(404, 'File not found'); } @@ -111,7 +112,7 @@ class Documents extends DolibarrApi * * Test sample 1: { "module_part": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }. * - * @param string $module_part Name of module or area concerned by file download ('invoice', 'order', ...). + * @param string $modulepart Name of module or area concerned by file download ('invoice', 'order', ...). * @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf). * @param string $doctemplate Set here the doc template to use for document generation (If not set, use the default template). * @param string $langcode Language code like 'en_US', 'fr_FR', 'es_ES', ... (If not set, use the default language). @@ -126,11 +127,11 @@ class Documents extends DolibarrApi * * @url PUT /builddoc */ - public function builddoc($module_part, $original_file = '', $doctemplate = '', $langcode = '') + public function builddoc($modulepart, $original_file = '', $doctemplate = '', $langcode = '') { global $conf, $langs; - if (empty($module_part)) { + if (empty($modulepart)) { throw new RestException(400, 'bad value for parameter modulepart'); } if (empty($original_file)) { @@ -147,7 +148,7 @@ class Documents extends DolibarrApi //--- Finds and returns the document $entity=$conf->entity; - $check_access = dol_check_secure_access_document($module_part, $original_file, $entity, DolibarrApiAccess::$user, '', 'write'); + $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, DolibarrApiAccess::$user, '', 'write'); $accessallowed = $check_access['accessallowed']; $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; $original_file = $check_access['original_file']; @@ -166,7 +167,7 @@ class Documents extends DolibarrApi $templateused=''; - if ($module_part == 'facture' || $module_part == 'invoice') + if ($modulepart == 'facture' || $modulepart == 'invoice') { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $this->invoice = new Facture($this->db); @@ -181,7 +182,7 @@ class Documents extends DolibarrApi throw new RestException(500, 'Error generating document'); } } - elseif ($module_part == 'commande' || $module_part == 'order') + elseif ($modulepart == 'commande' || $modulepart == 'order') { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $this->order = new Commande($this->db); @@ -195,7 +196,7 @@ class Documents extends DolibarrApi throw new RestException(500, 'Error generating document'); } } - elseif ($module_part == 'propal' || $module_part == 'proposal') + elseif ($modulepart == 'propal' || $modulepart == 'proposal') { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $this->propal = new Propal($this->db); From c8078f1195220c884b7f49e8ed9cdbdfd93fb648 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Aug 2019 16:39:15 +0200 Subject: [PATCH 081/982] Rename module_part parameter into modulepart into document APIs --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 62d791a670a..6ca4df10d38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ Following changes may create regressions for some external modules, but were nec * Properties ->libelle_incoterms were renamed into ->label_incoterms * Removed the method liste_array() of project class. It was not used by core code. * The function show_theme() hase been renamed into showSkins() +* Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency. ***** ChangeLog for 10.0.1 compared to 10.0.0 ***** From 6328585395b06519ba8a1b3c57cbbab015948db9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Aug 2019 16:40:21 +0200 Subject: [PATCH 082/982] Fix: the API_RESTRICT_ON_IP must be at lower level (also on explorer) --- htdocs/api/index.php | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/htdocs/api/index.php b/htdocs/api/index.php index c63a376e806..dd9ff7aadcb 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -24,6 +24,8 @@ * \file htdocs/api/index.php */ +use Luracast\Restler\Format\UploadFormat; + if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu @@ -117,6 +119,21 @@ $api->r->addAuthenticationClass('DolibarrApiAccess', ''); UploadFormat::$allowedMimeTypes = array('image/jpeg', 'image/png', 'text/plain', 'application/octet-stream'); +// Restrict API to some IPs +if (! empty($conf->global->API_RESTRICT_ON_IP)) +{ + $allowedip=explode(' ', $conf->global->API_RESTRICT_ON_IP); + $ipremote = getUserRemoteIP(); + if (! in_array($ipremote, $allowedip)) + { + dol_syslog('Remote ip is '.$ipremote.', not into list '.$conf->global->API_RESTRICT_ON_IP); + print 'APIs are not allowed from the IP '.$ipremote; + header('HTTP/1.1 503 API not allowed from your IP '.$ipremote); + //print $conf->global->API_RESTRICT_ON_IP; + exit(0); + } +} + // Call Explorer file for all APIs definitions (this part is slow) if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) @@ -136,6 +153,7 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || { while (($file = readdir($handle))!==false) { + $regmod=array(); if (is_readable($dir.$file) && preg_match("/^mod(.*)\.class\.php$/i", $file, $regmod)) { $module = strtolower($regmod[1]); @@ -165,6 +183,7 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || { if ($file_searched == 'api_access.class.php') continue; + $regapi = array(); if (is_readable($dir_part.$file_searched) && preg_match("/^api_(.*)\.class\.php$/i", $file_searched, $regapi)) { $classname = ucwords($regapi[1]); @@ -204,23 +223,9 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || } // Call one APIs or one definition of an API +$regbis = array(); if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' && $reg[2] != '/resources.json' && preg_match('/^\/(swagger|resources)\.json\/(.+)$/', $reg[2], $regbis) && $regbis[2] != 'root'))) { - // Restrict API to some IPs - if (! empty($conf->global->API_RESTRICT_ON_IP)) - { - $allowedip=explode(' ', $conf->global->API_RESTRICT_ON_IP); - $ipremote = getUserRemoteIP(); - if (! in_array($ipremote, $allowedip)) - { - dol_syslog('Remote ip is '.$ipremote.', not into list '.$conf->global->API_RESTRICT_ON_IP); - print 'API not allowed from the IP '.$ipremote; - header('HTTP/1.1 503 API not allowed from your IP '.$ipremote); - //print $conf->global->API_RESTRICT_ON_IP; - exit(0); - } - } - $module = $reg[1]; if ($module == 'explorer') // If we call page to explore details of a service { @@ -268,7 +273,6 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' && $api->r->addAPIClass($classname); } -// TODO If not found, redirect to explorer //var_dump($api->r->apiVersionMap); //exit; From 69b2d03c470fc145ad92c435520629a7a8afbfad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Aug 2019 16:41:59 +0200 Subject: [PATCH 083/982] FIX Api of documents work with value 'thirdparty' --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index a852c78d08b..5861ad07a72 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2452,7 +2452,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } // Wrapping for third parties - elseif (($modulepart == 'company' || $modulepart == 'societe') && !empty($conf->societe->dir_output)) + elseif (($modulepart == 'company' || $modulepart == 'societe' || $modulepart == 'thirdparty') && !empty($conf->societe->dir_output)) { if (empty($entity) || empty($conf->societe->multidir_output[$entity])) return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); if ($fuser->rights->societe->{$lire} || preg_match('/^specimen/i', $original_file)) From 60c3cefc53040eaaf3f311a73b4bc5db03cf7aaa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Aug 2019 16:41:59 +0200 Subject: [PATCH 084/982] FIX Api of documents work with value 'thirdparty' --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 1012b825254..c6a5cb14426 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2445,7 +2445,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } // Wrapping for third parties - elseif (($modulepart == 'company' || $modulepart == 'societe') && !empty($conf->societe->dir_output)) + elseif (($modulepart == 'company' || $modulepart == 'societe' || $modulepart == 'thirdparty') && !empty($conf->societe->dir_output)) { if (empty($entity) || empty($conf->societe->multidir_output[$entity])) return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); if ($fuser->rights->societe->{$lire} || preg_match('/^specimen/i', $original_file)) From 7cb68d6438530e80f8aa6270b34baeb6fb016b85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Aug 2019 18:02:10 +0200 Subject: [PATCH 085/982] NEW Default for Stripe is STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION --- htdocs/core/class/conf.class.php | 4 ++-- htdocs/public/payment/newpayment.php | 32 +++++++++++++++++----------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index d64033d969d..f94c95ff246 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -569,8 +569,8 @@ class Conf // By default, we show state code in combo list if (! isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE=1; - // Use a SCA ready workflow with Stripe module - if (! isset($this->global->STRIPE_USE_NEW_CHECKOUT)) $this->global->STRIPE_USE_NEW_CHECKOUT=1; + // Use a SCA ready workflow with Stripe module (STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION by default if nothing defined) + if (! isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION=1; // Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal" if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later. diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index daf77674190..db37b15345b 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1834,7 +1834,8 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment print '
    '; - print '
    '; + print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; @@ -1852,7 +1853,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment print ''; print ''; - if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) || ! empty($conf->global->STRIPE_USE_NEW_CHECKOUT)) + if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) || ! empty($conf->global->STRIPE_USE_NEW_CHECKOUT)) // Use a SCA ready method { require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; @@ -1876,8 +1877,8 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment } } - if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) || ! empty($paymentintent)) - { + //if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) || ! empty($paymentintent)) + //{ print '
    '; @@ -1914,7 +1915,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment print '
    '; - } + //} if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) { @@ -1942,6 +1943,8 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment { print ''; print ''."\n"; + $urllogofull = 'http://home.destailleur.fr:805/dolibarr_dev/htdocs/viewimage.php?modulepart=mycompany&entity=1&file=logos%2Fthumbs%2Ffbm+logo_small.png'; + print ''."\n"; // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code. print ''; */ - print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'">'; + print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'">'; } print ''; From c0681770276d5a12b383766ae000f483d746428a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 16:39:56 +0200 Subject: [PATCH 287/982] Work on search on global site files --- htdocs/core/lib/website.lib.php | 78 ++++++++++++++++++++++++++------- htdocs/langs/en_US/website.lang | 1 + htdocs/website/index.php | 2 + 3 files changed, 65 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index c1f3c6f9809..af0114c9c97 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -636,10 +636,11 @@ function getStructuredData($type, $data = array()) } /** - * Return list of containers object that match a criteria + * Return list of containers object that match a criteria. + * WARNING: This function can be used by websites. * * @param string $type Type of container to search into (Example: 'page') - * @param string $algo Algorithm used for search (Example: 'meta' is searching into meta information like title and description, 'metacontent') + * @param string $algo Algorithm used for search (Example: 'meta' is searching into meta information like title and description, 'content', 'sitefiles', or any combination, ...) * @param string $searchstring Search string * @param int $max Max number of answers * @return string HTML content @@ -674,20 +675,21 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25) } $searchdone = 0; + $found = 0; - if (! $error && in_array($algo, array('meta', 'metacontent', 'content'))) + if (! $error && (empty($max) || ($found < $max)) && (preg_match('/meta/', $algo) || preg_match('/content/', $algo))) { $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'website_page'; $sql.= " WHERE fk_website = ".$website->id; if ($type) $sql.= " AND type_container = '".$db->escape($type)."'"; $sql.= " AND ("; $searchalgo = ''; - if ($algo == 'meta' || $algo == 'metacontent') + if (preg_match('/meta/', $algo)) { $searchalgo.= ($searchalgo?' OR ':'')."title LIKE '%".$db->escape($searchstring)."%' OR description LIKE '%".$db->escape($searchstring)."%'"; $searchalgo.= ($searchalgo?' OR ':'')."keywords LIKE '".$db->escape($searchstring).",%' OR keywords LIKE '% ".$db->escape($searchstring)."%'"; // TODO Use a better way to scan keywords } - if ($algo == 'metacontent' || $algo == 'content') + if (preg_match('/content/', $algo)) { $searchalgo.= ($searchalgo?' OR ':'')."content LIKE '%".$db->escape($searchstring)."%'"; } @@ -706,16 +708,10 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25) $tmpwebsitepage = new WebsitePage($db); $tmpwebsitepage->fetch($obj->rowid); if ($tmpwebsitepage->id > 0) $arrayresult['list'][]=$tmpwebsitepage; + $found++; } $i++; } - - $arrayresult['code']='OK'; - if (empty($arrayresult['list'])) - { - $arrayresult['code']='KO'; - $arrayresult['message']=$weblangs->trans("NoRecordFound"); - } } else { @@ -727,11 +723,61 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25) $searchdone = 1; } - if (! $searchdone) + if (! $error && (empty($max) || ($found < $max)) && (preg_match('/sitefiles/', $algo))) { - $error++; - $arrayresult['code']='KO'; - $arrayresult['message']='No supported algorithm found'; + $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'website'; + $sql.= " WHERE rowid = ".$website->id; + $sql.= " AND ("; + $searchalgo = ''; + // TODO + $searchalgo.= '...'; + + $sql.=$searchalgo; + $sql.= ")"; + $sql.= $db->plimit($max); + + $resql = $db->query($sql); + if ($resql) + { + $i = 0; + while (($obj = $db->fetch_object($resql)) && ($i < $max || $max == 0)) + { + if ($obj->rowid > 0) + { + $tmpwebsitepage = new WebsitePage($db); + $tmpwebsitepage->fetch($obj->rowid); + if ($tmpwebsitepage->id > 0) $arrayresult['list'][]=$tmpwebsitepage; + } + $i++; + } + } + else + { + $error++; + $arrayresult['code']=$db->lasterrno(); + $arrayresult['message']=$db->lasterror(); + } + + $searchdone = 1; + } + + if (! $error) + { + if ($searchdone) + { + $arrayresult['code']='OK'; + if (empty($arrayresult['list'])) + { + $arrayresult['code']='KO'; + $arrayresult['message']=$weblangs->trans("NoRecordFound"); + } + } + else + { + $error++; + $arrayresult['code']='KO'; + $arrayresult['message']='No supported algorithm found'; + } } return $arrayresult; diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 0d6945a17e5..83e71073984 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -116,3 +116,4 @@ Dynamiccontent=Sample of a page with dynamic content ImportSite=Import site EditInLineOnOff=Mode 'Edit inline' is %s ShowSubContainersOnOff=Mode to execute 'dynamic content' is %s +GlobalCSSorJS=Global CSS/JS/Header file of web site \ No newline at end of file diff --git a/htdocs/website/index.php b/htdocs/website/index.php index e01017e88ac..f98024a726d 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3216,6 +3216,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print '
    '; print ' '.$langs->trans("Content"); print ' '.$langs->trans("Title").' | '.$langs->trans("Description").' | '.$langs->trans("Keywords"); + print ' '.$langs->trans("GlobalCSSorJS"); print '
    '; print ''; @@ -3239,6 +3240,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') $algo = ''; if (GETPOST('optionmeta')) $algo.='meta'; if (GETPOST('optioncontent')) $algo.='content'; + if (GETPOST('optionsitefiles')) $algo.='sitefiles'; $listofpages = getPagesFromSearchCriterias('', $algo, GETPOST('searchstring', 'none'), 1000); From b45d3ea1a0f8f4033e9c02bca784695c8d3aeef3 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 2 Sep 2019 17:38:59 +0200 Subject: [PATCH 288/982] FIX #11804 --- htdocs/ticket/list.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 2a4195cb07b..26b9756006c 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2018 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2018 Regis Houssin + * Copyright (C) 2019 Juanjo Menent * * 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 @@ -210,6 +211,11 @@ $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; +if ($socid > 0) +{ + $sql.= " AND t.fk_soc = ".$socid; +} + foreach($search as $key => $val) { if ($key == 'fk_statut') From a96742ee9b30acb63738592c93f37d301d279bb5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 18:43:22 +0200 Subject: [PATCH 289/982] Can search into global site files. Support of cancel to previous page --- htdocs/core/lib/website.lib.php | 54 ++++++------- htdocs/website/index.php | 129 +++++++++++++++++++++++--------- 2 files changed, 123 insertions(+), 60 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index af0114c9c97..60016b2f2e9 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -725,37 +725,39 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25) if (! $error && (empty($max) || ($found < $max)) && (preg_match('/sitefiles/', $algo))) { - $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'website'; - $sql.= " WHERE rowid = ".$website->id; - $sql.= " AND ("; - $searchalgo = ''; - // TODO - $searchalgo.= '...'; + global $dolibarr_main_data_root; - $sql.=$searchalgo; - $sql.= ")"; - $sql.= $db->plimit($max); + $pathofwebsite=$dolibarr_main_data_root.'/website/'.$website->ref; + $filehtmlheader=$pathofwebsite.'/htmlheader.html'; + $filecss=$pathofwebsite.'/styles.css.php'; + $filejs=$pathofwebsite.'/javascript.js.php'; + $filerobot=$pathofwebsite.'/robots.txt'; + $filehtaccess=$pathofwebsite.'/.htaccess'; + $filemanifestjson=$pathofwebsite.'/manifest.json.php'; + $filereadme=$pathofwebsite.'/README.md'; - $resql = $db->query($sql); - if ($resql) + $filecontent = file_get_contents($filehtmlheader); + if ((empty($max) || ($found < $max)) && preg_match('/'.preg_quote($searchstring, '/').'/', $filecontent)) { - $i = 0; - while (($obj = $db->fetch_object($resql)) && ($i < $max || $max == 0)) - { - if ($obj->rowid > 0) - { - $tmpwebsitepage = new WebsitePage($db); - $tmpwebsitepage->fetch($obj->rowid); - if ($tmpwebsitepage->id > 0) $arrayresult['list'][]=$tmpwebsitepage; - } - $i++; - } + $arrayresult['list'][]=array('type'=>'website_htmlheadercontent'); } - else + + $filecontent = file_get_contents($filecss); + if ((empty($max) || ($found < $max)) && preg_match('/'.preg_quote($searchstring, '/').'/', $filecontent)) { - $error++; - $arrayresult['code']=$db->lasterrno(); - $arrayresult['message']=$db->lasterror(); + $arrayresult['list'][]=array('type'=>'website_csscontent'); + } + + $filecontent = file_get_contents($filejs); + if ((empty($max) || ($found < $max)) && preg_match('/'.preg_quote($searchstring, '/').'/', $filecontent)) + { + $arrayresult['list'][]=array('type'=>'website_jscontent'); + } + + $filerobot = file_get_contents($filerobot); + if ((empty($max) || ($found < $max)) && preg_match('/'.preg_quote($searchstring, '/').'/', $filecontent)) + { + $arrayresult['list'][]=array('type'=>'website_robotcontent'); } $searchdone = 1; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f98024a726d..1a2dc531dd1 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -53,6 +53,9 @@ $pageref=GETPOST('pageref', 'aZ09'); $action=GETPOST('action', 'aZ09'); $confirm=GETPOST('confirm', 'alpha'); $cancel=GETPOST('cancel', 'alpha'); +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'bomlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $type_container=GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha'); @@ -270,9 +273,21 @@ if (GETPOST('refreshsite', 'alpha') || GETPOST('refreshsite.x', 'alpha') || GETP } if (GETPOST('refreshpage', 'alpha') && ! in_array($action, array('updatecss'))) $action='preview'; +// Cancel +if ($cancel) +{ + $action = 'preview'; + if ($backtopage) + { + header("Location: ".$backtopage); + exit; + } +} -$backtopage=$_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid.(GETPOST('section_dir', 'alpha')?'§ion_dir='.urlencode(GETPOST('section_dir', 'alpha')):''); // used after a confirm_deletefile into actions_linkedfiles.inc.php +$savbacktopage = $backtopage; +$backtopage = $_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid.(GETPOST('section_dir', 'alpha')?'§ion_dir='.urlencode(GETPOST('section_dir', 'alpha')):''); // used after a confirm_deletefile into actions_linkedfiles.inc.php include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; +$backtopage = $savbacktopage; if ($action == 'renamefile') $action='file_manager'; // After actions_linkedfiles, if action were renamefile, we set it to 'file_manager' @@ -984,7 +999,8 @@ if ($action == 'delete') // Update css if ($action == 'updatecss') { - if (GETPOST('refreshsite', 'alpha') || GETPOST('refreshpage', 'alpha')) // If we tried to reload another site/page, we stay on editcss mode. + // If we tried to reload another site/page, we stay on editcss mode. + if (GETPOST('refreshsite') || GETPOST('refreshsite_x') || GETPOST('refreshsite.x') || GETPOST('refreshpage') || GETPOST('refreshpage_x') || GETPOST('refreshpage.x')) { $action='editcss'; } @@ -1221,6 +1237,12 @@ if ($action == 'updatecss') } $action='preview'; + + if ($backtopage) + { + header("Location: ".$backtopage); + exit; + } } } } @@ -1861,6 +1883,7 @@ llxHeader($moreheadcss.$moreheadjs, $langs->trans("WebsiteSetup"), $help_url, '' print "\n"; print ''; print ''; +print ''; if ($action == 'createsite') { @@ -2081,7 +2104,7 @@ if (! GETPOST('hide_websitemenu')) { if (preg_match('/^create/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print ''; if (preg_match('/^edit/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print ''; - if ($action != 'preview') print ''; + if ($action != 'preview') print ''; } print ''; @@ -2500,7 +2523,8 @@ if ($action == 'editcss') print '
    '; print '
    '; - if (GETPOST('editcss', 'alpha') || GETPOST('refreshpage', 'alpha')) + + if (! GETPOSTISSET('WEBSITE_CSS_INLINE')) { $csscontent = @file_get_contents($filecss); // Clean the php css file to remove php code and get only css part @@ -2508,11 +2532,11 @@ if ($action == 'editcss') } else { - $csscontent = GETPOST('WEBSITE_CSS_INLINE'); + $csscontent = GETPOST('WEBSITE_CSS_INLINE', 'none'); } if (! trim($csscontent)) $csscontent='/* CSS content (all pages) */'."\n"."body.bodywebsite { margin: 0; font-family: 'Open Sans', sans-serif; }\n.bodywebsite h1 { margin-top: 0; margin-bottom: 0; padding: 10px;}"; - if (GETPOST('editcss', 'alpha') || GETPOST('refreshpage', 'alpha')) + if (! GETPOSTISSET('WEBSITE_JS_INLINE')) { $jscontent = @file_get_contents($filejs); // Clean the php js file to remove php code and get only js part @@ -2520,11 +2544,11 @@ if ($action == 'editcss') } else { - $jscontent = GETPOST('WEBSITE_JS_INLINE'); + $jscontent = GETPOST('WEBSITE_JS_INLINE', 'none'); } if (! trim($jscontent)) $jscontent='/* JS content (all pages) */'."\n"; - if (GETPOST('editcss', 'alpha') || GETPOST('refreshpage', 'alpha')) + if (! GETPOSTISSET('WEBSITE_HTML_HEADER')) { $htmlheadercontent = @file_get_contents($filehtmlheader); // Clean the php htmlheader file to remove php code and get only html part @@ -2532,7 +2556,7 @@ if ($action == 'editcss') } else { - $htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER'); + $htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none'); } if (! trim($htmlheadercontent)) { @@ -2547,7 +2571,7 @@ if ($action == 'editcss') $htmlheadercontent=''."\n".trim($htmlheadercontent)."\n".''; } - if (GETPOST('editcss', 'alpha') || GETPOST('refreshpage', 'alpha')) + if (! GETPOSTISSET('WEBSITE_ROBOT')) { $robotcontent = @file_get_contents($filerobot); // Clean the php htmlheader file to remove php code and get only html part @@ -2555,7 +2579,7 @@ if ($action == 'editcss') } else { - $robotcontent = GETPOST('WEBSITE_ROBOT'); + $robotcontent = GETPOST('WEBSITE_ROBOT', 'nothtml'); } if (! trim($robotcontent)) { @@ -2565,7 +2589,7 @@ if ($action == 'editcss') $robotcontent.="Disallow: /administrator/\n"; } - if (GETPOST('editcss', 'alpha') || GETPOST('refreshpage', 'alpha')) + if (! GETPOSTISSET('WEBSITE_HTACCESS')) { $htaccesscontent = @file_get_contents($filehtaccess); // Clean the php htaccesscontent file to remove php code and get only html part @@ -2573,7 +2597,7 @@ if ($action == 'editcss') } else { - $htaccesscontent = GETPOST('WEBSITE_HTACCESS'); + $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); } if (! trim($htaccesscontent)) { @@ -2582,7 +2606,7 @@ if ($action == 'editcss') } - if (GETPOST('editcss', 'alpha') || GETPOST('refreshpage', 'alpha')) + if (! GETPOSTISSET('WEBSITE_MANIFEST_JSON')) { $manifestjsoncontent = @file_get_contents($filemanifestjson); // Clean the manifestjson file to remove php code and get only html part @@ -2590,14 +2614,14 @@ if ($action == 'editcss') } else { - $manifestjsoncontent = GETPOST('WEBSITE_MANIFEST_JSON'); + $manifestjsoncontent = GETPOST('WEBSITE_MANIFEST_JSON', 'none'); } if (! trim($manifestjsoncontent)) { //$manifestjsoncontent.=""; } - if (GETPOST('editcss', 'alpha') || GETPOST('refreshpage', 'alpha')) + if (! GETPOSTISSET('WEBSITE_README')) { $readmecontent = @file_get_contents($filereadme); // Clean the readme file to remove php code and get only html part @@ -2605,7 +2629,7 @@ if ($action == 'editcss') } else { - $readmecontent = GETPOST('WEBSITE_README'); + $readmecontent = GETPOST('WEBSITE_README', 'none'); } if (! trim($readmecontent)) { @@ -3196,6 +3220,8 @@ print "\n"; if ($action == 'replacesite' || $action == 'replacesiteconfirm') { + $searchkey = GETPOST('searchstring', 'none'); + print '
    '; print ''; print ''; @@ -3225,7 +3251,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print $langs->trans("SearchString"); print '
    '; print '
    '; - print ''; + print ''; print '
    '; print ''; @@ -3242,17 +3268,65 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') if (GETPOST('optioncontent')) $algo.='content'; if (GETPOST('optionsitefiles')) $algo.='sitefiles'; - $listofpages = getPagesFromSearchCriterias('', $algo, GETPOST('searchstring', 'none'), 1000); + $listofpages = getPagesFromSearchCriterias('', $algo, $searchkey, 1000); print '
    '; print '
    '; if ($listofpages['code'] == 'OK') { - foreach($listofpages['list'] as $websitepagefound) + print '
    '; + + if ($action == 'replacesiteconfirm') { - print '
    '.$websitepagefound->title.' - '.$websitepagefound->description.'
    '; + print '
    '; + print '
    '; + print $langs->trans("ReplaceString"); + print '
    '; + print '
    '; + print ''; + print ''; + print '
    '; + print '
    '; + print '
    '; } + + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + foreach($listofpages['list'] as $answerrecord) + { + if (get_class($answerrecord) == 'WebsitePage') + { + print ''; + print ''; + print ''; + print ''; + print ''; + } + else + { + print ''; + print ''; + print ''; + print ''; + print ''; + } + } + print '
    '.$langs->trans("Type").''.$langs->trans("Link").''.$langs->trans("Description").'
    '.$langs->trans("Container").''; + print ''.$answerrecord->title.''; + print ''.$answerrecord->description; + print '
    '.$answerrecord['type'].''; + $backtopageurl = $_SERVER["PHP_SELF"].'?action=replacesiteconfirm&searchstring='.urlencode($searchkey).'&optioncontent='.GETPOST('optioncontent','az09').'&optionmeta='.GETPOST('optionmeta','az09').'&optionsitefiles='.GETPOST('optionsitefiles','az09'); + print 'ref.'&backtopage='.urlencode($backtopageurl).'">'.$langs->trans("EditCss").''; + print ''; + print '
    '; + print '
    '; } else { @@ -3260,19 +3334,6 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') } } - if ($action == 'replacesiteconfirm') - { - print '
    '; - print '
    '; - print $langs->trans("ReplaceString"); - print '
    '; - print '
    '; - print ''; - print ''; - print '
    '; - print '
    '; - } - print ''; } From f9df175efc0cc5e82c27de3e98507b1eda95de75 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 2 Sep 2019 21:26:44 +0200 Subject: [PATCH 290/982] FIX takepos layout clear or focus search fix focus for compatibility with barcode scanner --- htdocs/takepos/takepos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index b7061c0e135..70add232ed6 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -149,7 +149,7 @@ if(localStorage.hasKeyboard) { function ClearSearch() { console.log("ClearSearch"); $("#search").val(''); - browser->layer == 'classic') { ?> + browser->layout == 'classic') { ?> setFocusOnSearchField(); } From d811de4da2e7028d4ffd4150532dcd95ffeb5548 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 2 Sep 2019 22:01:48 +0200 Subject: [PATCH 291/982] let only triggers part --- htdocs/contact/card.php | 28 ++++++- htdocs/contact/class/contact.class.php | 93 +++++++++++++++++++++++- htdocs/contact/list.php | 10 +++ htdocs/core/class/commonobject.class.php | 7 +- htdocs/core/class/html.form.class.php | 40 ++++++++++ htdocs/core/lib/company.lib.php | 29 ++++---- 6 files changed, 179 insertions(+), 28 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 76d0e3911b5..20a61ec4e3e 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -371,6 +371,7 @@ if (empty($reshook)) $object->priv = GETPOST("priv", 'int'); $object->note_public = GETPOST("note_public", 'none'); $object->note_private = GETPOST("note_private", 'none'); + $object->roles = GETPOST("roles", 'array'); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $object); @@ -474,9 +475,6 @@ else // Si edition contact deja existant $object = new Contact($db); $res=$object->fetch($id, $user); - if ($res < 0) { dol_print_error($db, $object->error); exit; } - $res=$object->fetch_optionals(); - if ($res < 0) { dol_print_error($db, $object->error); exit; } // Show tabs $head = contact_prepare_head($object); @@ -724,6 +722,15 @@ else print "
    ' . $langs->trans("Role") . ''; + $contactType = $object->listeTypeContacts('external', '', 1); + print $form->multiselectarray('roles', $contactType); + print '
    ' . $langs->trans("Role") . ''; + print $form->showRoles("roles", $object, 'edit' ,$object->roles); + print '
    ' . $langs->trans("Roles") . ''; + print $form->showRoles("roles", $object, 'view'); + print '
    '; - foreach($contactstatic->roles as $key=>$val) { - print '
      '.implode(' ', $val['label']).'
    '; - } + print $form->showRoles("roles", $contactstatic, 'view'); print '
    '; +print '
    '; /*print ''; print ''; print ''; print ''; - $texte.= ''; + $texte.= ''; $texte.= '
    '.$langs->trans("Ref").''; print img_picto('','object_dir').' '.$langs->trans("ECMRoot").' -> '; print $s; @@ -484,7 +487,7 @@ if ($action != 'edit' && $action != 'delete') //{ if ($permtoadd) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { @@ -504,7 +507,7 @@ if ($action != 'edit' && $action != 'delete') // Confirm remove file if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST("section", 'alpha').'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST("section", 'alpha').'&urlfile='.urlencode($_GET["urlfile"]).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); } // Confirm remove file @@ -521,7 +524,7 @@ if ($action == 'delete_dir') ); } - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST('section', 'alpha').($module?'&module='.$module:''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $relativepathwithoutslash), 'confirm_deletedir', $formquestion, 1, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST('section', 'alpha').($module?'&module='.$module:'').($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $relativepathwithoutslash), 'confirm_deletedir', $formquestion, 1, 1); } diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 4eebb2d36b3..bbf210f631e 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -400,8 +400,6 @@ if ($action != 'edit') if ($user->rights->ecm->setup) { print ''.$langs->trans('Edit').''; - - //print ''.$langs->trans('Cancel').''; } /* if ($user->rights->ecm->setup) From f945ec57718808bb974efe6893e9ac88aec53720 Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Mon, 2 Sep 2019 21:18:57 +0100 Subject: [PATCH 293/982] fix: convert posted price formatted values to numeric --- htdocs/product/fournisseurs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 587d494a51f..cb56ff63cfc 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -196,7 +196,7 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Supplier")), null, 'errors'); } - if ($_POST["price"] < 0 || $_POST["price"] == '') + if (price2num($_POST["price"]) < 0 || $_POST["price"] == '') { if ($price_expression === '') // Return error of missing price only if price_expression not set { @@ -215,12 +215,12 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Currency")), null, 'errors'); } - if ($_POST["multicurrency_tx"] <= 0 || $_POST["multicurrency_tx"] == '') { + if (price2num($_POST["multicurrency_tx"]) <= 0 || $_POST["multicurrency_tx"] == '') { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CurrencyRate")), null, 'errors'); } - if ($_POST["multicurrency_price"] < 0 || $_POST["multicurrency_price"] == '') { + if (price2num($_POST["multicurrency_price"]) < 0 || $_POST["multicurrency_price"] == '') { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PriceCurrency")), null, 'errors'); From a126b1e538860368e98d53e867483744009ba42f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 22:25:44 +0200 Subject: [PATCH 294/982] FIX Add char $ and ; in sanitizing of filenames. --- htdocs/core/lib/functions.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5540feadd14..3d7c9ad0ae2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -796,8 +796,10 @@ function dol_size($size, $type = '') */ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) { - // List of special chars for filenames are defined on page https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - $filesystem_forbidden_chars = array('<', '>', '/', '\\', '?', '*', '|', '"', ':', '°'); + // List of special chars for filenames in windows are defined on page https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + // Char '>' '<' '|' '$' and ';' are special chars for shells. + // Char '/' and '\' are file delimiters. + $filesystem_forbidden_chars = array('<', '>', '/', '\\', '?', '*', '|', '"', ':', '°', '$', ';'); return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars); } From 6c96478040bdaf935325290c0e42abd0eb63af63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 22:57:55 +0200 Subject: [PATCH 295/982] Removed deprecated code --- htdocs/comm/action/class/actioncomm.class.php | 11 +++-------- .../interface_50_modAgenda_ActionsAuto.class.php | 2 -- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 07db3b5a5d8..2caff8d242c 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -251,9 +251,6 @@ class ActionComm extends CommonObject public function __construct(DoliDB $db) { $this->db = $db; - - $this->societe = new stdClass(); // deprecated - $this->contact = new stdClass(); // deprecated } /** @@ -307,8 +304,6 @@ class ActionComm extends CommonObject $this->userassigned[$tmpid]=array('id'=>$tmpid, 'transparency'=>$this->transparency); } - //if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated - $userownerid=$this->userownerid; $userdoneid=$this->userdoneid; @@ -678,7 +673,7 @@ class ActionComm extends CommonObject $this->contactid = $obj->fk_contact; // To have fetch_contact method working $this->fk_project = $obj->fk_project; // To have fetch_project method working - $this->societe->id = $obj->fk_soc; // deprecated + //$this->societe->id = $obj->fk_soc; // deprecated //$this->contact->id = $obj->fk_contact; // deprecated $this->fk_element = $obj->elementid; @@ -889,8 +884,8 @@ class ActionComm extends CommonObject return -1; } - $socid=($this->socid?$this->socid:((isset($this->societe->id) && $this->societe->id > 0) ? $this->societe->id : 0)); - $contactid=($this->contactid?$this->contactid:0); + $socid=(($this->socid > 0)?$this->socid:0); + $contactid=(($this->contactid > 0)?$this->contactid:0); $userownerid=($this->userownerid?$this->userownerid:0); $userdoneid=($this->userdoneid?$this->userdoneid:0); diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 1ffbb6d9c52..0c26718f529 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -899,8 +899,6 @@ class InterfaceActionsAuto extends DolibarrTriggers $actioncomm->durationp = 0; $actioncomm->punctual = 1; $actioncomm->percentage = -1; // Not applicable - $actioncomm->societe = $societeforaction; - $actioncomm->contact = $contactforaction; $actioncomm->socid = $societeforaction->id; $actioncomm->contactid = $contactforaction->id; $actioncomm->authorid = $user->id; // User saving action From 443f16bddfc60a3aea825389fc17f167e7eddac5 Mon Sep 17 00:00:00 2001 From: Tim Otte Date: Tue, 3 Sep 2019 10:36:00 +0200 Subject: [PATCH 296/982] Removed debug output --- htdocs/core/modules/modFournisseur.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index fb108fb83ba..0553fe3a1fa 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -641,8 +641,6 @@ class modFournisseur extends DolibarrModules $dirodt=DOL_DATA_ROOT.'/doctemplates/supplier_orders'; $dest=$dirodt.'/template_supplier_order.odt'; - file_put_contents("test.txt", var_export($dest, true)); - if (file_exists($src) && ! file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; From 0f02a621ba0860d495abe3e937da3fef32ec596c Mon Sep 17 00:00:00 2001 From: Tim Otte Date: Tue, 3 Sep 2019 10:39:11 +0200 Subject: [PATCH 297/982] Seriously? One newline failed the stickler ci test? --- .../pdf/doc_generic_supplier_order_odt.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php index 08711154819..d9e9112ec54 100644 --- a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php @@ -514,4 +514,4 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders return -1; } -} \ No newline at end of file +} From c63a08b71bc5fdb07b286942856295523da4f383 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Tue, 3 Sep 2019 10:39:40 +0200 Subject: [PATCH 298/982] FIX: display a link to cron/list.php instead of just instructions on how to get there. Note: will have no impact until translations are updated; French & English updates provided --- htdocs/cron/admin/cron.php | 2 +- htdocs/langs/en_US/cron.lang | 2 +- htdocs/langs/fr_FR/cron.lang | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index 729772bcf7e..75bb49399f8 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -119,7 +119,7 @@ print ''; print '

    '; -print $langs->trans("UseMenuModuleToolsToAddCronJobs").'
    '; +print $langs->trans("UseMenuModuleToolsToAddCronJobs", dol_buildpath('/cron/list.php?leftmenu=admintools', 1)).'
    '; if (! empty($conf->global->CRON_WARNING_DELAY_HOURS)) print info_admin($langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS)); print '

    '; diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 704b852e138..48036a66093 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -76,7 +76,7 @@ CronType_method=Call method of a PHP Class CronType_command=Shell command CronCannotLoadClass=Cannot load class file %s (to use class %s) CronCannotLoadObject=Class file %s was loaded, but object %s was not found into it -UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Admin tools - Scheduled jobs" to see and edit scheduled jobs. +UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Admin tools - Scheduled jobs" to see and edit scheduled jobs. JobDisabled=Job disabled MakeLocalDatabaseDumpShort=Local database backup MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index 5e50c173fe7..5addea1d31b 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -76,7 +76,7 @@ CronType_method=Appelle d'une méthode d'une classe Dolibarr CronType_command=Commande terminal CronCannotLoadClass=Impossible de charger le fichier %s (pour charger l'objet %s) CronCannotLoadObject=Le fichier de classe %s a été chargé, mais l'objet %s n'a pas été trouvé dedans -UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmées et les modifier. +UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmées et les modifier. JobDisabled=Travail désactivé MakeLocalDatabaseDumpShort=Sauvegarde locale de base MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql', 'pgsql', 'auto'), 1, 'auto' ou nom du fichier à générer, nb de fichiers de sauvegarde à garder From f7430565725dbbd80ddc2bb8cc903fe96ad8639a Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 3 Sep 2019 11:15:35 +0200 Subject: [PATCH 299/982] Add missing agenda hook --- htdocs/public/agenda/agendaexport.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index a69c940f7e2..33644e7bb72 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -95,6 +95,18 @@ if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) exit; } +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +$hookmanager->initHooks(array('agendaexport')); + +$reshook = $hookmanager->executeHooks('doActions', $filters); // Note that $action and $object may have been modified by some +if ($reshook < 0){ + if(!empty($hookmanager->errors) && is_array($hookmanager->errors)){ + print '
    '.implode('
    ', $hookmanager->errors).'
    '; + }else{ + print '
    '.$hookmanager->error.'
    '; + } +} + // Check exportkey if (empty($_GET["exportkey"]) || $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY != $_GET["exportkey"]) { @@ -106,8 +118,6 @@ if (empty($_GET["exportkey"]) || $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY != $_ exit; } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks -$hookmanager->initHooks(array('agendaexport')); // Define filename with prefix on filters predica (each predica set must have on cache file) $shortfilename='dolibarrcalendar'; From 42433f3beb220e7569c1a5d60741089e54305c33 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 3 Sep 2019 11:23:27 +0200 Subject: [PATCH 300/982] Fix: hook replace behavior --- htdocs/public/agenda/agendaexport.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 33644e7bb72..dee0e8267ef 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -100,22 +100,24 @@ $hookmanager->initHooks(array('agendaexport')); $reshook = $hookmanager->executeHooks('doActions', $filters); // Note that $action and $object may have been modified by some if ($reshook < 0){ + llxHeaderVierge(); if(!empty($hookmanager->errors) && is_array($hookmanager->errors)){ print '
    '.implode('
    ', $hookmanager->errors).'
    '; }else{ print '
    '.$hookmanager->error.'
    '; } -} - -// Check exportkey -if (empty($_GET["exportkey"]) || $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY != $_GET["exportkey"]) -{ - $user->getrights(); - - llxHeaderVierge(); - print '
    Bad value for key.
    '; llxFooterVierge(); - exit; +} +elseif(empty($reshook)) { + // Check exportkey + if (empty($_GET["exportkey"]) || $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY != $_GET["exportkey"]) { + $user->getrights(); + + llxHeaderVierge(); + print '
    Bad value for key.
    '; + llxFooterVierge(); + exit; + } } From 0c5859d2bfffdf47219729ee138718a646edd334 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Sep 2019 11:37:25 +0200 Subject: [PATCH 301/982] Update takepos.php --- htdocs/takepos/takepos.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 70add232ed6..bfe15aadd32 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -349,6 +349,7 @@ function deleteline() { $("#poslines").load("invoice.php?action=deleteline&place="+place+"&idline="+selectedline, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); + ClearSearch(); } function Customer() { From 6996e83390a34384a5e19a2ed033a39a2fa21113 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Sep 2019 11:40:19 +0200 Subject: [PATCH 302/982] Update takepos.php --- htdocs/takepos/takepos.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index bfe15aadd32..fccaa222fcd 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -399,6 +399,7 @@ function New() { $("#poslines").load("invoice.php?action=delete&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); + ClearSearch(); } } From 5446ef317090b5b76d650e528f224592c131389a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 11:42:47 +0200 Subject: [PATCH 303/982] css --- htdocs/theme/eldy/info-box.inc.php | 21 +++++++++++---------- htdocs/theme/eldy/style.css.php | 4 +++- htdocs/theme/eldy/theme_vars.inc.php | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index f5a88f23f9f..3586d310dfa 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -113,43 +113,44 @@ a.info-box-text{ text-decoration: none;} -/* ICONS */ +/* ICONS INFO BOX */ .info-box-icon { color: #fff !important; } global->THEME_AGRESSIVITY_RATIO)) $conf->global->THEME_AGRESSIVITY_RATIO=-75; +//print '/* conf->global->THEME_AGRESSIVITY_RATIO='.$conf->global->THEME_AGRESSIVITY_RATIO.' */'."\n"; +if (! isset($conf->global->THEME_AGRESSIVITY_RATIO)) $conf->global->THEME_AGRESSIVITY_RATIO=-40; if (GETPOSTISSET('THEME_AGRESSIVITY_RATIO')) $conf->global->THEME_AGRESSIVITY_RATIO=GETPOST('THEME_AGRESSIVITY_RATIO', 'int'); ?> .bg-infoxbox-project{ - background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; + background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; } .bg-infoxbox-action{ - background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; + background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; } .bg-infoxbox-propal, .bg-infoxbox-facture, .bg-infoxbox-commande{ - background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; + background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; } .bg-infoxbox-supplier_proposal, .bg-infoxbox-invoice_supplier, .bg-infoxbox-order_supplier{ - background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; + background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; } .bg-infoxbox-contrat{ - background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; + background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; } .bg-infoxbox-bank_account{ - background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; + background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; } .bg-infoxbox-adherent{ - background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; + background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; } .bg-infoxbox-expensereport{ - background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; + background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; } .bg-infoxbox-holiday{ background-color: global->THEME_AGRESSIVITY_RATIO); ?> !important; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 3b8e1fc7329..2032edb40f2 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -228,13 +228,15 @@ print 'dol_screenwidth='.$_SESSION['dol_screenwidth']."\n"; print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n"; print 'fontsize='.$fontsize."\n"; print 'nbtopmenuentries='.$nbtopmenuentries."\n"; -print 'fontsizesmaller='.$fontsizesmaller; +print 'fontsizesmaller='.$fontsizesmaller."\n"; print 'topMenuFontSize='.$topMenuFontSize."\n"; print 'toolTipBgColor='.$toolTipBgColor."\n"; print 'toolTipFontColor='.$toolTipFontColor."\n"; +print 'conf->global->THEME_AGRESSIVITY_RATIO='.$conf->global->THEME_AGRESSIVITY_RATIO." (must be between -100 and +100)\n"; print '*/'."\n"; +// Include the global.inc.php that include the badges, btn, info-box, dropdown, progress... require __DIR__ . '/global.inc.php'; diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 84749f70a13..18ee2978f5d 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -74,7 +74,7 @@ $colortextlink='10, 10, 100'; $fontsize='0.86em'; $fontsizesmaller='0.75em'; $topMenuFontSize='1.2em'; -$toolTipBgColor='rgba(255, 255, 255, 0.96);'; +$toolTipBgColor='rgba(255, 255, 255, 0.96)'; $toolTipFontColor='#333'; // text color From fa11bbe2d5d171a042d5237c4a87628b72cf50ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 12:51:11 +0200 Subject: [PATCH 304/982] Fix phpcs --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 1a2dc531dd1..1fd5939b4ac 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3317,7 +3317,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print '
    '.$answerrecord['type'].''; - $backtopageurl = $_SERVER["PHP_SELF"].'?action=replacesiteconfirm&searchstring='.urlencode($searchkey).'&optioncontent='.GETPOST('optioncontent','az09').'&optionmeta='.GETPOST('optionmeta','az09').'&optionsitefiles='.GETPOST('optionsitefiles','az09'); + $backtopageurl = $_SERVER["PHP_SELF"].'?action=replacesiteconfirm&searchstring='.urlencode($searchkey).'&optioncontent='.GETPOST('optioncontent', 'az09').'&optionmeta='.GETPOST('optionmeta', 'az09').'&optionsitefiles='.GETPOST('optionsitefiles', 'az09'); print 'ref.'&backtopage='.urlencode($backtopageurl).'">'.$langs->trans("EditCss").''; print ''; From 32343fba24f684ff86b4cd9194a0cf42c801a4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 3 Sep 2019 13:43:44 +0200 Subject: [PATCH 305/982] Optimize invoice situation doc with many many lines, it can be very very long to generate pdf --- htdocs/compta/facture/class/facture.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 33de9d47e18..1868c26c8fc 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5168,13 +5168,16 @@ class FactureLigne extends CommonInvoiceLine public function get_prev_progress($invoiceid, $include_credit_note = true) { // phpcs:enable + global $invoicecache; if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") { return 0; } else { // If invoice is not a situation invoice, this->fk_prev_id is used for something else - $tmpinvoice=new Facture($this->db); - $tmpinvoice->fetch($invoiceid); - if ($tmpinvoice->type != Facture::TYPE_SITUATION) return 0; + if (!isset($invoicecache[$invoiceid])) { + $invoicecache[$invoiceid]=new Facture($this->db); + $invoicecache[$invoiceid]->fetch($invoiceid); + } + if ($invoicecache[$invoiceid]->type != Facture::TYPE_SITUATION) return 0; $sql = 'SELECT situation_percent FROM ' . MAIN_DB_PREFIX . 'facturedet WHERE rowid=' . $this->fk_prev_id; $resql = $this->db->query($sql); From decf1d5a4bec863b8fdeaaf34d06a39774bfe299 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 3 Sep 2019 14:18:14 +0200 Subject: [PATCH 306/982] Use bug template --- htdocs/main.inc.php | 47 +++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9beff2dd38e..77b05ff6f2a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2035,20 +2035,39 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new'; - $bugbaseurl.= '?title='; - $bugbaseurl.= urlencode("Bug: "); - $bugbaseurl.= '&body='; - $bugbaseurl.= urlencode("# Bug\n"); - $bugbaseurl.= urlencode("\n"); - $bugbaseurl.= urlencode("## Environment\n"); - $bugbaseurl.= urlencode("- **Version**: " . DOL_VERSION . "\n"); - $bugbaseurl.= urlencode("- **OS**: " . php_uname('s') . "\n"); - $bugbaseurl.= urlencode("- **Web server**: " . $_SERVER["SERVER_SOFTWARE"] . "\n"); - $bugbaseurl.= urlencode("- **PHP**: " . php_sapi_name() . ' ' . phpversion() . "\n"); - $bugbaseurl.= urlencode("- **Database**: " . $db::LABEL . ' ' . $db->getVersion() . "\n"); - $bugbaseurl.= urlencode("- **URL**: " . $_SERVER["REQUEST_URI"] . "\n"); - + $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new?labels=Bug'; + $bugbaseurl.= '&title='; + $bugbaseurl.= urlencode("Bug: "); + $bugbaseurl.= '&body='; + $bugbaseurl.= urlencode("# Instructions\n"); + $bugbaseurl.= urlencode("*This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*\n"); + $bugbaseurl.= urlencode("*Please:*\n"); + $bugbaseurl.= urlencode("- *replace the bracket enclosed texts with meaningful information*\n"); + $bugbaseurl.= urlencode("- *remove any unused sub-section*\n"); + $bugbaseurl.= urlencode("\n"); + $bugbaseurl.= urlencode("\n"); + $bugbaseurl.= urlencode("# Bug\n"); + $bugbaseurl.= urlencode("[*Short description*]\n"); + $bugbaseurl.= urlencode("\n"); + $bugbaseurl.= urlencode("## Environment\n"); + $bugbaseurl.= urlencode("- **Version**: " . DOL_VERSION . "\n"); + $bugbaseurl.= urlencode("- **OS**: " . php_uname('s') . "\n"); + $bugbaseurl.= urlencode("- **Web server**: " . $_SERVER["SERVER_SOFTWARE"] . "\n"); + $bugbaseurl.= urlencode("- **PHP**: " . php_sapi_name() . ' ' . phpversion() . "\n"); + $bugbaseurl.= urlencode("- **Database**: " . $db::LABEL . ' ' . $db->getVersion() . "\n"); + $bugbaseurl.= urlencode("- **URL(s)**: " . $_SERVER["REQUEST_URI"] . "\n"); + $bugbaseurl.= urlencode("\n"); + $bugbaseurl.= urlencode("## Expected and actual behavior\n"); + $bugbaseurl.= urlencode("[*Verbose description*]\n"); + $bugbaseurl.= urlencode("\n"); + $bugbaseurl.= urlencode("## Steps to reproduce the behavior\n"); + $bugbaseurl.= urlencode("[*Verbose description*]\n"); + $bugbaseurl.= urlencode("\n"); + $bugbaseurl.= urlencode("## [Attached files](https://help.github.com/articles/issue-attachments) (Screenshots, screencasts, dolibarr.log, debugging informations…)\n"); + $bugbaseurl.= urlencode("[*Files*]\n"); + $bugbaseurl.= urlencode("\n"); + + // Execute hook printBugtrackInfo $parameters=array('bugbaseurl'=>$bugbaseurl); $reshook=$hookmanager->executeHooks('printBugtrackInfo', $parameters); // Note that $action and $object may have been modified by some hooks From b2cbad1a88e8f106be3753a5d23722916e1c6a99 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 3 Sep 2019 12:21:08 +0000 Subject: [PATCH 307/982] Fixing style errors. --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 77b05ff6f2a..2e91298f570 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2037,7 +2037,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new?labels=Bug'; $bugbaseurl.= '&title='; - $bugbaseurl.= urlencode("Bug: "); + $bugbaseurl.= urlencode("Bug: "); $bugbaseurl.= '&body='; $bugbaseurl.= urlencode("# Instructions\n"); $bugbaseurl.= urlencode("*This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*\n"); From 95f3db126776b8e94264c3a9457f1cfd6c17eeaf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 14:41:39 +0200 Subject: [PATCH 308/982] Fix translation --- htdocs/langs/en_US/website.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 83e71073984..be758c04890 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -116,4 +116,5 @@ Dynamiccontent=Sample of a page with dynamic content ImportSite=Import site EditInLineOnOff=Mode 'Edit inline' is %s ShowSubContainersOnOff=Mode to execute 'dynamic content' is %s -GlobalCSSorJS=Global CSS/JS/Header file of web site \ No newline at end of file +GlobalCSSorJS=Global CSS/JS/Header file of web site +BackToHomePage=Back to home page... \ No newline at end of file From ffcea3dfd85809dee960698a23fa83956f403de5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 14:48:06 +0200 Subject: [PATCH 309/982] Fix phpcs --- htdocs/product/class/api_products.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index c0d415165c0..2543ff4a2e6 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -479,7 +479,7 @@ class Products extends DolibarrApi * @param string $barcode Barcode of element * @param int $includestockdata Load also information about stock (slower) * @return array|mixed Data without useless information - * + * * @url GET {id}/purchase_prices * * @throws 401 @@ -502,16 +502,16 @@ class Products extends DolibarrApi $result = $this->product->fetch($id, $ref, $ref_ext, $barcode); if(! $result ) { throw new RestException(404, 'Product not found'); - } - + } + if(! DolibarrApi::_checkAccessToResource('product', $this->product->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } - + } + if ($includestockdata) { $this->product->load_stock(); } - + if($result) { $this->product = new ProductFournisseur($this->db); $this->product->fetch($id, $ref); From 80624c67f4a7085be83103144c8202dc587b4ae1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Sep 2019 14:48:46 +0200 Subject: [PATCH 310/982] Fix lang in invoice / takepos --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 1729e22427c..6ae5429d062 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; -$langs->loadLangs(array("companies","commercial","bills", "cashdesk")); +$langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks")); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); From a95e02e3f6caacac8766fdf1b9efbf39bfee8255 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 14:52:03 +0200 Subject: [PATCH 311/982] FIX #11789 FIX #11790 --- htdocs/comm/propal/card.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 7331d7a86e9..5b37242c8ac 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2535,10 +2535,13 @@ $formquestion = array_merge($formquestion, array( print ''; } - $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); - if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) + if ($usercanclose) { - print ''; + $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); + if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) + { + print ''; + } } } From 17ccb8fa101988c443be52aa28b35967f213c451 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 14:56:13 +0200 Subject: [PATCH 312/982] Fix missing tooltip --- htdocs/comm/propal/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 5b37242c8ac..9bf00cb6a9c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2500,7 +2500,7 @@ $formquestion = array_merge($formquestion, array( if ($usercansend) { print ''; } else - print ''; + print ''; } // Create an order @@ -2543,6 +2543,10 @@ $formquestion = array_merge($formquestion, array( print ''; } } + else + { + print ''; + } } // Set accepted/refused From 52a543953c1bf22f2a4c47af8a5ead06c79fca57 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 14:58:54 +0200 Subject: [PATCH 313/982] Fix position of tests --- htdocs/comm/propal/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9bf00cb6a9c..180f95e2d4e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2535,17 +2535,17 @@ $formquestion = array_merge($formquestion, array( print ''; } - if ($usercanclose) + $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); + if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) { - $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); - if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) + if ($usercanclose) { print ''; } - } - else - { - print ''; + else + { + print ''; + } } } From 132aceaa2085ba7aeca628bbd821bcba2aeaf9ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 15:35:06 +0200 Subject: [PATCH 314/982] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3e8cb903cfb..cccc1efe1c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -110,6 +110,7 @@ install: rm $TRAVIS_BUILD_DIR/composer.json rm $TRAVIS_BUILD_DIR/composer.lock composer self-update + # To have composer making parallel downloads composer global require hirak/prestissimo composer -n init composer -n config vendor-dir htdocs/includes From 106938168f210df8836c7ab2ecc27261a12b1f7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 15:36:49 +0200 Subject: [PATCH 315/982] Fix phpcs --- .../core/modules/societe/mod_codecompta_digitaria.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index 8044610a914..01b8da27b91 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -119,7 +119,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Example */ - public function getExample($langs, $objsoc=0, $type=-1) + public function getExample($langs, $objsoc = 0, $type = -1) { global $mysoc; @@ -128,9 +128,9 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode if (! isset($conf->global->COMPANY_DIGITARIA_REMOVE_SPECIAL)) $thirdpartylabelexample = preg_replace('/([^a-z0-9])/i', '', $mysoc->name); $s.="
    \n"; - $s.=$this->prefixcustomeraccountancycode.strtoupper(substr($thirdpartylabelexample,0, $this->customeraccountancycodecharacternumber)); + $s.=$this->prefixcustomeraccountancycode.strtoupper(substr($thirdpartylabelexample, 0, $this->customeraccountancycodecharacternumber)); $s.="
    \n"; - $s.=$this->prefixsupplieraccountancycode.strtoupper(substr($thirdpartylabelexample,0, $this->supplieraccountancycodecharacternumber)); + $s.=$this->prefixsupplieraccountancycode.strtoupper(substr($thirdpartylabelexample, 0, $this->supplieraccountancycodecharacternumber)); return $s; } @@ -143,7 +143,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode * @param int $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ - public function get_code($db, $societe, $type='') + public function get_code($db, $societe, $type = '') { // phpcs:enable $i = 0; @@ -229,7 +229,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode * @param int $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ - public function checkIfAccountancyCodeIsAlreadyUsed($db, $code, $type='') + public function checkIfAccountancyCodeIsAlreadyUsed($db, $code, $type = '') { if ($type == 'supplier') { @@ -269,4 +269,3 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode } } } - From bd47bd096b756230a911de8db2be12a29e4e47cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 15:58:20 +0200 Subject: [PATCH 316/982] NEW Can defined a position of numbering submodules for thirdparties --- .../societe/mod_codeclient_elephant.php | 7 - .../societe/mod_codeclient_leopard.php | 7 - .../modules/societe/mod_codeclient_monkey.php | 7 - .../societe/mod_codecompta_aquarium.php | 17 +-- .../societe/mod_codecompta_digitaria.php | 18 +-- .../societe/mod_codecompta_panicum.php | 9 +- .../modules/societe/modules_societe.class.php | 11 +- htdocs/langs/en_US/admin.lang | 3 +- htdocs/societe/admin/societe.php | 122 ++++++++++-------- 9 files changed, 91 insertions(+), 110 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index b4e9f5d5258..3b72d57ed03 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -34,13 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php' */ class mod_codeclient_elephant extends ModeleThirdPartyCode { - /** - * @var string Nom du modele - * @deprecated - * @see name - */ - public $nom='Elephant'; - /** * @var string model name */ diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index 727d2e09299..abea7070e80 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -38,13 +38,6 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode * Le fonctionnement de celui-ci doit donc rester le plus ouvert possible */ - /** - * @var string Nom du modele - * @deprecated - * @see name - */ - public $nom='Leopard'; - /** * @var string model name */ diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index f86be2ed96c..87f4a527880 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -32,13 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php' */ class mod_codeclient_monkey extends ModeleThirdPartyCode { - /** - * @var string Nom du modele - * @deprecated - * @see name - */ - public $nom='Monkey'; - /** * @var string model name */ diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index e9c60b699cc..edd0c5cf4dd 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -31,13 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php' */ class mod_codecompta_aquarium extends ModeleAccountancyCode { - /** - * @var string Nom du modele - * @deprecated - * @see name - */ - public $nom='Aquarium'; - /** * @var string model name */ @@ -49,9 +42,11 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' - public $prefixcustomeraccountancycode; + public $prefixcustomeraccountancycode; - public $prefixsupplieraccountancycode; + public $prefixsupplieraccountancycode; + + public $position = 20; /** @@ -93,11 +88,11 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode $texte.=$langs->trans("ModuleCompanyCodeCustomer".$this->name, $s2)."
    \n"; $texte.=$langs->trans("ModuleCompanyCodeSupplier".$this->name, $s1)."
    \n"; $texte.="
    \n"; - if (! isset($conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL) || ! empty($conf->global->$conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL)) $texte.=$langs->trans('COMPANY_AQUARIUM_REMOVE_SPECIAL').' = '.yn(1)."
    \n"; + if (! isset($conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL) || ! empty($conf->global->$conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL)) $texte.=$langs->trans('RemoveSpecialChars').' = '.yn(1)."
    \n"; //if (! empty($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)) $texte.=$langs->trans('COMPANY_AQUARIUM_REMOVE_ALPHA').' = '.yn($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)."
    \n"; if (! empty($conf->global->COMPANY_AQUARIUM_CLEAN_REGEX)) $texte.=$langs->trans('COMPANY_AQUARIUM_CLEAN_REGEX').' = '.$conf->global->COMPANY_AQUARIUM_CLEAN_REGEX."
    \n"; $texte.= '
     
    '; $texte.= ''; diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index 01b8da27b91..97486da70cc 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -31,13 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php' */ class mod_codecompta_digitaria extends ModeleAccountancyCode { - /** - * @var string Nom du modele - * @deprecated - * @see name - */ - public $nom='Digitaria'; - /** * @var string model name */ @@ -49,9 +42,12 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode */ public $version='dolibarr'; // 'development', 'experimental', 'dolibarr' - public $prefixcustomeraccountancycode; + public $prefixcustomeraccountancycode; + + public $prefixsupplieraccountancycode; + + public $position = 30; - public $prefixsupplieraccountancycode; /** * Constructor @@ -98,13 +94,13 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode $texte.= $langs->trans("ModuleCompanyCodeSupplier".$this->name, $s1, $s3)."
    \n"; $texte.= "
    \n"; // Remove special char if COMPANY_DIGITARIA_REMOVE_SPECIAL is set to 1 or not set (default) - if (! isset($conf->global->COMPANY_DIGITARIA_REMOVE_SPECIAL) || ! empty($conf->global->$conf->global->COMPANY_DIGITARIA_REMOVE_SPECIAL)) $texte.= $langs->trans('COMPANY_DIGITARIA_REMOVE_SPECIAL').' = '.yn(1)."
    \n"; + if (! isset($conf->global->COMPANY_DIGITARIA_REMOVE_SPECIAL) || ! empty($conf->global->$conf->global->COMPANY_DIGITARIA_REMOVE_SPECIAL)) $texte.= $langs->trans('RemoveSpecialChars').' = '.yn(1)."
    \n"; // Apply a regex replacement pattern on code if COMPANY_DIGITARIA_CLEAN_REGEX is set. Value must be a regex with parenthesis. The part into parenthesis is kept, the rest removed. if (! empty($conf->global->COMPANY_DIGITARIA_CLEAN_REGEX)) $texte.= $langs->trans('COMPANY_DIGITARIA_CLEAN_REGEX').' = '.$conf->global->COMPANY_DIGITARIA_CLEAN_REGEX."
    \n"; // Unique index on code if COMPANY_DIGITARIA_UNIQUE_CODE is set to 1 or not set (default) if (! isset($conf->global->COMPANY_DIGITARIA_UNIQUE_CODE) || ! empty($conf->global->COMPANY_DIGITARIA_UNIQUE_CODE)) $texte.= $langs->trans('COMPANY_DIGITARIA_UNIQUE_CODE').' = '.yn(1)."
    \n"; $texte.= ''; - $texte.= '  '; + $texte.= ''; $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/societe/mod_codecompta_panicum.php b/htdocs/core/modules/societe/mod_codecompta_panicum.php index f3106cef761..60f66ca4e46 100644 --- a/htdocs/core/modules/societe/mod_codecompta_panicum.php +++ b/htdocs/core/modules/societe/mod_codecompta_panicum.php @@ -30,13 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php' */ class mod_codecompta_panicum extends ModeleAccountancyCode { - /** - * @var string Nom du modele - * @deprecated - * @see name - */ - public $nom='Panicum'; - /** * @var string model name */ @@ -48,6 +41,8 @@ class mod_codecompta_panicum extends ModeleAccountancyCode */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + public $position = 10; + /** * Constructor diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index 4a873847d8a..62f481b9b25 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -83,18 +83,18 @@ abstract class ModeleThirdPartyCode return $langs->trans("NoDescription"); } - /** Renvoi nom module + /** Return name of module * * @param Translate $langs Object langs * @return string Nom du module */ public function getNom($langs) { - return $this->nom; + return $this->name; } - /** Renvoi un exemple de numerotation + /** Return an example of numbering * * @param Translate $langs Object langs * @return string Example @@ -261,8 +261,7 @@ abstract class ModeleThirdPartyCode /** - * \class ModeleAccountancyCode - * \brief Parent class for third parties accountancy code generators + * Parent class for third parties accountancy code generators */ abstract class ModeleAccountancyCode { @@ -340,7 +339,7 @@ abstract class ModeleAccountancyCode $langs->load("admin"); $s=''; - if ($type == -1) $s.=$langs->trans("Name").': '.$this->nom.'
    '; + if ($type == -1) $s.=$langs->trans("Name").': '.$this->name.'
    '; if ($type == -1) $s.=$langs->trans("Version").': '.$this->getVersion().'
    '; //$s.='
    '; //$s.=''.$langs->trans("ThisIsModuleRules").':
    '; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0ae5239642d..f59f4449b8e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1848,9 +1848,8 @@ NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups EnterCalculationRuleIfPreviousFieldIsYes=Enter calculation rule if previous field was set to Yes (For example 'CODEGRP1+CODEGRP2') SeveralLangugeVariatFound=Several language variants found -COMPANY_AQUARIUM_REMOVE_SPECIAL=Remove special characters +RemoveSpecialChars=Remove special characters COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN_REGEX) -COMPANY_DIGITARIA_REMOVE_SPECIAL=Remove special characters COMPANY_DIGITARIA_CLEAN_REGEX=Regex filter to clean value (COMPANY_DIGITARIA_CLEAN_REGEX) COMPANY_DIGITARIA_UNIQUE_CODE=Unauthorized double GDPRContact=Data Protection Officer (DPO, Data Privacy or GDPR contact) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index d07ddfc2b4f..82f8c32510e 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -360,6 +360,8 @@ print ' '.$langs->trans("Status").''; print ' '.$langs->trans("ShortInfo").''; print "\n"; +$arrayofmodules = array(); + foreach ($dirsociete as $dirroot) { $dir = dol_buildpath($dirroot, 0); @@ -388,39 +390,45 @@ foreach ($dirsociete as $dirroot) if ($modCodeTiers->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($modCodeTiers->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - print ''."\n"; - print ''.$modCodeTiers->name.''."\n"; - print ''.$modCodeTiers->info($langs).''."\n"; - print ''.$modCodeTiers->getExample($langs).''."\n"; - - if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file") - { - print ''."\n"; - print img_picto($langs->trans("Activated"), 'switch_on'); - print "\n"; - } - else - { - $disabled = false; - if (! empty($conf->multicompany->enabled) && (is_object($mc) && ! empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true); - print ''; - if (! $disabled) print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - if (! $disabled) print ''; - print ''; - } - - print ''; - $s=$modCodeTiers->getToolTip($langs, null, -1); - print $form->textwithpicto('', $s, 1); - print ''; - - print ''; + $arrayofmodules[$file] = $modCodeTiers; } } closedir($handle); } } + +$arrayofmodules = dol_sort_array($arrayofmodules, 'position'); + +foreach($arrayofmodules as $file => $modCodeTiers) +{ + print ''."\n"; + print ''.$modCodeTiers->name.''."\n"; + print ''.$modCodeTiers->info($langs).''."\n"; + print ''.$modCodeTiers->getExample($langs).''."\n"; + + if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file") + { + print ''."\n"; + print img_picto($langs->trans("Activated"), 'switch_on'); + print "\n"; + } + else + { + $disabled = (! empty($conf->multicompany->enabled) && (is_object($mc) && ! empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true); + print ''; + if (! $disabled) print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + if (! $disabled) print ''; + print ''; + } + + print ''; + $s=$modCodeTiers->getToolTip($langs, null, -1); + print $form->textwithpicto('', $s, 1); + print ''; + + print ''; +} print ''; print '
    '; @@ -441,6 +449,8 @@ print ''.$langs->trans("Status").''; print ''.$langs->trans("ShortInfo").''; print "\n"; +$arrayofmodules = array(); + foreach ($dirsociete as $dirroot) { $dir = dol_buildpath($dirroot, 0); @@ -464,33 +474,41 @@ foreach ($dirsociete as $dirroot) $modCodeCompta = new $file; - print ''; - print ''.$modCodeCompta->name."\n"; - print $modCodeCompta->info($langs); - print ''; - print ''.$modCodeCompta->getExample($langs)."\n"; - - if ($conf->global->SOCIETE_CODECOMPTA_ADDON == "$file") - { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } - else - { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - $s=$modCodeCompta->getToolTip($langs, null, -1); - print $form->textwithpicto('', $s, 1); - print ''; - print "\n"; + $arrayofmodules[$file] = $modCodeCompta; } } - closedir($handle); } + closedir($handle); +} + +$arrayofmodules = dol_sort_array($arrayofmodules, 'position'); + + +foreach($arrayofmodules as $file => $modCodeCompta) +{ + print ''; + print ''.$modCodeCompta->name."\n"; + print $modCodeCompta->info($langs); + print ''; + print ''.$modCodeCompta->getExample($langs)."\n"; + + if ($conf->global->SOCIETE_CODECOMPTA_ADDON == "$file") + { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } + else + { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + $s=$modCodeCompta->getToolTip($langs, null, -1); + print $form->textwithpicto('', $s, 1); + print ''; + print "\n"; } print "\n"; print ''; From 28c4f86c79b305291d51994ff3578added6c0aa0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 16:23:39 +0200 Subject: [PATCH 317/982] Fix regression --- htdocs/compta/facture/class/facture.class.php | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b3c34d03360..131f0ee90fd 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -210,12 +210,12 @@ class Facture extends CommonInvoice * @var double percentage of retainage */ public $retained_warranty; - + /** * @var int timestamp of date limit of retainage */ public $retained_warranty_date_limit; - + /** * @var int Code in llx_c_paiement */ @@ -461,10 +461,10 @@ class Facture extends CommonInvoice // Define due date if not already defined if (empty($forceduedate)) { $duedate = $this->calculate_date_lim_reglement(); - if ($duedate < 0) { - dol_syslog(__METHOD__ . ' ' . $this->error, LOG_ERR); + /*if ($duedate < 0) { Regression, a date can be negative if before 1970. + dol_syslog(__METHOD__ . ' Error in calculate_date_lim_reglement. We got ' . $duedate, LOG_ERR); return -1; - } + }*/ $this->date_lim_reglement = $duedate; } else { $this->date_lim_reglement = $forceduedate; @@ -535,7 +535,7 @@ class Facture extends CommonInvoice $sql.= ", ".(empty($this->retained_warranty)?"0":$this->db->escape($this->retained_warranty)); $sql.= ", ".(!empty($this->retained_warranty_date_limit)?"'".$this->db->idate($this->retained_warranty_date_limit)."'":'NULL'); $sql.= ", ".(int) $this->retained_warranty_fk_cond_reglement; - + $sql.=")"; $resql=$this->db->query($sql); @@ -1439,7 +1439,7 @@ class Facture extends CommonInvoice $this->retained_warranty = $obj->retained_warranty; $this->retained_warranty_date_limit = $this->db->jdate($obj->retained_warranty_date_limit); $this->retained_warranty_fk_cond_reglement = $obj->retained_warranty_fk_cond_reglement; - + $this->extraparams = (array) json_decode($obj->extraparams, true); //Incoterms @@ -1688,7 +1688,7 @@ class Facture extends CommonInvoice if (isset($this->modelpdf)) $this->modelpdf=trim($this->modelpdf); if (isset($this->import_key)) $this->import_key=trim($this->import_key); if (isset($this->retained_warranty)) $this->retained_warranty = floatval($this->retained_warranty); - + // Check parameters // Put here code to add control on parameters values @@ -4431,9 +4431,9 @@ class Facture extends CommonInvoice if(empty($this->retained_warranty) ){ return -1; } - + $retainedWarrantyAmount = 0; - + // Billed - retained warranty if($this->type == Facture::TYPE_SITUATION) { @@ -4447,18 +4447,18 @@ class Facture extends CommonInvoice } } } - + if($displayWarranty && !empty($this->situation_final)) { $this->fetchPreviousNextSituationInvoice(); $TPreviousIncoice = $this->tab_previous_situation_invoice; - + $total2BillWT = 0; foreach ($TPreviousIncoice as &$fac){ $total2BillWT += $fac->total_ttc; } $total2BillWT += $this->total_ttc; - + $retainedWarrantyAmount = $total2BillWT * $this->retained_warranty / 100; } else{ @@ -4470,10 +4470,10 @@ class Facture extends CommonInvoice // Because one day retained warranty could be used on standard invoices $retainedWarrantyAmount = $this->total_ttc * $this->retained_warranty / 100; } - + return $retainedWarrantyAmount; } - + /** * Change the retained warranty * @@ -4489,7 +4489,7 @@ class Facture extends CommonInvoice $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql .= ' SET '.$fieldname.' = '.floatval($value); $sql .= ' WHERE rowid='.$this->id; - + if ($this->db->query($sql)) { $this->retained_warranty = floatval($value); @@ -4509,8 +4509,8 @@ class Facture extends CommonInvoice return -2; } } - - + + /** * Change the retained_warranty_date_limit * @@ -4523,8 +4523,8 @@ class Facture extends CommonInvoice if(!$timestamp && $dateYmd){ $timestamp = $this->db->jdate($dateYmd); } - - + + dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit('.$timestamp.')'); if ($this->statut >= 0) { @@ -4532,7 +4532,7 @@ class Facture extends CommonInvoice $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql .= ' SET '.$fieldname.' = '.(strval($timestamp)!='' ? '\'' .$this->db->idate($timestamp).'\'' : 'null' ); $sql .= ' WHERE rowid='.$this->id; - + if ($this->db->query($sql)) { $this->retained_warranty_date_limit = $timestamp; From a5aedacb7e69f81f3915acd965fc22d6f2897018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 3 Sep 2019 16:49:41 +0200 Subject: [PATCH 318/982] Update productbatch.class.php --- htdocs/product/class/productbatch.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 4b1e5232abb..22077747b95 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -223,7 +223,7 @@ class Productbatch extends CommonObject $sql.= " batch=".(isset($this->batch)?"'".$this->db->escape($this->batch)."'":"null").","; $sql.= " qty=".(isset($this->qty)?$this->qty:"null").","; $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").""; - $sql.= " WHERE rowid=".$this->id." AND tms='".$this->db->idate($this->tms)."'"; + $sql.= " WHERE rowid=".$this->id; $this->db->begin(); From 6c20fbafdf0c5811a5802da2c11468b0798a0359 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 3 Sep 2019 17:04:42 +0200 Subject: [PATCH 319/982] add trigger files --- htdocs/contact/card.php | 4 +- htdocs/contact/class/contact.class.php | 43 +++++++ htdocs/contact/list.php | 4 +- htdocs/core/class/commonobject.class.php | 42 +++--- htdocs/core/class/html.form.class.php | 41 ------ htdocs/core/class/html.formcompany.class.php | 64 +++++++--- htdocs/core/lib/company.lib.php | 6 +- ...rface_90_modSociete_ContactRoles.class.php | 120 ++++++++++++++++++ 8 files changed, 241 insertions(+), 83 deletions(-) create mode 100644 htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 20a61ec4e3e..5861cc71d38 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1051,7 +1051,7 @@ else if (!empty($object->socid)) { print '' . $langs->trans("Role") . ''; print ''; - print $form->showRoles("roles", $object, 'edit' ,$object->roles); + print $formcompany->showRoles("roles", $object, 'edit' ,$object->roles); print ''; } @@ -1256,7 +1256,7 @@ else if (!empty($object->socid)) { print '' . $langs->trans("Roles") . ''; print ''; - print $form->showRoles("roles", $object, 'view'); + print $formcompany->showRoles("roles", $object, 'view'); print ''; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index d718a898f2d..6b46e32f532 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1525,6 +1525,49 @@ class Contact extends CommonObject } } + /** + * Get Contact roles for a thirdparty + * + * @param string $element element type + * @return array|int + * @throws Exception + */ + public function getContactRoles($element = '') + { + $tab=array(); + + $sql = "SELECT sc.fk_socpeople as id, sc.fk_c_type_contact"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc"; + $sql.= ", ".MAIN_DB_PREFIX."societe_contacts sc"; + $sql.= " WHERE sc.fk_soc =".$this->socid; + $sql.= " AND sc.fk_c_type_contact=tc.rowid"; + $sql.= " AND tc.element='".$element."'"; + $sql.= " AND tc.active=1"; + + dol_syslog(get_class($this)."::liste_contact", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $num=$this->db->num_rows($resql); + $i=0; + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $tab[]=array('fk_socpeople'=>$obj->id, 'type_contact'=>$obj->fk_c_type_contact); + + $i++; + } + + return $tab; + } + else + { + $this->error=$this->db->error(); + dol_print_error($this->db); + return -1; + } + } + /** * Updates Roles * diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 585d6db499d..6b595a05860 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -36,6 +36,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "suppliers", "categories")); @@ -264,6 +265,7 @@ if ($search_priv < 0) $search_priv=''; $form=new Form($db); $formother=new FormOther($db); +$formcompany=new FormCompany($db); $contactstatic=new Contact($db); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); @@ -518,7 +520,7 @@ if (! empty($conf->categorie->enabled)) } $moreforfilter.='
    '; $moreforfilter.=$langs->trans('Roles'). ': '; - $moreforfilter.=$form->showRoles("search_roles", $objecttmp, 'edit', $search_roles); + $moreforfilter.=$formcompany->showRoles("search_roles", $objecttmp, 'edit', $search_roles); $moreforfilter.='
    '; } if ($moreforfilter) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 716b615f503..1a1b5c597ce 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1224,9 +1224,10 @@ abstract class CommonObject public function listeTypeContacts($source = 'internal', $option = 0, $activeonly = 0, $code = '', $element = '') { // phpcs:enable - global $langs; + global $langs, $conf; $tab = array(); + $sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle, tc.position, tc.element"; $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc"; @@ -1251,27 +1252,36 @@ abstract class CommonObject dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); $resql=$this->db->query($sql); - if ($resql) - { - $num=$this->db->num_rows($resql); - $i=0; - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); - - $libelle_element = $langs->trans('ContactDefault_'.$obj->element); - $transkey="TypeContact_".$this->element."_".$source."_".$obj->code; - $libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle); - if (empty($option)) $tab[$obj->rowid]=$libelle_element.' - '.$libelle_type; - else $tab[$obj->rowid]=$libelle_element.' - '.$libelle_type; - $i++; + if ($resql) { + $num = $this->db->num_rows($resql); + if ($num > 0) { + while ($obj = $this->db->fetch_object($resql)) { + if (strpos($obj->element, 'project')!==false) { + $element='projet'; + } elseif($obj->element=='contrat') { + $element='contract'; + } elseif(strpos($obj->element, 'supplier')!==false && $obj->element!='supplier_proposal') { + $element='fournisseur'; + } elseif(strpos($obj->element, 'supplier')!==false && $obj->element!='supplier_proposal') { + $element='fournisseur'; + } else { + $element=$obj->element; + } + if ($conf->{$element}->enabled) { + $libelle_element = $langs->trans('ContactDefault_' . $obj->element); + $transkey = "TypeContact_" . $this->element . "_" . $source . "_" . $obj->code; + $libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle); + if (empty($option)) + $tab[$obj->rowid] = $libelle_element . ' - ' . $libelle_type; + else $tab[$obj->rowid] = $libelle_element . ' - ' . $libelle_type; + } + } } return $tab; } else { $this->error=$this->db->lasterror(); - //dol_print_error($this->db); return null; } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4eca1ef0f85..f351a361d14 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6484,47 +6484,6 @@ class Form return 'ErrorBadValueForParameterRenderMode'; // Should not happened } - /** - * showContactRoles on view and edit mode - * - * @param string $htmlname Html component name and id - * @param Contact $contact Contact Obejct - * @param string $rendermode view, edit - * @param array $selected $key=>$val $val is selected Roles for input mode - * @return string String with contacts roles - */ - public function showRoles($htmlname = '', Contact $contact, $rendermode = 'view', $selected = array()) - { - if ($rendermode === 'view') { - $toprint = array(); - foreach ($contact->roles as $key => $val) { - $toprint[] = '
  • ' . $val['label'] . '
  • '; - } - return '
      ' . implode(' ', $toprint) . '
    '; - } - - if ($rendermode === 'edit') - { - $contactType=$contact->listeTypeContacts('external', '', 1); - - if (count($selected)>0) { - $newselected=array(); - foreach($selected as $key=>$val) { - if (is_array($val) && array_key_exists('id', $val) && in_array($val['id'], array_keys($contactType))) { - $newselected[]=$val['id']; - } else { - break; - } - } - if (count($newselected)>0) $selected=$newselected; - } - return $this->multiselectarray($htmlname, $contactType, $selected); - } - - return 'ErrorBadValueForParameterRenderMode'; // Should not happened - } - - /** * Show linked object block. * diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 2207ab8ab2b..81b87b6f340 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -29,28 +29,11 @@ * Class to build HTML component for third parties management * Only common components are here. */ -class FormCompany + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + +class FormCompany extends Form { - /** - * @var DoliDB Database handler. - */ - public $db; - - /** - * @var string Error code (or message) - */ - public $error=''; - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct($db) - { - $this->db = $db; - } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** @@ -763,6 +746,45 @@ class FormCompany } } + /** + * showContactRoles on view and edit mode + * + * @param string $htmlname Html component name and id + * @param Contact $contact Contact Obejct + * @param string $rendermode view, edit + * @param array $selected $key=>$val $val is selected Roles for input mode + * @return string String with contacts roles + */ + public function showRoles($htmlname = '', Contact $contact, $rendermode = 'view', $selected = array()) + { + if ($rendermode === 'view') { + $toprint = array(); + foreach ($contact->roles as $key => $val) { + $toprint[] = '
  • ' . $val['label'] . '
  • '; + } + return '
      ' . implode(' ', $toprint) . '
    '; + } + + if ($rendermode === 'edit') + { + $contactType=$contact->listeTypeContacts('external', '', 1); + if (count($selected)>0) { + $newselected=array(); + foreach($selected as $key=>$val) { + if (is_array($val) && array_key_exists('id', $val) && in_array($val['id'], array_keys($contactType))) { + $newselected[]=$val['id']; + } else { + break; + } + } + if (count($newselected)>0) $selected=$newselected; + } + return $this->multiselectarray($htmlname, $contactType, $selected); + } + + return 'ErrorBadValueForParameterRenderMode'; // Should not happened + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return a select list with zip codes and their town diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 14b20bbe46b..331b03bacc4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -859,6 +859,8 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') global $user,$conf,$extrafields,$hookmanager; global $contextpage; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + $formcompany = new FormCompany($db); $form = new Form($db); $optioncss = GETPOST('optioncss', 'alpha'); @@ -1017,7 +1019,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if (in_array($key, array('lastname','name'))) print ''; elseif (in_array($key, array('statut'))) print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0, 1),'1'=>$contactstatic->LibStatut(1, 1)), $search_status); elseif (in_array($key, array('role'))) { - print $form->showRoles("search_roles", $contactstatic, 'edit', $search_roles); + print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles); } print ''; } @@ -1152,7 +1154,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if (! empty($arrayfields['sc.role']['checked'])) { print ''; - print $form->showRoles("roles", $contactstatic, 'view'); + print $formcompany->showRoles("roles", $contactstatic, 'view'); print ''; } diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php new file mode 100644 index 00000000000..8fba51e7a69 --- /dev/null +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -0,0 +1,120 @@ + + * Copyright (C) 2009-2017 Regis Houssin + * Copyright (C) 2011-2014 Juanjo Menent + * Copyright (C) 2013 Cedric GROSS + * Copyright (C) 2014 Marcos García + * Copyright (C) 2015 Bahfir Abbes + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php + * \ingroup agenda + * \brief Trigger file for agenda module + */ + +require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; + + +/** + * Class of triggered functions for agenda module + */ +class InterfaceContactRoles extends DolibarrTriggers +{ + public $family = 'agenda'; + public $description = "Triggers of this module add actions in agenda according to setup made in agenda setup."; + + /** + * Version of the trigger + * @var string + */ + public $version = self::VERSION_DOLIBARR; + + /** + * @var string Image of the trigger + */ + public $picto = 'action'; + + /** + * Function called when a Dolibarrr business event is done. + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) + * + * Following properties may be set before calling trigger. The may be completed by this trigger to be used for writing the event into database: + * $object->actiontypecode (translation action code: AC_OTH, ...) + * $object->actionmsg (note, long text) + * $object->actionmsg2 (label, short text) + * $object->sendtoid (id of contact or array of ids) + * $object->socid (id of thirdparty) + * $object->fk_project + * $object->fk_element + * $object->elementtype + * + * @param string $action Event action code + * @param Object $object Object + * @param User $user Object user + * @param Translate $langs Object langs + * @param conf $conf Object conf + * @return int <0 if KO, 0 if no triggered ran, >0 if OK + */ + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) + { + // Lors de la création d'un document, récupération des contacts et rôle associés à la société et association avec le document + if ($action === 'PROPAL_CREATE' || $action === 'ORDER_CREATE' || $action === 'BILL_CREATE' || $action === 'ORDER_SUPPLIER_CREATE' || $action === 'BILL_SUPPLIER_CREATE' + || $action === 'CONTRACT_CREATE' || $action === 'FICHINTER_CREATE' || $action === 'PROJECT_CREATE' || $action === 'TICKET_CREATE' || $action === 'ACTION_CREATE') { + + if(!empty($object->socid) && $object->socid != '-1') { + global $db, $langs; + + $contactdefault = new Contact($this->db); + $contactdefault->socid=$object->socid; + $TContact = $contactdefault->getContactRoles(); + + // Le trigger est appelé avant que le core n'ajoute lui-même des contacts (contact propale, clone), il ne faut pas les associer avant sinon bug + $TContactAlreadyLinked = array(); + if ($object->id > 0) + { + $class = get_class($object); + $cloneFrom = new $class($db); + $r = $cloneFrom->fetch($object->id); + + if (!empty($cloneFrom->id)) $TContactAlreadyLinked = array_merge($cloneFrom->liste_contact(-1,'external'), $cloneFrom->liste_contact(-1,'internal')); + } + + foreach($TContact as $i => $infos) { + // Gestion du cas du clone + foreach ($TContactAlreadyLinked as $contactData) { + if($contactData['id'] == $infos['fk_socpeople'] && $contactData['fk_c_type_contact'] == $infos['type_contact']) unset($TContact[$i]); + } + } + + $nb = 0; + foreach($TContact as $infos) { + // Gestion du cas spécifique de la création de propale avec sélection du contact, cela créé un bug si le contact est ajouté par le module contactdefault + $res = $object->add_contact($infos['fk_socpeople'], $infos['type_contact']); + if($res > 0) $nb++; + } + + if($nb > 0) { + setEventMessage($langs->trans('ContactAddedAutomatically', $nb)); + } + } + + dol_syslog( + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id + ); + } + } +} From 65fee73b225ca47daa3667369171fff61403790d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 17:31:20 +0200 Subject: [PATCH 320/982] Update treso.php --- htdocs/compta/bank/treso.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 10b366f0b9c..8ce3370587f 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -264,12 +264,12 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $paiement = -1*$socialcontribstatic->getSommePaiement(); // Payment already done } - $parameters = array('obj' => $obj); + $parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'payment' => $paiement); $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if(empty($reshook)){ $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; - $paiement = isset($hookmanager->resArray['paiement']) ? $hookmanager->resArray['paiement'] : $paiement; + $paiement = isset($hookmanager->resArray['payment']) ? $hookmanager->resArray['payment'] : $paiement; } $total_ttc = $obj->total_ttc; From 7c07e64adcf1b121d410644eda4471c3c87c1224 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 17:32:18 +0200 Subject: [PATCH 321/982] Update treso.php --- htdocs/compta/bank/treso.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 8ce3370587f..5b39e8fd79b 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -269,7 +269,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) if(empty($reshook)){ $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; - $paiement = isset($hookmanager->resArray['payment']) ? $hookmanager->resArray['payment'] : $paiement; + $paiement = isset($hookmanager->resArray['paiement']) ? $hookmanager->resArray['paiement'] : $paiement; } $total_ttc = $obj->total_ttc; From 481a25cb8fc3b8b9bd71a77a6c101573aa8fcbc7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 17:39:19 +0200 Subject: [PATCH 322/982] The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french). --- ChangeLog | 2 +- htdocs/compta/bank/treso.php | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7efaa290bfc..60cb7dd6ecf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,7 +18,7 @@ Following changes may create regressions for some external modules, but were nec * The function show_theme() hase been renamed into showSkins() * Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency. * The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead. -* The hook "moreFamily" must return payment into var "payment" and no more "paiement". +* The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french). diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 29bc1db3593..ac4c9c767e8 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -213,9 +213,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $i = 0; while ($i < $num) { - $paiement = ''; $ref = ''; $refcomp = ''; + $totalpayment = ''; $obj = array_shift($tab_sqlobj); @@ -236,7 +236,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $societestatic->name = $obj->name; $refcomp=$societestatic->getNomUrl(1, '', 24); - $paiement = -1*$facturefournstatic->getSommePaiement(); // Payment already done + $totalpayment = -1*$facturefournstatic->getSommePaiement(); // Payment already done } } if ($obj->family == 'invoice') @@ -250,9 +250,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $societestatic->name = $obj->name; $refcomp=$societestatic->getNomUrl(1, '', 24); - $paiement = $facturestatic->getSommePaiement(); // Payment already done - $paiement+= $facturestatic->getSumDepositsUsed(); - $paiement+= $facturestatic->getSumCreditNotesUsed(); + $totalpayment = $facturestatic->getSommePaiement(); // Payment already done + $totalpayment+= $facturestatic->getSumDepositsUsed(); + $totalpayment+= $facturestatic->getSumCreditNotesUsed(); } if ($obj->family == 'social_contribution') { @@ -261,19 +261,19 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $socialcontribstatic->lib=$obj->type; $ref = $socialcontribstatic->getNomUrl(1, 24); - $paiement = -1*$socialcontribstatic->getSommePaiement(); // Payment already done + $totalpayment = -1*$socialcontribstatic->getSommePaiement(); // Payment already done } - $parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'payment' => $paiement); + $parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment); $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if(empty($reshook)){ $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; - $paiement = isset($hookmanager->resArray['paiement']) ? $hookmanager->resArray['paiement'] : $paiement; + $totalpayment = isset($hookmanager->resArray['totalpayment']) ? $hookmanager->resArray['totalpayment'] : $totalpayment; } $total_ttc = $obj->total_ttc; - if ($paiement) $total_ttc = $obj->total_ttc - $paiement; + if ($totalpayment) $total_ttc = $obj->total_ttc - $totalpayment; $solde += $total_ttc; // We discard lines with a remainder to pay to 0 From 0a17e6bfd5adc6bc1bfc4dc3a99c264b6918cb1f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 22:39:24 +0200 Subject: [PATCH 323/982] FIX Several pb in export of documents FIX Must escape shell FIX Must exclude logs and some dirs for compressed backup FIX gzip and bzip2 must use option -f --- htdocs/admin/tools/dolibarr_export.php | 20 +++++++++++---- htdocs/admin/tools/export_files.php | 34 ++++++++++++++++---------- htdocs/core/class/utils.class.php | 24 +++++++++--------- htdocs/core/lib/files.lib.php | 28 +++++++++++++++------ 4 files changed, 70 insertions(+), 36 deletions(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index c06314daa9a..0bef19dde56 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -50,10 +50,20 @@ if (! $user->admin) if ($action == 'delete') { - $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); - $ret=dol_delete_file($file, 1); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); + if (preg_match('/^backup\//', GETPOST('urlfile', 'alpha'))) + { + $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); + $ret=dol_delete_file($file, 1); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); + } + else + { + $file=$conf->admin->dir_output.'/documents/'.basename(GETPOST('urlfile', 'alpha')); + $ret=dol_delete_file($file, 1); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); + } $action=''; } @@ -577,7 +587,7 @@ print "\n"; ?>
    -
    " id="buttonGo" />

    diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index c1ddedfea53..4f9e8b933d2 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -112,21 +112,27 @@ $utils = new Utils($db); if ($compression == 'zip') { - $ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression); + $ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.log|\/temp\/|documents\/admin\/documents\/)/'); if ($ret < 0) { - $errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputfile); + $errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir); } } elseif (in_array($compression, array('gz', 'bz'))) { - $file = substr($file, 0, strrpos($file, '.')); + $userlogin = ($user->login ? $user->login : 'unknown'); + + $outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method + + $file = substr($file, 0, strrpos($file, '.')); $file .= '.tar'; - $cmd = 'tar -cf '.$outputdir."/".$file." --exclude=documents/admin/documents -C ".DOL_DATA_ROOT." ".DOL_DATA_ROOT."/../documents/"; - exec($cmd, $out, $retval); - //var_dump($cmd, DOL_DATA_ROOT);exit; - - if ($retval != 0) + // We also exclude '/temp/' dir and 'documents/admin/documents' + $cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT); + + $result = $utils->executeCLI($cmd, $outputfile); + + $retval = $result['error']; + if ($result['result'] || ! empty($retval)) { $langs->load("errors"); dol_syslog("Documents tar retval after exec=".$retval, LOG_ERR); @@ -136,15 +142,17 @@ elseif (in_array($compression, array('gz', 'bz'))) { if ($compression == 'gz') { - $cmd = "gzip " . $outputdir."/".$file; + $cmd = "gzip -f " . $outputdir."/".$file; } if ($compression == 'bz') { - $cmd = "bzip2 " . $outputdir."/".$file; + $cmd = "bzip2 -f " . $outputdir."/".$file; } - - exec($cmd, $out, $retval); - if ($retval != 0) + + $result = $utils->executeCLI($cmd, $outputfile); + + $retval = $result['error']; + if ($result['result'] || ! empty($retval)) { $errormsg = 'Error '.$compression.' generation return '.$retval; unlink($outputdir."/".$file); diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index f86d6570e5c..86eff6613c1 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -316,27 +316,29 @@ class Utils // TODO Replace with executeCLI function if ($execmethod == 1) { - exec($fullcommandclear, $readt, $retval); - $result = $retval; + $output_arr = array(); $retval = null; + exec($fullcommandclear, $output_arr, $retval); if ($retval != 0) { $langs->load("errors"); dol_syslog("Datadump retval after exec=".$retval, LOG_ERR); - $error = 'Error '.$retval; + $errormsg = 'Error '.$retval; $ok=0; } else { $i=0; - if (!empty($readt)) - foreach($readt as $key=>$read) + if (!empty($output_arr)) { - $i++; // output line number - if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue; - fwrite($handle, $read.($execmethod == 2 ? '' : "\n")); - if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) $ok=1; - elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) $ok=1; + foreach($output_arr as $key => $read) + { + $i++; // output line number + if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue; + fwrite($handle, $read.($execmethod == 2 ? '' : "\n")); + if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) $ok=1; + elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) $ok=1; + } } } } @@ -534,6 +536,7 @@ class Utils if ($execmethod == 1) { + $retval = null; exec($command, $output_arr, $retval); $result = $retval; if ($retval != 0) @@ -545,7 +548,6 @@ class Utils } if ($execmethod == 2) // With this method, there is no way to get the return code, only output { - $ok=0; $handle = fopen($outputfile, 'w+b'); if ($handle) { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index c6a5cb14426..d2aee3e6a30 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1221,9 +1221,12 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, } } } - else dol_syslog("Failed to remove file ".$filename, LOG_WARNING); - // TODO Failure to remove can be because file was already removed or because of permission - // If error because it does not exists, we should return true, and we should return false if this is a permission problem + else + { + dol_syslog("Failed to remove file ".$filename, LOG_WARNING); + // TODO Failure to remove can be because file was already removed or because of permission + // If error because it does not exists, we should return true, and we should return false if this is a permission problem + } } } else dol_syslog("No files to delete found", LOG_DEBUG); @@ -2062,9 +2065,10 @@ function dol_uncompress($inputfile, $outputdir) * @param string $inputdir Source dir name * @param string $outputfile Target file name (output directory must exists and be writable) * @param string $mode 'zip' + * @param string $excludefiles A regex pattern. For example: '/\.log$|\/temp\//' * @return int <0 if KO, >0 if OK */ -function dol_compress_dir($inputdir, $outputfile, $mode = "zip") +function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '') { $foundhandler=0; @@ -2095,6 +2099,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip") return 1; } else*/ + //if (class_exists('ZipArchive') && ! empty($conf->global->MAIN_USE_ZIPARCHIVE_FOR_ZIP_COMPRESS)) if (class_exists('ZipArchive')) { $foundhandler=1; @@ -2102,6 +2107,13 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip") // Initialize archive object $zip = new ZipArchive(); $result = $zip->open($outputfile, ZipArchive::CREATE | ZipArchive::OVERWRITE); + if (! $result) + { + global $langs, $errormsg; + $langs->load("errors"); + $errormsg=$langs->trans("ErrorFailedToWriteInFile", $outputfile); + return -4; + } // Create recursive directory iterator /** @var SplFileInfo[] $files */ @@ -2118,9 +2130,11 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip") // Get real and relative path for current file $filePath = $file->getRealPath(); $relativePath = substr($filePath, strlen($inputdir) + 1); - - // Add current file to archive - $zip->addFile($filePath, $relativePath); + if (empty($excludefiles) || ! preg_match($excludefiles, $filePath)) + { + // Add current file to archive + $zip->addFile($filePath, $relativePath); + } } } From c8fd4a2385507cd2f4eb27f2b82107902a730892 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 22:48:35 +0200 Subject: [PATCH 324/982] Fix phpcs --- htdocs/index.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 5a22dd2e13f..d50b5248fab 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -825,13 +825,11 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $boxwork .= ''; // End table array of working board $boxwork .= ''; - if (!empty($isIntopOpenedDashBoard)) { print '
    '; print '
    ' . $openedDashBoard . '
    '; print '
    '; } - } From 5494fed0a0054b7305e1757c4c2cb7119f9ffdb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Sep 2019 03:48:12 +0200 Subject: [PATCH 325/982] Removed duplicate images --- doc/images/dolibarr_screenshot5_1280x800.png | Bin 43930 -> 0 bytes ....jpg => dolibarr_screenshot5_1920x1080.jpg} | Bin .../dolibarr_screenshot5_1920x1080_a.jpg | Bin 227972 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 doc/images/dolibarr_screenshot5_1280x800.png rename doc/images/{dolibarr_screenshot5_1920x1080_b.jpg => dolibarr_screenshot5_1920x1080.jpg} (100%) delete mode 100644 doc/images/dolibarr_screenshot5_1920x1080_a.jpg diff --git a/doc/images/dolibarr_screenshot5_1280x800.png b/doc/images/dolibarr_screenshot5_1280x800.png deleted file mode 100644 index 92f6dfa521d19ea04c289488345d87704982c95f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43930 zcmeFZcUx24wm!V*0#X!^hazC33aE6DB8Vsm(tA~@p-2fJ5C}FDMMNo56MApbJBWf( zLkkj0P&%P0y@lV*vvr?+&fXv3eXnc#2dxfy);haV`TJk>!(1&8|Jsnstl=qpI(PQI;(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ot5_1920x1080.jpg similarity index 100% rename from doc/images/dolibarr_screenshot5_1920x1080_b.jpg rename to doc/images/dolibarr_screenshot5_1920x1080.jpg diff --git a/doc/images/dolibarr_screenshot5_1920x1080_a.jpg b/doc/images/dolibarr_screenshot5_1920x1080_a.jpg deleted file mode 100644 index 1c6e2cbdbdf0c00a5fb4a513e407f9b907fd067c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 227972 zcmb5We_T^%mOp-zkRQziNF_T9l1L&9kk52yAweYk@&*);4?iO5&Xjp|yMQr>;txPj z(7Ko3;2?yOwL}7>1%kG22Me9jsWXF;O4I-^__CMiAO7JV1fKus{ZoCL;B{usdk^4{FMgPCs_os-Ld2SJ0ip6-DV7|;?z0CODMu;IQ!DQj($HrhnMh=&U zZK1mGl)In4NNro~V>0>pn2c6kNNBJ^sgMy0d9wTI z3FS)qZfn@ok7Chp*lzTz<$3v6e*TdkwjH!41nLvrY_qM0?Qw)glVR)$W)szNLK+;* zkunXIZYj~jRz~%YdRI`SCXV98F-_viTih=X4%tM$ytqm)rm%*zcpE5DO&}?(f(-1C z&`?>bb*BjkA}o`7eh#Bq%_H-}eFcuQIzA&w$B*l*q$T;g#x#h8y%(BN_6^)R zyCeLtW7L}aMpmI9g%?L;R8$yy2n$Q9$>H%e0x}pwPp}o7+?}N}Lk5AHusuS zu37YM6$(YxwQQxFl%+Th*623{2h&|u3l0!#IDa=-1kp{1D1wo`WpCxY^KHdyaet=T zL)ASix||b7Fp~KhMvIjcT9`tSrCJ&+1nRz?P#J%_JUIi>LaZfW6m0JGp}&_4 zLJ@L;`+m%`>z)DHyg^*Te*LhAI#nMaC48919=Te5bk)CLz}N&<5C#pyZok`TwlNI^ z5iDacnp1m^#lD*_XWaJxG|!dngkAqD;~P0+ZxJ| zihP9Db@C*Qw(?N)D;C!;I5U5sh+FSt_W9c*uDcGovDqr;b`9f+W5?&A=hmkjV5IP} z;!scLpCAPNGqpEbbYSrC&7fcr2*$MZq0OkFcv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gDtg%!)(UMED8+iKvLTUAY^Xx^~{oFdjc$lTN3jY6y)rWcqAKvR7iU3iKsMF-ju zYern+6_Y8WYbjn;Kt{%OC0h From a7ecf9f18b4a1ce3f9e9aa9580549853937d90f0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 4 Sep 2019 09:32:37 +0200 Subject: [PATCH 326/982] FIX Missing ticket icon on md theme --- htdocs/theme/md/img/title_ticket.png | Bin 0 -> 234 bytes htdocs/theme/md/img/title_ticketsup.png | Bin 1044 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 htdocs/theme/md/img/title_ticket.png delete mode 100644 htdocs/theme/md/img/title_ticketsup.png diff --git a/htdocs/theme/md/img/title_ticket.png b/htdocs/theme/md/img/title_ticket.png new file mode 100644 index 0000000000000000000000000000000000000000..b1cf5df0e7580226f61d129d2ebbd93506c0ee75 GIT binary patch literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE^%(yc-&<;;;jpisG|i(`nz>ARCRaxok7IL~kXzgpJm zM11VK^(HA9|5mHa<@0*ky3KvMaD~7LH>R5mMdzB|2db>yXXyFuWtvwery_%ZMTfA= zhjgLjJv)AvF52&z70kZ(`(4T8Co7wyvYBt$D^Iz;@5gSAYJ<(cFLJz|+5P3Pw|E2l Ywo4Xlix2!20y=@g)78&qol`;+0C<>DdjJ3c literal 0 HcmV?d00001 diff --git a/htdocs/theme/md/img/title_ticketsup.png b/htdocs/theme/md/img/title_ticketsup.png deleted file mode 100644 index 3ec332075e66b1160122713117fa0d8087f659c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1044 zcmV+v1nc{WP)kdg00002VoOIv0RM-N z%)bBt010qNS#tmY4c7nw4c7reD4Tcy000McNliru;sXr{7YHUBg%1D#1EonsK~zY` z&6Vv>+f@|DKj+?GOI!Oe%0ttN3<`sdEyC0&NN_>-kSr`F#uvWx?=#VuMVTRPCT5Yr zP}vM5jFurAY!phN4;j$*_q)DmDJ{$w`bN*Yn{&ROdmeJ`h5y<#QQFC2{*|_yCP87* zN0FzL|AE*dj+&fVoe_65-(Z92B{Iloa0Y6 z;Jn9-FoK6BJh*@o2OM%B4|uS20K7>T2{M(89t#fnTLn{Kj%~800OBV^8}CT~lh5Sl?fd!d`exKwPxRI0 z{dnFvGpl~FlMDG{&!vD)nh$s1CloQh$ zeuhU36K#-38Rk*pp);pfRg)fk=i(`V88s1XW`9iri%fH+0dR$B7UB1&YDR2{$ml76 z6}B8}K`#RkB!)wKP2P?}j39tcSc}?N%_jgO5#<$2WmKi}1}_8D(&Qooc&q!8CoQ79 z!;uDnM3qb1YI~*tfQ^qK+_(U6;bsUQHo$B_?`XuWVvQxl#H)~8_2f{-%~eVOl(>qU zGEVifoD%VxXam5~T8kscOYPtgr3-*AqL?E&C`W89E~^2cQgWy)9jL}+Sp?kl0?>;a z!{X7ds-SYop-MHDu%QmM(&0~h)%%y2!b=>0I9{e$s^svoPqirI(5yEA{3%@&RGav# zz#S$@)-p&k$xgKce$}c(m;8+xd|xIf!iA~?AWec+T4rxDgI=|!9|E&exn;N zKa*#l9QK6eTxV3oJd~-VeFBiM`?As@t%S9!e`mQsj^|_%c35G99Hm<=e5A%yKrO2~ zchawU4-$J9EZw8Sa!&l`vmfLi+d#Tf{g+l(r`(Wh;#Yfe@4NZBN1%S?KJ{>oal*hB zQ*4ss0Pqkb!VMz8E_bq?S!@i3pUe;6?4693*MB@;G@Bl}O?TyEkyTb%`D&N{rTqo<%tv;ioLqST O0000 Date: Wed, 4 Sep 2019 10:30:05 +0200 Subject: [PATCH 327/982] Fix injection in User-Agent --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 19517973882..4738aa90419 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1775,7 +1775,7 @@ function top_menu_user(User $user, Translate $langs) $dropdownBody.= '
    '; $dropdownBody.= '
    '.$langs->trans("Session").''; - $dropdownBody.= '
    '.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"]; + $dropdownBody.= '
    '.$langs->trans("IPAddress").': '.dol_escape_htmltag($_SERVER["REMOTE_ADDR"]); if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $dropdownBody.= '
    '.$langs->trans("ConnectedOnMultiCompany").': '.$conf->entity.' (user entity '.$user->entity.')'; $dropdownBody.= '
    '.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)'); $dropdownBody.= '
    '.$langs->trans("ConnectedSince").': '.dol_print_date($user->datelastlogin, "dayhour", 'tzuser'); @@ -1784,7 +1784,7 @@ function top_menu_user(User $user, Translate $langs) $dropdownBody.= '
    '.$langs->trans("CurrentMenuManager").': '.$menumanager->name; $langFlag=picto_from_langcode($langs->getDefaultLang()); $dropdownBody.= '
    '.$langs->trans("CurrentUserLanguage").': '.($langFlag?$langFlag.' ':'').$langs->getDefaultLang(); - $dropdownBody.= '
    '.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')'; + $dropdownBody.= '
    '.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.dol_escape_htmltag($_SERVER['HTTP_USER_AGENT']).')'; $dropdownBody.= '
    '.$langs->trans("Layout").': '.$conf->browser->layout; $dropdownBody.= '
    '.$langs->trans("Screen").': '.$_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; if ($conf->browser->layout == 'phone') $dropdownBody.= '
    '.$langs->trans("Phone").': '.$langs->trans("Yes"); From a3d417a40f791a9f74548781290eab66435d7337 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Sep 2019 11:21:41 +0200 Subject: [PATCH 328/982] Fix can't change approver of a leave request in some cases --- htdocs/holiday/card.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 87305a19fd4..2207148e4ea 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -122,7 +122,7 @@ if ($action == 'create') elseif ($starthalfday == 'afternoon') $halfday=-1; elseif ($endhalfday == 'morning') $halfday=1; - $valideur = GETPOST('valideur'); + $valideur = GETPOST('valideur', 'int'); $description = trim(GETPOST('description')); // If no type @@ -270,8 +270,8 @@ if ($action == 'update' && ! GETPOSTISSET('savevalidator')) // If this is the requestor or has read/write rights if ($cancreate) { - $valideur = $_POST['valideur']; - $description = trim($_POST['description']); + $valideur = GETPOST('valideur', 'int'); + $description = trim(GETPOST('description', 'none')); // If no start date if (empty($_POST['date_debut_'])) { @@ -1297,7 +1297,8 @@ else if (empty($include_users)) print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateHolidays"); else { - $s=$form->select_dolusers($object->fk_validator, "valideur", (($action == 'editvalidator') ? 0 : 1), ($user->admin ? '' : array($user->id)), 0, $include_users); + $arrayofvalidatorstoexclude = (($user->admin || ($user->id != $userRequest->id))? '' : array($user->id)); // Nobody if we are admin or if we are not the user of the leave. + $s=$form->select_dolusers($object->fk_validator, "valideur", (($action == 'editvalidator') ? 0 : 1), $arrayofvalidatorstoexclude, 0, $include_users); print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate")); } if ($action == 'editvalidator') From f2f2621da8dae5fcbe9b6a9f2df0341e5c9701e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Sep 2019 11:33:07 +0200 Subject: [PATCH 329/982] FIX Can't save setup of mailman module --- htdocs/admin/mailman.php | 11 ++++++++++- htdocs/admin/spip.php | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 4ee9e214890..a2403315614 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -158,8 +158,10 @@ $head = mailmanspip_admin_prepare_head(); if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { print '

    '; + print ''; + print ''; - dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + dol_fiche_head($head, 'mailman', $langs->trans("Setup"), -1, 'user'); //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; @@ -227,14 +229,21 @@ else if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { print ''; + print ''; print ''; + print $langs->trans("TestSubscribe").'
    '; print $langs->trans("EMail").'
    '; + print ''; + print '
    '; + print ''; print ''; + print $langs->trans("TestUnSubscribe").'
    '; print $langs->trans("EMail").'
    '; + print '
    '; } diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index e0b4b986969..579363395f3 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -123,8 +123,10 @@ $head = mailmanspip_admin_prepare_head(); if (! empty($conf->global->ADHERENT_USE_SPIP)) { print '
    '; + print ''; + print ''; - dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + dol_fiche_head($head, 'spip', $langs->trans("Setup"), -1, 'user'); //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; From 7d5877b8b1982ef06f0e140f56b8a983dc92d2e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Sep 2019 13:50:10 +0200 Subject: [PATCH 330/982] Doxygen --- htdocs/core/modules/modDebugBar.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modDebugBar.class.php b/htdocs/core/modules/modDebugBar.class.php index 8d51a102251..b69406ffb57 100644 --- a/htdocs/core/modules/modDebugBar.class.php +++ b/htdocs/core/modules/modDebugBar.class.php @@ -16,7 +16,7 @@ */ /** - * \defgroup debugbar Debug bar + * \defgroup debugbar Module Debug bar * \brief debugbar module descriptor. * * \file htdocs/core/modules/modDebugBar.class.php From 750182f9cdbc5131ee405c656a271a51e0e10882 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Sep 2019 13:54:36 +0200 Subject: [PATCH 331/982] Removed deprecated method actioncomm->add(), use create() instead --- ChangeLog | 2 +- htdocs/comm/action/class/actioncomm.class.php | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60cb7dd6ecf..2e0bbf78352 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,7 +19,7 @@ Following changes may create regressions for some external modules, but were nec * Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency. * The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead. * The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french). - +* Removed deprecated method actioncomm->add(), use create() instead ***** ChangeLog for 10.0.1 compared to 10.0.0 ***** diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 2caff8d242c..12926f9b360 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -497,20 +497,6 @@ class ActionComm extends CommonObject } } - /** - * Add an action/event into database. - * $this->type_id OR $this->type_code must be set. - * - * @param User $user Object user making action - * @param int $notrigger 1 = disable triggers, 0 = enable triggers - * @return int Id of created event, < 0 if KO - * @deprecated Use create instead - */ - public function add(User $user, $notrigger = 0) - { - return $this->create($user, $notrigger); - } - /** * Load an object from its id and create a new one in database * From 1950952b058f7ce749255ffe4f70db60fbb145c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Sep 2019 15:11:06 +0200 Subject: [PATCH 332/982] Missing label --- htdocs/core/modules/modTicket.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index e16b6e87fd0..620c1639901 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -19,6 +19,7 @@ /** * \defgroup ticket Module Ticket + * \brief Module for ticket and request management. * \file core/modules/modTicket.class.php * \ingroup ticket * \brief Description and activation file for module Ticket From b70587c150a4a6cfa9a3438cb80736b6a958216a Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 4 Sep 2019 15:14:16 +0200 Subject: [PATCH 333/982] NEW check if a resource is in use in an event --- htdocs/admin/resource.php | 9 ++ htdocs/comm/action/card.php | 58 ++++++++++++ htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/resource.lang | 3 + htdocs/langs/fr_FR/admin.lang | 1 + htdocs/langs/fr_FR/resource.lang | 3 + htdocs/resource/element_resource.php | 132 +++++++++++++++++++++++++-- 7 files changed, 199 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index a5a0b5fbf3f..3dfd8e1e2c2 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -127,6 +127,15 @@ print ''; print ''; print ''; + +print ''; +print ''.$langs->trans('EnableResourceUsedInEventCheck').''; +print ''; +echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK'); +print ''; +print ''; +print ''; + print ''; print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index af54186e255..f7111ccf545 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -512,6 +512,64 @@ if ($action == 'update') $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; + if (!$error) { + // check if an event resource is already in use + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element == 'action') { + $eventDateStart = $object->datep; + $eventDateEnd = $object->datef; + + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= " WHERE ac.id != " . $object->id; + $sql .= " AND er.resource_id IN ("; + $sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " WHERE er.element_id = " . $object->id; + $sql .= " AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= ")"; + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $object->error = $db->lasterror(); + $object->errors[] = $object->error; + } else { + if ($db->num_rows($resql) > 0) { + // already in use + $error++; + $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $object->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $object->errors[] = $object->error; + } + $db->free($resql); + } + + if ($error) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } + if (! $error) { $db->begin(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f59f4449b8e..e06eafd81be 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1900,6 +1900,7 @@ ResourceSetup=Configuration of Resource module UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). DisabledResourceLinkUser=Disable feature to link a resource to users DisabledResourceLinkContact=Disable feature to link a resource to contacts +EnableResourceUsedInEventCheck=Enable feature to check if a resource is in use in an event ConfirmUnactivation=Confirm module reset OnMobileOnly=On small screen (smartphone) only DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be Prospect or Customer but can't be both) diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang index 33a5046e006..134cc4c87a3 100644 --- a/htdocs/langs/en_US/resource.lang +++ b/htdocs/langs/en_US/resource.lang @@ -34,3 +34,6 @@ IdResource=Id resource AssetNumber=Serial number ResourceTypeCode=Resource type code ImportDataset_resource_1=Resources + +ErrorResourcesAlreadyInUse=Some resources are in use +ErrorResourceUseInEvent=%s use in %s event \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 7407396835b..be8e67e3359 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1896,6 +1896,7 @@ ResourceSetup=Configuration du module Ressource UseSearchToSelectResource=Utilisez un champ avec auto-complétion pour choisir les ressources (plutôt qu'une liste déroulante). DisabledResourceLinkUser=Désactiver la fonctionnalité pour lier une ressource aux utilisateurs DisabledResourceLinkContact=Désactiver la fonctionnalité pour lier une ressource aux contacts/adresses +EnableResourceUsedInEventCheck=Activer la fonctionnalité de vérification d'une ressource déjà réservée lors d'un évènement ConfirmUnactivation=Confirmer réinitialisation du module OnMobileOnly=Sur petit écran (smartphone) uniquement DisableProspectCustomerType=Désactiver le type de tiers "Prospect + Client" (le tiers doit donc être un client potentiel ou un client, mais ne peut pas être les deux) diff --git a/htdocs/langs/fr_FR/resource.lang b/htdocs/langs/fr_FR/resource.lang index be7547b36da..5db22aedcbd 100644 --- a/htdocs/langs/fr_FR/resource.lang +++ b/htdocs/langs/fr_FR/resource.lang @@ -34,3 +34,6 @@ IdResource=id ressource AssetNumber=Numéro de série ResourceTypeCode=Code de type de ressource ImportDataset_resource_1=Ressources + +ErrorResourcesAlreadyInUse=Des ressources sont déjà occupées +ErrorResourceUseInEvent=%s occupée dans l'événement %s \ No newline at end of file diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 02565a23dd0..e55399f2da4 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -87,6 +87,8 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { + $error = 0; + if ($action == 'add_element_resource' && ! $cancel) { $res = 0; @@ -100,8 +102,68 @@ if (empty($reshook)) { $objstat = fetchObjectByElement($element_id, $element, $element_ref); $objstat->element = $element; // For externals module, we need to keep @xx - $res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory); + + // TODO : add this check at update_linked_resource and when modifying event start or end date + // check if an event resource is already in use + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='dolresource' && intval($busy)==1) { + $eventDateStart = $objstat->datep; + $eventDateEnd = $objstat->datef; + $isFullDayEvent = intval($objstat->fulldayevent); + if (empty($eventDateEnd)) { + if ($isFullDayEvent) { + $eventDateStartArr = dol_getdate($eventDateStart); + $eventDateStart = dol_mktime(0, 0, 0, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + $eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + } + } + + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($objstat->element) . "'"; + $sql .= " WHERE er.resource_id = " . $resource_id; + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $objstat->error = $db->lasterror(); + $objstat->errors[] = $objstat->error; + } else { + if ($db->num_rows($resql)>0) { + // already in use + $error++; + $objstat->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $objstat->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $objstat->errors[] = $objstat->error; + } + $db->free($resql); + } + } + + if (!$error) { + $res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory); + } } + if (! $error && $res > 0) { setEventMessages($langs->trans('ResourceLinkedWithSuccess'), null, 'mesgs'); @@ -123,18 +185,72 @@ if (empty($reshook)) $object->busy = $busy; $object->mandatory = $mandatory; - $result = $object->update_element_resource($user); + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='dolresource' && intval($object->busy)==1) { + $eventDateStart = $object->objelement->datep; + $eventDateEnd = $object->objelement->datef; + $isFullDayEvent = intval($objstat->fulldayevent); + if (empty($eventDateEnd)) { + if ($isFullDayEvent) { + $eventDateStartArr = dol_getdate($eventDateStart); + $eventDateStart = dol_mktime(0, 0, 0, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + $eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + } + } - if ($result >= 0) - { + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($object->resource_type) . "'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element_type) . "'"; + $sql .= " WHERE er.resource_id = " . $object->resource_id; + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $object->error = $db->lasterror(); + $object->errors[] = $object->error; + } else { + if ($db->num_rows($resql)>0) { + // already in use + $error++; + $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $object->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $object->errors[] = $objstat->error; + } + $db->free($resql); + } + } + + if (!$error) { + $result = $object->update_element_resource($user); + if ($result < 0) $error++; + } + + if ($error) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { setEventMessages($langs->trans('RessourceLineSuccessfullyUpdated'), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id); exit; } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } } } From 7aaf3ac6293d9618f638a68bc43799c767b90d6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Sep 2019 15:41:09 +0200 Subject: [PATCH 334/982] Typo --- htdocs/install/mysql/tables/llx_user.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index c82669df7cc..ac29410873a 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -36,7 +36,7 @@ create table llx_user pass_encoding varchar(24), pass varchar(128), pass_crypted varchar(128), - pass_temp varchar(128), -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validaity) + pass_temp varchar(128), -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validity) api_key varchar(128), -- key to use REST API by this user gender varchar(10), civility varchar(6), From f7fe3d2842993a7232f722adeafe301711a207c7 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Wed, 4 Sep 2019 16:30:55 +0200 Subject: [PATCH 335/982] Fix set var in context attribute instead of object attribute --- htdocs/compta/prelevement/class/bonprelevement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 5c2204dc216..a7a17c3f18a 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1092,7 +1092,7 @@ class BonPrelevement extends CommonObject } $this->factures = $factures_prev_id; - $this->factures_prev = $factures_prev; + $this->context['factures_prev'] = $factures_prev; // Generation of SEPA file $this->filename $this->generate($format,$executiondate); From 9666200d6b94a6b959d5c0f287f9fafd877404bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Sep 2019 19:55:15 +0200 Subject: [PATCH 336/982] Enhance error management --- htdocs/core/lib/files.lib.php | 32 ++++++++++++++++++++++++-------- test/phpunit/FilesLibTest.php | 8 +++++--- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 83d7f6f7614..a5f97b3fa3a 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1884,14 +1884,16 @@ function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = '' /** - * Compress a file + * Compress a file. + * An error string may be returned into parameters. * * @param string $inputfile Source file name * @param string $outputfile Target file name * @param string $mode 'gz' or 'bz' or 'zip' + * @param string $errorstring Error string * @return int <0 if KO, >0 if OK */ -function dol_compress_file($inputfile, $outputfile, $mode = "gz") +function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring = null) { global $conf; @@ -1916,8 +1918,12 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz") $zip = new ZipArchive; if ($zip->open($outputfile, ZipArchive::CREATE) !== true) { - $errormsg="Failed to open file ".$outputfile."\n"; - dol_syslog("dol_compress_file failure - ".$errormsg, LOG_ERR); + $errorstring="dol_compress_file failure - Failed to open file ".$outputfile."\n"; + dol_syslog($errorstring, LOG_ERR); + + global $errormsg; + $errormsg = $errorstring; + return -6; } @@ -1961,12 +1967,16 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz") { global $errormsg; $errormsg=$archive->errorInfo(true); - dol_syslog("dol_compress_file failure - ".$errormsg, LOG_ERR); + if ($archive->errorCode() == PCLZIP_ERR_WRITE_OPEN_FAIL) { - dol_syslog("dol_compress_file error PCLZIP_ERR_WRITE_OPEN_FAIL", LOG_ERR); + $errorstring = "PCLZIP_ERR_WRITE_OPEN_FAIL"; + dol_syslog("dol_compress_file error - archive->errorCode() = PCLZIP_ERR_WRITE_OPEN_FAIL", LOG_ERR); return -4; } + + $errorstring = "dol_compress_file error archive->errorCode = ".$archive->errorCode()." errormsg=".$errormsg; + dol_syslog("dol_compress_file failure - ".$errormsg, LOG_ERR); return -3; } else @@ -1986,7 +1996,11 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz") } else { - dol_syslog("Try to zip with format ".$mode." with no handler for this format", LOG_ERR); + $errorstring = "Try to zip with format ".$mode." with no handler for this format"; + dol_syslog($errorstring, LOG_ERR); + + global $errormsg; + $errormsg = $errorstring; return -2; } } @@ -1994,8 +2008,10 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz") { global $langs, $errormsg; $langs->load("errors"); - dol_syslog("Failed to open file ".$outputfile, LOG_ERR); $errormsg=$langs->trans("ErrorFailedToWriteInDir"); + + $errorstring = "Failed to open file ".$outputfile; + dol_syslog($errorstring, LOG_ERR); return -1; } } diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index cbe6ad948d8..f52b7d21304 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -409,13 +409,15 @@ class FilesLibTest extends PHPUnit\Framework\TestCase $count=0; dol_delete_dir_recursive($dirout, $count, 1); - $result=dol_compress_file($filein, $fileout, $format); + $errorstring = ''; + + $result=dol_compress_file($filein, $fileout, $format, $errorstring); print __METHOD__." result=".$result."\n"; - $this->assertGreaterThanOrEqual(1, $result); + $this->assertGreaterThanOrEqual(1, $result, "Pb with dol_compress_file ".$errorstring); $result=dol_uncompress($fileout, $dirout); print __METHOD__." result=".join(',', $result)."\n"; - $this->assertEquals(0, count($result)); + $this->assertEquals(0, count($result), "Pb with dol_uncompress_file"); } /** From 4ef7e755ad56dc76eb2319f3a87a8fe819f20055 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 5 Sep 2019 09:29:40 +0200 Subject: [PATCH 337/982] FIX only check on busy resources before updating an event --- htdocs/comm/action/card.php | 7 ++++--- htdocs/resource/element_resource.php | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index f7111ccf545..ed0ad19b96d 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -524,9 +524,10 @@ if ($action == 'update') $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; $sql .= " WHERE ac.id != " . $object->id; $sql .= " AND er.resource_id IN ("; - $sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources as er"; - $sql .= " WHERE er.element_id = " . $object->id; - $sql .= " AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources"; + $sql .= " WHERE element_id = " . $object->id; + $sql .= " AND element_type = '" . $db->escape($object->element) . "'"; + $sql .= " AND busy = 1"; $sql .= ")"; $sql .= " AND er.busy = 1"; $sql .= " AND ("; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index e55399f2da4..07bcdb3fd99 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -202,6 +202,7 @@ if (empty($reshook)) $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($object->resource_type) . "'"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element_type) . "'"; $sql .= " WHERE er.resource_id = " . $object->resource_id; + $sql .= " AND ac.id != " . $object->element_id; $sql .= " AND er.busy = 1"; $sql .= " AND ("; From 9ed09db93cd5f1c263ba4b231fb046c618825fa4 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 5 Sep 2019 09:41:15 +0200 Subject: [PATCH 338/982] FIX replace "
    " by "
    " --- htdocs/comm/action/card.php | 2 +- htdocs/resource/element_resource.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index ed0ad19b96d..44d6b000efe 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -558,7 +558,7 @@ if ($action == 'update') $error++; $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; while ($obj = $db->fetch_object($resql)) { - $object->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + $object->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); } $object->errors[] = $object->error; } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 07bcdb3fd99..bb9a54a9bf0 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -151,7 +151,7 @@ if (empty($reshook)) $error++; $objstat->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; while ($obj = $db->fetch_object($resql)) { - $objstat->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + $objstat->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); } $objstat->errors[] = $objstat->error; } @@ -232,7 +232,7 @@ if (empty($reshook)) $error++; $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; while ($obj = $db->fetch_object($resql)) { - $object->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + $object->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); } $object->errors[] = $objstat->error; } From ecaa2df0b8598efdc2c4034749cdf700237803c5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 5 Sep 2019 10:37:09 +0200 Subject: [PATCH 339/982] FIX change "rowid" type in llx_accounting_account (bigint instead int) --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_accounting_account.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 8efe44db103..e19ccc1c73b 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -89,5 +89,5 @@ ALTER TABLE llx_projet ADD COLUMN usage_organize_event integer DEFAULT 0; UPDATE llx_projet set usage_opportunity = 1 WHERE fk_opp_status > 0; - +ALTER TABLE llx_accounting_account MODIFY COLUMN rowid bigint AUTO_INCREMENT; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_accounting_account.sql b/htdocs/install/mysql/tables/llx_accounting_account.sql index 727965f6a9d..fd1962b6c09 100644 --- a/htdocs/install/mysql/tables/llx_accounting_account.sql +++ b/htdocs/install/mysql/tables/llx_accounting_account.sql @@ -21,7 +21,7 @@ create table llx_accounting_account ( - rowid integer AUTO_INCREMENT PRIMARY KEY, + rowid bigint AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, datec datetime, tms timestamp, From 9601f846cef60e264a7be699b348ffe5a419001b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 5 Sep 2019 11:11:48 +0200 Subject: [PATCH 340/982] Update stripe.class.php --- htdocs/stripe/class/stripe.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index d0459e1e288..2211bf80118 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -383,6 +383,7 @@ class Stripe extends CommonObject { $metadata['dol_type'] = $object->element; $metadata['dol_id'] = $object->id; + if (isset($object->thirdparty->id)) $metadata['dol_thirdparty_id'] = $object->thirdparty->id; } $dataforintent = array( From 815d0bbc20d7b49ed5adfb06b31d8503e604bd48 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 5 Sep 2019 11:57:12 +0200 Subject: [PATCH 341/982] FIX rename "dolresource" into "resource" for compatibility with PR 11822 --- htdocs/comm/action/card.php | 2 +- htdocs/resource/element_resource.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 44d6b000efe..c9a4f782b4d 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -520,7 +520,7 @@ if ($action == 'update') $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'resource'"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; $sql .= " WHERE ac.id != " . $object->id; $sql .= " AND er.resource_id IN ("; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index bb9a54a9bf0..b842ad6c832 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -105,7 +105,7 @@ if (empty($reshook)) // TODO : add this check at update_linked_resource and when modifying event start or end date // check if an event resource is already in use - if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='dolresource' && intval($busy)==1) { + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='resource' && intval($busy)==1) { $eventDateStart = $objstat->datep; $eventDateEnd = $objstat->datef; $isFullDayEvent = intval($objstat->fulldayevent); @@ -185,7 +185,7 @@ if (empty($reshook)) $object->busy = $busy; $object->mandatory = $mandatory; - if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='dolresource' && intval($object->busy)==1) { + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='resource' && intval($object->busy)==1) { $eventDateStart = $object->objelement->datep; $eventDateEnd = $object->objelement->datef; $isFullDayEvent = intval($objstat->fulldayevent); From 4fe141c9f1eb3e4999f87e9667bd4afe8c132d00 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 5 Sep 2019 12:05:50 +0200 Subject: [PATCH 342/982] FIX Nowrap missing on amount in boxes --- htdocs/core/boxes/box_activity.php | 6 +++--- htdocs/core/boxes/box_comptes.php | 2 +- htdocs/core/boxes/box_produits_alerte_stock.php | 4 ++-- htdocs/core/boxes/box_supplier_orders.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 995ba93fb64..c313b6c526a 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -173,7 +173,7 @@ class box_activity extends ModeleBoxes $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( @@ -256,7 +256,7 @@ class box_activity extends ModeleBoxes $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( @@ -340,7 +340,7 @@ class box_activity extends ModeleBoxes ); $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency) ); diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 525562d308d..1928ac7cc94 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -134,7 +134,7 @@ class box_comptes extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="right nowraponall"', 'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code) ); diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index d1381870338..165b6db0d6b 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -179,12 +179,12 @@ class box_produits_alerte_stock extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="right nowraponall"', 'text' => $price, ); $this->info_box_contents[$line][] = array( - 'td' => 'class="nowrap"', + 'td' => 'class="right"', 'text' => $price_base_type, ); diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 34316cd1ad1..6874425db78 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -135,7 +135,7 @@ class box_supplier_orders extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="right nowrap"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); From 12868413bdaefd386e2fb8ac09ba9769cdc04336 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 13:33:49 +0200 Subject: [PATCH 343/982] Doxygen --- htdocs/core/modules/modDebugBar.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modDebugBar.class.php b/htdocs/core/modules/modDebugBar.class.php index 8d51a102251..b69406ffb57 100644 --- a/htdocs/core/modules/modDebugBar.class.php +++ b/htdocs/core/modules/modDebugBar.class.php @@ -16,7 +16,7 @@ */ /** - * \defgroup debugbar Debug bar + * \defgroup debugbar Module Debug bar * \brief debugbar module descriptor. * * \file htdocs/core/modules/modDebugBar.class.php From 3f121f07ccbd42958aa09edf68ac2a0df51f55d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 13:38:38 +0200 Subject: [PATCH 344/982] Removed deprecated properties --- htdocs/contact/class/contact.class.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e064b93504d..c73ceaf13ee 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -82,26 +82,11 @@ class Contact extends CommonObject public $civility_id; // In fact we store civility_code public $civility_code; - public $civility; + public $civility; public $address; public $zip; public $town; - /** - * @deprecated - * @see $state_id - */ - public $fk_departement; - /** - * @deprecated - * @see $state_code - */ - public $departement_code; - /** - * @deprecated - * @see $state - */ - public $departement; public $state_id; // Id of department public $state_code; // Code of department public $state; // Label of department From 1828872bd1007d4a248d9617816351ce732a885a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 13:38:38 +0200 Subject: [PATCH 345/982] Removed deprecated properties --- htdocs/contact/class/contact.class.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index bae8632e289..18da6bf476d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -81,26 +81,11 @@ class Contact extends CommonObject public $civility_id; // In fact we store civility_code public $civility_code; - public $civility; + public $civility; public $address; public $zip; public $town; - /** - * @deprecated - * @see $state_id - */ - public $fk_departement; - /** - * @deprecated - * @see $state_code - */ - public $departement_code; - /** - * @deprecated - * @see $state - */ - public $departement; public $state_id; // Id of department public $state_code; // Code of department public $state; // Label of department From 8d5105e29c88cc5a70704c393383ff6923e3df20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 13:41:29 +0200 Subject: [PATCH 346/982] Remove deprecated field --- htdocs/holiday/class/holiday.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 66c212ef4c7..d767bcdc691 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -376,7 +376,6 @@ class Holiday extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; - $this->rowid = $obj->rowid; // deprecated $this->ref = ($obj->ref?$obj->ref:$obj->rowid); $this->fk_user = $obj->fk_user; $this->date_create = $this->db->jdate($obj->date_create); From f4a7714f82c4940b5fc42e4830f49be8494fe1f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 13:42:58 +0200 Subject: [PATCH 347/982] Fix bad log --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index a5f97b3fa3a..0c72fe35fab 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2089,7 +2089,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = { $foundhandler=0; - dol_syslog("Try to zip dir ".$inputdir." into ".$outputdir." mode=".$mode); + dol_syslog("Try to zip dir ".$inputdir." into ".$outputfile." mode=".$mode); if (! dol_is_dir(dirname($outputfile)) || ! is_writable(dirname($outputfile))) { From 4a19f510fd8820e3327b6c76151c5ebb30bd2bea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 13:58:35 +0200 Subject: [PATCH 348/982] Fix scrutinizer reports --- htdocs/contrat/services_list.php | 2 +- htdocs/core/lib/asset.lib.php | 11 ++++++----- htdocs/core/lib/contract.lib.php | 6 ++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index e86433af85d..9371a9ea835 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -705,7 +705,7 @@ while ($i < min($num, $limit)) print ''; if ($obj->cstatut == 0) // If contract is draft, we say line is also draft { - print $contractstatic->LibStatut(0, 5, ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now)); + print $contractstatic->LibStatut(0, 5); } else { diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index b9890533a00..8e8b561ac8e 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -48,7 +48,7 @@ function asset_admin_prepare_head() //$this->tabs = array( // 'entity:-tabname:Title:@assets:/asset/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'assets_admin'); $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); @@ -60,7 +60,7 @@ function asset_admin_prepare_head() $head[$h][2] = 'attributes_type'; $h++; - complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'assets_admin', 'remove'); return $head; } @@ -68,11 +68,12 @@ function asset_admin_prepare_head() /** * Prepare admin pages header * + * @param Contrat $object Object related to tabs * @return array head array with tabs */ -function asset_prepare_head() +function asset_prepare_head(Asset $object) { - global $langs, $conf; + global $db, $langs, $conf; $langs->load("assets"); @@ -96,7 +97,7 @@ function asset_prepare_head() require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->assets->dir_output . '/' . get_exdir($filename, 2, 0, 1, $object, 'assets'). '/'. dol_sanitizeFileName($object->ref); + $upload_dir = $conf->assets->dir_output . '/' . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index d1a4a07689e..80609f524d4 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -101,7 +101,7 @@ function contract_prepare_head(Contrat $object) */ function contract_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf; $h = 0; $head = array(); @@ -127,9 +127,7 @@ function contract_admin_prepare_head() $head[$h][2] = 'attributeslines'; $h++; - - complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'remove'); - return $head; + return $head; } From f893854986d74ddeae506ae22cd15eb99f53572f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 14:24:13 +0200 Subject: [PATCH 349/982] Fix remove warnings --- htdocs/contact/class/contact.class.php | 2 +- htdocs/core/lib/agenda.lib.php | 6 ++---- htdocs/core/lib/bank.lib.php | 1 - htdocs/core/lib/donation.lib.php | 2 +- htdocs/core/lib/multicurrency.lib.php | 2 +- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/datapolicy/lib/datapolicy.lib.php | 4 +++- htdocs/dav/dav.lib.php | 4 ++-- htdocs/emailcollector/lib/emailcollector.lib.php | 2 ++ htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php | 2 ++ htdocs/product/inventory/lib/inventory.lib.php | 2 +- htdocs/takepos/lib/takepos.lib.php | 4 +++- htdocs/website/lib/websiteaccount.lib.php | 2 ++ 13 files changed, 21 insertions(+), 14 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index c73ceaf13ee..ebfafa698b7 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1008,7 +1008,7 @@ class Contact extends CommonObject // Removed extrafields if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) { // For avoid conflicts if trigger used - $result=$this->deleteExtraFields($this); + $result=$this->deleteExtraFields(); if ($result < 0) $error++; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index c6bc31956d6..9316dcbfeb6 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -549,15 +549,13 @@ function calendars_prepare_head($param) $h++; - $object=new stdClass(); - // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'agenda'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'agenda'); - complete_head_from_modules($conf, $langs, $object, $head, $h, 'agenda', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'agenda', 'remove'); return $head; } diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index f117bc24daf..54d1c491878 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -163,7 +163,6 @@ function bank_admin_prepare_head($object) */ function various_payment_prepare_head($object) { - global $db, $langs, $conf; $h = 0; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 91c41ffcced..7b78ac96b91 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -80,7 +80,7 @@ function donation_prepare_head($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->don->dir_output . '/' . get_exdir($filename, 2, 0, 1, $object, 'donation'). '/'. dol_sanitizeFileName($object->ref); + $upload_dir = $conf->don->dir_output . '/' . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id; diff --git a/htdocs/core/lib/multicurrency.lib.php b/htdocs/core/lib/multicurrency.lib.php index 339ca2d01bc..e44511fcb97 100644 --- a/htdocs/core/lib/multicurrency.lib.php +++ b/htdocs/core/lib/multicurrency.lib.php @@ -40,7 +40,7 @@ function multicurrencyAdminPrepareHead() $head[$h][2] = 'settings'; $h++; - complete_head_from_modules($conf, $langs, $object, $head, $h, 'multicurrency'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency'); return $head; } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 84be86f4a15..c1d42bf25b7 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -59,7 +59,7 @@ function ticketAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@ticket:/ticket/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticketadmin'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'ticketadmin'); return $head; } diff --git a/htdocs/datapolicy/lib/datapolicy.lib.php b/htdocs/datapolicy/lib/datapolicy.lib.php index b72417d7ff9..1ea83696a1b 100644 --- a/htdocs/datapolicy/lib/datapolicy.lib.php +++ b/htdocs/datapolicy/lib/datapolicy.lib.php @@ -48,7 +48,9 @@ function datapolicyAdminPrepareHead() $h++; } - complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'datapolicy'); + + complete_head_from_modules($conf, $langs, null, $head, $h, 'datapolicy', 'remove'); return $head; } diff --git a/htdocs/dav/dav.lib.php b/htdocs/dav/dav.lib.php index 3c213f400c1..058fc635fc7 100644 --- a/htdocs/dav/dav.lib.php +++ b/htdocs/dav/dav.lib.php @@ -63,9 +63,9 @@ function dav_admin_prepare_head() // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'admindav'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'admindav'); - complete_head_from_modules($conf, $langs, $object, $head, $h, 'admindav', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'admindav', 'remove'); return $head; } diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index e7cc3bcb3a0..e9cb3984819 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -81,5 +81,7 @@ function emailcollectorPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailcollector'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailcollector', 'remove'); + return $head; } diff --git a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php index e1af0259062..d9ea2f110cd 100644 --- a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php @@ -79,5 +79,7 @@ function myobjectPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'myobject@mymodule'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'myobject@mymodule', 'remove'); + return $head; } diff --git a/htdocs/product/inventory/lib/inventory.lib.php b/htdocs/product/inventory/lib/inventory.lib.php index 175c772cb61..ad2e8193449 100644 --- a/htdocs/product/inventory/lib/inventory.lib.php +++ b/htdocs/product/inventory/lib/inventory.lib.php @@ -50,7 +50,7 @@ function inventoryAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@inventory:/inventory/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'inventory'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'inventory'); return $head; } diff --git a/htdocs/takepos/lib/takepos.lib.php b/htdocs/takepos/lib/takepos.lib.php index 691f118d2cb..024e1fb9ae5 100644 --- a/htdocs/takepos/lib/takepos.lib.php +++ b/htdocs/takepos/lib/takepos.lib.php @@ -52,7 +52,9 @@ function takeposAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@takepos:/takepos/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'takepos'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos'); + + complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos', 'remove'); return $head; } diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php index 0b63be45188..8ade5eee288 100644 --- a/htdocs/website/lib/websiteaccount.lib.php +++ b/htdocs/website/lib/websiteaccount.lib.php @@ -79,5 +79,7 @@ function websiteaccountPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website', 'remove'); + return $head; } From f62c79c4455fa8bc71bdc88f8a3a1f5d1029acc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 14:26:18 +0200 Subject: [PATCH 350/982] Fix object user must be a param of delete method --- htdocs/core/class/link.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 283b296b3e3..4ad6b9d5d9a 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -355,11 +355,12 @@ class Link extends CommonObject /** * Delete a link from database * - * @return int <0 if KO, 0 if nothing done, >0 if OK + * @param User $user Object suer + * @return int <0 if KO, 0 if nothing done, >0 if OK */ - public function delete() + public function delete($user) { - global $user, $langs, $conf; + global $langs, $conf; dol_syslog(get_class($this)."::delete", LOG_DEBUG); $error = 0; From 07e647ca10e6d5afe21faee4839df2356522be3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 14:27:13 +0200 Subject: [PATCH 351/982] Fix sql outside transaction --- htdocs/core/class/link.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 4ad6b9d5d9a..a5242c597c4 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -365,13 +365,17 @@ class Link extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $error = 0; + $this->db->begin(); + // Call trigger $result=$this->call_trigger('LINK_DELETE', $user); - if ($result < 0) return -1; + if ($result < 0) + { + $this->db->rollback(); + return -1; + } // End call triggers - $this->db->begin(); - // Remove link $sql = "DELETE FROM " . MAIN_DB_PREFIX . "links"; $sql.= " WHERE rowid = " . $this->id; From c816a41006a555d502344f3aa4b8e06628b6de71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 15:00:46 +0200 Subject: [PATCH 352/982] Fix missing exit --- htdocs/externalsite/frames.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/externalsite/frames.php b/htdocs/externalsite/frames.php index eb8e06919d3..9c232cbe710 100644 --- a/htdocs/externalsite/frames.php +++ b/htdocs/externalsite/frames.php @@ -49,6 +49,7 @@ if (empty($keyforcontent) && empty($conf->global->EXTERNALSITE_URL)) llxHeader(); print '
    '.$langs->trans('ExternalSiteModuleNotComplete').'
    '; llxFooter(); + exit; } if (! empty($keyforcontent)) From 87c596a93409687b36a5ae0d591248ed9a95b364 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 15:58:54 +0200 Subject: [PATCH 353/982] Fix responsive --- htdocs/core/boxes/box_factures.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 5aa7d0575c6..05ab5db50fd 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -156,7 +156,7 @@ class box_factures extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax200"', 'text' => $societestatic->getNomUrl(1, '', 40), 'asis' => 1, ); From 6bb5860f62463dc8fe28c5621cc829529746287a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 5 Sep 2019 14:12:52 +0000 Subject: [PATCH 354/982] Fixing style errors. --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 55fef7d0185..b668ae0465f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7801,7 +7801,7 @@ abstract class CommonObject * @param string $type Type of category ('product', ...) * @return int < 0 si erreur, > 0 si ok */ - function cloneCategories($fromId, $toId, $type='') + function cloneCategories($fromId, $toId, $type = '') { $this->db->begin(); From 6902b2cbf22969c58202404c15521fa3bfa3f916 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 5 Sep 2019 16:14:15 +0200 Subject: [PATCH 355/982] fix function visibility thanks to stckler --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 55fef7d0185..0f8dd4f0c00 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7801,7 +7801,7 @@ abstract class CommonObject * @param string $type Type of category ('product', ...) * @return int < 0 si erreur, > 0 si ok */ - function cloneCategories($fromId, $toId, $type='') + public function cloneCategories($fromId, $toId, $type='') { $this->db->begin(); From 92e7d7bb26389c1633b7dd6bd7909507ac78f489 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 16:18:20 +0200 Subject: [PATCH 356/982] Fix duplicate translation --- htdocs/compta/localtax/quadri_detail.php | 2 +- htdocs/compta/tva/clients.php | 2 +- htdocs/compta/tva/quadri_detail.php | 2 +- htdocs/expensereport/class/expensereport.class.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/langs/en_US/compta.lang | 2 +- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/paybox.lang | 1 - 8 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 4bbe5c723e1..54fa04d33a2 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -170,7 +170,7 @@ $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); $namecust=$langs->trans("Name"); if ($mysoc->tva_assuj) { - $vatcust.=' ('.$langs->trans("ToPay").')'; + $vatcust.=' ('.$langs->trans("StatusToPay").')'; } // Suppliers invoices diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index e0775313dd3..e977b31e5e4 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -185,7 +185,7 @@ $productcust=$langs->trans("Description"); $namerate=$langs->trans("VATRate"); $amountcust=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) { - $vatcust.=' ('.$langs->trans("ToPay").')'; + $vatcust.=' ('.$langs->trans("StatusToPay").')'; } $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("Description"); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index c48bc385c53..26601308ccf 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -173,7 +173,7 @@ $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); $namecust=$langs->trans("Name"); if ($mysoc->tva_assuj) { - $vatcust.=' ('.$langs->trans("ToPay").')'; + $vatcust.=' ('.$langs->trans("VATToPay").')'; } // Suppliers invoices diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 9b1a62ed402..32915339297 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2340,7 +2340,7 @@ class ExpenseReport extends CommonObject { $response->warning_delay=$conf->expensereport->payment->warning_delay/60/60/24; $response->label=$langs->trans("ExpenseReportsToPay"); - $response->labelShort=$langs->trans("ToPay"); + $response->labelShort=$langs->trans("StatusToPay"); $response->url=DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=5'; } $response->img=img_object('', "trip"); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a3e6666f412..ac19cac8a34 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2203,7 +2203,7 @@ class FactureFournisseur extends CommonInvoice $response = new WorkboardResponse(); $response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24; $response->label=$langs->trans("SupplierBillsToPay"); - $response->labelShort=$langs->trans("ToPay"); + $response->labelShort=$langs->trans("StatusToPay"); $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=billing&leftmenu=suppliers_bills'; $response->img=img_object($langs->trans("Bills"), "bill"); diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 9a5f9768d24..42d88f3f722 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -63,7 +63,7 @@ LT2SupplierES=IRPF purchases LT2CustomerIN=SGST sales LT2SupplierIN=SGST purchases VATCollected=VAT collected -ToPay=To pay +StatusToPay=To pay SpecialExpensesArea=Area for all special payments SocialContribution=Social or fiscal tax SocialContributions=Social or fiscal taxes diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 5c3e30967de..397e562e265 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -412,6 +412,7 @@ DefaultTaxRate=Default tax rate Average=Average Sum=Sum Delta=Delta +StatusToPay=To pay RemainToPay=Remain to pay Module=Module/Application Modules=Modules/Applications diff --git a/htdocs/langs/en_US/paybox.lang b/htdocs/langs/en_US/paybox.lang index a4eee3680af..35216661140 100644 --- a/htdocs/langs/en_US/paybox.lang +++ b/htdocs/langs/en_US/paybox.lang @@ -11,7 +11,6 @@ YourEMail=Email to receive payment confirmation Creditor=Creditor PaymentCode=Payment code PayBoxDoPayment=Pay with Paybox -ToPay=Do payment YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card information Continue=Next ToOfferALinkForOnlinePayment=URL for %s payment From cd96238adc0407213ce276e60f6d788933e9f0be Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 5 Sep 2019 14:19:35 +0000 Subject: [PATCH 357/982] Fixing style errors. --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0f8dd4f0c00..e395f3d4455 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7801,7 +7801,7 @@ abstract class CommonObject * @param string $type Type of category ('product', ...) * @return int < 0 si erreur, > 0 si ok */ - public function cloneCategories($fromId, $toId, $type='') + public function cloneCategories($fromId, $toId, $type = '') { $this->db->begin(); From 8e7f83653400d01d98f813f5170849312868b86c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 16:23:04 +0200 Subject: [PATCH 358/982] Fix trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f59f4449b8e..9b8c6f04c51 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1851,7 +1851,7 @@ SeveralLangugeVariatFound=Several language variants found RemoveSpecialChars=Remove special characters COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN_REGEX) COMPANY_DIGITARIA_CLEAN_REGEX=Regex filter to clean value (COMPANY_DIGITARIA_CLEAN_REGEX) -COMPANY_DIGITARIA_UNIQUE_CODE=Unauthorized double +COMPANY_DIGITARIA_UNIQUE_CODE=Duplicate not allowed GDPRContact=Data Protection Officer (DPO, Data Privacy or GDPR contact) GDPRContactDesc=If you store data about European companies/citizens, you can name the contact who is responsible for the General Data Protection Regulation here HelpOnTooltip=Help text to show on tooltip From 3802734212a282999190a3e47003ceff63aa60fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 16:37:30 +0200 Subject: [PATCH 359/982] fix --- build/flatpack/org.flatpak.Dolibarr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/flatpack/org.flatpak.Dolibarr.json b/build/flatpack/org.flatpak.Dolibarr.json index 9e2135cf0a3..69140d32372 100644 --- a/build/flatpack/org.flatpak.Dolibarr.json +++ b/build/flatpack/org.flatpak.Dolibarr.json @@ -1 +1 @@ -Help wanted... \ No newline at end of file +"Help wanted..." \ No newline at end of file From 50957ab621e1a6b759d779a1ce2b081f7b3c1155 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 16:51:20 +0200 Subject: [PATCH 360/982] Sync transifex --- htdocs/langs/en_AU/admin.lang | 4 ---- htdocs/langs/en_AU/withdrawals.lang | 2 -- htdocs/langs/en_CA/admin.lang | 4 ---- htdocs/langs/en_GB/admin.lang | 4 ---- htdocs/langs/en_GB/withdrawals.lang | 1 - htdocs/langs/en_IN/admin.lang | 4 ---- htdocs/langs/es_CL/compta.lang | 1 - htdocs/langs/es_CO/compta.lang | 1 - htdocs/langs/fr_BE/admin.lang | 4 ---- htdocs/langs/fr_BE/withdrawals.lang | 1 - htdocs/langs/fr_CA/admin.lang | 4 ---- htdocs/langs/fr_CA/withdrawals.lang | 1 - htdocs/langs/fr_FR/admin.lang | 8 +++++-- htdocs/langs/fr_FR/bills.lang | 6 ++--- htdocs/langs/fr_FR/compta.lang | 2 +- htdocs/langs/fr_FR/cron.lang | 2 +- htdocs/langs/fr_FR/dict.lang | 34 +++++++++++++-------------- htdocs/langs/fr_FR/holiday.lang | 1 + htdocs/langs/fr_FR/main.lang | 3 +-- htdocs/langs/fr_FR/modulebuilder.lang | 1 + htdocs/langs/fr_FR/paybox.lang | 1 - htdocs/langs/fr_FR/products.lang | 6 ++++- htdocs/langs/fr_FR/website.lang | 4 ++++ 23 files changed, 40 insertions(+), 59 deletions(-) delete mode 100644 htdocs/langs/en_AU/withdrawals.lang diff --git a/htdocs/langs/en_AU/admin.lang b/htdocs/langs/en_AU/admin.lang index 447918b3b95..f792eabe51a 100644 --- a/htdocs/langs/en_AU/admin.lang +++ b/htdocs/langs/en_AU/admin.lang @@ -1,11 +1,7 @@ # Dolibarr language file - Source file is en_US - admin OldVATRates=Old GST rate NewVATRates=New GST rate -Module600Name=Notifications on business event DictionaryVAT=GST Rates or Sales Tax Rates OptionVatMode=GST due -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications LinkColor=Colour of links OperationParamDesc=Define values to use for action, or how to extract values. For example:
    objproperty1=SET:abc
    objproperty1=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:abc
    objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
    options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/en_AU/withdrawals.lang b/htdocs/langs/en_AU/withdrawals.lang deleted file mode 100644 index 967d1f20411..00000000000 --- a/htdocs/langs/en_AU/withdrawals.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - withdrawals -RUM=Unique Mandate Reference (UMR) diff --git a/htdocs/langs/en_CA/admin.lang b/htdocs/langs/en_CA/admin.lang index ae0ffe7f7c7..e5e33b73dd6 100644 --- a/htdocs/langs/en_CA/admin.lang +++ b/htdocs/langs/en_CA/admin.lang @@ -1,10 +1,6 @@ # Dolibarr language file - Source file is en_US - admin -Module600Name=Notifications on business event LocalTax1Management=PST Management CompanyZip=Postal code LDAPFieldZip=Postal code -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications FormatZip=Postal code OperationParamDesc=Define values to use for action, or how to extract values. For example:
    objproperty1=SET:abc
    objproperty1=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:abc
    objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
    options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/en_GB/admin.lang b/htdocs/langs/en_GB/admin.lang index 3f23aecf4be..29af3e502f6 100644 --- a/htdocs/langs/en_GB/admin.lang +++ b/htdocs/langs/en_GB/admin.lang @@ -41,14 +41,10 @@ UMaskExplanation=This parameter allows you to define permissions set by default ListOfDirectories=List of OpenDocument template directories ListOfDirectoriesForModelGenODT=List of directories containing template files in OpenDocument format.

    Put here full path of directories.
    Add a carriage return between each directory.
    To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

    Files in those directories must end with .odt or .ods. FollowingSubstitutionKeysCanBeUsed=
    To learn how to create your .odt document templates, before storing them in those directories, read wiki documentation: -Module600Name=Notifications on business event Module50200Name=PayPal DictionaryAccountancyJournal=Finance journals CompanyZip=Postcode LDAPFieldZip=Postcode GenbarcodeLocation=Barcode generation command line tool (used by internal engine for some bar code types). Must be compatible with "genbarcode".
    For example: /usr/local/bin/genbarcode -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications FormatZip=Postcode OperationParamDesc=Define values to use for action, or how to extract values. For example:
    objproperty1=SET:abc
    objproperty1=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:abc
    objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
    options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/en_GB/withdrawals.lang b/htdocs/langs/en_GB/withdrawals.lang index b34ed7e8f1f..aaf36937580 100644 --- a/htdocs/langs/en_GB/withdrawals.lang +++ b/htdocs/langs/en_GB/withdrawals.lang @@ -15,7 +15,6 @@ NotifyCredit=Payment Credit WithdrawalFileNotCapable=Unable to generate Payment receipt file for your country %s (Your country is not supported) DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Direct Debit orders to manage the direct debit payment order. When the payment order is closed, payment on the invoice will be automatically recorded, and the invoice closed if the outstanding balance is null. WithdrawalFile=Payment file -RUM=Unique Mandate Reference (UMR) WithdrawRequestAmount=The amount of Direct Debit request: WithdrawRequestErrorNilAmount=Unable to create a Direct Debit request for an empty amount. SEPALegalText=By signing this mandate form, you authorise (A) %s to send instructions to your bank to debit your account and (B) your bank to debit your account in accordance with the instructions from %s. As part of your rights, you are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited. Your rights regarding the above mandate are explained in a statement that you can obtain from your bank. diff --git a/htdocs/langs/en_IN/admin.lang b/htdocs/langs/en_IN/admin.lang index d19942507b6..e3cc80d5cea 100644 --- a/htdocs/langs/en_IN/admin.lang +++ b/htdocs/langs/en_IN/admin.lang @@ -1,7 +1,6 @@ # Dolibarr language file - Source file is en_US - admin Module20Name=Quotations Module20Desc=Management of quotations -Module600Name=Notifications on business event Permission21=Read quotations Permission22=Create/modify quotations Permission24=Validate quotations @@ -14,8 +13,5 @@ ProposalsNumberingModules=Quotation numbering models ProposalsPDFModules=Quotation documents models FreeLegalTextOnProposal=Free text on quotations WatermarkOnDraftProposal=Watermark on draft quotations (none if empty) -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications MailToSendProposal=Customer quotations OperationParamDesc=Define values to use for action, or how to extract values. For example:
    objproperty1=SET:abc
    objproperty1=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:abc
    objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
    options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/es_CL/compta.lang b/htdocs/langs/es_CL/compta.lang index 2aa54a47917..499f8f169ef 100644 --- a/htdocs/langs/es_CL/compta.lang +++ b/htdocs/langs/es_CL/compta.lang @@ -54,7 +54,6 @@ LT2CustomerES=Ventas de IRPF LT2SupplierES=Compras de IRPF LT2CustomerIN=Ventas de SGST VATCollected=IVA recaudado -ToPay=Pagar SpecialExpensesArea=Área para todos los pagos especiales SocialContribution=Impuesto social o fiscal LabelContrib=Contribución de etiqueta diff --git a/htdocs/langs/es_CO/compta.lang b/htdocs/langs/es_CO/compta.lang index c35bb1a59e1..be705a0bacc 100644 --- a/htdocs/langs/es_CO/compta.lang +++ b/htdocs/langs/es_CO/compta.lang @@ -50,7 +50,6 @@ LT2Supplier=Impuestos 3 compras LT2CustomerES=Ventas de IRPF LT2SupplierES=Compras IRPF VATCollected=IVA recaudado -ToPay=Pagar SpecialExpensesArea=Área para todos los pagos especiales. SocialContribution=Impuesto social o fiscal SocialContributions=Impuestos sociales o fiscales. diff --git a/htdocs/langs/fr_BE/admin.lang b/htdocs/langs/fr_BE/admin.lang index 7d99260c310..45352a47b83 100644 --- a/htdocs/langs/fr_BE/admin.lang +++ b/htdocs/langs/fr_BE/admin.lang @@ -16,9 +16,5 @@ FormToTestFileUploadForm=Formulaire pour tester l'upload de fichiers (selon la c IfModuleEnabled=Note: oui ne fonctionne que si le module %s est activé Module20Name=Propales Module30Name=Factures -Module600Name=Notifications on business event Target=Objectif -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications OperationParamDesc=Define values to use for action, or how to extract values. For example:
    objproperty1=SET:abc
    objproperty1=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:abc
    objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
    options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/fr_BE/withdrawals.lang b/htdocs/langs/fr_BE/withdrawals.lang index 305bdf13d8e..eb336cadcc0 100644 --- a/htdocs/langs/fr_BE/withdrawals.lang +++ b/htdocs/langs/fr_BE/withdrawals.lang @@ -1,3 +1,2 @@ # Dolibarr language file - Source file is en_US - withdrawals StatusTrans=Envoyé -RUM=Unique Mandate Reference (UMR) diff --git a/htdocs/langs/fr_CA/admin.lang b/htdocs/langs/fr_CA/admin.lang index 69ce614e588..5990a0d3fa8 100644 --- a/htdocs/langs/fr_CA/admin.lang +++ b/htdocs/langs/fr_CA/admin.lang @@ -89,7 +89,6 @@ WatermarkOnDraftExpenseReports=Filigrane sur les projets de rapports de dépense Module0Desc=Gestion des utilisateurs / employés et des groupes Module42Desc=Installations de journalisation (fichier, syslog, ...). Ces journaux sont à des fins techniques / de débogage. Module75Name=Notes de frais et déplacements -Module600Name=Notifications on business event Module2400Name=Evénements / Agenda Module2600Name=services API / Web ( serveur SOAP ) Module2600Desc=Active le serveur de Web Services de Dolibarr @@ -199,9 +198,6 @@ DeleteFiscalYear=Supprimer la période comptable ConfirmDeleteFiscalYear=Êtes-vous sûr de supprimer cette période comptable? ShowFiscalYear=Afficher la période comptable SalariesSetup=Configuration du module salariés -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications ConfFileMustContainCustom=L'installation ou la construction d'un module externe à partir de l'application doit sauvegarder les fichiers du module dans le répertoire %s. Pour que ce répertoire soit traité par Dolibarr, vous devez configurer votre conf / conf.php pour ajouter les 2 lignes de directive:
    $ dolibarr_main_url_root_alt = '/ custom';
    $ dolibarr_main_document_root_alt = '%s / custom'; HighlightLinesOnMouseHover=Mettez en surbrillance les lignes de table lorsque déplacement de la souris passe au-dessus PressF5AfterChangingThis=Appuyez sur CTRL + F5 sur le clavier ou effacez votre cache de navigateur après avoir changé cette valeur pour l'avoir efficace diff --git a/htdocs/langs/fr_CA/withdrawals.lang b/htdocs/langs/fr_CA/withdrawals.lang index d8dc0f4bd1a..f0875b5400f 100644 --- a/htdocs/langs/fr_CA/withdrawals.lang +++ b/htdocs/langs/fr_CA/withdrawals.lang @@ -53,7 +53,6 @@ DoStandingOrdersBeforePayments=Cet onglet vous permet de demander une commande d WithdrawalFile=Fichier de retrait SetToStatusSent=Définir le statut "Fichier envoyé" StatisticsByLineStatus=Statistiques par état des lignes -RUM=Unique Mandate Reference (UMR) RUMLong=Référence de mandat unique WithdrawMode=Mode de débit direct (FRST ou RECUR) WithdrawRequestAmount=Montant de la demande de débit direct: diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 7407396835b..20cdc9175d6 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -462,7 +462,9 @@ EnableAndSetupModuleCron=Si vous voulez avoir cette facture récurrente génér ModuleCompanyCodeCustomerAquarium=%s suivi d'un code client tiers pour un code comptable client ModuleCompanyCodeSupplierAquarium=%s suivi du code fournisseur tiers pour le code comptable fournisseur ModuleCompanyCodePanicum=Retourne un code comptable vide -ModuleCompanyCodeDigitaria=Renvoie un code comptable composé suivant le code tiers. Le code est composé du caractère 'C' en première position suivi des 5 premiers caractères du code tiers. +ModuleCompanyCodeDigitaria=Renvoie un code de comptabilisation composé en fonction du nom du tiers. Le code consiste en un préfixe pouvant être défini dans la première position, suivi d'un nombre de caractères défini dans le code tiers. +ModuleCompanyCodeCustomerDigitaria=%s suivi du nom de client tronqué du nombre de caractères: %s pour le code comptable client. +ModuleCompanyCodeSupplierDigitaria=%s suivi du nom du fournisseur tronqué du nombre de caractères: %s pour le code comptable fournisseur. Use3StepsApproval=Par défaut, les commandes fournisseurs nécessitent d'être créées et approuvées par 2 utilisateurs différents (une étape/utilisateur pour créer et une étape/utilisateur pour approuver. Notez que si un utilisateur à les deux permissions, ces deux actions sont effectuées en une seule fois). Cette option ajoute la nécessité d'une approbation par une troisième étape/utilisateur, si le montant de la commande est supérieur au montant d'une valeur définie (soit 3 étapes nécessaire: 1 =Validation, 2=Première approbation et 3=seconde approbation si le montant l'exige).
    Laissez le champ vide si une seule approbation (2 étapes) est suffisante, placez une valeur très faible (0.1) si une deuxième approbation (3 étapes) est toujours exigée. UseDoubleApproval=Activer l'approbation en trois étapes si le montant HT est supérieur à... WarningPHPMail=Attention : Il est préférable de configurer les emails sortant pour utiliser le serveur email de votre fournisseur plutôt que la configuration par défaut. Certains fournisseurs email (comme Yahoo) ne permettent pas l'envoi d'e-mails depuis un autre serveur que le leur si l'adresse d'envoi utilisée est une adresse autre que la leur. Votre configuration actuelle utilise le serveur de l'application pour l'envoi d'e-mails et non le serveur de votre fournisseur de messagerie, aussi certains destinataires (ceux compatibles avec le protocole restrictif DMARC) demanderont au fournisseur d'email si ils peuvent accepter l'email et certains fournisseurs (comme Yahoo) peuvent répondre "non" car le serveur utilisé pour l'envoi n'est pas un serveur appartenant au fournisseur, aussi certains de vos emails envoyés peuvent ne pas etre accepté (faites attention aussi aux quotas de votre fournisseur d'email).
    SI votre fournisseur d'email (comme Yahoo) impose cette restriction, vous devrez modifier votre configuration et opter pour l'autre méthode d'envoi "SMTP server" et saisir les identifiants SMTP de votre compte fournis par votre fournisseur d'e-mail (à demander à votre fournisseur d'e-mail) @@ -1846,8 +1848,10 @@ NothingToSetup=Aucune configuration particulière n'est requise pour ce module. SetToYesIfGroupIsComputationOfOtherGroups=Réglez ceci sur Oui si ce groupe est un calcul d'autres groupes EnterCalculationRuleIfPreviousFieldIsYes=Entrez la règle de calcul si le champ précédent a été défini sur Oui (par exemple, 'CODEGRP1 + CODEGRP2') SeveralLangugeVariatFound=Plusieurs variantes de langue trouvées -COMPANY_AQUARIUM_REMOVE_SPECIAL=Supprimer les caractères spéciaux +RemoveSpecialChars=Supprimer les caractères spéciaux COMPANY_AQUARIUM_CLEAN_REGEX=Filtre Regex pour nettoyer la valeur (COMPANY_AQUARIUM_CLEAN_REGEX) +COMPANY_DIGITARIA_CLEAN_REGEX=Filtre de regex pour nettoyer la valeur (COMPANY_DIGITARIA_CLEAN_REGEX) +COMPANY_DIGITARIA_UNIQUE_CODE=Doublons non autorisés GDPRContact=Responsable de la protection des données (DPO ou contact RGPD) GDPRContactDesc=Si vous stockez des données sur des entreprises / citoyens européens, vous pouvez stocker ici le contact responsable du RGPD. HelpOnTooltip=Texte d'aide à afficher dans l'info-bulle diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index bdf515ca297..edb61e62406 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -496,9 +496,9 @@ CantRemovePaymentWithOneInvoicePaid=Suppression impossible quand il existe au mo ExpectedToPay=Paiement attendu CantRemoveConciliatedPayment=Suppression d'un paiement rapproché impossible PayedByThisPayment=Règlé par ce paiement -ClosePaidInvoicesAutomatically=Classifiez "Payée" toutes les factures standard, d'acompte ou de remplacement entièrement payées. -ClosePaidCreditNotesAutomatically=Classer automatiquement à "Payé" les factures avoirs entièrement remboursées. -ClosePaidContributionsAutomatically=Classer "payé" toutes les contributions sociales ou fiscales payées entièrement. +ClosePaidInvoicesAutomatically=Classer "Payée" toutes les factures standard, d'acompte ou de remplacement quand le paiement est complet. +ClosePaidCreditNotesAutomatically=Classer automatiquement à "Payé" les factures d'avoirs quand le remboursement est complet. +ClosePaidContributionsAutomatically=Classer automatiquement à "Payé" toutes les contributions sociales ou fiscales quand les sont complets. AllCompletelyPayedInvoiceWillBeClosed=Toutes les factures avec un reste à payer nul seront automatiquement fermées au statut "Payé". ToMakePayment=Payer ToMakePaymentBack=Rembourser diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index d557f85e726..7732a9c8dca 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -63,7 +63,7 @@ LT2SupplierES=IRPF achats LT2CustomerIN=TVA sur les ventes LT2SupplierIN=TVA sur les achats VATCollected=TVA récupérée -ToPay=A payer +StatusToPay=A payer SpecialExpensesArea=Espace des paiements particuliers SocialContribution=Charge sociale ou fiscale SocialContributions=Charges fiscales ou sociales diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index 4a80dd19ac4..38c6d34650d 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -76,7 +76,7 @@ CronType_method=Appelle d'une méthode d'une classe Dolibarr CronType_command=Commande terminal CronCannotLoadClass=Impossible de charger le fichier %s (pour charger l'objet %s) CronCannotLoadObject=Le fichier de classe %s a été chargé, mais l'objet %s n'a pas été trouvé dedans -UseMenuModuleToolsToAddCronJobs=Aller à la page "
    Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmées et les modifier. +UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmés et les modifier. JobDisabled=Travail désactivé MakeLocalDatabaseDumpShort=Sauvegarde locale de base MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql', 'pgsql', 'auto'), 1, 'auto' ou nom du fichier à générer, nombre de fichiers de sauvegarde à garder diff --git a/htdocs/langs/fr_FR/dict.lang b/htdocs/langs/fr_FR/dict.lang index ac8d667c6e3..8da0543e2c2 100644 --- a/htdocs/langs/fr_FR/dict.lang +++ b/htdocs/langs/fr_FR/dict.lang @@ -332,27 +332,27 @@ PaperFormatCAP6=Format P6 Canadien ExpAutoCat=Voiture ExpCycloCat=2 roues ExpMotoCat=Moto -ExpAuto3CV=3 cv +ExpAuto3CV=3 CV ExpAuto4CV=4 CV -ExpAuto5CV=5 cv +ExpAuto5CV=5 CV ExpAuto6CV=6 CV -ExpAuto7CV=7 cv -ExpAuto8CV=8 cv +ExpAuto7CV=7 CV +ExpAuto8CV=8 CV ExpAuto9CV=9 CV -ExpAuto10CV=10 cv -ExpAuto11CV=11 cv -ExpAuto12CV=12 cv -ExpAuto3PCV=3 cv et plus +ExpAuto10CV=10 CV +ExpAuto11CV=11 CV +ExpAuto12CV=12 CV +ExpAuto3PCV=3 CV et plus ExpAuto4PCV=4 CV et plus -ExpAuto5PCV=5 cv et plus -ExpAuto6PCV=6 cv et plus -ExpAuto7PCV=7 cv et plus -ExpAuto8PCV=8 cv et plus -ExpAuto9PCV=9 cv et plus -ExpAuto10PCV=10 cv et plus -ExpAuto11PCV=11 cv et plus -ExpAuto12PCV=12 cv et plus -ExpAuto13PCV=13 cv et plus +ExpAuto5PCV=5 CV et plus +ExpAuto6PCV=6 CV et plus +ExpAuto7PCV=7 CV et plus +ExpAuto8PCV=8 CV et plus +ExpAuto9PCV=9 CV et plus +ExpAuto10PCV=10 CV et plus +ExpAuto11PCV=11 CV et plus +ExpAuto12PCV=12 CV et plus +ExpAuto13PCV=13 CV et plus ExpCyclo=Capacité inférieure à 50 cm3 ExpMoto12CV=2 roues 1 ou 2 cv ExpMoto345CV=2 roues 3, 4 ou 5 cv diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index 1dd59973aea..dfc6e33299a 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -18,6 +18,7 @@ ValidatorCP=Approbateur ListeCP=Liste des demandes de congés LeaveId=ID demande de congès ReviewedByCP=Sera approuvé par +UserID=ID Utilisateur UserForApprovalID=ID de l'utilisateur d'approbation UserForApprovalFirstname=Prénom de l'utilisateur d'approbation UserForApprovalLastname=Nom de l'utilisateur d'approbation diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index ec5d8a471df..b375a3e16e0 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -348,8 +348,6 @@ PriceUTTC=P.U TTC Amount=Montant AmountInvoice=Montant facture AmountInvoiced=Montant facturé -AmountInvoicedHT=Montant HT facturé -AmountInvoicedTTC=Montant TTC facturé AmountPayment=Montant paiement AmountHTShort=Montant HT AmountTTCShort=Montant TTC @@ -414,6 +412,7 @@ DefaultTaxRate=Taux de taxe par défaut Average=Moyenne Sum=Somme Delta=Écart +StatusToPay=A payer RemainToPay=Reste à payer Module=Module/Application Modules=Modules/Applications diff --git a/htdocs/langs/fr_FR/modulebuilder.lang b/htdocs/langs/fr_FR/modulebuilder.lang index 8aad310a172..5efb048a4a2 100644 --- a/htdocs/langs/fr_FR/modulebuilder.lang +++ b/htdocs/langs/fr_FR/modulebuilder.lang @@ -105,6 +105,7 @@ InitStructureFromExistingTable=Construire la chaîne du tableau de structure d'u UseAboutPage=Désactiver la page "à propos de" UseDocFolder=Désactiver le dossier de la documentation UseSpecificReadme=Utiliser un fichier ReadMe spécifique +ContentOfREADMECustomized=Remarque: le contenu du fichier README.md a été remplacé par la valeur spécifique définie dans la configuration de ModuleBuilder. RealPathOfModule=Chemin réel du dossier du module ContentCantBeEmpty=Le contenu du fichier ne peut pas être vide WidgetDesc=Vous pouvez générer et éditer ici les widgets qui seront intégrés à votre module. diff --git a/htdocs/langs/fr_FR/paybox.lang b/htdocs/langs/fr_FR/paybox.lang index 2f0891171a5..6a79a2196a6 100644 --- a/htdocs/langs/fr_FR/paybox.lang +++ b/htdocs/langs/fr_FR/paybox.lang @@ -11,7 +11,6 @@ YourEMail=Email de confirmation du paiement Creditor=Bénéficiaire PaymentCode=Code de paiement PayBoxDoPayment=Payer avec PayBox -ToPay=Saisir règlement YouWillBeRedirectedOnPayBox=Vous serez redirigé vers la page sécurisée Paybox de saisie de votre carte bancaire Continue=Continuer ToOfferALinkForOnlinePayment=URL de paiement %s diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index a1dc8e412a6..a0473ad8c76 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -29,10 +29,14 @@ ProductOrService=Produit ou Service ProductsAndServices=Produits et Services ProductsOrServices=Produits ou Services ProductsPipeServices=Produits | Services +ProductsOnSale=Produits en vente +ProductsOnPurchase=Produits en achat ProductsOnSaleOnly=Produits en vente uniquement ProductsOnPurchaseOnly=Produits seulement en achat ProductsNotOnSell=Produits hors vente et hors achat ProductsOnSellAndOnBuy=Produits en vente et en achat +ServicesOnSale=Services en vente +ServicesOnPurchase=Services en achat ServicesOnSaleOnly=Services en vente uniquement ServicesOnPurchaseOnly=Services en achat uniquement ServicesNotOnSell=Services hors vente et hors achat @@ -340,4 +344,4 @@ ErrorCopyProductCombinations=Une erreur s'est produite lors de la copie des vari ErrorDestinationProductNotFound=Produit destination non trouvé ErrorProductCombinationNotFound=Variante du produit non trouvé ActionAvailableOnVariantProductOnly=Action disponible uniquement sur la variante du produit -ProductsPricePerCustomer=Prix produit par clients \ No newline at end of file +ProductsPricePerCustomer=Prix produit par clients diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang index 0858738f1fb..608da399e3a 100644 --- a/htdocs/langs/fr_FR/website.lang +++ b/htdocs/langs/fr_FR/website.lang @@ -114,3 +114,7 @@ CSSContentTooltipHelp=Entrez ici le contenu CSS. Pour éviter tout conflit avec LinkAndScriptsHereAreNotLoadedInEditor=Avertissement: Ce contenu est affiché uniquement lorsque le site est accessible depuis un serveur. Il n'est pas utilisé en mode édition. Par conséquent, si vous devez charger des fichiers javascript également en mode édition, ajoutez simplement la balise 'script src=...' dans la page. Dynamiccontent=Exemple de page à contenu dynamique ImportSite=Importer modèle de site web +EditInLineOnOff=Mode 'Modifier en ligne' est %s +ShowSubContainersOnOff=Mode 'exécution dynamique' est %s +GlobalCSSorJS=Fichier CSS/JS/Header global du site Web +BackToHomePage=Retour à la page d'accueil... From 04174316c81d49825cb61c82b872c4435ff59826 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 17:57:21 +0200 Subject: [PATCH 361/982] Fix css for expanded dir in ecm --- htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index bc76fd445c3..a63ce37fdfe 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2207,6 +2207,9 @@ img.toolbarbutton { height: 30px; } +li.expanded > a.fmdirlia.jqft.ecmjqft { + font-weight: bold !important; +} diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 983d0773f48..c621e909095 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2351,6 +2351,9 @@ img.toolbarbutton { height: 30px; } +li.expanded > a.fmdirlia.jqft.ecmjqft { + font-weight: bold !important; +} /* ============================================================================== */ From 37a32af7b00763642fc8be05ddf98e7c647230a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 20:06:09 +0200 Subject: [PATCH 362/982] NEW Add dictionary to store public holidays. --- htdocs/admin/dict.php | 68 ++++++++++--------- htdocs/core/lib/admin.lib.php | 10 ++- .../mysql/data/llx_c_hrm_public_holiday.sql | 43 ++++++++++++ .../install/mysql/migration/10.0.0-11.0.0.sql | 17 ++++- .../install/mysql/tables/llx_c_field_list.sql | 1 - .../tables/llx_c_hrm_public_holiday.key.sql | 21 ++++++ .../mysql/tables/llx_c_hrm_public_holiday.sql | 31 +++++++++ htdocs/langs/en_US/hrm.lang | 1 + 8 files changed, 158 insertions(+), 34 deletions(-) create mode 100644 htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql create mode 100644 htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql create mode 100644 htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ee90a0638fb..2c6b41b7796 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -88,7 +88,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0); +$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,32,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0); // Name of SQL tables of dictionaries $tabname=array(); @@ -123,9 +123,10 @@ $tabname[28]= MAIN_DB_PREFIX."c_holiday_types"; $tabname[29]= MAIN_DB_PREFIX."c_lead_status"; $tabname[30]= MAIN_DB_PREFIX."c_format_cards"; //$tabname[31]= MAIN_DB_PREFIX."accounting_system"; -//$tabname[32]= MAIN_DB_PREFIX."c_accounting_category"; +$tabname[32]= MAIN_DB_PREFIX."c_hrm_public_holiday"; $tabname[33]= MAIN_DB_PREFIX."c_hrm_department"; $tabname[34]= MAIN_DB_PREFIX."c_hrm_function"; + $tabname[35]= MAIN_DB_PREFIX."c_exp_tax_cat"; $tabname[36]= MAIN_DB_PREFIX."c_exp_tax_range"; $tabname[37]= MAIN_DB_PREFIX."c_units"; @@ -163,7 +164,7 @@ $tablib[28]= "DictionaryHolidayTypes"; $tablib[29]= "DictionaryOpportunityStatus"; $tablib[30]= "DictionaryFormatCards"; //$tablib[31]= "DictionaryAccountancysystem"; -//$tablib[32]= "DictionaryAccountancyCategory"; +$tablib[32]= "DictionaryPublicHolidays"; $tablib[33]= "DictionaryDepartment"; $tablib[34]= "DictionaryFunction"; $tablib[35]= "DictionaryExpenseTaxCat"; @@ -203,7 +204,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new $tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; $tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; //$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s"; -//$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; +$tabsql[32]= "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country=c.rowid AND c.active=1"; $tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department"; $tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function"; $tabsql[35]= "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c"; @@ -243,7 +244,7 @@ $tabsqlsort[28]="country ASC, code ASC"; $tabsqlsort[29]="position ASC"; $tabsqlsort[30]="code ASC"; //$tabsqlsort[31]="pcg_version ASC"; -//$tabsqlsort[32]="position ASC"; +$tabsqlsort[32]="year ASC, month ASC, day ASC"; $tabsqlsort[33]="code ASC"; $tabsqlsort[34]="code ASC"; $tabsqlsort[35]="c.label ASC"; @@ -283,7 +284,7 @@ $tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country"; $tabfield[29]= "code,label,percent,position"; $tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfield[31]= "pcg_version,label"; -//$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country"; +$tabfield[32]= "code,year,month,day,country_id,country"; $tabfield[33]= "code,label"; $tabfield[34]= "code,label"; $tabfield[35]= "label"; @@ -323,7 +324,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country"; $tabfieldvalue[29]= "code,label,percent,position"; $tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldvalue[31]= "pcg_version,label"; -//$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country"; +$tabfieldvalue[32]= "code,day,month,year,country"; $tabfieldvalue[33]= "code,label"; $tabfieldvalue[34]= "code,label"; $tabfieldvalue[35]= "label"; @@ -364,15 +365,16 @@ $tabfieldinsert[29]= "code,label,percent,position"; $tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldinsert[31]= "pcg_version,label"; //$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country"; +$tabfieldinsert[32]= "code,day,month,year,fk_country"; $tabfieldinsert[33]= "code,label"; $tabfieldinsert[34]= "code,label"; $tabfieldinsert[35]= "label"; $tabfieldinsert[36]= "range_ik,fk_c_exp_tax_cat"; $tabfieldinsert[37]= "code,label,short_label,unit_type,scale"; -// Rowid name if the field is not autoincrement type -// Example: "" if id field is "rowid" and has autoincrement on -// "nameoffield" if id field is not "rowid" or has not autoincrement on +// Rowid name of field depending if field is autoincrement on or off.. +// Use "" if id field is "rowid" and has autoincrement on +// Use "nameoffield" if id field is not "rowid" or has not autoincrement on $tabrowid=array(); $tabrowid[1] = ""; $tabrowid[2] = ""; @@ -405,7 +407,7 @@ $tabrowid[28]= ""; $tabrowid[29]= ""; $tabrowid[30]= ""; //$tabrowid[31]= ""; -//$tabrowid[32]= ""; +$tabrowid[32]= "id"; $tabrowid[33]= "rowid"; $tabrowid[34]= "rowid"; $tabrowid[35]= ""; @@ -445,7 +447,7 @@ $tabcond[28]= ! empty($conf->holiday->enabled); $tabcond[29]= ! empty($conf->projet->enabled); $tabcond[30]= ! empty($conf->label->enabled); //$tabcond[31]= ! empty($conf->accounting->enabled); -//$tabcond[32]= ! empty($conf->accounting->enabled); +$tabcond[32]= (! empty($conf->holiday->enabled) || ! empty($conf->hrm->enabled)); $tabcond[33]= ! empty($conf->hrm->enabled); $tabcond[34]= ! empty($conf->hrm->enabled); $tabcond[35]= ! empty($conf->expensereport->enabled); @@ -485,12 +487,12 @@ $tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$lan $tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList")); $tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize")); //$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode")); -//$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode")); +$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'daterule'=>"Use 'date'", 'country'=>$langs->trans("EnterACountryOnlyIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear")); $tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode")); -$tabhelp[35]= array(); -$tabhelp[36]= array('range_ik'=>$langs->trans('PrevRangeToThisRange')); -$tabhelp[37]= array('code'=>$langs->trans("EnterAnyCode")); +$tabhelp[35] = array(); +$tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange')); +$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode")); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); @@ -525,12 +527,12 @@ $tabfieldcheck[28] = array(); $tabfieldcheck[29] = array(); $tabfieldcheck[30] = array(); //$tabfieldcheck[31] = array(); -//$tabfieldcheck[32] = array(); +$tabfieldcheck[32] = array(); $tabfieldcheck[33] = array(); $tabfieldcheck[34] = array(); -$tabfieldcheck[35]= array(); -$tabfieldcheck[36]= array(); -$tabfieldcheck[37]= array(); +$tabfieldcheck[35] = array(); +$tabfieldcheck[36] = array(); +$tabfieldcheck[37] = array(); // Complete all arrays with entries found into modules complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck); @@ -621,9 +623,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory - if ($value == 'country' && in_array($tablib[$id], array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory - if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; + // Discard check of mandatory fields for country for some tables + if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays','DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory + if ($value == 'country' && in_array($tablib[$id], array('DictionaryPublicHolidays','DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory + // Discard check of mandatory fiedls for other fields + if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'color' && empty($_POST['color'])) continue; if ($value == 'formula' && empty($_POST['formula'])) continue; @@ -992,8 +996,10 @@ if ($id) if (! preg_match('/ WHERE /', $sql)) $sql.= " WHERE 1 = 1"; if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id; - if ($search_code != '' && $id != 9) $sql.= natural_search("code", $search_code); if ($search_code != '' && $id == 9) $sql.= natural_search("code_iso", $search_code); + elseif ($search_code != '' && $id == 28) $sql.= natural_search("h.code", $search_code); + elseif ($search_code != '' && $id == 32) $sql.= natural_search("a.code", $search_code); + elseif ($search_code != '' && $id != 9) $sql.= natural_search("code", $search_code); if ($sortfield) { @@ -1053,7 +1059,7 @@ if ($id) continue; } - // Define field friedly name from its technical name + // Define field friendly name from its technical name $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate $class=''; @@ -1156,7 +1162,8 @@ if ($id) print ''; // Line to enter new values - print ''; + print ''; + print ''; $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. @@ -1632,10 +1639,10 @@ if ($id) if ($obj->code == 'RECEP') $canbemodified=1; if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm") $canbemodified=1; - // Url + // Build Url. The table is id=, the id of line is rowid= $rowidcol=$tabrowid[$id]; // If rowidcol not defined - if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27))) $rowidcol='rowid'; + if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27,32))) $rowidcol='rowid'; $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((! empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0')?$obj->{$rowidcol}:(! empty($obj->code)?urlencode($obj->code):'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); if (! empty($param)) $url .= '&'.$param; if (! is_null($withentity)) $url .= '&entity='.$withentity; @@ -1971,7 +1978,6 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } else { - $fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''; if ($fieldlist[$field]=='sortorder') @@ -1981,11 +1987,11 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $classtd=''; $class=''; if ($fieldlist[$field]=='code') $class='maxwidth100'; - if (in_array($fieldlist[$field], array('pos', 'use_default', 'affect', 'delay', 'position', 'sortorder', 'sens', 'category_type'))) $class='maxwidth50'; + if (in_array($fieldlist[$field], array('dayrule', 'day', 'month', 'year', 'pos', 'use_default', 'affect', 'delay', 'position', 'sortorder', 'sens', 'category_type'))) $class='maxwidth50'; if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) $class='quatrevingtpercent'; print ''; $transfound=0; - if (in_array($fieldlist[$field], array('label','libelle'))) + if (in_array($fieldlist[$field], array('label','libelle'))) // For label { $transkey=''; // Special case for labels diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6635220cc23..cf5ab8dc7e0 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1094,6 +1094,8 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab { global $db, $modules, $conf, $langs; + dol_syslog("complete_dictionary_with_modules Search external modules to complete the list of dictionnary tables", LOG_DEBUG, 1); + // Search modules $modulesdir = dolGetModulesDirs(); $i = 0; // is a sequencer of modules found @@ -1191,6 +1193,8 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab } } + dol_syslog("", LOG_DEBUG, -1); + return 1; } @@ -1259,7 +1263,7 @@ function activateModulesRequiredByCountry($country_code) } /** - * Add external modules to list of contact element + * Search external modules to complete the list of contact element * * @param array $elementList elementList * @return int 1 @@ -1278,6 +1282,8 @@ function complete_elementList_with_modules(&$elementList) $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. + dol_syslog("complete_elementList_with_modules Search external modules to complete the list of contact element", LOG_DEBUG, 1); + $modulesdir = dolGetModulesDirs(); foreach ($modulesdir as $dir) @@ -1355,6 +1361,8 @@ function complete_elementList_with_modules(&$elementList) } } + dol_syslog("", LOG_DEBUG, -1); + return 1; } diff --git a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql new file mode 100644 index 00000000000..5b6f4bf3f0c --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql @@ -0,0 +1,43 @@ +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- Copyright (C) 2003 Jean-Louis Bergamo +-- Copyright (C) 2004-2010 Laurent Destailleur +-- Copyright (C) 2004 Benoit Mortier +-- Copyright (C) 2004 Guillaume Delecourt +-- Copyright (C) 2005-2012 Regis Houssin +-- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2019 Markus Welters +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + + +-- LIST ON https://fr.wikipedia.org/wiki/Jour_férié + + +-- A lot of countries +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('NEWYEARDAY1', 0, 0, 0, 1, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('LABORDAY1', 0, 0, 0, 5, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('CHRISTMASDAY1', 0, 0, 0, 12, 25, 1); + +-- France only +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRVICTORYDAY', 0, 1, 0, 5, 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRNATIONALDAY', 0, 1, 0, 7, 14, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRASSOMPTION', 0, 1, 0, 8, 15, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRTOUSSAINT', 0, 1, 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRARMISTICE', 0, 1, 0, 11, 11, 1); diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 8efe44db103..64de0364139 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -89,5 +89,20 @@ ALTER TABLE llx_projet ADD COLUMN usage_organize_event integer DEFAULT 0; UPDATE llx_projet set usage_opportunity = 1 WHERE fk_opp_status > 0; - + +create table llx_c_hrm_public_holiday +( + id integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 0 NOT NULL, -- multi company id, 0 = all + fk_country integer, + code varchar(62), + dayrule varchar(255) DEFAULT 'date', -- 'date', 'xxx', ... + day integer, + month integer, + year integer, -- 0 for all years + active integer DEFAULT 1, + import_key varchar(14) +)ENGINE=innodb; + + \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_c_field_list.sql b/htdocs/install/mysql/tables/llx_c_field_list.sql index 44b02c35248..fa528bec0ef 100644 --- a/htdocs/install/mysql/tables/llx_c_field_list.sql +++ b/htdocs/install/mysql/tables/llx_c_field_list.sql @@ -36,5 +36,4 @@ create table llx_c_field_list visible tinyint DEFAULT 1 NOT NULL, -- visibility of field. 0=Never visible, 1=Visible on list and forms, 2=Visible on list only enabled varchar(255) DEFAULT 1, -- Condition to show or hide rang integer DEFAULT 0 - )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql new file mode 100644 index 00000000000..23dcbf355b4 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql @@ -0,0 +1,21 @@ +-- ======================================================================== +-- Copyright (C) 2019 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_hrm_public_holiday ADD UNIQUE INDEX uk_c_hrm_public_holiday(entity, code); +ALTER TABLE llx_c_hrm_public_holiday ADD UNIQUE INDEX uk_c_hrm_public_holiday2(entity, day, month, year); + diff --git a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql new file mode 100644 index 00000000000..7efbe314875 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql @@ -0,0 +1,31 @@ +-- ======================================================================== +-- Copyright (C) 2019 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== + +create table llx_c_hrm_public_holiday +( + id integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 0 NOT NULL, -- multi company id, 0 = all + fk_country integer, + code varchar(62), + dayrule varchar(255) DEFAULT 'date', -- 'date', 'xxx', ... + day integer, + month integer, + year integer, -- 0 for all years + active integer DEFAULT 1, + import_key varchar(14) +)ENGINE=innodb; diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 12bb1592cbc..3697c47e30d 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -9,6 +9,7 @@ ConfirmDeleteEstablishment=Are you sure you wish to delete this establishment? OpenEtablishment=Open establishment CloseEtablishment=Close establishment # Dictionary +DictionaryPublicHolidays=HRM - Public holidays DictionaryDepartment=HRM - Department list DictionaryFunction=HRM - Function list # Module From e91b6f7843dfde2f0d66c4bcac89e6de5496fd0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 22:48:33 +0200 Subject: [PATCH 363/982] FIX Can't delete a draft leave even if it should --- htdocs/holiday/card.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 2207148e4ea..7301d08f87b 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -55,13 +55,6 @@ $langs->load("holiday"); $childids = $user->getAllChildIds(1); -$cancreate = 0; -if (! empty($user->rights->holiday->write_all)) $cancreate=1; -if (! empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate=1; - -$candelete = 0; -if (! empty($user->rights->holiday->delete)) $candelete=1; - $morefilter = 'AND employee = 1'; if (! empty($conf->global->HOLIDAY_FOR_NON_SALARIES_TOO)) $morefilter = ''; @@ -82,6 +75,14 @@ if ($id > 0) } } +$cancreate = 0; +if (! empty($user->rights->holiday->write_all)) $cancreate=1; +if (! empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate=1; + +$candelete = 0; +if (! empty($user->rights->holiday->delete)) $candelete=1; +if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->create && in_array($object->fk_user, $childids)) $candelete=1; + /* * Actions @@ -1435,7 +1436,7 @@ else { print ''.$langs->trans("SetToDraft").''; } - if ($user->rights->holiday->delete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) // If draft or canceled or refused + if ($candelete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) // If draft or canceled or refused { print ''.$langs->trans("DeleteCP").''; } From 9a823f1c64c9cd619cc418772c7fb663f2287e60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 22:51:26 +0200 Subject: [PATCH 364/982] Fix bad perm --- htdocs/holiday/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 7301d08f87b..204d832a94c 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -81,8 +81,7 @@ if (! empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $ca $candelete = 0; if (! empty($user->rights->holiday->delete)) $candelete=1; -if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->create && in_array($object->fk_user, $childids)) $candelete=1; - +if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write && in_array($object->fk_user, $childids)) $candelete=1; /* * Actions From 04adbd8c80d8bd532a76e942dc4358b2acc17d57 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 01:52:51 +0200 Subject: [PATCH 365/982] Fix conflict between new module reception and old process Fix inventory record does not need status at creation --- htdocs/admin/stock.php | 120 ++++++++---------- htdocs/admin/supplier_order.php | 34 +++-- .../class/fournisseur.commande.class.php | 3 +- htdocs/fourn/commande/card.php | 80 +++++++----- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/en_US/orders.lang | 2 +- htdocs/langs/en_US/sendings.lang | 2 + htdocs/langs/en_US/stocks.lang | 4 +- htdocs/langs/fr_FR/orders.lang | 2 +- .../inventory/class/inventory.class.php | 4 +- htdocs/reception/card.php | 4 +- 11 files changed, 135 insertions(+), 122 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 7c22d1a4a58..572f034f259 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -103,14 +103,14 @@ print '
    '; print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; $found=0; print ''; print ''; -print ''; print ''; -print ''; print ''; -print ''; print ''; -print ''; print ''; print ''; From 3a2b3d311a66791f35940fb185be72d2e02bd66d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 8 Sep 2019 04:57:09 +0200 Subject: [PATCH 413/982] Traduction --- .../core/modules/barcode/doc/phpbarcode.modules.php | 6 +++--- .../modules/barcode/doc/tcpdfbarcode.modules.php | 6 +++--- htdocs/core/modules/bom/modules_bom.php | 13 +++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php index 96cf345ff09..d6bcb3fcd25 100644 --- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php @@ -71,10 +71,10 @@ class modPhpbarcode extends ModeleBarCode } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php index 3d2564591da..6e80a430204 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -67,10 +67,10 @@ class modTcpdfbarcode extends ModeleBarCode } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/bom/modules_bom.php b/htdocs/core/modules/bom/modules_bom.php index fc4d2167980..a26cdafd17a 100644 --- a/htdocs/core/modules/bom/modules_bom.php +++ b/htdocs/core/modules/bom/modules_bom.php @@ -85,7 +85,7 @@ abstract class ModeleNumRefBoms } /** - * Renvoie la description par defaut du modele de numerotation + * Returns the default description of the numbering template * * @return string Texte descripif */ @@ -97,7 +97,7 @@ abstract class ModeleNumRefBoms } /** - * Renvoie un exemple de numerotation + * Returns an example of numbering * * @return string Example */ @@ -109,9 +109,10 @@ abstract class ModeleNumRefBoms } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { @@ -119,7 +120,7 @@ abstract class ModeleNumRefBoms } /** - * Renvoie prochaine valeur attribuee + * Returns next assigned value * * @param Societe $objsoc Object thirdparty * @param Object $object Object we need next value for @@ -132,7 +133,7 @@ abstract class ModeleNumRefBoms } /** - * Renvoie version du module numerotation + * Returns version of numbering module * * @return string Valeur */ From d9fa32b555da7b630b89bf8156fb144f6a340e4f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 8 Sep 2019 05:00:24 +0200 Subject: [PATCH 414/982] Traduction --- htdocs/core/modules/bom/mod_bom_advanced.php | 2 +- htdocs/core/modules/bom/mod_bom_standard.php | 2 +- htdocs/core/modules/cheque/mod_chequereceipt_mint.php | 2 +- htdocs/core/modules/cheque/mod_chequereceipt_thyme.php | 2 +- htdocs/core/modules/commande/mod_commande_marbre.php | 2 +- htdocs/core/modules/commande/mod_commande_saphir.php | 2 +- htdocs/core/modules/dons/modules_don.php | 2 +- htdocs/core/modules/expensereport/mod_expensereport_sand.php | 2 +- htdocs/core/modules/facture/mod_facture_mars.php | 2 +- htdocs/core/modules/facture/mod_facture_terre.php | 2 +- htdocs/core/modules/facture/modules_facture.php | 2 +- htdocs/core/modules/fichinter/mod_arctic.php | 2 +- htdocs/core/modules/fichinter/mod_pacific.php | 2 +- htdocs/core/modules/livraison/mod_livraison_jade.php | 2 +- htdocs/core/modules/livraison/modules_livraison.php | 2 +- htdocs/core/modules/payment/mod_payment_ant.php | 2 +- htdocs/core/modules/payment/mod_payment_cicada.php | 2 +- htdocs/core/modules/product/modules_product.class.php | 2 +- htdocs/core/modules/project/mod_project_universal.php | 2 +- htdocs/core/modules/project/modules_project.php | 2 +- htdocs/core/modules/project/task/mod_task_universal.php | 2 +- htdocs/core/modules/project/task/modules_task.php | 2 +- htdocs/core/modules/propale/mod_propale_saphir.php | 2 +- htdocs/core/modules/propale/modules_propale.php | 2 +- .../modules/supplier_order/mod_commande_fournisseur_muguet.php | 2 +- .../supplier_order/mod_commande_fournisseur_orchidee.php | 2 +- .../modules/supplier_payment/mod_supplier_payment_brodator.php | 2 +- .../modules/supplier_payment/mod_supplier_payment_bronan.php | 2 +- .../modules/supplier_proposal/mod_supplier_proposal_saphir.php | 2 +- .../modules/supplier_proposal/modules_supplier_proposal.php | 2 +- htdocs/core/modules/ticket/mod_ticket_universal.php | 2 +- htdocs/core/modules/ticket/modules_ticket.php | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/htdocs/core/modules/bom/mod_bom_advanced.php b/htdocs/core/modules/bom/mod_bom_advanced.php index aa8eef7aa59..3f6be391a37 100644 --- a/htdocs/core/modules/bom/mod_bom_advanced.php +++ b/htdocs/core/modules/bom/mod_bom_advanced.php @@ -92,7 +92,7 @@ class mod_bom_advanced extends ModeleNumRefboms } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php index 39af3ecc7e1..60870da1a01 100644 --- a/htdocs/core/modules/bom/mod_bom_standard.php +++ b/htdocs/core/modules/bom/mod_bom_standard.php @@ -61,7 +61,7 @@ class mod_bom_standard extends ModeleNumRefboms /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index 0169ce04a70..48a99112839 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -58,7 +58,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index 545222c8b03..69aa090ab04 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -86,7 +86,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index 160a07635f4..f05c668e8e7 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -61,7 +61,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index 4f9931f35e9..c976290377b 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -92,7 +92,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index 9957bf4f326..373b9dd8742 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -96,7 +96,7 @@ abstract class ModeleNumRefDons } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 5217e2dc1c3..5abace4279c 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -95,7 +95,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 4c9d249d6c8..3c94fd46511 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -74,7 +74,7 @@ class mod_facture_mars extends ModeleNumRefFactures } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index db9a3e2e046..ecb26218636 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -84,7 +84,7 @@ class mod_facture_terre extends ModeleNumRefFactures } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index 7ed9eb7e94a..865ea6cb71b 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -98,7 +98,7 @@ abstract class ModeleNumRefFactures } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 1d33cb7fc83..6c1ec0d46fe 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -97,7 +97,7 @@ class mod_arctic extends ModeleNumRefFicheinter } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index 7d636a8b8e0..aed72285ee4 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -68,7 +68,7 @@ class mod_pacific extends ModeleNumRefFicheinter } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/livraison/mod_livraison_jade.php index 5cae280f245..d9ad3f16a31 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/livraison/mod_livraison_jade.php @@ -72,7 +72,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/livraison/modules_livraison.php index ce9d9b77f77..55b2146f2a6 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/livraison/modules_livraison.php @@ -100,7 +100,7 @@ abstract class ModeleNumRefDeliveryOrder } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php index a9cde1b86cb..a9bacfede80 100644 --- a/htdocs/core/modules/payment/mod_payment_ant.php +++ b/htdocs/core/modules/payment/mod_payment_ant.php @@ -95,7 +95,7 @@ class mod_payment_ant extends ModeleNumRefPayments } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/payment/mod_payment_cicada.php b/htdocs/core/modules/payment/mod_payment_cicada.php index a6f1eee1ef7..97b386a87f3 100644 --- a/htdocs/core/modules/payment/mod_payment_cicada.php +++ b/htdocs/core/modules/payment/mod_payment_cicada.php @@ -68,7 +68,7 @@ class mod_payment_cicada extends ModeleNumRefPayments /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 30350d9378f..0628744d8d9 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -90,7 +90,7 @@ abstract class ModeleProductCode } - /** Renvoi un exemple de numerotation + /** Return an example of numbering * * @param Translate $langs Object langs * @return string Example diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index 70394f92129..d27f3d1c250 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -96,7 +96,7 @@ class mod_project_universal extends ModeleNumRefProjects } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index f77111bade3..de3bbd2ccf5 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -95,7 +95,7 @@ abstract class ModeleNumRefProjects } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index 760caaa366e..1d311f96391 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -96,7 +96,7 @@ class mod_task_universal extends ModeleNumRefTask } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php index e37c4b1dabb..965bcbdd016 100644 --- a/htdocs/core/modules/project/task/modules_task.php +++ b/htdocs/core/modules/project/task/modules_task.php @@ -96,7 +96,7 @@ abstract class ModeleNumRefTask } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 99c82217a87..bb9bf463930 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -98,7 +98,7 @@ class mod_propale_saphir extends ModeleNumRefPropales } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index dc01941ece4..f67cc5c194c 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -99,7 +99,7 @@ abstract class ModeleNumRefPropales } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index 96dc9fbfd99..a864161a459 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -80,7 +80,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index c816953a298..96c294c2e8d 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -98,7 +98,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index d06a2ccfcf3..7eaf44a691f 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -95,7 +95,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php index e01c82cb445..608fe54ce55 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php @@ -68,7 +68,7 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php index 343e16df8ed..072409fbcba 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php @@ -98,7 +98,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php index a7c12a9aeed..707e2f76c21 100644 --- a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php +++ b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php @@ -99,7 +99,7 @@ abstract class ModeleNumRefSupplierProposal } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index 007e0b318cd..64e58f1b66b 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -94,7 +94,7 @@ class mod_ticket_universal extends ModeleNumRefTicket } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ diff --git a/htdocs/core/modules/ticket/modules_ticket.php b/htdocs/core/modules/ticket/modules_ticket.php index b66eb30422f..a63ad5295e4 100644 --- a/htdocs/core/modules/ticket/modules_ticket.php +++ b/htdocs/core/modules/ticket/modules_ticket.php @@ -57,7 +57,7 @@ abstract class ModeleNumRefTicket } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ From 48b2a11da25dc7badd8bc2a2d09bcf186c4a750e Mon Sep 17 00:00:00 2001 From: david Date: Sun, 8 Sep 2019 05:15:26 +0200 Subject: [PATCH 415/982] FIX #10460 compatibility with MariaDB 10.4 --- htdocs/core/class/html.form.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 187df8cf539..49efea8c04d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1152,9 +1152,8 @@ class Form $sql .= ", dictp.code as country_code"; } - $sql.= " FROM (".MAIN_DB_PREFIX ."societe as s"; + $sql.= " FROM ".MAIN_DB_PREFIX ."societe as s"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " )"; if ($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST) { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid=s.fk_pays"; } From 3ddd123eb15a387d548c9de9b18e28a12a1761a2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 8 Sep 2019 05:18:52 +0200 Subject: [PATCH 416/982] Traduction --- .../modules/barcode/doc/tcpdfbarcode.modules.php | 4 ++-- htdocs/core/modules/bom/mod_bom_standard.php | 6 +++--- htdocs/core/modules/bom/modules_bom.php | 2 +- .../core/modules/cheque/mod_chequereceipt_mint.php | 6 +++--- .../core/modules/cheque/modules_chequereceipts.php | 9 +++++---- .../core/modules/commande/mod_commande_marbre.php | 6 +++--- htdocs/core/modules/commande/modules_commande.php | 5 +++-- htdocs/core/modules/dons/modules_don.php | 6 +++--- .../expensereport/mod_expensereport_jade.php | 6 +++--- htdocs/core/modules/facture/mod_facture_mars.php | 6 +++--- htdocs/core/modules/facture/mod_facture_terre.php | 6 +++--- htdocs/core/modules/facture/modules_facture.php | 6 +++--- htdocs/core/modules/fichinter/mod_pacific.php | 6 +++--- .../core/modules/fichinter/modules_fichinter.php | 6 +++--- .../core/modules/livraison/mod_livraison_jade.php | 6 +++--- .../core/modules/livraison/modules_livraison.php | 6 +++--- htdocs/core/modules/payment/mod_payment_cicada.php | 6 +++--- htdocs/core/modules/payment/modules_payment.php | 9 +++++---- .../core/modules/product/modules_product.class.php | 7 ++++--- htdocs/core/modules/project/mod_project_simple.php | 7 ++++--- htdocs/core/modules/project/modules_project.php | 6 +++--- .../core/modules/project/task/mod_task_simple.php | 7 ++++--- htdocs/core/modules/project/task/modules_task.php | 6 +++--- htdocs/core/modules/propale/mod_propale_marbre.php | 6 +++--- htdocs/core/modules/propale/modules_propale.php | 6 +++--- .../core/modules/societe/modules_societe.class.php | 14 ++++++++------ .../mod_commande_fournisseur_muguet.php | 6 +++--- .../mod_supplier_payment_bronan.php | 6 +++--- .../supplier_payment/modules_supplier_payment.php | 9 +++++---- .../mod_supplier_proposal_marbre.php | 6 +++--- .../modules_supplier_proposal.php | 6 +++--- htdocs/core/modules/ticket/mod_ticket_simple.php | 6 +++--- htdocs/core/modules/ticket/modules_ticket.php | 6 +++--- 33 files changed, 110 insertions(+), 101 deletions(-) diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php index 6e80a430204..aad1493ff5f 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -67,8 +67,8 @@ class modTcpdfbarcode extends ModeleBarCode } /** - * Checks if the numbers already in force in the data base do not - * cause conflicts that would prevent this numbering from working. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * * @return boolean false if conflict, true if ok */ diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php index 60870da1a01..0f3c704b5dd 100644 --- a/htdocs/core/modules/bom/mod_bom_standard.php +++ b/htdocs/core/modules/bom/mod_bom_standard.php @@ -72,10 +72,10 @@ class mod_bom_standard extends ModeleNumRefboms /** - * Test si les numeros deje en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/bom/modules_bom.php b/htdocs/core/modules/bom/modules_bom.php index a26cdafd17a..35cd9c11abd 100644 --- a/htdocs/core/modules/bom/modules_bom.php +++ b/htdocs/core/modules/bom/modules_bom.php @@ -109,7 +109,7 @@ abstract class ModeleNumRefBoms } /** - * Checks if the numbers already in force in the data base do not + * Checks if the numbers already in force in the data base do not * cause conflicts that would prevent this numbering from working. * * @return boolean false if conflict, true if ok diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index 48a99112839..f9e98d550b8 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -69,10 +69,10 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts /** - * Test si les numeros deje en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php index 29fd071200a..7d05e4f94b8 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -76,10 +76,11 @@ abstract class ModeleNumRefChequeReceipts } /** - * Test if the existing numbers in the database do not cause conflicts that would prevent this numbering run. - * - * @return boolean false si conflit, true si ok - */ + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. + * + * @return boolean false if conflict, true if ok + */ public function canBeActivated() { return true; diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index f05c668e8e7..85ec964a100 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -72,10 +72,10 @@ class mod_commande_marbre extends ModeleNumRefCommandes /** - * Test si les numeros deje en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index 47fb20a56b4..bd95ed752fb 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -110,9 +110,10 @@ abstract class ModeleNumRefCommandes } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index 373b9dd8742..edca09dd57b 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -108,10 +108,10 @@ abstract class ModeleNumRefDons } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas d - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php index 176c3a46dcb..d8e5979f126 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -78,10 +78,10 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport /** - * Test whether the numbers already in force in the base do not cause conflicts - * that would prevent this numbering from working. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 3c94fd46511..bc7ae612d09 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -84,10 +84,10 @@ class mod_facture_mars extends ModeleNumRefFactures } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index ecb26218636..6644702c82f 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -94,10 +94,10 @@ class mod_facture_terre extends ModeleNumRefFactures } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index 865ea6cb71b..c9a010a84c2 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -110,10 +110,10 @@ abstract class ModeleNumRefFactures } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas - * de conflits qui empecheraient cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index aed72285ee4..74fedefba9a 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -78,10 +78,10 @@ class mod_pacific extends ModeleNumRefFicheinter } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index f5056bf45bb..970507e8c0b 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -109,10 +109,10 @@ abstract class ModeleNumRefFicheinter } /** - * Tests if the numbers already in force in the database do not cause conflicts - * that would prevent this numbering from working. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/livraison/mod_livraison_jade.php index d9ad3f16a31..de16820b8f3 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/livraison/mod_livraison_jade.php @@ -82,10 +82,10 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/livraison/modules_livraison.php index 55b2146f2a6..9dff79742ef 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/livraison/modules_livraison.php @@ -112,10 +112,10 @@ abstract class ModeleNumRefDeliveryOrder } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas d - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/payment/mod_payment_cicada.php b/htdocs/core/modules/payment/mod_payment_cicada.php index 97b386a87f3..7aff7dff662 100644 --- a/htdocs/core/modules/payment/mod_payment_cicada.php +++ b/htdocs/core/modules/payment/mod_payment_cicada.php @@ -79,10 +79,10 @@ class mod_payment_cicada extends ModeleNumRefPayments /** - * Test si les numeros deje en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/payment/modules_payment.php b/htdocs/core/modules/payment/modules_payment.php index b85c97008e3..d0e0c99ed66 100644 --- a/htdocs/core/modules/payment/modules_payment.php +++ b/htdocs/core/modules/payment/modules_payment.php @@ -63,10 +63,11 @@ abstract class ModeleNumRefPayments } /** - * Test if the existing numbers in the database do not cause conflicts that would prevent this numbering run. - * - * @return boolean false si conflit, true si ok - */ + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. + * + * @return boolean false if conflict, true if ok + */ public function canBeActivated() { return true; diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 0628744d8d9..482f35cacd0 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -101,10 +101,11 @@ abstract class ModeleProductCode return $langs->trans("NoExample"); } - /** Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + /** + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index faab6523820..a8b7f3b4cd0 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -80,10 +80,11 @@ class mod_project_simple extends ModeleNumRefProjects } - /** Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + /** + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index de3bbd2ccf5..211b586e8f1 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -107,10 +107,10 @@ abstract class ModeleNumRefProjects } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index 7619c9b6834..11139f4366a 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -80,10 +80,11 @@ class mod_task_simple extends ModeleNumRefTask } - /** Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + /** + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php index 965bcbdd016..510f727e7ec 100644 --- a/htdocs/core/modules/project/task/modules_task.php +++ b/htdocs/core/modules/project/task/modules_task.php @@ -108,10 +108,10 @@ abstract class ModeleNumRefTask } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index 4fba93d7a8d..dcc535bcca1 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -81,10 +81,10 @@ class mod_propale_marbre extends ModeleNumRefPropales /** - * Test si les numeros deje en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index f67cc5c194c..5cd2791cc95 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -111,10 +111,10 @@ abstract class ModeleNumRefPropales } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index 62f481b9b25..b665e36f163 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -105,10 +105,11 @@ abstract class ModeleThirdPartyCode return $langs->trans("NoExample"); } - /** Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + /** + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { @@ -297,10 +298,11 @@ abstract class ModeleAccountancyCode return $langs->trans("NoExample"); } - /** Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + /** + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index a864161a459..d10ce45a7f9 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -91,10 +91,10 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php index 608fe54ce55..b1f8dbd2e9c 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php @@ -79,10 +79,10 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments /** - * Test si les numeros deje en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php index a3f7495efb5..07bad24bcfc 100644 --- a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php +++ b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php @@ -98,10 +98,11 @@ abstract class ModeleNumRefSupplierPayments } /** - * Test if the existing numbers in the database do not cause conflicts that would prevent this numbering run. - * - * @return boolean false si conflit, true si ok - */ + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. + * + * @return boolean false if conflict, true if ok + */ public function canBeActivated() { return true; diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php index db9cec8e2c3..5238ebb4b4d 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php @@ -81,10 +81,10 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal /** - * Test si les numeros deje en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php index 707e2f76c21..eda9e24eb1f 100644 --- a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php +++ b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php @@ -111,10 +111,10 @@ abstract class ModeleNumRefSupplierProposal } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/ticket/mod_ticket_simple.php b/htdocs/core/modules/ticket/mod_ticket_simple.php index 299c9c6a485..e3cab2404ad 100644 --- a/htdocs/core/modules/ticket/mod_ticket_simple.php +++ b/htdocs/core/modules/ticket/mod_ticket_simple.php @@ -77,10 +77,10 @@ class mod_ticket_simple extends ModeleNumRefTicket } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { diff --git a/htdocs/core/modules/ticket/modules_ticket.php b/htdocs/core/modules/ticket/modules_ticket.php index a63ad5295e4..945b8f0fe67 100644 --- a/htdocs/core/modules/ticket/modules_ticket.php +++ b/htdocs/core/modules/ticket/modules_ticket.php @@ -69,10 +69,10 @@ abstract class ModeleNumRefTicket } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ public function canBeActivated() { From 985cfab8e9c6f5cc67ff429441da96786fc9a949 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 8 Sep 2019 05:22:13 +0200 Subject: [PATCH 417/982] Traduction --- htdocs/core/modules/commande/modules_commande.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index bd95ed752fb..974b30f6f68 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -121,7 +121,7 @@ abstract class ModeleNumRefCommandes } /** - * Renvoie prochaine valeur attribuee + * Returns next assigned value * * @param Societe $objsoc Object thirdparty * @param Object $object Object we need next value for @@ -134,7 +134,7 @@ abstract class ModeleNumRefCommandes } /** - * Renvoie version du module numerotation + * Returns version of numbering module * * @return string Valeur */ From fa5cda2e883cff38134726c13c6176a7c721d3af Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 8 Sep 2019 18:03:14 +0200 Subject: [PATCH 418/982] Fix missing total progress column --- htdocs/core/lib/project.lib.php | 40 +++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 19d89c6799b..5e9d05057be 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -664,12 +664,48 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print convertSecondToTime($total_projectlinesa_spent, 'allhourmin'); if ($projectidfortotallink > 0) print ''; print ''; + + if ($total_projectlinesa_planned) { + $totalAverageDeclaredProgress = round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2); + $totalCalculatedProgress = round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2); + // this conf is actually hidden, by default we use 1% for "be carefull or warning" + $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.01; + + // define progress color according to time spend vs workload + $progressBarClass = 'progress-bar-info'; + $badgeClass = 'badge '; + + if ($totalCalculatedProgress > $totalAverageDeclaredProgress) { + $progressBarClass = 'progress-bar-danger'; + $badgeClass.= 'badge-danger'; + } elseif ($totalCalculatedProgress * $warningRatio >= $totalAverageDeclaredProgress) { // warning if close at 1% + $progressBarClass = 'progress-bar-warning'; + $badgeClass.= 'badge-warning'; + } else { + $progressBarClass = 'progress-bar-success'; + $badgeClass.= 'badge-success'; + } + } + print ''; print ''; + + + // resume + print ''; + if ($showbilltime) { print ''; if ($showbilltime) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 7b74e3a743a..ebe506c15d6 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -121,6 +121,7 @@ $arrayfields=array( 't.duration_effective'=>array('label'=>$langs->trans("TimeSpent"), 'checked'=>1, 'position'=>103), 't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>104), 't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>105), + 't.progress_summary'=>array('label'=>$langs->trans("TaskProgressSummary"), 'checked'=>1, 'position'=>106), 't.tobill'=>array('label'=>$langs->trans("TimeToBill"), 'checked'=>0, 'position'=>110), 't.billed'=>array('label'=>$langs->trans("TimeBilled"), 'checked'=>0, 'position'=>111), 't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), @@ -570,6 +571,7 @@ if (! empty($arrayfields['t.planned_workload']['checked'])) print ''; if (! empty($arrayfields['t.progress_calculated']['checked'])) print ''; if (! empty($arrayfields['t.progress']['checked'])) print ''; +if (! empty($arrayfields['t.progress_summary']['checked'])) print ''; if (! empty($arrayfields['t.tobill']['checked'])) print ''; if (! empty($arrayfields['t.billed']['checked'])) print ''; // Extra fields @@ -610,6 +612,7 @@ if (! empty($arrayfields['t.planned_workload']['checked'])) print_liste_ if (! empty($arrayfields['t.duration_effective']['checked'])) print_liste_field_titre($arrayfields['t.duration_effective']['label'], $_SERVER["PHP_SELF"], "t.duration_effective", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.progress_calculated']['checked'])) print_liste_field_titre($arrayfields['t.progress_calculated']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center '); if (! empty($arrayfields['t.progress']['checked'])) print_liste_field_titre($arrayfields['t.progress']['label'], $_SERVER["PHP_SELF"], "t.progress", "", $param, '', $sortfield, $sortorder, 'center '); +if (! empty($arrayfields['t.progress_summary']['checked'])) print_liste_field_titre($arrayfields['t.progress_summary']['label'], $_SERVER["PHP_SELF"], "t.progress", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.tobill']['checked'])) print_liste_field_titre($arrayfields['t.tobill']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.billed']['checked'])) print_liste_field_titre($arrayfields['t.billed']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center '); // Extra fields @@ -642,6 +645,9 @@ while ($i < min($num, $limit)) $object->progress = $obj->progress; $object->datee = $db->jdate($obj->date_end); // deprecated $object->date_end = $db->jdate($obj->date_end); + $object->planned_workload= $obj->planned_workload; + $object->duration_effective= $obj->duration_effective; + $projectstatic->id = $obj->projectid; $projectstatic->ref = $obj->projectref; @@ -784,12 +790,23 @@ while ($i < min($num, $limit)) print ''; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalprogress_declaredfield']=$totalarray['nbfield']; $totalarray['totaldurationdeclared'] += $obj->planned_workload * $obj->progress / 100; + } + // Progress summary + if (! empty($arrayfields['t.progress_summary']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalprogress_summary']=$totalarray['nbfield']; } // Time not billed if (! empty($arrayfields['t.tobill']['checked'])) @@ -891,7 +908,7 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota elseif ($totalarray['totalprogress_declaredfield'] == $i) print ''; elseif ($totalarray['totaltobillfield'] == $i) print ''; elseif ($totalarray['totalbilledfield'] == $i) print ''; - else print ''; + else print ''; } print ''; } From 1d311b29691d840474e9ea9f38a2922b09582fec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Sep 2019 21:21:33 +0200 Subject: [PATCH 421/982] Fix scrutinizer --- htdocs/core/modules/modBlockedLog.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index d9833e2978e..b582d5e2165 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -93,7 +93,7 @@ class modBlockedLog extends DolibarrModules $this->always_enabled = (!empty($conf->blockedlog->enabled) && !empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY) && in_array($mysoc->country_code, explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)) - && $this->alreadyUsed(1)); + && $this->alreadyUsed()); // Constants //----------- From 47f72fb74cac7c57f777347098544bad131cb467 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Sep 2019 21:21:58 +0200 Subject: [PATCH 422/982] Update data file --- htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql index 5b6f4bf3f0c..312c30210c8 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql @@ -41,3 +41,4 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRASSOMPTION', 0, 1, 0, 8, 15, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRTOUSSAINT', 0, 1, 0, 11, 1, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRARMISTICE', 0, 1, 0, 11, 11, 1); +--INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('EASTER', 0, 1, 'easter', 0, 0, 0, 1); From 5cc0b24f6fb77b269498f763ebd33b42c753a59b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Sep 2019 21:24:01 +0200 Subject: [PATCH 423/982] Fix param --- htdocs/core/tpl/contacts.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 1f7d403b575..0f9b733d010 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -208,7 +208,7 @@ if ($permission) { if ($tab[$i]['source']=='external') { $contactstatic->fetch($tab[$i]['id']); - echo $contactstatic->getNomUrl(1, '', 0, '', 0, 0, '', 'valignmiddle'); + echo $contactstatic->getNomUrl(1, '', 0, '', 0, 0); } ?> From feca9a7ee3198f28fbab20c4555a30d4ce300e85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Sep 2019 21:28:17 +0200 Subject: [PATCH 424/982] Fix phpcs --- htdocs/modulebuilder/index.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 30fd315dde3..4b7efffdfed 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2372,18 +2372,18 @@ elseif (! empty($module)) print '
    ".$langs->trans("RuleForStockManagementDecrease")."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("DeStockOnBill").''; +print ''; if (! empty($conf->facture->enabled)) { if ($conf->use_javascript_ajax) { @@ -130,7 +130,7 @@ $found++; print '
    '.$langs->trans("DeStockOnValidateOrder").''; +print ''; if (! empty($conf->commande->enabled)) { if ($conf->use_javascript_ajax) { @@ -152,7 +152,7 @@ $found++; print '
    '.$langs->trans("DeStockOnShipment").''; +print ''; if (! empty($conf->expedition->enabled)) { if ($conf->use_javascript_ajax) { @@ -172,7 +172,7 @@ $found++; print '
    '.$langs->trans("DeStockOnShipmentOnClosing").''; +print ''; if (! empty($conf->expedition->enabled)) { if ($conf->use_javascript_ajax) { @@ -205,14 +205,14 @@ print '
    '; print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; $found=0; print ''; print ''; -print ''; print ''; -print ''; - print ''; - print ''; + print ''; - print ''; - print ''; + print ''; print ''; - print '
    ".$langs->trans("RuleForStockManagementIncrease")."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("ReStockOnBill").''; +print ''; if (! empty($conf->fournisseur->enabled)) { if ($conf->use_javascript_ajax) { @@ -233,7 +233,7 @@ $found++; print '
    '.$langs->trans("ReStockOnValidateOrder").''; +print ''; if (! empty($conf->fournisseur->enabled)) { if ($conf->use_javascript_ajax) { @@ -253,8 +253,8 @@ $found++; if (!empty($conf->reception->enabled)) { print '
    '.$langs->trans("StockOnReception").''; + print ''.$langs->trans("StockOnReception").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION'); @@ -268,8 +268,8 @@ if ($conf->use_javascript_ajax) { print '
    '.$langs->trans("StockOnReceptionOnClosing").''; + print ''.$langs->trans("StockOnReceptionOnClosing").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE'); @@ -284,7 +284,7 @@ else { print '
    '.$langs->trans("ReStockOnDispatchOrder").''; + print ''; if (! empty($conf->fournisseur->enabled)) { if ($conf->use_javascript_ajax) { @@ -313,16 +313,17 @@ if ($conf->use_javascript_ajax) { print '
    '; print '
    '; + print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''; print ''; -print ''; print ''; - print ''; print ''; - print ''; print ''; - print ''; + print ''; + print ''; + print "
    ".$langs->trans("RuleForStockAvailability")."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("WarehouseAllowNegativeTransfer").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_ALLOW_NEGATIVE_TRANSFER'); } else { @@ -337,7 +338,7 @@ if($conf->invoice->enabled) { print '
    '.$langs->trans("StockMustBeEnoughForInvoice").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE'); } else { @@ -352,7 +353,7 @@ if($conf->order->enabled) { print '
    '.$langs->trans("StockMustBeEnoughForOrder").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER'); } else { @@ -367,7 +368,7 @@ if($conf->expedition->enabled) { print '
    '.$langs->trans("StockMustBeEnoughForShipment").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT'); } else { @@ -391,12 +392,12 @@ if ($virtualdiffersfromphysical) print ''; print ''; print "\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; print ''; print ''; - print ''; print ''; print ''; print "\n"; -$var=false; -//if ($conf->global->MAIN_FEATURES_LEVEL > 0) -//{ - print '\n"; +print '\n"; -//} // Ask for payment bank during supplier order /* Kept as hidden for the moment @@ -564,6 +560,20 @@ print '\n"; +// Option to add a quality/validation step, on products, after reception. +$langs->load("stocks"); +print ''; +print ''; +print ''; +print '\n\n"; + print '
    ".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("UseVirtualStockByDefault").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK'); } else { @@ -414,12 +415,12 @@ print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''; print ''; -print ''; print ''; -print '\n"; print ''; print ''; -print '\n"; print "\n"; -if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - print ''; - print ''; - print '\n\n"; -} - print '
    ".$langs->trans("Other")."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("UserWarehouseAutoCreate").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_USERSTOCK_AUTOCREATE'); } else { @@ -433,7 +434,7 @@ print '
    '; print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")); print ''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_SUPPORTS_SERVICES'); } else { @@ -445,7 +446,7 @@ print "
    '.$langs->trans("AllowAddLimitStockByWarehouse").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE'); } else { @@ -455,19 +456,6 @@ if ($conf->use_javascript_ajax) { print "
    '.$langs->trans("UseDispatchStatus").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); -} - print "
    '; print '
    '; @@ -476,43 +464,45 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print ''; print ''; print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; // Example with a yes / no select - print ''; + /*print ''; print ''; - print ''; + */ // Example with a yes / no select - print ''; + /*print ''; print ''; - print ''; + print ''; + */ - // Example with a yes / no select + // Example with a yes / no select print ''; - print ''; - print ''; + print ''; print '
    '.$langs->trans("Inventory").''.$langs->trans("Status").'
    '.$langs->trans("Status").'
    '.$langs->trans("INVENTORY_DISABLE_VIRTUAL").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVENTORY_DISABLE_VIRTUAL'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVENTORY_DISABLE_VIRTUAL", $arrval, $conf->global->INVENTORY_DISABLE_VIRTUAL); -} + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('INVENTORY_DISABLE_VIRTUAL'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("INVENTORY_DISABLE_VIRTUAL", $arrval, $conf->global->INVENTORY_DISABLE_VIRTUAL); + } print '
    '.$langs->trans("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVENTORY_USE_MIN_PA_IF_NO_LAST_PA'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA", $arrval, $conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA); -} - print '
    '; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('INVENTORY_USE_MIN_PA_IF_NO_LAST_PA'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA", $arrval, $conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA); + } + print '
    '.$langs->trans("INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT); -} + print ''.$langs->trans("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT); + } print '
    '; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index e895a0b4005..f1fbbd4b286 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -494,20 +494,16 @@ print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").' 
    '; - print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
    '; - print $langs->trans("IfSetToYesDontForgetPermission"); - print '
    '; - print ''; - print ''; - print ''; - print "
    '; +print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
    '; +print $langs->trans("IfSetToYesDontForgetPermission"); +print '
    '; +print ''; +print ''; +print ''; +print "
    '; print ''; print "
    '.$langs->trans("UseDispatchStatus").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); +} +print "

    '; print ''; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2edd86d1c10..c38107b14b4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1822,10 +1822,9 @@ class CommandeFournisseur extends CommonOrder $error++; } - // Si module stock gere et que incrementation faite depuis un dispatching en stock + // If module stock is enabled and the stock increase is done on purchase order dispatching if (! $error && $entrepot > 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - $mouv = new MouvementStock($this->db); if ($product > 0) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ff33a42e2a9..66b48164a9e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2346,7 +2346,7 @@ elseif (! empty($object->id)) }*/ // Modify - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->commander) { @@ -2355,7 +2355,7 @@ elseif (! empty($object->id)) } // Approve - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->approuver) { @@ -2377,7 +2377,7 @@ elseif (! empty($object->id)) // Second approval (if option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set) if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->approve2) { @@ -2398,7 +2398,7 @@ elseif (! empty($object->id)) } // Refuse - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->approuver || $user->rights->fournisseur->commande->approve2) { @@ -2411,7 +2411,7 @@ elseif (! empty($object->id)) } // Send - if (in_array($object->statut, array(2, 3, 4, 5))) + if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED, 3, 4, 5))) { if ($user->rights->fournisseur->commande->commander) { @@ -2420,7 +2420,7 @@ elseif (! empty($object->id)) } // Reopen - if (in_array($object->statut, array(2))) + if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED))) { $buttonshown=0; if (! $buttonshown && $user->rights->fournisseur->commande->approuver) @@ -2462,7 +2462,7 @@ elseif (! empty($object->id)) } } - if ($object->statut == 2) + if ($object->statut == CommandeFournisseur::STATUS_ACCEPTED) { if ($user->rights->fournisseur->commande->commander) { @@ -2474,6 +2474,15 @@ elseif (! empty($object->id)) } } + // Classify received (this does not record reception) + if ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY) + { + if ($user->rights->fournisseur->commande->receptionner) + { + print ''; + } + } + // Create bill //if (! empty($conf->facture->enabled)) //{ @@ -2590,38 +2599,41 @@ elseif (! empty($object->id)) print '
    '; - if ($user->rights->fournisseur->commande->receptionner && ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY)) + if ($action == 'classifyreception') { - // Set status to received (action=livraison) - print ''."\n"; - print '
    '; - print ''; - print ''; - print load_fiche_titre($langs->trans("Receive"), '', ''); + if ($user->rights->fournisseur->commande->receptionner && ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY)) + { + // Set status to received (action=livraison) + print ''."\n"; + print ''; + print ''; + print ''; + print load_fiche_titre($langs->trans("Receive"), '', ''); - print ''; - //print ''; - print '\n"; + print '
    '.$langs->trans("Receive").'
    '.$langs->trans("DeliveryDate").''; - $datepreselected = dol_now(); - print $form->selectDate($datepreselected, '', 1, 1, '', "commande", 1, 1); - print "
    '; + //print ''; + print '\n"; - print ''; - print ''; - print ''; - print "
    '.$langs->trans("Receive").'
    '.$langs->trans("DeliveryDate").''; + $datepreselected = dol_now(); + print $form->selectDate($datepreselected, '', 1, 1, '', "commande", 1, 1); + print "
    '.$langs->trans("Delivery")."\n"; - $liv = array(); - $liv[''] = ' '; - $liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected"); - $liv['par'] = $langs->trans("PartialWoman"); - $liv['nev'] = $langs->trans("NeverReceived"); - $liv['can'] = $langs->trans("Canceled"); + print '
    '.$langs->trans("Delivery")."\n"; + $liv = array(); + $liv[''] = ' '; + $liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected"); + $liv['par'] = $langs->trans("PartialWoman"); + $liv['nev'] = $langs->trans("NeverReceived"); + $liv['can'] = $langs->trans("Canceled"); - print $form->selectarray("type", $liv); + print $form->selectarray("type", $liv); - print '
    '.$langs->trans("Comment").'
    \n"; - print "
    \n"; - print "
    "; + print '
    '.$langs->trans("Comment").'
    \n"; + print "\n"; + print "
    "; + } } // List of actions on element diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9b8c6f04c51..494e7d4a8a3 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1695,7 +1695,7 @@ SuppliersSetup=Vendor module setup SuppliersCommandModel=Complete template of purchase order (logo...) SuppliersInvoiceModel=Complete template of vendor invoice (logo...) SuppliersInvoiceNumberingModel=Vendor invoices numbering models -IfSetToYesDontForgetPermission=If set to yes, don't forget to provide permissions to groups or users allowed for the second approval +IfSetToYesDontForgetPermission=If set to a non null value, don't forget to provide permissions to groups or users allowed for the second approval ##### GeoIPMaxmind ##### GeoIPMaxmindSetup=GeoIP Maxmind module setup PathToGeoIPMaxmindCountryDataFile=Path to file containing Maxmind ip to country translation.
    Examples:
    /usr/local/share/GeoIP/GeoIP.dat
    /usr/share/GeoIP/GeoIP.dat
    /usr/share/GeoIP/GeoLite2-Country.mmdb diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index ad895845488..256bd2a7d4d 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -154,5 +154,5 @@ CreateOrders=Create orders ToBillSeveralOrderSelectCustomer=To create an invoice for several orders, click first onto customer, then choose "%s". OptionToSetOrderBilledNotEnabled=Option (from module Workflow) to set order to 'Billed' automatically when invoice is validated is off, so you will have to set status of order to 'Billed' manually. IfValidateInvoiceIsNoOrderStayUnbilled=If invoice validation is 'No', the order will remain to status 'Unbilled' until the invoice is validated. -CloseReceivedSupplierOrdersAutomatically=Close order to "%s" automatically if all products are received. +CloseReceivedSupplierOrdersAutomatically=Close order to status "%s" automatically if all products are received. SetShippingMode=Set shipping mode diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index ede7fea87b7..f3f023f8dcf 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -21,6 +21,7 @@ QtyShipped=Qty shipped QtyShippedShort=Qty ship. QtyPreparedOrShipped=Qty prepared or shipped QtyToShip=Qty to ship +QtyToReceive=Qty to receive QtyReceived=Qty received QtyInOtherShipments=Qty in other shipments KeepToShip=Remain to ship @@ -46,6 +47,7 @@ DateDeliveryPlanned=Planned date of delivery RefDeliveryReceipt=Ref delivery receipt StatusReceipt=Status delivery receipt DateReceived=Date delivery received +ClassifyReception=Classify reception SendShippingByEMail=Send shipment by email SendShippingRef=Submission of shipment %s ActionsOnShipping=Events on shipment diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index d42f1a82243..a98d4e18cbf 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -55,7 +55,7 @@ PMPValue=Weighted average price PMPValueShort=WAP EnhancedValueOfWarehouses=Warehouses value UserWarehouseAutoCreate=Create a user warehouse automatically when creating a user -AllowAddLimitStockByWarehouse=Manage also values for minimum and desired stock per pairing (product-warehouse) in addition to values per product +AllowAddLimitStockByWarehouse=Manage also value for minimum and desired stock per pairing (product-warehouse) in addition to the value for minimum and desired stock per product IndependantSubProductStock=Product stock and subproduct stock are independent QtyDispatched=Quantity dispatched QtyDispatchedShort=Qty dispatched @@ -184,7 +184,7 @@ SelectFournisseur=Vendor filter inventoryOnDate=Inventory INVENTORY_DISABLE_VIRTUAL=Virtual product (kit): do not decrement stock of a child product INVENTORY_USE_MIN_PA_IF_NO_LAST_PA=Use the buy price if no last buy price can be found -INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT=Stock movement has date of inventory +INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT=Stock movements will have the date of inventory (instead of the date of inventory validation) inventoryChangePMPPermission=Allow to change PMP value for a product ColumnNewPMP=New unit PMP OnlyProdsInStock=Do not add product without stock diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index a4a8827ca05..bbbeb2638e8 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -154,5 +154,5 @@ CreateOrders=Créer commandes ToBillSeveralOrderSelectCustomer=Pour créer une facture pour plusieurs commandes, cliquez d'abord sur le client, puis choisir "%s". OptionToSetOrderBilledNotEnabled=L'option (issue du module Workflow) pour définir automatiquement les commandes à 'Facturé' que une facture est validée, est désactivée, aussi vous devrez donc définir le statut de la commande sur 'Facturé' manuellement. IfValidateInvoiceIsNoOrderStayUnbilled=Si la validation de facture est à "Non", la commande restera au statut "Non facturé" jusqu'à ce que la facture soit validée. -CloseReceivedSupplierOrdersAutomatically=Fermer la commande "%s" automatiquement si tous les produits ont été reçus. +CloseReceivedSupplierOrdersAutomatically=Fermer la commande au statut "%s" automatiquement si tous les produits ont été reçus. SetShippingMode=Définir la méthode d'expédition diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 62cfc476ba8..85b174ea725 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -59,7 +59,7 @@ class Inventory extends CommonObject * 'type' if the field format. * 'label' the translation key. * 'enabled' is a condition when the field must be managed. - * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'index' if we want an index in database. * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). @@ -96,7 +96,7 @@ class Inventory extends CommonObject //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'default'=>0, 'arrayofkeyval'=>array(0=>'Todo', 1=>'Done', -1=>'Cancel')), + 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>4, 'enabled'=>1, 'position'=>1000, 'default'=>0, 'arrayofkeyval'=>array(0=>'ToDo', 1=>'Done', -1=>'Cancel')), ); /** diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 2153d8a53c7..e93c4f2d7ad 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2016 Yasser Carreón - * Copyright (C) 2018 Quentin Vial-Gouteyron + * Copyright (C) 2018 Quentin Vial-Gouteyron * * 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 @@ -56,7 +56,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -$langs->loadLangs(array("receptions","companies","bills",'deliveries','orders','stocks','other','propal')); +$langs->loadLangs(array("receptions","companies","bills",'deliveries','orders','stocks','other','propal','sendings')); if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); if (! empty($conf->productbatch->enabled)) $langs->load('productbatch'); From 80daf29d790e60031d2b3ad02d85ba58504ca0dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 01:52:51 +0200 Subject: [PATCH 366/982] Fix conflict between new module reception and old process Fix inventory record does not need status at creation Conflicts: htdocs/fourn/commande/card.php --- htdocs/admin/stock.php | 120 ++++++++---------- htdocs/admin/supplier_order.php | 34 +++-- .../class/fournisseur.commande.class.php | 3 +- htdocs/fourn/commande/card.php | 80 +++++++----- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/en_US/orders.lang | 2 +- htdocs/langs/en_US/sendings.lang | 2 + htdocs/langs/en_US/stocks.lang | 4 +- htdocs/langs/fr_FR/orders.lang | 2 +- .../inventory/class/inventory.class.php | 4 +- htdocs/reception/card.php | 4 +- 11 files changed, 135 insertions(+), 122 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 2e934211970..83834aa5861 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -98,14 +98,14 @@ print '
    '; print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; $found=0; print ''; print ''; -print ''; print ''; -print ''; print ''; -print ''; print ''; -print ''; print "\n"; + // Ref client print ''; + print $langs->trans("SupplierOrder").''; print '\n"; From fbbe49d6dcf8dbe2fae7f06e7bfab1d060a5362d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 02:12:56 +0200 Subject: [PATCH 369/982] Replace deprecated code --- htdocs/reception/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index f1d32b3ed6e..1dbac0117fa 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -816,7 +816,7 @@ if ($action == 'create') print '\n"; print ''; @@ -1164,10 +1164,10 @@ if ($action == 'create') { print ''; print ''; print ''; } else { @@ -1425,7 +1425,7 @@ elseif ($id || $ref) print ''; print ''; print ''; - print $form->select_date($object->date_delivery?$object->date_delivery:-1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0, 1); + print $form->selectDate($object->date_delivery?$object->date_delivery:-1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print ''; print ''; } @@ -1888,9 +1888,9 @@ elseif ($id || $ref) { print ''; } print ''; From 16484e1fa3fccb4a44dfa87ff5f051aa5fd4efc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 02:22:44 +0200 Subject: [PATCH 370/982] Fix balance of td --- htdocs/fourn/commande/dispatch.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 48599a5bbf2..17a7443aa9f 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -883,8 +883,16 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; print ''; - if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) || !empty($conf->reception->enabled)) + + // Status + if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) { print ''; + } + elseif(!empty($conf->reception->enabled)) { + print ''; + } + + print ''; print "\n"; @@ -969,17 +977,15 @@ if ($id > 0 || ! empty($ref)) { } } print ''; - }elseif(!empty($conf->reception->enabled)){ + } elseif(!empty($conf->reception->enabled)) { print ''; } - print ''; - print ''; - + print ''; print "\n"; From 5b1d94a668d46b4ad54ce07007eec2cebb933c6e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 02:27:49 +0200 Subject: [PATCH 371/982] Fix translation --- .../core/modules/reception/doc/pdf_squille.modules.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 9acd517370a..ca167e10644 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -121,15 +121,7 @@ class pdf_squille extends ModelePdfReception // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - $outputlangs->load("main"); - $outputlangs->load("dict"); - $outputlangs->load("companies"); - $outputlangs->load("bills"); - $outputlangs->load("products"); - $outputlangs->load("propal"); - $outputlangs->load("deliveries"); - $outputlangs->load("receptions"); - $outputlangs->load("productbatch"); + $outputlangs->loadLangs(array("main","dict","companies","bills","products","propal","deliveries","receptions","productbatch","sendings")); $nblignes = count($object->lines); From 626e3fd90e8cf244f123c9bd8dc77f211ea1dd27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 02:34:24 +0200 Subject: [PATCH 372/982] Fix look and feel v10 --- htdocs/commande/tpl/linkedobjectblock.tpl.php | 4 +- .../reception/tpl/linkedobjectblock.tpl.php | 39 +++++++++++++------ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 74a2243d633..c2fed2895a8 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -81,8 +81,8 @@ if (count($linkedObjectBlock) > 1) - - + + diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php index 9601c661c70..2b66b76e9dd 100644 --- a/htdocs/reception/tpl/linkedobjectblock.tpl.php +++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php @@ -1,6 +1,7 @@ - * Copyright (C) 2014 Marcos García +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Marcos García + * Copyright (C) 2019 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +16,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +// Protection to avoid direct call of template +if (empty($conf) || ! is_object($conf)) +{ + print "Error, template page can't be called as URL"; + exit; +} + ?> @@ -22,41 +31,47 @@ load("receptions"); +$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); + $total=0; $ilink=0; -$var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $trclass=($var?'pair':'impair'); + $trclass='oddeven'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - - - - - + + + + - - + + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + Date: Fri, 6 Sep 2019 02:39:08 +0200 Subject: [PATCH 373/982] Fix more consistent setup --- htdocs/admin/supplier_order.php | 20 +++++++++++++------- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index f1fbbd4b286..2fef63ffdd8 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // Load translation files required by the page -$langs->loadLangs(array("admin", "other", "orders")); +$langs->loadLangs(array("admin", "other", "orders", "stocks")); if (!$user->admin) accessforbidden(); @@ -561,16 +561,22 @@ print '' print "\n"; // Option to add a quality/validation step, on products, after reception. -$langs->load("stocks"); print ''; print ''; print ''; print '\n\n"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5f1d04f8bb0..bc9981faf3f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1919,3 +1919,4 @@ DeleteEmailCollector=Delete email collector ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector? RecipientEmailsWillBeReplacedWithThisValue=Recipient emails will be always replaced with this value AtLeastOneDefaultBankAccountMandatory=At least 1 default bank account must be defined +FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled \ No newline at end of file From c0b8315e1983c3ddc6b3f6a2d0ac759e33338deb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 02:45:00 +0200 Subject: [PATCH 374/982] Replace deprecated code --- htdocs/reception/list.php | 2 +- htdocs/website/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 17518df8ab6..8b37df8c779 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -566,7 +566,7 @@ if ($resql) print $langs->trans('DateInvoice'); print ''; print ''; print ''; print ''; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 1fd5939b4ac..38af5be87e4 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3080,7 +3080,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; From ec1751bae9f7342d61fc5bcbd461e83c25cdd56b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 02:47:20 +0200 Subject: [PATCH 375/982] Doxygen --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5e2c754fce6..187df8cf539 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5216,7 +5216,7 @@ class Form * @param datetime $adddateof Add a link "Date of invoice" using the following date. * @return string|void Nothing or string if nooutput is 1 * @deprecated - * @see form_date(), select_month(), select_year(), select_dayofweek() + * @see selectDate(), form_date(), select_month(), select_year(), select_dayofweek() */ public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') { From d50114df649a0d7752f4a549e5d541da1dc27eeb Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 6 Sep 2019 09:20:18 +0200 Subject: [PATCH 376/982] mostlyDone --- htdocs/contact/class/contact.class.php | 2 +- ...rface_90_modSociete_ContactRoles.class.php | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 6b46e32f532..fad72d69637 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1544,7 +1544,7 @@ class Contact extends CommonObject $sql.= " AND tc.element='".$element."'"; $sql.= " AND tc.active=1"; - dol_syslog(get_class($this)."::liste_contact", LOG_DEBUG); + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index 8fba51e7a69..36a8274c602 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -71,16 +71,20 @@ class InterfaceContactRoles extends DolibarrTriggers */ public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { - // Lors de la création d'un document, récupération des contacts et rôle associés à la société et association avec le document + if ($action === 'PROPAL_CREATE' || $action === 'ORDER_CREATE' || $action === 'BILL_CREATE' || $action === 'ORDER_SUPPLIER_CREATE' || $action === 'BILL_SUPPLIER_CREATE' || $action === 'CONTRACT_CREATE' || $action === 'FICHINTER_CREATE' || $action === 'PROJECT_CREATE' || $action === 'TICKET_CREATE' || $action === 'ACTION_CREATE') { - if(!empty($object->socid) && $object->socid != '-1') { - global $db, $langs; + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + $socid=(property_exists($object, 'socid')?$object->socid:$object->fk_soc); + + if(!empty($socid) && $socid != '-1') { + global $db, $langs; + var_dump($socid); $contactdefault = new Contact($this->db); - $contactdefault->socid=$object->socid; - $TContact = $contactdefault->getContactRoles(); + $contactdefault->socid=$socid; + $TContact = $contactdefault->getContactRoles($object->element); // Le trigger est appelé avant que le core n'ajoute lui-même des contacts (contact propale, clone), il ne faut pas les associer avant sinon bug $TContactAlreadyLinked = array(); @@ -90,7 +94,7 @@ class InterfaceContactRoles extends DolibarrTriggers $cloneFrom = new $class($db); $r = $cloneFrom->fetch($object->id); - if (!empty($cloneFrom->id)) $TContactAlreadyLinked = array_merge($cloneFrom->liste_contact(-1,'external'), $cloneFrom->liste_contact(-1,'internal')); + if (!empty($cloneFrom->id)) $TContactAlreadyLinked = array_merge($cloneFrom->liste_contact(-1, 'external'), $cloneFrom->liste_contact(-1, 'internal')); } foreach($TContact as $i => $infos) { @@ -111,10 +115,6 @@ class InterfaceContactRoles extends DolibarrTriggers setEventMessage($langs->trans('ContactAddedAutomatically', $nb)); } } - - dol_syslog( - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id - ); } } } From bb81f66a1af79915591aa4eb2c2bae574d82910e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 10:36:49 +0200 Subject: [PATCH 377/982] Add phpunit test for Lessc --- htdocs/comm/action/card.php | 4 +- .../class/bonprelevement.class.php | 2 - .../class/paymentsocialcontribution.class.php | 2 +- htdocs/core/class/CMailFile.class.php | 2 +- htdocs/core/class/extrafields.class.php | 3 +- htdocs/core/class/lessc.class.php | 4 +- htdocs/website/index.php | 2 +- test/phpunit/AllTests.php | 2 + test/phpunit/LesscTest.php | 182 ++++++++++++++++++ 9 files changed, 193 insertions(+), 10 deletions(-) create mode 100644 test/phpunit/LesscTest.php diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index af54186e255..a9dd837fc8c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -147,7 +147,7 @@ if ($action == 'classin' && ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))) { $object->fetch($id); - $object->setProject(GETPOST('projectid')); + $object->setProject(GETPOST('projectid', 'int')); } // Action clone object @@ -165,7 +165,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') reset($object->socpeopleassigned); $object->contactid = key($object->socpeopleassigned); } - $result = $object->createFromClone($user, GETPOST('fk_userowner'), GETPOST('socid')); + $result = $object->createFromClone($user, GETPOST('socid', 'int')); if ($result > 0) { header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result); exit(); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a60330270d4..c9dd592c6a9 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -798,8 +798,6 @@ class BonPrelevement extends CommonObject $month = strftime("%m", $datetimeprev); $year = strftime("%Y", $datetimeprev); - $puser = new User($this->db, $conf->global->PRELEVEMENT_USER); - $this->invoice_in_error = array(); $this->thirdparty_in_error = array(); diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 86dda559061..c17724e2de5 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -184,7 +184,7 @@ class PaymentSocialContribution extends CommonObject $remaintopay=price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT'); if ($remaintopay == 0) { - $result=$contrib->set_paid($user, '', ''); + $result=$contrib->set_paid($user); } else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing."); } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index eabe0440dca..43ad52b5f47 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -428,7 +428,7 @@ class CMailFile foreach ($this->images_encoded as $img) { //$img['fullpath'],$img['image_encoded'],$img['name'],$img['content_type'],$img['cid'] - $attachment = Swift_Image::fromPath($img['fullpath'], $img['content_type']); + $attachment = Swift_Image::fromPath($img['fullpath']); // embed image $imgcid = $this->message->embed($attachment); // replace cid by the one created by swiftmail in html message diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c92ae311141..0a9f98b4afd 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -274,9 +274,10 @@ class ExtraFields * @param string $perms Permission * @param string $list Into list view by default * @param string $computed Computed value + * @param string $help Help on tooltip * @return int <=0 if KO, >0 if OK */ - private function create($attrname, $type = 'varchar', $length = 255, $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = '', $perms = '', $list = '0', $computed = '') + private function create($attrname, $type = 'varchar', $length = 255, $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = '', $perms = '', $list = '0', $computed = '', $help = '') { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php index f6a9208cadf..396991b6612 100644 --- a/htdocs/core/class/lessc.class.php +++ b/htdocs/core/class/lessc.class.php @@ -3058,7 +3058,7 @@ class lessc_parser { $content[] = $m[1]; if ($m[2] == "@{") { $this->count -= strlen($m[2]); - if ($this->interpolation($inter, false)) { + if ($this->interpolation($inter)) { $content[] = $inter; } else { $this->count += strlen($m[2]); @@ -3310,7 +3310,7 @@ class lessc_parser { continue; } - if ($this->interpolation($inter, false)) { + if ($this->interpolation($inter)) { $attrParts[] = $inter; $hasInterpolation = true; continue; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 38af5be87e4..47e3188f5ff 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -705,7 +705,7 @@ if ($action == 'addcontainer') getAllImages($object, $objectpage, $urltograbbis, $tmpgeturl['content'], $action, 1, $grabimages, $grabimagesinto); include_once DOL_DOCUMENT_ROOT.'/core/class/lessc.class.php'; - $lesscobj = new lessc(); + $lesscobj = new Lessc(); try { $contentforlessc = ".bodywebsite {\n".$tmpgeturl['content']."\n}\n"; //print '
    '.$contentforlessc.'
    '; diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index 37abbc9a2bd..f5068dc59ee 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -87,6 +87,8 @@ class AllTests $suite->addTestSuite('DateLibTest'); require_once dirname(__FILE__).'/UtilsTest.php'; $suite->addTestSuite('UtilsTest'); + require_once dirname(__FILE__).'/LesscTest.php'; + $suite->addTestSuite('LesscTest'); //require_once dirname(__FILE__).'/DateLibTzFranceTest.php'; //$suite->addTestSuite('DateLibTzFranceTest'); require_once dirname(__FILE__).'/MarginsLibTest.php'; diff --git a/test/phpunit/LesscTest.php b/test/phpunit/LesscTest.php new file mode 100644 index 00000000000..634b362a7b2 --- /dev/null +++ b/test/phpunit/LesscTest.php @@ -0,0 +1,182 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file test/phpunit/LessTest.php + * \ingroup test + * \brief PHPUnit test + * \remarks To run this script as CLI: phpunit filename.php + */ + +global $conf,$user,$langs,$db; +//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver +//require_once 'PHPUnit/Autoload.php'; +require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php'; +require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; + +if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); +if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no menu to show +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); +if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) + +if (empty($user->id)) +{ + print "Load permissions for admin user nb 1\n"; + $user->fetch(1); + $user->getrights(); +} +$conf->global->MAIN_DISABLE_ALL_MAILS=1; + + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +class LesscTest extends PHPUnit\Framework\TestCase +{ + protected $savconf; + protected $savuser; + protected $savlangs; + protected $savdb; + + /** + * Constructor + * We save global variables into local variables + * + * @return SecurityTest + */ + public function __construct() + { + parent::__construct(); + + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $this->savlangs=$langs; + $this->savdb=$db; + + print __METHOD__." db->type=".$db->type." user->id=".$user->id; + //print " - db ".$db->db; + print "\n"; + } + + // Static methods + public static function setUpBeforeClass() + { + global $conf,$user,$langs,$db; + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. + + print __METHOD__."\n"; + } + + // tear down after class + public static function tearDownAfterClass() + { + global $conf,$user,$langs,$db; + $db->rollback(); + + print __METHOD__."\n"; + } + + /** + * Init phpunit tests + * + * @return void + */ + protected function setUp() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + print __METHOD__."\n"; + } + + /** + * End phpunit tests + * + * @return void + */ + protected function tearDown() + { + print __METHOD__."\n"; + } + + /** + * testLess + * + * @return string + */ + public function testLessc() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + include_once DOL_DOCUMENT_ROOT.'/core/class/lessc.class.php'; + + $lesscobj = new Lessc(); + + $cssfile = " + a { font-size: 10px; } + b .test { + font-size: 10px; + } + "; + + try { + $contentforlessc = ".bodywebsite {\n".$cssfile."\n}\n"; + //print '
    '.$contentforlessc.'
    '; + $result = $lesscobj->compile($contentforlessc); + //var_dump($contentforlessc); exit; + + } catch (exception $e) { + //echo "failed to compile lessc"; + dol_syslog("Failed to compile the CSS with lessc: ".$e->getMessage(), LOG_WARNING); + } + + $cssexpected = " +.bodywebsite a { + font-size: 10px; +} +.bodywebsite b .test { + font-size: 10px; +} +"; + + print __METHOD__." SeparatorDecimal=".$result."\n"; + $this->assertEquals(trim($result), trim($cssexpected)); + + return; + } +} From f08c07f31550db064e66ad603665a4df8df3985b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 10:42:51 +0200 Subject: [PATCH 378/982] Fix bugs reported by scrutinizer --- htdocs/core/lib/files.lib.php | 6 ------ htdocs/core/menus/standard/empty.php | 11 +++++++---- htdocs/core/modules/import/import_csv.modules.php | 2 +- htdocs/core/modules/import/import_xlsx.modules.php | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 0c72fe35fab..3bbedb91076 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1023,22 +1023,16 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable { case UPLOAD_ERR_INI_SIZE: // 1 return 'ErrorFileSizeTooLarge'; - break; case UPLOAD_ERR_FORM_SIZE: // 2 return 'ErrorFileSizeTooLarge'; - break; case UPLOAD_ERR_PARTIAL: // 3 return 'ErrorPartialFile'; - break; case UPLOAD_ERR_NO_TMP_DIR: // return 'ErrorNoTmpDir'; - break; case UPLOAD_ERR_CANT_WRITE: return 'ErrorFailedToWriteInDir'; - break; case UPLOAD_ERR_EXTENSION: return 'ErrorUploadBlockedByAddon'; - break; default: break; } diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 1898d67ad39..964681a962b 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -51,12 +51,15 @@ class MenuManager /** - * Load this->tabMenu - * - * @return void + * Load this->tabMenu + * + * @param string $forcemainmenu To force mainmenu to load + * @param string $forceleftmenu To force leftmenu to load + * @return void */ - public function loadMenu() + public function loadMenu($forcemainmenu = '', $forceleftmenu = '') { + // Do nothing } diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 606b23e2767..0888e5b84bf 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -761,7 +761,7 @@ class ImportCsv extends ModeleImports $lastinsertid = $res->rowid; $last_insert_id_array[$tablename] = $lastinsertid; } elseif($resql->num_rows > 1) { - $this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode($filters, ', ')); + $this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode(', ', $filters)); $this->errors[$error]['type']='SQL'; $error++; } else { diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 66670247a4c..253622d115f 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -782,7 +782,7 @@ class ImportXlsx extends ModeleImports $lastinsertid = $res->rowid; $last_insert_id_array[$tablename] = $lastinsertid; } elseif($resql->num_rows > 1) { - $this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode($filters, ', ')); + $this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode(', ', $filters)); $this->errors[$error]['type']='SQL'; $error++; } else { From 529dd05226e53316e17995a0b2dd3f3dcd0f836b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 10:53:05 +0200 Subject: [PATCH 379/982] Replace deprecated code --- htdocs/adherents/class/adherent.class.php | 3 ++- htdocs/bom/class/api_boms.class.php | 2 +- htdocs/comm/propal/class/api_proposals.class.php | 2 +- htdocs/commande/class/api_orders.class.php | 2 +- htdocs/compta/facture/class/api_invoices.class.php | 2 +- htdocs/contrat/class/api_contracts.class.php | 2 +- htdocs/don/class/api_donations.class.php | 2 +- htdocs/expedition/class/api_shipments.class.php | 2 +- htdocs/expensereport/class/api_expensereports.class.php | 2 +- htdocs/fichinter/class/api_interventions.class.php | 2 +- htdocs/fourn/class/api_supplier_orders.class.php | 2 +- htdocs/modulebuilder/template/class/api_mymodule.class.php | 2 +- htdocs/product/class/api_products.class.php | 2 +- htdocs/projet/class/api_projects.class.php | 2 +- htdocs/projet/class/api_tasks.class.php | 2 +- htdocs/societe/class/api_thirdparties.class.php | 2 +- .../supplier_proposal/class/api_supplier_proposals.class.php | 2 +- htdocs/ticket/class/api_tickets.class.php | 4 ++-- htdocs/user/class/api_users.class.php | 2 +- 19 files changed, 21 insertions(+), 20 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c5128942830..1b516e1c94e 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2063,9 +2063,10 @@ class Adherent extends CommonObject * @param string $mode ''=Show firstname+lastname as label (using default order), 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref * @param string $morecss Add more css on link * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ - public function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1) + public function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1, $notooltip = 0) { global $conf, $langs; diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php index 54f289a5b23..89f3e337099 100644 --- a/htdocs/bom/class/api_boms.class.php +++ b/htdocs/bom/class/api_boms.class.php @@ -101,7 +101,7 @@ class Boms extends DolibarrApi $obj_ret = array(); $tmpobject = new BOM($db); - $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; $restrictonsocid = 0; // Set to 1 if there is a field socid in table of object diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 9cc8bd32d26..15badcd75a3 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -103,7 +103,7 @@ class Proposals extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 440ea9e6984..56147545f36 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -107,7 +107,7 @@ class Orders extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index d6b33acbda6..d558bf5ac7f 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -112,7 +112,7 @@ class Invoices extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 4735f840582..194e145210f 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -108,7 +108,7 @@ class Contracts extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index f9e2c5ab64b..ef59743e03f 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -106,7 +106,7 @@ class Donations extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; $sql = "SELECT t.rowid"; if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) ) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index 9f1e42a7aaa..5e4d0d5e00c 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -106,7 +106,7 @@ class Shipments extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index cb5a438bc21..f2177aafc63 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -101,7 +101,7 @@ class ExpenseReports extends DolibarrApi $obj_ret = array(); // case of external user, $societe param is ignored and replaced by user's socid - //$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $societe; + //$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe; $sql = "SELECT t.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as t"; diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index b183623edb3..12f6824ad4d 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -113,7 +113,7 @@ class Interventions extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 897d210b1f1..323ddf29521 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -103,7 +103,7 @@ class SupplierOrders extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index 0fcd9a8afd4..594f979bb22 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -111,7 +111,7 @@ class MyModuleApi extends DolibarrApi throw new RestException(401); } - $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; $restrictonsocid = 0; // Set to 1 if there is a field socid in table of object diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 2543ff4a2e6..446b4fa3cfe 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -116,7 +116,7 @@ class Products extends DolibarrApi $obj_ret = array(); - $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; $sql = "SELECT t.rowid, t.ref, t.ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."product as t"; diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 38ea9796f65..0744017161e 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -105,7 +105,7 @@ class Projects extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index b5e589e4ef9..2415950e37b 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -113,7 +113,7 @@ class Tasks extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 95aad3a003b..ddb19c563fe 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -124,7 +124,7 @@ class Thirdparties extends DolibarrApi $obj_ret = array(); // case of external user, we force socids - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php index 014951d980e..cb606e8a083 100644 --- a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php +++ b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php @@ -101,7 +101,7 @@ class Supplierproposals extends DolibarrApi $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 400b8452938..aac1bf88f60 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -234,8 +234,8 @@ class Tickets extends DolibarrApi $obj_ret = array(); - if (!$socid && DolibarrApiAccess::$user->societe_id) { - $socid = DolibarrApiAccess::$user->societe_id; + if (!$socid && DolibarrApiAccess::$user->socid) { + $socid = DolibarrApiAccess::$user->socid; } // If the internal user must only see his customers, force searching by him diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index f570dd21285..1344cdd9815 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -76,7 +76,7 @@ class Users extends DolibarrApi } // case of external user, $societe param is ignored and replaced by user's socid - //$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $societe; + //$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe; $sql = "SELECT t.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."user as t"; From 369961b3766891766626307efbd8a3c5eab97ac1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 6 Sep 2019 11:55:41 +0200 Subject: [PATCH 380/982] FIX avoid Warning: A non-numeric value encountered --- htdocs/contrat/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 5c9ac3375dd..35338f41903 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -433,7 +433,7 @@ if (empty($reshook)) } $qty = GETPOST('qty'.$predef); - $remise_percent = GETPOST('remise_percent'.$predef); + $remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0); if ($qty == '') { @@ -566,7 +566,8 @@ if (empty($reshook)) $info_bits=0; if ($tva_npr) $info_bits |= 0x01; - if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min)))) + if (((! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) + || empty($conf->global->MAIN_USE_ADVANCED_PERMS) ) && ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min)))) { $object->error = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency)); $result = -1 ; From 0ed7ab07fd8207df753e02da89c98ca46396e730 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 12:41:34 +0200 Subject: [PATCH 381/982] Fix date selection for supplier proposal not yet supported --- htdocs/supplier_proposal/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 56473959a39..551a5f0616e 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1711,7 +1711,7 @@ if ($action == 'create') if (! empty($conf->global->SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; if (! empty($object->lines)) - $ret = $object->printObjectLines($action, $soc, $mysoc, $lineid, 1); + $ret = $object->printObjectLines($action, $soc, $mysoc, $lineid, $dateSelector); // Form to add new line if ($object->statut == SupplierProposal::STATUS_DRAFT && $user->rights->supplier_proposal->creer) @@ -1719,7 +1719,7 @@ if ($action == 'create') if ($action != 'editline') { // Add products/services form - $object->formAddObjectLine(1, $soc, $mysoc); + $object->formAddObjectLine($dateSelector, $soc, $mysoc); $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook From 123eace8c04159ed57578d193ef3c91183d9a950 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 12:44:23 +0200 Subject: [PATCH 382/982] Fix look and feel v10 --- htdocs/core/class/commonobject.class.php | 19 +++++++++++++++---- htdocs/core/tpl/objectline_create.tpl.php | 2 +- htdocs/core/tpl/objectline_edit.tpl.php | 4 ++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c57148124be..cabd5647bc9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6532,9 +6532,12 @@ abstract class CommonObject } else { - $csstyle=''; $class=(!empty($extrafields->attributes[$this->table_element]['hidden'][$key]) ? 'hideobject ' : ''); + $csstyle=''; if (is_array($params) && count($params)>0) { + if (array_key_exists('class', $params)) { + $class.=$params['class'].' '; + } if (array_key_exists('style', $params)) { $csstyle=$params['style']; } @@ -6571,16 +6574,19 @@ abstract class CommonObject $labeltoshow = $langs->trans($label); - $out .= '
    '; $html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : ''; + $out .=''; + /*for($ii = 0; $ii < ($colspan - 1); $ii++) + { + $out .=''; + }*/ + if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) $out .= ''; else $out .= ''; $e++; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index f427bb34f92..6bad5bb2ac5 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -375,7 +375,7 @@ if ($nolinesbefore) { { $coldisplay++; ?> - + + showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var],'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); + print $line->showOptionals($extrafieldsline, 'edit', array('class'=>'tredited', 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); } ?> From e1ee70fd8feb14b564eae6a57e2b990e30682d92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 12:45:27 +0200 Subject: [PATCH 383/982] Start to implement date selection of supplier proposals --- .../install/mysql/migration/10.0.0-11.0.0.sql | 5 +- .../mysql/tables/llx_supplier_proposaldet.sql | 2 + htdocs/supplier_proposal/card.php | 21 +++-- .../class/supplier_proposal.class.php | 83 +++++++------------ 4 files changed, 53 insertions(+), 58 deletions(-) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 64de0364139..00964b85e3e 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -105,4 +105,7 @@ create table llx_c_hrm_public_holiday )ENGINE=innodb; - \ No newline at end of file +ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL; +ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL; + + \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_supplier_proposaldet.sql b/htdocs/install/mysql/tables/llx_supplier_proposaldet.sql index 211502686ee..b735046a340 100644 --- a/htdocs/install/mysql/tables/llx_supplier_proposaldet.sql +++ b/htdocs/install/mysql/tables/llx_supplier_proposaldet.sql @@ -40,6 +40,8 @@ CREATE TABLE llx_supplier_proposaldet ( total_localtax2 double(24,8) DEFAULT 0, total_ttc double(24,8) DEFAULT 0, product_type integer DEFAULT 0, + date_start datetime DEFAULT NULL, -- date debut si service + date_end datetime DEFAULT NULL, -- date fin si service info_bits integer DEFAULT 0, buy_price_ht double(24,8) DEFAULT 0, fk_product_fournisseur_price integer DEFAULT NULL, diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index efb480370cd..2a61876659d 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -357,7 +357,7 @@ if (empty($reshook)) $array_options = $lines[$i]->array_options; } - $result = $object->addline( + $result = $object->addline( $desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, @@ -646,6 +646,9 @@ if (empty($reshook)) $pu_ht = $productsupplier->fourn_pu; if (empty($pu_ht)) $pu_ht = 0; // If pu is '' or null, we force to have a numeric value + $fournprice = 0; + $buyingprice = 0; + $result=$object->addline( $desc, $pu_ht, @@ -670,9 +673,17 @@ if (empty($reshook)) $productsupplier->fk_unit, '', 0, - $productsupplier->fourn_multicurrency_unitprice + $productsupplier->fourn_multicurrency_unitprice, + $date_start, + $date_end ); + //var_dump($tva_tx);var_dump($productsupplier->fourn_pu);var_dump($price_base_type);exit; + if ($result < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } } if ($idprod == -99 || $idprod == 0) { @@ -1751,12 +1762,12 @@ if ($action == 'create') // Add free products/services form global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; - $forceall=1; $dateSelector=0; $inputalsopricewithtax=1; + $forceall=1; $dateSelector=1; $inputalsopricewithtax=1; $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty. if (! empty($conf->global->SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; if (! empty($object->lines)) - $ret = $object->printObjectLines($action, $soc, $mysoc, $lineid, 1); + $ret = $object->printObjectLines($action, $soc, $mysoc, $lineid, $dateSelector); // Form to add new line if ($object->statut == SupplierProposal::STATUS_DRAFT && $user->rights->supplier_proposal->creer) @@ -1764,7 +1775,7 @@ if ($action == 'create') if ($action != 'editline') { // Add products/services form - $object->formAddObjectLine(1, $soc, $mysoc); + $object->formAddObjectLine($dateSelector, $soc, $mysoc); $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 3748aede1c7..142917a10d3 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -391,11 +391,13 @@ class SupplierProposal extends CommonObject * @param string $origin 'order', 'supplier_proposal', ... * @param int $origin_id Id of origin line * @param double $pu_ht_devise Amount in currency + * @param int $date_start Date start + * @param int $date_end Date end * @return int >0 if OK, <0 if KO * * @see add_product() */ - public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $pu_ttc = 0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $array_option = 0, $ref_supplier = '', $fk_unit = '', $origin = '', $origin_id = 0, $pu_ht_devise = 0) + public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $pu_ttc = 0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $array_option = 0, $ref_supplier = '', $fk_unit = '', $origin = '', $origin_id = 0, $pu_ht_devise = 0, $date_start = 0, $date_end = 0) { global $mysoc, $conf; @@ -570,6 +572,8 @@ class SupplierProposal extends CommonObject $this->line->origin=$origin; $this->line->origin_id=$origin_id; $this->line->ref_fourn = $this->db->escape($ref_supplier); + $this->line->date_start = $date_start; + $this->line->date_end = $date_end; // infos marge if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) { @@ -594,10 +598,6 @@ class SupplierProposal extends CommonObject // Mise en option de la ligne if (empty($qty) && empty($special_code)) $this->line->special_code=3; - // TODO deprecated - $this->line->price=$price; - $this->line->remise=$remise; - if (is_array($array_option) && count($array_option)>0) { $this->line->array_options=$array_option; } @@ -613,7 +613,7 @@ class SupplierProposal extends CommonObject if ($result > 0) { $this->db->commit(); - return $this->line->rowid; + return $this->line->id; } else { @@ -629,6 +629,11 @@ class SupplierProposal extends CommonObject return -2; } } + else + { + $this->error = 'BadStatusOfObjectToAddLine'; + return -5; + } } @@ -688,6 +693,7 @@ class SupplierProposal extends CommonObject $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $mysoc, $this->thirdparty); // Clean vat code + $reg = array(); $vat_src_code=''; if (preg_match('/\((.*)\)/', $txtva, $reg)) { @@ -707,14 +713,6 @@ class SupplierProposal extends CommonObject $multicurrency_total_tva = $tabprice[17]; $multicurrency_total_ttc = $tabprice[18]; - // Anciens indicateurs: $price, $remise (a ne plus utiliser) - $price = $pu; - if ($remise_percent > 0) - { - $remise = round(($pu * $remise_percent / 100), 2); - $price = $pu - $remise; - } - // Update line $this->line=new SupplierProposalLine($this->db); @@ -730,7 +728,7 @@ class SupplierProposal extends CommonObject $this->line->rang = $rangmax + 1; } - $this->line->rowid = $rowid; + $this->line->id = $rowid; $this->line->label = $label; $this->line->desc = $desc; $this->line->qty = $qty; @@ -768,10 +766,6 @@ class SupplierProposal extends CommonObject } $this->line->pa_ht = $pa_ht; - // TODO deprecated - $this->line->price=$price; - $this->line->remise=$remise; - if (is_array($array_option) && count($array_option)>0) { $this->line->array_options=$array_option; } @@ -791,7 +785,6 @@ class SupplierProposal extends CommonObject $this->update_price(1); $this->fk_supplier_proposal = $this->id; - $this->rowid = $rowid; $this->db->commit(); return $result; @@ -2745,9 +2738,6 @@ class SupplierProposalLine extends CommonObjectLine public $oldline; - // From llx_supplier_proposaldet - public $rowid; // deprecated - /** * @var int ID */ @@ -2813,20 +2803,11 @@ class SupplierProposalLine extends CommonObjectLine // Bit 1: 0 ligne normale - 1 si ligne de remise fixe public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne - public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne + public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne - /** - * @deprecated - * @see remise_percent, fk_remise_except - */ - public $remise; - - /** - * @deprecated - * @see subprice - */ - public $price; + public $date_start; + public $date_end; // From llx_product /** @@ -2902,6 +2883,7 @@ class SupplierProposalLine extends CommonObjectLine public function fetch($rowid) { $sql = 'SELECT pd.rowid, pd.fk_supplier_proposal, pd.fk_parent_line, pd.fk_product, pd.label as custom_label, pd.description, pd.price, pd.qty, pd.tva_tx,'; + $sql.= ' pd.date_start, pd.date_end,'; $sql.= ' pd.remise, pd.remise_percent, pd.fk_remise_except, pd.subprice,'; $sql.= ' pd.info_bits, pd.total_ht, pd.total_tva, pd.total_ttc, pd.fk_product_fournisseur_price as fk_fournprice, pd.buy_price_ht as pa_ht, pd.special_code, pd.rang,'; $sql.= ' pd.localtax1_tx, pd.localtax2_tx, pd.total_localtax1, pd.total_localtax2,'; @@ -2917,21 +2899,20 @@ class SupplierProposalLine extends CommonObjectLine { $objp = $this->db->fetch_object($result); - $this->rowid = $objp->rowid; // deprecated $this->id = $objp->rowid; $this->fk_supplier_proposal = $objp->fk_supplier_proposal; $this->fk_parent_line = $objp->fk_parent_line; $this->label = $objp->custom_label; $this->desc = $objp->description; $this->qty = $objp->qty; - $this->price = $objp->price; // deprecated $this->subprice = $objp->subprice; $this->tva_tx = $objp->tva_tx; - $this->remise = $objp->remise; $this->remise_percent = $objp->remise_percent; $this->fk_remise_except = $objp->fk_remise_except; $this->fk_product = $objp->fk_product; $this->info_bits = $objp->info_bits; + $this->date_start = $this->db->jdate($objp->date_start); + $this->date_end = $this->db->jdate($objp->date_end); $this->total_ht = $objp->total_ht; $this->total_tva = $objp->total_tva; @@ -3028,6 +3009,7 @@ class SupplierProposalLine extends CommonObjectLine // Insert line into database $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'supplier_proposaldet'; $sql.= ' (fk_supplier_proposal, fk_parent_line, label, description, fk_product, product_type,'; + $sql.= ' date_start, date_end,'; $sql.= ' fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,'; $sql.= ' subprice, remise_percent, '; $sql.= ' info_bits, '; @@ -3040,6 +3022,8 @@ class SupplierProposalLine extends CommonObjectLine $sql.= " '".$this->db->escape($this->desc)."',"; $sql.= " ".($this->fk_product?"'".$this->db->escape($this->fk_product)."'":"null").","; $sql.= " '".$this->db->escape($this->product_type)."',"; + $sql.= " ".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : "null").","; + $sql.= " ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null").","; $sql.= " ".($this->fk_remise_except?"'".$this->db->escape($this->fk_remise_except)."'":"null").","; $sql.= " ".price2num($this->qty).","; $sql.= " ".price2num($this->tva_tx).","; @@ -3073,8 +3057,7 @@ class SupplierProposalLine extends CommonObjectLine $resql=$this->db->query($sql); if ($resql) { - $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'supplier_proposaldet'); - $this->id=$this->rowid; + $this->id=$this->db->last_insert_id(MAIN_DB_PREFIX.'supplier_proposaldet'); if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { @@ -3120,7 +3103,7 @@ class SupplierProposalLine extends CommonObjectLine $error=0; $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposaldet WHERE rowid = ".$this->rowid; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposaldet WHERE rowid = ".$this->id; dol_syslog("SupplierProposalLine::delete", LOG_DEBUG); if ($this->db->query($sql) ) { @@ -3128,7 +3111,6 @@ class SupplierProposalLine extends CommonObjectLine // Remove extrafields if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used { - $this->id=$this->rowid; $result=$this->deleteExtraFields(); if ($result < 0) { @@ -3180,8 +3162,6 @@ class SupplierProposalLine extends CommonObjectLine if (empty($this->localtax2_type)) $this->localtax2_type=0; if (empty($this->marque_tx)) $this->marque_tx=0; if (empty($this->marge_tx)) $this->marge_tx=0; - if (empty($this->price)) $this->price=0; // TODO A virer - if (empty($this->remise)) $this->remise=0; // TODO A virer if (empty($this->remise_percent)) $this->remise_percent=0; if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->special_code)) $this->special_code=0; @@ -3212,6 +3192,8 @@ class SupplierProposalLine extends CommonObjectLine $sql.= " description='".$this->db->escape($this->desc)."'"; $sql.= " , label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null"); $sql.= " , product_type=".$this->product_type; + $sql.= " , date_start=".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : "null"); + $sql.= " , date_end=".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null"); $sql.= " , tva_tx='".price2num($this->tva_tx)."'"; $sql.= " , localtax1_tx=".price2num($this->localtax1_tx); $sql.= " , localtax2_tx=".price2num($this->localtax2_tx); @@ -3220,8 +3202,6 @@ class SupplierProposalLine extends CommonObjectLine $sql.= " , qty='".price2num($this->qty)."'"; $sql.= " , subprice=".price2num($this->subprice).""; $sql.= " , remise_percent=".price2num($this->remise_percent).""; - $sql.= " , price=".price2num($this->price).""; // TODO A virer - $sql.= " , remise=".price2num($this->remise).""; // TODO A virer $sql.= " , info_bits='".$this->db->escape($this->info_bits)."'"; if (empty($this->skip_update_total)) { @@ -3245,7 +3225,7 @@ class SupplierProposalLine extends CommonObjectLine $sql.= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva).""; $sql.= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc).""; - $sql.= " WHERE rowid = ".$this->rowid; + $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql=$this->db->query($sql); @@ -3253,7 +3233,6 @@ class SupplierProposalLine extends CommonObjectLine { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; $result=$this->insertExtraFields(); if ($result < 0) { @@ -3298,10 +3277,10 @@ class SupplierProposalLine extends CommonObjectLine // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposaldet SET"; - $sql.= " total_ht=".price2num($this->total_ht, 'MT').""; - $sql.= ",total_tva=".price2num($this->total_tva, 'MT').""; - $sql.= ",total_ttc=".price2num($this->total_ttc, 'MT').""; - $sql.= " WHERE rowid = ".$this->rowid; + $sql.= " total_ht=".price2num($this->total_ht, 'MT'); + $sql.= ",total_tva=".price2num($this->total_tva, 'MT'); + $sql.= ",total_ttc=".price2num($this->total_ttc, 'MT'); + $sql.= " WHERE rowid = ".$this->id; dol_syslog("SupplierProposalLine::update_total", LOG_DEBUG); From 165f64463b754f63d287c02222c266ffca60480a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 12:44:23 +0200 Subject: [PATCH 384/982] Fix look and feel v10 --- htdocs/core/class/commonobject.class.php | 19 +++++++++++++++---- htdocs/core/tpl/objectline_create.tpl.php | 2 +- htdocs/core/tpl/objectline_edit.tpl.php | 4 ++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4e88348c6d0..d20a8d2785b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6450,9 +6450,12 @@ abstract class CommonObject } else { - $csstyle=''; $class=(!empty($extrafields->attributes[$this->table_element]['hidden'][$key]) ? 'hideobject ' : ''); + $csstyle=''; if (is_array($params) && count($params)>0) { + if (array_key_exists('class', $params)) { + $class.=$params['class'].' '; + } if (array_key_exists('style', $params)) { $csstyle=$params['style']; } @@ -6489,16 +6492,19 @@ abstract class CommonObject $labeltoshow = $langs->trans($label); - $out .= ''; $html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : ''; + $out .=''; + /*for($ii = 0; $ii < ($colspan - 1); $ii++) + { + $out .=''; + }*/ + if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) $out .= ''; else $out .= ''; $e++; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index f427bb34f92..6bad5bb2ac5 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -375,7 +375,7 @@ if ($nolinesbefore) { { $coldisplay++; ?> - + + showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var],'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); + print $line->showOptionals($extrafieldsline, 'edit', array('class'=>'tredited', 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); } ?> From 104858cf4751fd73d845c7464a21b58e47b74984 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 12:51:10 +0200 Subject: [PATCH 385/982] Fix date selection on supplier proposal line not yet supported --- htdocs/supplier_proposal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 2a61876659d..bf6ec8d0c59 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1762,7 +1762,7 @@ if ($action == 'create') // Add free products/services form global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; - $forceall=1; $dateSelector=1; $inputalsopricewithtax=1; + $forceall=1; $dateSelector=0; $inputalsopricewithtax=1; $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty. if (! empty($conf->global->SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; From d1a5be20ea2321b717e2fd5498b310f3027d493b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 13:02:52 +0200 Subject: [PATCH 386/982] Fix wrong warning --- htdocs/compta/prelevement/card.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 5864d6301bd..b8aa09eae60 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -356,8 +356,6 @@ if ($id > 0 || $ref) print_liste_field_titre(''); print "\n"; - $var=false; - $total = 0; while ($i < min($num, $conf->liste_limit)) @@ -406,7 +404,10 @@ if ($id > 0 || $ref) print ''; print ''; print '\n"; print ''; From bc7bf3b4b5d0cdf7748914cf23693b66ff9b5303 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 13:44:02 +0200 Subject: [PATCH 387/982] FIX bad consistency in list of invoice for direct debit order. --- .../class/bonprelevement.class.php | 7 +- htdocs/compta/prelevement/demandes.php | 204 +++++++++++------- htdocs/compta/prelevement/index.php | 3 + 3 files changed, 129 insertions(+), 85 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 1a98c33ab02..6f8a7431b0e 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -739,14 +739,13 @@ class BonPrelevement extends CommonObject $sql = "SELECT count(f.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - $sql.= " WHERE f.fk_statut = 1"; + $sql.= " WHERE f.fk_statut = ".Facture::STATUS_VALIDATED; $sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND f.rowid = pfd.fk_facture"; - $sql.= " AND f.paye = 0"; $sql.= " AND pfd.traite = 0"; $sql.= " AND f.total_ttc > 0"; - dol_syslog(get_class($this)."::SommeAPrelever"); + dol_syslog(get_class($this)."::NbFactureAPrelever"); $resql = $this->db->query($sql); if ( $resql ) @@ -759,7 +758,7 @@ class BonPrelevement extends CommonObject } else { - $this->error=get_class($this)."::SommeAPrelever Erreur -1 sql=".$this->db->error(); + $this->error=get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error(); return -1; } } diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 8f9df284291..1caf62f1491 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -35,31 +35,43 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); // Security check $socid = GETPOST('socid', 'int'); +$status = GETPOST('status', 'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement', '', '', 'bons'); -// Get supervariables -$page = GETPOST('page', 'int'); -$sortorder = GETPOST('sortorder', 'alpha'); -$sortfield = GETPOST('sortfield', 'alpha'); +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +// Load variable for pagination $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOST("page", 'int'); -if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="f.ref"; +$massactionbutton = ''; + /* * View */ -llxHeader(); +if (!$status) +{ + $title = $langs->trans("RequestStandingOrderToTreat"); +} +else +{ + $title = $langs->trans("RequestStandingOrderTreated"); +} + +llxHeader('', $title); $thirdpartystatic=new Societe($db); $invoicestatic=new Facture($db); @@ -78,95 +90,125 @@ $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND f.fk_soc = ".$socid; -if (!$statut) $sql.= " AND pfd.traite = 0"; -if ($statut) $sql.= " AND pfd.traite = ".$statut; +if (!$status) $sql.= " AND pfd.traite = 0"; +if ($status) $sql.= " AND pfd.traite = ".$status; +$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; $sql.= " AND pfd.fk_facture = f.rowid"; if (dol_strlen(trim(GETPOST('search_societe', 'alpha')))) { $sql.= natural_search("s.nom", 'search_societe'); } -$sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($limit+1, $offset); +$sql.=$db->order($sortfield, $sortorder); -$resql=$db->query($sql); -if ($resql) + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $num = $db->num_rows($resql); - $i = 0; - - if (!$statut) + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0 { - print_barre_liste($langs->trans("RequestStandingOrderToTreat"), $page, "demandes.php", $urladd, $sortfield, $sortorder, '', $num); + $page = 0; + $offset = 0; } - else - { - print_barre_liste($langs->trans("RequestStandingOrderTreated"), $page, "demandes.php", $urladd, $sortfield, $sortorder, '', $num); - } - - print '
    '; - - print '
    ".$langs->trans("RuleForStockManagementDecrease")."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("DeStockOnBill").''; +print ''; if (! empty($conf->facture->enabled)) { if ($conf->use_javascript_ajax) { @@ -125,7 +125,7 @@ $found++; print '
    '.$langs->trans("DeStockOnValidateOrder").''; +print ''; if (! empty($conf->commande->enabled)) { if ($conf->use_javascript_ajax) { @@ -147,7 +147,7 @@ $found++; print '
    '.$langs->trans("DeStockOnShipment").''; +print ''; if (! empty($conf->expedition->enabled)) { if ($conf->use_javascript_ajax) { @@ -167,7 +167,7 @@ $found++; print '
    '.$langs->trans("DeStockOnShipmentOnClosing").''; +print ''; if (! empty($conf->expedition->enabled)) { if ($conf->use_javascript_ajax) { @@ -200,14 +200,14 @@ print '
    '; print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; $found=0; print ''; print ''; -print ''; print ''; -print ''; - print ''; - print ''; + print ''; - print ''; - print ''; + print ''; print ''; - print '
    ".$langs->trans("RuleForStockManagementIncrease")."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("ReStockOnBill").''; +print ''; if (! empty($conf->fournisseur->enabled)) { if ($conf->use_javascript_ajax) { @@ -228,7 +228,7 @@ $found++; print '
    '.$langs->trans("ReStockOnValidateOrder").''; +print ''; if (! empty($conf->fournisseur->enabled)) { if ($conf->use_javascript_ajax) { @@ -248,8 +248,8 @@ $found++; if (!empty($conf->reception->enabled)) { print '
    '.$langs->trans("StockOnReception").''; + print ''.$langs->trans("StockOnReception").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION'); @@ -263,8 +263,8 @@ if ($conf->use_javascript_ajax) { print '
    '.$langs->trans("StockOnReceptionOnClosing").''; + print ''.$langs->trans("StockOnReceptionOnClosing").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE'); @@ -279,7 +279,7 @@ else { print '
    '.$langs->trans("ReStockOnDispatchOrder").''; + print ''; if (! empty($conf->fournisseur->enabled)) { if ($conf->use_javascript_ajax) { @@ -308,16 +308,17 @@ if ($conf->use_javascript_ajax) { print '
    '; print '
    '; + print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''; print ''; -print ''; print ''; - print ''; print ''; - print ''; print ''; - print ''; + print ''; + print ''; + print "
    ".$langs->trans("RuleForStockAvailability")."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("WarehouseAllowNegativeTransfer").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_ALLOW_NEGATIVE_TRANSFER'); } else { @@ -332,7 +333,7 @@ if($conf->invoice->enabled) { print '
    '.$langs->trans("StockMustBeEnoughForInvoice").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE'); } else { @@ -347,7 +348,7 @@ if($conf->order->enabled) { print '
    '.$langs->trans("StockMustBeEnoughForOrder").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER'); } else { @@ -362,7 +363,7 @@ if($conf->expedition->enabled) { print '
    '.$langs->trans("StockMustBeEnoughForShipment").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT'); } else { @@ -386,12 +387,12 @@ if ($virtualdiffersfromphysical) print ''; print ''; print "\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; print ''; print ''; - print ''; print ''; print ''; print "\n"; -$var=false; -//if ($conf->global->MAIN_FEATURES_LEVEL > 0) -//{ - print '\n"; +print '\n"; -//} // Ask for payment bank during supplier order /* Kept as hidden for the moment @@ -564,6 +560,20 @@ print '\n"; +// Option to add a quality/validation step, on products, after reception. +$langs->load("stocks"); +print ''; +print ''; +print ''; +print '\n\n"; + print '
    ".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("UseVirtualStockByDefault").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK'); } else { @@ -409,12 +410,12 @@ print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''; print ''; -print ''; print ''; -print '\n"; print ''; print ''; -print '\n"; print "\n"; -if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - print ''; - print ''; - print '\n\n"; -} - print '
    ".$langs->trans("Other")."'.$langs->trans("Status").''.$langs->trans("Status").'
    '.$langs->trans("UserWarehouseAutoCreate").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_USERSTOCK_AUTOCREATE'); } else { @@ -428,7 +429,7 @@ print '
    '; print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")); print ''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_SUPPORTS_SERVICES'); } else { @@ -440,7 +441,7 @@ print "
    '.$langs->trans("AllowAddLimitStockByWarehouse").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE'); } else { @@ -450,19 +451,6 @@ if ($conf->use_javascript_ajax) { print "
    '.$langs->trans("UseDispatchStatus").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); -} - print "
    '; print '
    '; @@ -471,43 +459,45 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print ''; print ''; print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; // Example with a yes / no select - print ''; + /*print ''; print ''; - print ''; + */ // Example with a yes / no select - print ''; + /*print ''; print ''; - print ''; + print ''; + */ - // Example with a yes / no select + // Example with a yes / no select print ''; - print ''; - print ''; + print ''; print '
    '.$langs->trans("Inventory").''.$langs->trans("Status").'
    '.$langs->trans("Status").'
    '.$langs->trans("INVENTORY_DISABLE_VIRTUAL").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVENTORY_DISABLE_VIRTUAL'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVENTORY_DISABLE_VIRTUAL", $arrval, $conf->global->INVENTORY_DISABLE_VIRTUAL); -} + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('INVENTORY_DISABLE_VIRTUAL'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("INVENTORY_DISABLE_VIRTUAL", $arrval, $conf->global->INVENTORY_DISABLE_VIRTUAL); + } print '
    '.$langs->trans("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVENTORY_USE_MIN_PA_IF_NO_LAST_PA'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA", $arrval, $conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA); -} - print '
    '; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('INVENTORY_USE_MIN_PA_IF_NO_LAST_PA'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA", $arrval, $conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA); + } + print '
    '.$langs->trans("INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT); -} + print ''.$langs->trans("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT); + } print '
    '; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index e895a0b4005..f1fbbd4b286 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -494,20 +494,16 @@ print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").' 
    '; - print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
    '; - print $langs->trans("IfSetToYesDontForgetPermission"); - print '
    '; - print ''; - print ''; - print ''; - print "
    '; +print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
    '; +print $langs->trans("IfSetToYesDontForgetPermission"); +print '
    '; +print ''; +print ''; +print ''; +print "
    '; print ''; print "
    '.$langs->trans("UseDispatchStatus").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); +} +print "

    '; print ''; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index d15545e4cda..51829492665 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1822,10 +1822,9 @@ class CommandeFournisseur extends CommonOrder $error++; } - // Si module stock gere et que incrementation faite depuis un dispatching en stock + // If module stock is enabled and the stock increase is done on purchase order dispatching if (! $error && $entrepot > 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - $mouv = new MouvementStock($this->db); if ($product > 0) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 3e42552a942..1f6baa158da 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2338,7 +2338,7 @@ elseif (! empty($object->id)) }*/ // Modify - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->commander) { @@ -2347,7 +2347,7 @@ elseif (! empty($object->id)) } // Approve - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->approuver) { @@ -2369,7 +2369,7 @@ elseif (! empty($object->id)) // Second approval (if option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set) if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->approve2) { @@ -2390,7 +2390,7 @@ elseif (! empty($object->id)) } // Refuse - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->approuver || $user->rights->fournisseur->commande->approve2) { @@ -2403,7 +2403,7 @@ elseif (! empty($object->id)) } // Send - if (in_array($object->statut, array(2, 3, 4, 5))) + if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED, 3, 4, 5))) { if ($user->rights->fournisseur->commande->commander) { @@ -2412,7 +2412,7 @@ elseif (! empty($object->id)) } // Reopen - if (in_array($object->statut, array(2))) + if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED))) { $buttonshown=0; if (! $buttonshown && $user->rights->fournisseur->commande->approuver) @@ -2454,7 +2454,7 @@ elseif (! empty($object->id)) } } - if ($object->statut == 2) + if ($object->statut == CommandeFournisseur::STATUS_ACCEPTED) { if ($user->rights->fournisseur->commande->commander) { @@ -2466,6 +2466,15 @@ elseif (! empty($object->id)) } } + // Classify received (this does not record reception) + if ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY) + { + if ($user->rights->fournisseur->commande->receptionner) + { + print ''; + } + } + // Create bill //if (! empty($conf->facture->enabled)) //{ @@ -2583,38 +2592,41 @@ elseif (! empty($object->id)) print '
    '; - if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4)) + if ($action == 'classifyreception') { - // Set status to received (action=livraison) - print ''."\n"; - print '
    '; - print ''; - print ''; - print load_fiche_titre($langs->trans("Receive"), '', ''); + if ($user->rights->fournisseur->commande->receptionner && ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY)) + { + // Set status to received (action=livraison) + print ''."\n"; + print ''; + print ''; + print ''; + print load_fiche_titre($langs->trans("Receive"), '', ''); - print ''; - //print ''; - print '\n"; + print '
    '.$langs->trans("Receive").'
    '.$langs->trans("DeliveryDate").''; - $datepreselected = dol_now(); - print $form->selectDate($datepreselected, '', 1, 1, '', "commande", 1, 1); - print "
    '; + //print ''; + print '\n"; - print "'; - print ''; - print ''; - print "
    '.$langs->trans("Receive").'
    '.$langs->trans("DeliveryDate").''; + $datepreselected = dol_now(); + print $form->selectDate($datepreselected, '', 1, 1, '', "commande", 1, 1); + print "
    ".$langs->trans("Delivery")."\n"; - $liv = array(); - $liv[''] = ' '; - $liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected"); - $liv['par'] = $langs->trans("PartialWoman"); - $liv['nev'] = $langs->trans("NeverReceived"); - $liv['can'] = $langs->trans("Canceled"); + print '
    '.$langs->trans("Delivery")."\n"; + $liv = array(); + $liv[''] = ' '; + $liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected"); + $liv['par'] = $langs->trans("PartialWoman"); + $liv['nev'] = $langs->trans("NeverReceived"); + $liv['can'] = $langs->trans("Canceled"); - print $form->selectarray("type", $liv); + print $form->selectarray("type", $liv); - print '
    '.$langs->trans("Comment").'
    \n"; - print "
    \n"; - print "
    "; + print '
    '.$langs->trans("Comment").'
    \n"; + print "\n"; + print "
    "; + } } // List of actions on element diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 367ff6672a5..5f1d04f8bb0 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1685,7 +1685,7 @@ SuppliersSetup=Vendor module setup SuppliersCommandModel=Complete template of purchase order (logo...) SuppliersInvoiceModel=Complete template of vendor invoice (logo...) SuppliersInvoiceNumberingModel=Vendor invoices numbering models -IfSetToYesDontForgetPermission=If set to yes, don't forget to provide permissions to groups or users allowed for the second approval +IfSetToYesDontForgetPermission=If set to a non null value, don't forget to provide permissions to groups or users allowed for the second approval ##### GeoIPMaxmind ##### GeoIPMaxmindSetup=GeoIP Maxmind module setup PathToGeoIPMaxmindCountryDataFile=Path to file containing Maxmind ip to country translation.
    Examples:
    /usr/local/share/GeoIP/GeoIP.dat
    /usr/share/GeoIP/GeoIP.dat diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index ad895845488..256bd2a7d4d 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -154,5 +154,5 @@ CreateOrders=Create orders ToBillSeveralOrderSelectCustomer=To create an invoice for several orders, click first onto customer, then choose "%s". OptionToSetOrderBilledNotEnabled=Option (from module Workflow) to set order to 'Billed' automatically when invoice is validated is off, so you will have to set status of order to 'Billed' manually. IfValidateInvoiceIsNoOrderStayUnbilled=If invoice validation is 'No', the order will remain to status 'Unbilled' until the invoice is validated. -CloseReceivedSupplierOrdersAutomatically=Close order to "%s" automatically if all products are received. +CloseReceivedSupplierOrdersAutomatically=Close order to status "%s" automatically if all products are received. SetShippingMode=Set shipping mode diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index ede7fea87b7..f3f023f8dcf 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -21,6 +21,7 @@ QtyShipped=Qty shipped QtyShippedShort=Qty ship. QtyPreparedOrShipped=Qty prepared or shipped QtyToShip=Qty to ship +QtyToReceive=Qty to receive QtyReceived=Qty received QtyInOtherShipments=Qty in other shipments KeepToShip=Remain to ship @@ -46,6 +47,7 @@ DateDeliveryPlanned=Planned date of delivery RefDeliveryReceipt=Ref delivery receipt StatusReceipt=Status delivery receipt DateReceived=Date delivery received +ClassifyReception=Classify reception SendShippingByEMail=Send shipment by email SendShippingRef=Submission of shipment %s ActionsOnShipping=Events on shipment diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index fd89d432360..17f914b7405 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -55,7 +55,7 @@ PMPValue=Weighted average price PMPValueShort=WAP EnhancedValueOfWarehouses=Warehouses value UserWarehouseAutoCreate=Create a user warehouse automatically when creating a user -AllowAddLimitStockByWarehouse=Manage also values for minimum and desired stock per pairing (product-warehouse) in addition to values per product +AllowAddLimitStockByWarehouse=Manage also value for minimum and desired stock per pairing (product-warehouse) in addition to the value for minimum and desired stock per product IndependantSubProductStock=Product stock and subproduct stock are independent QtyDispatched=Quantity dispatched QtyDispatchedShort=Qty dispatched @@ -182,7 +182,7 @@ SelectFournisseur=Vendor filter inventoryOnDate=Inventory INVENTORY_DISABLE_VIRTUAL=Virtual product (kit): do not decrement stock of a child product INVENTORY_USE_MIN_PA_IF_NO_LAST_PA=Use the buy price if no last buy price can be found -INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT=Stock movement has date of inventory +INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT=Stock movements will have the date of inventory (instead of the date of inventory validation) inventoryChangePMPPermission=Allow to change PMP value for a product ColumnNewPMP=New unit PMP OnlyProdsInStock=Do not add product without stock diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index a4a8827ca05..bbbeb2638e8 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -154,5 +154,5 @@ CreateOrders=Créer commandes ToBillSeveralOrderSelectCustomer=Pour créer une facture pour plusieurs commandes, cliquez d'abord sur le client, puis choisir "%s". OptionToSetOrderBilledNotEnabled=L'option (issue du module Workflow) pour définir automatiquement les commandes à 'Facturé' que une facture est validée, est désactivée, aussi vous devrez donc définir le statut de la commande sur 'Facturé' manuellement. IfValidateInvoiceIsNoOrderStayUnbilled=Si la validation de facture est à "Non", la commande restera au statut "Non facturé" jusqu'à ce que la facture soit validée. -CloseReceivedSupplierOrdersAutomatically=Fermer la commande "%s" automatiquement si tous les produits ont été reçus. +CloseReceivedSupplierOrdersAutomatically=Fermer la commande au statut "%s" automatiquement si tous les produits ont été reçus. SetShippingMode=Définir la méthode d'expédition diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 62cfc476ba8..85b174ea725 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -59,7 +59,7 @@ class Inventory extends CommonObject * 'type' if the field format. * 'label' the translation key. * 'enabled' is a condition when the field must be managed. - * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'index' if we want an index in database. * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). @@ -96,7 +96,7 @@ class Inventory extends CommonObject //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'default'=>0, 'arrayofkeyval'=>array(0=>'Todo', 1=>'Done', -1=>'Cancel')), + 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>4, 'enabled'=>1, 'position'=>1000, 'default'=>0, 'arrayofkeyval'=>array(0=>'ToDo', 1=>'Done', -1=>'Cancel')), ); /** diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 7cbd77dd4da..b9156b1837b 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2016 Yasser Carreón - * Copyright (C) 2018 Quentin Vial-Gouteyron + * Copyright (C) 2018 Quentin Vial-Gouteyron * * 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 @@ -56,7 +56,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -$langs->loadLangs(array("receptions","companies","bills",'deliveries','orders','stocks','other','propal')); +$langs->loadLangs(array("receptions","companies","bills",'deliveries','orders','stocks','other','propal','sendings')); if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); if (! empty($conf->productbatch->enabled)) $langs->load('productbatch'); From 08c16ea2e12bad3823928011378ecbd28372e3c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 02:03:26 +0200 Subject: [PATCH 367/982] Fix bad dir created --- htdocs/core/modules/modReception.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php index 6594d7bb04a..f85f5656afe 100644 --- a/htdocs/core/modules/modReception.class.php +++ b/htdocs/core/modules/modReception.class.php @@ -58,7 +58,7 @@ class modReception extends DolibarrModules // Data directories to create when module is enabled $this->dirs = array("/reception/receipt", "/reception/receipt/temp", - "/doctemplates/reception" + "/doctemplates/receptions" ); // Config pages From 613886f86b67f231b99cd78dbf531c6436cefa3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 02:09:37 +0200 Subject: [PATCH 368/982] Fix translation --- htdocs/reception/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index e93c4f2d7ad..f1d32b3ed6e 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -780,9 +780,10 @@ if ($action == 'create') } print '
    '; - if ($origin == 'supplier_order') print $langs->trans('RefSupplierOrder'); + if ($origin == 'supplier_order') print $langs->trans('SupplierOrder'); else print $langs->trans('RefSupplier'); print ''; print ''; @@ -1398,7 +1399,7 @@ elseif ($id || $ref) if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && ! empty($conf->propal->enabled)) { print '
    '; - print $langs->trans("RefSupplierOrder").''; print $objectsrc->getNomUrl(1, 'reception'); print "'; //print dol_print_date($object->date_livraison,"day"); // date_livraison come from order and will be stored into date_delivery planed. $date_delivery = ($date_delivery?$date_delivery:$object->date_livraison); // $date_delivery comes from GETPOST - print $form->select_date($date_delivery?$date_delivery:-1, 'date_delivery', 1, 1, 1); + print $form->selectDate($date_delivery?$date_delivery:-1, 'date_delivery', 1, 1, 1); print "
    '; - print $form->select_date($dispatchLines[$indiceAsked]['DLC'], 'dlc' . $indiceAsked, '', '', 1, ""); + print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc' . $indiceAsked, '', '', 1, ""); print ''; - print $form->select_date($dispatchLines[$indiceAsked]['DLUO'], 'dluo' . $indiceAsked, '', '', 1, ""); + print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo' . $indiceAsked, '', '', 1, ""); print '

    '; print $langs->trans('EatByDate').' : '; - print $form->select_date($lines[$i]->eatby, 'dlc' .$line_id, '', '', 1, ""). '
    '; + print $form->selectDate($lines[$i]->eatby, 'dlc' .$line_id, '', '', 1, ""). '
    '; print $langs->trans('SellByDate').' : '; - print $form->select_date($lines[$i]->sellby, 'dluo' .$line_id, '', '', 1, ""); + print $form->selectDate($lines[$i]->sellby, 'dluo' .$line_id, '', '', 1, ""); print '
    ' . $langs->trans("Warehouse") . '' . $langs->trans("Comment") . '' . $langs->trans("Status") . '
    '; if(!empty($reception->id)){ print $reception->getLibStatut(5); } + print ''; - print '
    trans("Total"); ?>
    trans("Reception"); ?>getNomUrl(1); ?>date_delivery, 'day'); ?>trans("Reception"); ?> + global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print ' + getNomUrl(1); ?>date_delivery, 'day'); ?>rights->reception->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } ?>getLibStatut(3); ?> + getLibStatut(3); ?> element != 'order_supplier') { ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
    '.$langs->trans("UseDispatchStatus").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); +if ($conf->reception->enabled) +{ + print ''.$langs->trans("FeatureNotAvailableWithReceptionModule").''; +} +else +{ + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); + } } print "
    '; - print $form->select_date('', '', '', '', '', '', 1, 1); + print $form->selectDate('', '', '', '', '', '', 1, 1); print '
    '; print $langs->trans('DateCreation'); print ''; - print $form->select_date($pagedatecreation, 'datecreation', 1, 1, 0, '', 1, 1); + print $form->selectDate($pagedatecreation, 'datecreation', 1, 1, 0, '', 1, 1); //print dol_print_date($pagedatecreation, 'dayhour'); print '
    attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired'; $out .= '">'; - if (! empty($extrafields->attributes[$object->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$object->table_element]['help'][$key]); + if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); else $out .= $labeltoshow; $out .= ''; + //$out .=''; switch($mode) { case "view": @@ -6593,6 +6599,11 @@ abstract class CommonObject $out .= '
    ">"> - attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired'; $out .= '">'; - if (! empty($extrafields->attributes[$object->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$object->table_element]['help'][$key]); + if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); else $out .= $labeltoshow; $out .= ''; + //$out .=''; switch($mode) { case "view": @@ -6511,6 +6517,11 @@ abstract class CommonObject $out .= '
    ">"> -
    '.$langs->trans("Total").' '; - if ($total != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices"); + if (empty($offset) && $num <= $limit) // If we have all record on same page, then the following test/warning can be done + { + if ($total != $object->amount) print img_warning("TotalAmountOfdirectDebitOrderDiffersFromSumOfLines"); + } print price($total); print " 
    '; - - print ''; - print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]); - print_liste_field_titre("Company", $_SERVER["PHP_SELF"]); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"'); - print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"'); - print_liste_field_titre(''); - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - // Action column - print ''; - print ''; - - $users = array(); - - while ($i < min($num, $limit)) - { - $obj = $db->fetch_object($resql); - - print ''; - - // Ref facture - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - $i++; - } - - print "
    '; - $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); - print $searchpicto; - print '
    '; - $invoicestatic->id=$obj->rowid; - $invoicestatic->ref=$obj->ref; - print $invoicestatic->getNomUrl(1, 'withdraw'); - print ''; - $thirdpartystatic->id=$obj->socid; - $thirdpartystatic->name=$obj->name; - print $thirdpartystatic->getNomUrl(1, 'customer'); - print ''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->date_demande), 'day').'

    "; - - print ''; +} +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) +{ + $num = $nbtotalofrecords; } else { - dol_print_error($db); + $sql.= $db->plimit($limit+1, $offset); + + $resql=$db->query($sql); + if (! $resql) + { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); } + + +$newcardbutton = ''.$langs->trans("Back").''; + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit); + +print '
    '; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + + +print ''; + +print ''; +print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]); +print_liste_field_titre("Company", $_SERVER["PHP_SELF"]); +print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"'); +print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"'); +print_liste_field_titre(''); +print ''; + +print ''; +print ''; +print ''; +print ''; +print ''; +// Action column +print ''; +print ''; + +$users = array(); + +$i = 0; +while ($i < min($num, $limit)) +{ + $obj = $db->fetch_object($resql); + if (empty($obj)) break; // Should not happen + + print ''; + + // Ref facture + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + $i++; +} + +print "
    '; +$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); +print $searchpicto; +print '
    '; + $invoicestatic->id=$obj->rowid; + $invoicestatic->ref=$obj->ref; + print $invoicestatic->getNomUrl(1, 'withdraw'); + print ''; + $thirdpartystatic->id=$obj->socid; + $thirdpartystatic->name=$obj->name; + print $thirdpartystatic->getNomUrl(1, 'customer'); + print ''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->date_demande), 'day').'

    "; + +print '
    '; + + // End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 1be716f8f61..44db7dd2625 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -71,6 +71,7 @@ $thirdpartystatic=new Societe($db); $invoicestatic=new Facture($db); $bprev = new BonPrelevement($db); + print ''; print ''; @@ -100,6 +101,8 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX $sql.= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; +$sql.= " AND f.total_ttc > 0"; +$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; $sql.= " AND pfd.traite = 0 AND pfd.fk_facture = f.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND f.fk_soc = ".$socid; From 57a15b88fa3a7ce1a264f39d379432073b52b910 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 14:07:42 +0200 Subject: [PATCH 388/982] Fix UMR --- htdocs/langs/en_US/withdrawals.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index 88e5eaf128c..b1d6e30e329 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -76,7 +76,7 @@ WithdrawalFile=Withdrawal file SetToStatusSent=Set to status "File Sent" ThisWillAlsoAddPaymentOnInvoice=This will also record payments to invoices and will classify them as "Paid" if remain to pay is null StatisticsByLineStatus=Statistics by status of lines -RUM=Unique Mandate Reference (UMR) +RUM=UMR DateRUM=Mandate signature date RUMLong=Unique Mandate Reference RUMWillBeGenerated=If empty, a UMR (Unique Mandate Reference) will be generated once the bank account information is saved. From bc0b8dfad06163a8c073d5dafe795dcc0278d2f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 14:24:33 +0200 Subject: [PATCH 389/982] FIX Consistency in direct debit order lists. FIX Confirmation of deletion --- htdocs/compta/prelevement/card.php | 19 ++++++++++++++++++- .../class/bonprelevement.class.php | 4 ++-- htdocs/compta/prelevement/create.php | 9 ++++++--- htdocs/compta/prelevement/demandes.php | 1 + htdocs/langs/en_US/main.lang | 1 + .../modulebuilder/template/myobject_card.php | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index b8aa09eae60..bf95a35f1fd 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -239,6 +239,23 @@ if ($id > 0 || $ref) dol_fiche_end(); + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') + { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Delete'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + } + + // Call Hook formConfirm + /*$parameters = array(); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; + elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;*/ + + // Print form confirm + print $formconfirm; + if (empty($object->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted') { @@ -298,7 +315,7 @@ if ($id > 0 || $ref) print "id."\">".$langs->trans("ClassCredited").""; } - print "id."\">".$langs->trans("Delete").""; + print "id."\">".$langs->trans("Delete").""; print ""; } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 6f8a7431b0e..d37e8be9412 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1629,8 +1629,8 @@ class BonPrelevement extends CommonObject public static function buildRumNumber($row_code_client, $row_datec, $row_drum) { global $langs; - $pre = $langs->trans('RUM').'-'; - return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); + $pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation) + return $pre.'-'.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index ddbec62e413..3145bd20598 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'widthdrawals', 'companies', 'bills')); +$langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies', 'bills')); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -105,6 +105,7 @@ if (empty($reshook)) /* * View */ + $form = new Form($db); $thirdpartystatic=new Societe($db); @@ -206,9 +207,11 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; +$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +$sql.= " AND f.total_ttc > 0"; $sql.= " AND pfd.traite = 0"; $sql.= " AND pfd.fk_facture = f.rowid"; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; +if ($socid > 0) $sql.= " AND f.fk_soc = ".$socid; $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -292,7 +295,7 @@ if ($resql) $i++; } } - else print ''; + else print ''; print "
    '.$langs->trans("Statistics").'
    '.$langs->trans("None").'
    '.$langs->trans("None").'
    "; print ""; print "
    \n"; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 1caf62f1491..a34fde042e5 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -92,6 +92,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc. if ($socid) $sql.= " AND f.fk_soc = ".$socid; if (!$status) $sql.= " AND pfd.traite = 0"; if ($status) $sql.= " AND pfd.traite = ".$status; +$sql.= " AND f.total_ttc > 0"; $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; $sql.= " AND pfd.fk_facture = f.rowid"; if (dol_strlen(trim(GETPOST('search_societe', 'alpha')))) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 5e55597c306..f6753f1b87a 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -821,6 +821,7 @@ Mandatory=Mandatory Hello=Hello GoodBye=GoodBye Sincerely=Sincerely +ConfirmDeleteObject=Are you sure you want to delete this object? DeleteLine=Delete line ConfirmDeleteLine=Are you sure you want to delete this line? NoPDFAvailableForDocGenAmongChecked=No PDF were available for the document generation among checked record diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 28c817658f6..72bc424c53c 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -256,7 +256,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); } // Confirmation to delete line if ($action == 'deleteline') From cad9a59d2a9c16ebe6231db7bbda7020e65faba4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 14:45:55 +0200 Subject: [PATCH 390/982] Add option to be able to find behaviour before the fix of list of invoice in direct debit order. --- htdocs/compta/prelevement/class/bonprelevement.class.php | 7 +++++-- htdocs/compta/prelevement/create.php | 5 ++++- htdocs/compta/prelevement/demandes.php | 5 ++++- htdocs/compta/prelevement/index.php | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index d37e8be9412..10c12d967b3 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -739,8 +739,11 @@ class BonPrelevement extends CommonObject $sql = "SELECT count(f.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - $sql.= " WHERE f.fk_statut = ".Facture::STATUS_VALIDATED; - $sql.= " AND f.entity IN (".getEntity('invoice').")"; + $sql.= " WHERE f.entity IN (".getEntity('invoice').")"; + if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) + { + $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; + } $sql.= " AND f.rowid = pfd.fk_facture"; $sql.= " AND pfd.traite = 0"; $sql.= " AND f.total_ttc > 0"; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 3145bd20598..34da3336bcc 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -207,7 +207,10 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; -$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) +{ + $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +} $sql.= " AND f.total_ttc > 0"; $sql.= " AND pfd.traite = 0"; $sql.= " AND pfd.fk_facture = f.rowid"; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index a34fde042e5..6c1ea278430 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -93,7 +93,10 @@ if ($socid) $sql.= " AND f.fk_soc = ".$socid; if (!$status) $sql.= " AND pfd.traite = 0"; if ($status) $sql.= " AND pfd.traite = ".$status; $sql.= " AND f.total_ttc > 0"; -$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) +{ + $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +} $sql.= " AND pfd.fk_facture = f.rowid"; if (dol_strlen(trim(GETPOST('search_societe', 'alpha')))) { diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 44db7dd2625..468d4807c65 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -102,7 +102,10 @@ $sql.= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND f.total_ttc > 0"; -$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) +{ + $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +} $sql.= " AND pfd.traite = 0 AND pfd.fk_facture = f.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND f.fk_soc = ".$socid; From 348ab4765cf16fdceb7533c0fb22be6c87626c37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 15:20:04 +0200 Subject: [PATCH 391/982] Fix sql injection --- htdocs/categories/viewcat.php | 2 +- htdocs/product/class/product.class.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index a7170b799a2..a7a0767c6b5 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -40,7 +40,7 @@ $type = GETPOST('type', 'az09'); $action=GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $removeelem = GETPOST('removeelem', 'int'); -$elemid = GETPOST('elemid', 'alpha'); +$elemid = GETPOST('elemid', 'int'); if ($id == "" && $label == "") { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9c515d619c6..dd5544a9a06 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -284,14 +284,14 @@ class Product extends CommonObject * @var int */ public $barcode_type; - + /** * Main Barcode type code * * @var string */ public $barcode_type_code; - + /** * Additional barcodes (Some products have different barcodes according to the country of origin of manufacture) * @@ -2052,7 +2052,7 @@ class Product extends CommonObject $sql.= " fk_price_expression, price_autogen"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; if ($id) { - $sql.= " WHERE rowid = ".$this->db->escape($id); + $sql.= " WHERE rowid = ".(int) $id; } else { $sql.= " WHERE entity IN (".getEntity($this->element).")"; if ($ref) { From 74203a68964997354bf524278f7b17e90999d416 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 16:01:54 +0200 Subject: [PATCH 392/982] Fix phpcs --- test/phpunit/LesscTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/test/phpunit/LesscTest.php b/test/phpunit/LesscTest.php index 634b362a7b2..70ed161c260 100644 --- a/test/phpunit/LesscTest.php +++ b/test/phpunit/LesscTest.php @@ -159,7 +159,6 @@ class LesscTest extends PHPUnit\Framework\TestCase //print '
    '.$contentforlessc.'
    '; $result = $lesscobj->compile($contentforlessc); //var_dump($contentforlessc); exit; - } catch (exception $e) { //echo "failed to compile lessc"; dol_syslog("Failed to compile the CSS with lessc: ".$e->getMessage(), LOG_WARNING); From 018a43e1d3353a97d58fdc6fdd24f1c0fa9136a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 18:57:34 +0200 Subject: [PATCH 393/982] Fix --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 142917a10d3..f6866569f13 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -324,9 +324,6 @@ class SupplierProposal extends CommonObject $supplier_proposalligne->rang=-1; $supplier_proposalligne->info_bits=2; - // TODO deprecated - $supplier_proposalligne->price=-$remise->amount_ht; - $supplier_proposalligne->total_ht = -$remise->amount_ht; $supplier_proposalligne->total_tva = -$remise->amount_tva; $supplier_proposalligne->total_ttc = -$remise->amount_ttc; @@ -1350,7 +1347,6 @@ class SupplierProposal extends CommonObject $line->subprice = $objp->subprice; $line->fk_remise_except = $objp->fk_remise_except; $line->remise_percent = $objp->remise_percent; - $line->price = $objp->price; // TODO deprecated $line->info_bits = $objp->info_bits; $line->total_ht = $objp->total_ht; @@ -2364,7 +2360,6 @@ class SupplierProposal extends CommonObject $line->desc=$langs->trans("Description")." ".$xnbp; $line->qty=1; $line->subprice=100; - $line->price=100; $line->tva_tx=19.6; $line->localtax1_tx=0; $line->localtax2_tx=0; From 231725e3511d75c4a12ed71a0c53a3845f58d68c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 19:12:43 +0200 Subject: [PATCH 394/982] Fix scrutinizer --- htdocs/admin/commande.php | 1 - htdocs/asset/info.php | 7 +++++-- htdocs/core/class/fiscalyear.class.php | 8 ++++---- htdocs/cron/class/cronjob.class.php | 7 ++++--- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 455175220a8..40514cd1890 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -438,7 +438,6 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - $var = !$var; print '
    '; print (empty($module->name)?$name:$module->name); print "\n"; diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php index 462abf17342..45157e9b7a5 100644 --- a/htdocs/asset/info.php +++ b/htdocs/asset/info.php @@ -44,15 +44,18 @@ $object->fetch($id); * Actions */ + + /* * View */ + +$form = new Form($db); + $title = $langs->trans('Asset') . " - " . $langs->trans('Info'); $helpurl = ""; llxHeader('', $title, $helpurl); -$form = new Form($db); - $object->info($id); $head = asset_prepare_head($object); diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 5593b4a90a4..90d824b7263 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -63,28 +63,28 @@ class Fiscalyear extends CommonObject * @var string fiscal year label */ public $label; - + /** * Date start (date_start) * * @var integer */ public $date_start; - + /** * Date end (date_end) * * @var integer */ public $date_end; - + /** * Date creation record (datec) * * @var integer */ public $datec; - + public $statut; // 0=open, 1=closed /** diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 7934a628880..0e12da80cfc 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -894,14 +894,15 @@ class Cronjob extends CommonObject /** * Load object information * - * @return int + * @param int $id ID + * @return int <0 if KO, >0 if OK */ - public function info() + public function info($id) { $sql = "SELECT"; $sql.= " f.rowid, f.datec, f.tms, f.fk_user_mod, f.fk_user_author"; $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as f"; - $sql.= " WHERE f.rowid = ".$this->id; + $sql.= " WHERE f.rowid = ".$id; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); From 89e1cdff61556c6fd453794b2753b4dd21f97329 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 19:41:15 +0200 Subject: [PATCH 395/982] Debug module datapolicy --- htdocs/core/modules/modDataPolicy.class.php | 2 +- htdocs/datapolicy/class/datapolicy.class.php | 15 ++++++++++- .../datapolicy/class/datapolicycron.class.php | 27 ++++++++++++------- htdocs/langs/en_US/cron.lang | 1 + 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index a08ce2f7873..2c6d749d1ee 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -187,7 +187,7 @@ class modDataPolicy extends DolibarrModules { // Cronjobs (List of cron jobs entries to add when module is enabled) // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week $this->cronjobs = array( - 0 => array('label' => 'DATAPOLICY Cron', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'DataPolicyCron', 'method' => 'exec', 'parameters' => '', 'comment' => 'Clean data', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => '$conf->datapolicy->enabled'), + 0 => array('label' => 'DATAPOLICYJob', 'jobtype' => 'method', 'class' => 'datapolicy/class/datapolicycron.class.php', 'objectname' => 'DataPolicyCron', 'method' => 'cleanDataForDataPolicy', 'parameters' => '', 'comment' => 'Clean data', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => '$conf->datapolicy->enabled'), //1 => array('label' => 'DATAPOLICY Mailing', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'sendMailing', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 0, 'test' => true) ); // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true), diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php index bf1033084d5..c4b3cd2458d 100644 --- a/htdocs/datapolicy/class/datapolicy.class.php +++ b/htdocs/datapolicy/class/datapolicy.class.php @@ -30,6 +30,16 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; */ class DataPolicy { + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + } + /** * getAllContactNotInformed * @@ -200,7 +210,6 @@ class DataPolicy } else { $result4 = $mailfile->sendfile(); if (!$error) { - $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
    "; $contact->array_options['options_datapolicy_send'] = date('Y-m-d', time()); $contact->update($contact->id); @@ -301,6 +310,10 @@ class DataPolicy $sendto = $adherent->email; + // TODO Use a dolibarr email template + $s = 'TXTLINKDATAPOLICIESSUBJECT_' . $l; + $ma = 'TXTLINKDATAPOLICIESMESSAGE_' . $l; + $code= md5($adherent->email); if (!empty($adherent->default_lang)) { $l = $adherent->default_lang; diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 656831eed2f..a938724ad73 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -27,12 +27,24 @@ */ class DataPolicyCron { + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + } + + /** * Function exec + * CAN BE A CRON TASK * - * @return boolean + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) */ - public function exec() + public function cleanDataForDataPolicy() { global $conf, $db, $langs, $user; @@ -479,14 +491,10 @@ class DataPolicyCron $db->query($sql); } } else { - if (DOL_VERSION < 8) { + if ($object->element == 'adherent') { $ret = $object->delete($obj->rowid, $user); } else { - if ($object->element == 'adherent') { - $ret = $object->delete($obj->rowid); - } else { - $ret = $object->delete(); - } + $ret = $object->delete($user); } } @@ -495,7 +503,8 @@ class DataPolicyCron } } } - return true; + + return 0; } diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index aee4d7bb988..1de1251831a 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -81,3 +81,4 @@ JobDisabled=Job disabled MakeLocalDatabaseDumpShort=Local database backup MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run. +DATAPOLICYJob=Data cleaner and anonymizer From f338a5f9ad6e27c3ff341e7001d7825a901afc64 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 19:56:00 +0200 Subject: [PATCH 396/982] Debug module datapolicy --- htdocs/core/modules/modDataPolicy.class.php | 1 - .../datapolicy/class/datapolicycron.class.php | 92 +++++++++++-------- 2 files changed, 56 insertions(+), 37 deletions(-) diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 2c6d749d1ee..13095010a55 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -188,7 +188,6 @@ class modDataPolicy extends DolibarrModules { // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week $this->cronjobs = array( 0 => array('label' => 'DATAPOLICYJob', 'jobtype' => 'method', 'class' => 'datapolicy/class/datapolicycron.class.php', 'objectname' => 'DataPolicyCron', 'method' => 'cleanDataForDataPolicy', 'parameters' => '', 'comment' => 'Clean data', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => '$conf->datapolicy->enabled'), - //1 => array('label' => 'DATAPOLICY Mailing', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'sendMailing', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 0, 'test' => true) ); // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index a938724ad73..6c1a740bd98 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -19,7 +19,7 @@ /** * \file htdocs/datapolicy/class/datapolicycron.class.php * \ingroup datapolicy - * \brief Example hook overload. + * \brief File for cron task of module DataPolicy */ /** @@ -46,10 +46,14 @@ class DataPolicyCron */ public function cleanDataForDataPolicy() { - global $conf, $db, $langs, $user; + global $conf, $langs, $user; $langs->load('datapolicy@datapolicy'); + $error = 0; + $errormsg = ''; + $nbupdated = $nbdeleted = 0; + // FIXME Removed hardcoded values of id $arrayofparameters=array( 'DATAPOLICIES_TIERS_CLIENT' => array( @@ -458,14 +462,18 @@ class DataPolicyCron ), ); - foreach ($arrayofparameters as $key => $params) { - if ($conf->global->$key != '' && is_numeric($conf->global->$key) && (int) $conf->global->$key > 0) { + $this->db->begin(); + foreach ($arrayofparameters as $key => $params) + { + if ($conf->global->$key != '' && is_numeric($conf->global->$key) && (int) $conf->global->$key > 0) + { $sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key); $resql = $db->query($sql); - if ($resql && $db->num_rows($resql) > 0) { + if ($resql && $db->num_rows($resql) > 0) + { $num = $db->num_rows($resql); $i = 0; @@ -473,29 +481,51 @@ class DataPolicyCron require_once $params['file']; $object = new $params['class']($db); - while ($i < $num) + while ($i < $num && ! $error) { $obj = $db->fetch_object($resql); $object->fetch($obj->rowid); $object->id = $obj->rowid; - if ($object->isObjectUsed($obj->rowid) > 0) { + if ($object->isObjectUsed($obj->rowid) > 0) // If object to clean is used + { foreach ($params['fields_anonym'] as $fields => $val) { $object->$fields = $val; } - $object->update($obj->rowid, $user); - if ($params['class'] == 'Societe') { - // On supprime les contacts associé - $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = " . $obj->rowid; - $db->query($sql); + $result = $object->update($obj->rowid, $user); + if ($result > 0) + { + if ($params['class'] == 'Societe') { + // We delete contacts of thirdparty + $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = " . $obj->rowid; + $result = $this->db->query($sql); + if ($result < 0) + { + $errormsg = $this->db->lasterror(); + $error++; + } + } } - } else { + else + { + $errormsg = $object->error; + $error++; + } + $nbupdated++; + } else { // If object to clean is not used if ($object->element == 'adherent') { - $ret = $object->delete($obj->rowid, $user); + $result = $object->delete($obj->rowid, $user); } else { - $ret = $object->delete($user); + $result = $object->delete($user); } + if ($result < 0) + { + $errormsg = $object->error; + $error++; + } + + $nbdeleted++; } $i++; @@ -504,27 +534,17 @@ class DataPolicyCron } } + $this->db->commit(); + + if (! $error) + { + $this->output = $nbupdated.' record updated, '.$nbdeleted.' record deleted'; + } + else + { + $this->error = $errormsg; + } + return 0; } - - - /** - * sendMailing - * - * @return boolean - */ - public function sendMailing() - { - global $conf, $db, $langs, $user; - - $langs->load('datapolicy@datapolicy'); - - require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php'; - - $contacts = new DataPolicy($db); - $contacts->getAllContactNotInformed(); - $contacts->getAllCompaniesNotInformed(); - $contacts->getAllAdherentsNotInformed(); - return true; - } } From f12a01293233b43dceed54eb13ed3842dcf2b76d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 23:25:40 +0200 Subject: [PATCH 397/982] Update card.php --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 35338f41903..0bf304b96a1 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -433,7 +433,7 @@ if (empty($reshook)) } $qty = GETPOST('qty'.$predef); - $remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0); + $remise_percent = ((GETPOST('remise_percent'.$predef) != '') ? GETPOST('remise_percent'.$predef) : 0); if ($qty == '') { From a168c989f8a12462bee3c96a4f1e50ec737480cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 23:29:27 +0200 Subject: [PATCH 398/982] Update stripe.class.php --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 2211bf80118..abc875c370f 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -383,7 +383,7 @@ class Stripe extends CommonObject { $metadata['dol_type'] = $object->element; $metadata['dol_id'] = $object->id; - if (isset($object->thirdparty->id)) $metadata['dol_thirdparty_id'] = $object->thirdparty->id; + if (is_object($object->thirdparty) && $object->thirdparty->id > 0) $metadata['dol_thirdparty_id'] = $object->thirdparty->id; } $dataforintent = array( From bdbae9b3bcd000a991d2e7f0f760d05dbd9706f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Sep 2019 23:51:33 +0200 Subject: [PATCH 399/982] Fix phpcs --- htdocs/install/repair.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 37a7dfaa842..472e77e1974 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -78,7 +78,7 @@ print 'Option rebuild_product_thumbs (\'test\' or \'confirmed\') is '.(GETPOST(' print 'Option force_disable_of_modules_not_found (\'test\' or \'confirmed\') is '.(GETPOST('force_disable_of_modules_not_found', 'alpha')?GETPOST('force_disable_of_modules_not_found', 'alpha'):'undefined').'
    '."\n"; print 'Option clean_perm_table (\'test\' or \'confirmed\') is '.(GETPOST('clean_perm_table', 'alpha')?GETPOST('clean_perm_table', 'alpha'):'undefined').'
    '."\n"; print 'Option force_utf8_on_tables, for mysql/mariadb only (\'test\' or \'confirmed\') is '.(GETPOST('force_utf8_on_tables', 'alpha')?GETPOST('force_utf8_on_tables', 'alpha'):'undefined').'
    '."\n"; -print 'Option repair_link_dispatch_lines_supplier_order_lines, (\'test\' or \'confirmed\') is '.(GETPOST('repair_link_dispatch_lines_supplier_order_lines','alpha')?GETPOST('repair_link_dispatch_lines_supplier_order_lines','alpha'):'undefined').'
    '."\n"; +print 'Option repair_link_dispatch_lines_supplier_order_lines, (\'test\' or \'confirmed\') is '.(GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha')?GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha'):'undefined').'
    '."\n"; print '
    '; print ''; From 397e656161aa5fbf7f86fa7d2f74e7d8e84596b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Sep 2019 10:43:35 +0200 Subject: [PATCH 400/982] Update doc --- htdocs/conf/conf.php.example | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 4d26fef7965..84fc87d35f8 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -152,7 +152,9 @@ $dolibarr_main_db_collation='utf8_unicode_ci'; // dolibarr_main_instance_unique_id -// An ID that is unique for each installation. +// An secret ID that is unique for each installation. +// This value is also visible and never propagated outside of Dolibarr, so it can be used as a salt / key for some encryption. +// To propagate a unique key, you propagate the value concatenated with a string with a hash function. Example: md5('dolibarr'+dolibarr_main_instance_unique_id) // Default value: randomly defined during installation // Examples: // $dolibarr_main_instance_unique_id='84b5bc91f83b56e458db71e0adac2b62'; From 30d2f84eb71082bdb9ff4248ca4063cc9803ebc1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Sep 2019 10:58:20 +0200 Subject: [PATCH 401/982] Remove a label that is no more used --- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 1 - htdocs/langs/en_US/orders.lang | 4 ---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index c6b5eb46515..e3f26b1ccd7 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -924,7 +924,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->rights->fournisseur->commande->lire); $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->rights->fournisseur->commande->lire); } - // Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("StatusSupplierOrderBilled"), 2, $user->rights->fournisseur->commande->lire); + // Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("Billed"), 2, $user->rights->fournisseur->commande->lire); $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ddaa74e2525..64c7ca73b7b 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -648,7 +648,6 @@ class CommandeFournisseur extends CommonOrder $this->statuts[5] = 'StatusSupplierOrderReceivedAll'; $this->statuts[6] = 'StatusSupplierOrderCanceled'; // Approved->Canceled $this->statuts[7] = 'StatusSupplierOrderCanceled'; // Process running->canceled - //$this->statuts[8] = 'StatusSupplierOrderBilled'; // Everything is finished, order received totally and bill received $this->statuts[9] = 'StatusSupplierOrderRefused'; // List of language codes for status diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 6a99b7e5a6b..3197cc12bca 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -37,7 +37,6 @@ StatusOrderDeliveredShort=Delivered StatusOrderToBillShort=Delivered StatusOrderApprovedShort=Approved StatusOrderRefusedShort=Refused -StatusOrderBilledShort=Billed StatusOrderToProcessShort=To process StatusOrderReceivedPartiallyShort=Partially received StatusOrderReceivedAllShort=Products received @@ -50,7 +49,6 @@ StatusOrderProcessed=Processed StatusOrderToBill=Delivered StatusOrderApproved=Approved StatusOrderRefused=Refused -StatusOrderBilled=Billed StatusOrderReceivedPartially=Partially received StatusOrderReceivedAll=All products received ShippingExist=A shipment exists @@ -170,7 +168,6 @@ StatusSupplierOrderDeliveredShort=Delivered StatusSupplierOrderToBillShort=Delivered StatusSupplierOrderApprovedShort=Approved StatusSupplierOrderRefusedShort=Refused -StatusSupplierOrderBilledShort=Billed StatusSupplierOrderToProcessShort=To process StatusSupplierOrderReceivedPartiallyShort=Partially received StatusSupplierOrderReceivedAllShort=Products received @@ -183,6 +180,5 @@ StatusSupplierOrderProcessed=Processed StatusSupplierOrderToBill=Delivered StatusSupplierOrderApproved=Approved StatusSupplierOrderRefused=Refused -StatusSupplierOrderBilled=Billed StatusSupplierOrderReceivedPartially=Partially received StatusSupplierOrderReceivedAll=All products received \ No newline at end of file From eb7f9642681b353790915e4c983b1151fff6ae56 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Sep 2019 11:25:11 +0200 Subject: [PATCH 402/982] Update objectline_create.tpl.php --- htdocs/core/tpl/objectline_create.tpl.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 458872cf99b..480e0975f00 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -647,7 +647,7 @@ jQuery(document).ready(function() { jQuery('#trlinefordates').show(); global->EDIT_PREDEF_PRICEHT)) + if (!empty($conf->global->MAIN_EDIT_PREDEF_PRICEHT)) { ?> // get the HT price for the product and display it @@ -842,10 +842,9 @@ function setforpredef() { jQuery("#prod_entry_mode_free").prop('checked',false).change(); jQuery("#prod_entry_mode_predef").prop('checked',true).change(); - global->EDIT_PREDEF_PRICEHT)) - {?> + global->MAIN_EDIT_PREDEF_PRICEHT)) { ?> jQuery("#price_ht").val('').hide(); - + jQuery("#multicurrency_price_ht").hide(); jQuery("#price_ttc").hide(); // May no exists jQuery("#fourn_ref").hide(); From c7a90ad52803ddae84a9a517acdaf1ddff9edb8d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Sep 2019 11:25:58 +0200 Subject: [PATCH 403/982] Update product.php --- htdocs/product/admin/product.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index a8116314dda..392ae8eb081 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -155,9 +155,6 @@ if ($action == 'other') $resql_new = $db->query($sql_new); } } - - $value = GETPOST('activate_EditPredifinedPriceHT','alpha'); - $res = dolibarr_set_const($db, "EDIT_PREDEF_PRICEHT", $value,'chaine',0,'',$conf->entity); } if ($action == 'specimen') // For products From a5d04e8fd5d7725abcb3c4c463b061db14290b40 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Sep 2019 11:26:21 +0200 Subject: [PATCH 404/982] Update product.php --- htdocs/product/admin/product.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 392ae8eb081..45f938431c3 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -675,14 +675,6 @@ if (! empty($conf->fournisseur->enabled)) print ''; } -// Activate price ht edition for predefined product on line add -print ''; -print ''; -print ''; -print ''; - if (! empty($conf->global->PRODUCT_CANVAS_ABILITY)) { // Add canvas feature From 5d6ccfdf0035582a01e9375a3bc31629e4bc8d50 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Sep 2019 13:12:39 +0200 Subject: [PATCH 405/982] Fix phpcs --- htdocs/core/tpl/objectline_create.tpl.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index b11006ac9bb..1f0897f7e98 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -685,10 +685,10 @@ jQuery(document).ready(function() { jQuery("#price_ht").val(data.price_ht); }, 'json'); - + rights->margins->creer) { $langs->load('stocks'); @@ -850,10 +850,10 @@ function setforpredef() { console.log("Call setforpredef. We hide some fields and show dates"); jQuery("#select_type").val(-1); jQuery("#prod_entry_mode_free").prop('checked',false).change(); - jQuery("#prod_entry_mode_predef").prop('checked',true).change(); + jQuery("#prod_entry_mode_predef").prop('checked',true).change( global->MAIN_EDIT_PREDEF_PRICEHT)) { ?> jQuery("#price_ht").val('').hide(); - + jQuery("#price_ht").val('') jQuery("#price_ht, #multicurrency_price_ht, #price_ttc, #fourn_ref, #tva_tx, #title_vat, #title_up_ht, #title_up_ht_currency, #title_up_ttc, #title_up_ttc_currency").hide(); jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").hide(); From 61d432865b6b42707323b10c8192d64770c9c8f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 7 Sep 2019 14:33:36 +0200 Subject: [PATCH 406/982] wip --- ...face_99_modZapier_ZapierTriggers.class.php | 309 ++++++++---------- 1 file changed, 136 insertions(+), 173 deletions(-) diff --git a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php index ae08b55d651..9d24af321e7 100644 --- a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php @@ -54,7 +54,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers $this->db = $db; $this->name = preg_replace('/^Interface/i', '', get_class($this)); - $this->family = "demo"; + $this->family = "technic"; $this->description = "Zapier triggers."; // 'development', 'experimental', 'dolibarr' or version $this->version = 'development'; @@ -104,8 +104,8 @@ class InterfaceZapierTriggers extends DolibarrTriggers $logtriggeraction = false; if ($action!='') { $actions = explode('_', $action); - $sql = 'SELECT rowid, url FROM '.MAIN_DB_PREFIX.'zapier_hook WHERE'; - $sql .= ' module="'.$db->escape(strtolower($actions[0])).'" AND action="'.$db->escape(strtolower($actions[1])).'"'; + $sql = 'SELECT rowid, url FROM '.MAIN_DB_PREFIX.'zapier_hook'; + $sql .= ' WHERE module="'.$db->escape(strtolower($actions[0])).'" AND action="'.$db->escape(strtolower($actions[1])).'"'; //setEventMessages($sql, null); } @@ -119,28 +119,11 @@ class InterfaceZapierTriggers extends DolibarrTriggers //case 'USER_DELETE': //case 'USER_SETINGROUP': //case 'USER_REMOVEFROMGROUP': - - case 'USER_LOGIN': - //$logtriggeraction = true; - break; - case 'USER_LOGIN_FAILED': - //$logtriggeraction = true; - break; - case 'USER_LOGOUT': - //$logtriggeraction = true; - break; + // case 'USER_LOGIN': + // case 'USER_LOGIN_FAILED': + // case 'USER_LOGOUT': // Warning: To increase performances, this action is triggered only if constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1. - //case 'USER_UPDATE_SESSION': - - case 'DOSSIERISOLATION_CREATE': - //$logtriggeraction = true; - break; - case 'DOSSIERISOLATION_MODIFY': - //$logtriggeraction = true; - break; - case 'DOSSIERISOLATION_DELETE': - //$logtriggeraction = true; - break; + // // case 'USER_UPDATE_SESSION': // Actions case 'ACTION_MODIFY': @@ -200,20 +183,20 @@ class InterfaceZapierTriggers extends DolibarrTriggers case 'CONTACT_ENABLEDISABLE': // Products - case 'PRODUCT_CREATE': - case 'PRODUCT_MODIFY': - case 'PRODUCT_DELETE': - case 'PRODUCT_PRICE_MODIFY': - case 'PRODUCT_SET_MULTILANGS': - case 'PRODUCT_DEL_MULTILANGS': + // case 'PRODUCT_CREATE': + // case 'PRODUCT_MODIFY': + // case 'PRODUCT_DELETE': + // case 'PRODUCT_PRICE_MODIFY': + // case 'PRODUCT_SET_MULTILANGS': + // case 'PRODUCT_DEL_MULTILANGS': //Stock mouvement - case 'STOCK_MOVEMENT': + // case 'STOCK_MOVEMENT': //MYECMDIR - case 'MYECMDIR_DELETE': - case 'MYECMDIR_CREATE': - case 'MYECMDIR_MODIFY': + // case 'MYECMDIR_DELETE': + // case 'MYECMDIR_CREATE': + // case 'MYECMDIR_MODIFY': // Customer orders case 'ORDER_CREATE': @@ -240,165 +223,145 @@ class InterfaceZapierTriggers extends DolibarrTriggers case 'LINEORDER_DELETE': // Supplier orders - case 'ORDER_SUPPLIER_CREATE': - case 'ORDER_SUPPLIER_CLONE': - case 'ORDER_SUPPLIER_VALIDATE': - case 'ORDER_SUPPLIER_DELETE': - case 'ORDER_SUPPLIER_APPROVE': - case 'ORDER_SUPPLIER_REFUSE': - case 'ORDER_SUPPLIER_CANCEL': - case 'ORDER_SUPPLIER_SENTBYMAIL': - case 'ORDER_SUPPLIER_DISPATCH': - case 'LINEORDER_SUPPLIER_DISPATCH': - case 'LINEORDER_SUPPLIER_CREATE': - case 'LINEORDER_SUPPLIER_UPDATE': + // case 'ORDER_SUPPLIER_CREATE': + // case 'ORDER_SUPPLIER_CLONE': + // case 'ORDER_SUPPLIER_VALIDATE': + // case 'ORDER_SUPPLIER_DELETE': + // case 'ORDER_SUPPLIER_APPROVE': + // case 'ORDER_SUPPLIER_REFUSE': + // case 'ORDER_SUPPLIER_CANCEL': + // case 'ORDER_SUPPLIER_SENTBYMAIL': + // case 'ORDER_SUPPLIER_DISPATCH': + // case 'LINEORDER_SUPPLIER_DISPATCH': + // case 'LINEORDER_SUPPLIER_CREATE': + // case 'LINEORDER_SUPPLIER_UPDATE': // Proposals - case 'PROPAL_CREATE': - case 'PROPAL_CLONE': - case 'PROPAL_MODIFY': - case 'PROPAL_VALIDATE': - case 'PROPAL_SENTBYMAIL': - case 'PROPAL_CLOSE_SIGNED': - //$logtriggeraction = true; - break; - case 'PROPAL_CLOSE_REFUSED': - //$logtriggeraction = true; - break; - case 'PROPAL_DELETE': - //$logtriggeraction = true; - break; - case 'LINEPROPAL_INSERT': - case 'LINEPROPAL_UPDATE': - case 'LINEPROPAL_DELETE': + // case 'PROPAL_CREATE': + // case 'PROPAL_CLONE': + // case 'PROPAL_MODIFY': + // case 'PROPAL_VALIDATE': + // case 'PROPAL_SENTBYMAIL': + // case 'PROPAL_CLOSE_SIGNED': + // case 'PROPAL_CLOSE_REFUSED': + // case 'PROPAL_DELETE': + // case 'LINEPROPAL_INSERT': + // case 'LINEPROPAL_UPDATE': + // case 'LINEPROPAL_DELETE': // SupplierProposal - case 'SUPPLIER_PROPOSAL_CREATE': - case 'SUPPLIER_PROPOSAL_CLONE': - case 'SUPPLIER_PROPOSAL_MODIFY': - case 'SUPPLIER_PROPOSAL_VALIDATE': - case 'SUPPLIER_PROPOSAL_SENTBYMAIL': - case 'SUPPLIER_PROPOSAL_CLOSE_SIGNED': - case 'SUPPLIER_PROPOSAL_CLOSE_REFUSED': - case 'SUPPLIER_PROPOSAL_DELETE': - case 'LINESUPPLIER_PROPOSAL_INSERT': - case 'LINESUPPLIER_PROPOSAL_UPDATE': - case 'LINESUPPLIER_PROPOSAL_DELETE': + // case 'SUPPLIER_PROPOSAL_CREATE': + // case 'SUPPLIER_PROPOSAL_CLONE': + // case 'SUPPLIER_PROPOSAL_MODIFY': + // case 'SUPPLIER_PROPOSAL_VALIDATE': + // case 'SUPPLIER_PROPOSAL_SENTBYMAIL': + // case 'SUPPLIER_PROPOSAL_CLOSE_SIGNED': + // case 'SUPPLIER_PROPOSAL_CLOSE_REFUSED': + // case 'SUPPLIER_PROPOSAL_DELETE': + // case 'LINESUPPLIER_PROPOSAL_INSERT': + // case 'LINESUPPLIER_PROPOSAL_UPDATE': + // case 'LINESUPPLIER_PROPOSAL_DELETE': // Contracts - case 'CONTRACT_CREATE': - case 'CONTRACT_ACTIVATE': - case 'CONTRACT_CANCEL': - case 'CONTRACT_CLOSE': - case 'CONTRACT_DELETE': - case 'LINECONTRACT_INSERT': - case 'LINECONTRACT_UPDATE': - case 'LINECONTRACT_DELETE': + // case 'CONTRACT_CREATE': + // case 'CONTRACT_ACTIVATE': + // case 'CONTRACT_CANCEL': + // case 'CONTRACT_CLOSE': + // case 'CONTRACT_DELETE': + // case 'LINECONTRACT_INSERT': + // case 'LINECONTRACT_UPDATE': + // case 'LINECONTRACT_DELETE': // Bills - case 'BILL_CREATE': - //$logtriggeraction = true; - break; - case 'BILL_CLONE': - case 'BILL_MODIFY': - case 'BILL_VALIDATE': - case 'BILL_UNVALIDATE': - //$logtriggeraction = true; - break; - case 'BILL_SENTBYMAIL': - //$logtriggeraction = true; - break; - case 'BILL_CANCEL': - //$logtriggeraction = true; - break; - case 'BILL_DELETE': - //$logtriggeraction = true; - break; - case 'BILL_PAYED': - case 'LINEBILL_INSERT': - case 'LINEBILL_UPDATE': - case 'LINEBILL_DELETE': + // case 'BILL_CREATE': + // case 'BILL_CLONE': + // case 'BILL_MODIFY': + // case 'BILL_VALIDATE': + // case 'BILL_UNVALIDATE': + // case 'BILL_SENTBYMAIL': + // case 'BILL_CANCEL': + // case 'BILL_DELETE': + // case 'BILL_PAYED': + // case 'LINEBILL_INSERT': + // case 'LINEBILL_UPDATE': + // case 'LINEBILL_DELETE': //Supplier Bill - case 'BILL_SUPPLIER_CREATE': - case 'BILL_SUPPLIER_UPDATE': - case 'BILL_SUPPLIER_DELETE': - case 'BILL_SUPPLIER_PAYED': - case 'BILL_SUPPLIER_UNPAYED': - case 'BILL_SUPPLIER_VALIDATE': - case 'BILL_SUPPLIER_UNVALIDATE': - case 'LINEBILL_SUPPLIER_CREATE': - case 'LINEBILL_SUPPLIER_UPDATE': - case 'LINEBILL_SUPPLIER_DELETE': + // case 'BILL_SUPPLIER_CREATE': + // case 'BILL_SUPPLIER_UPDATE': + // case 'BILL_SUPPLIER_DELETE': + // case 'BILL_SUPPLIER_PAYED': + // case 'BILL_SUPPLIER_UNPAYED': + // case 'BILL_SUPPLIER_VALIDATE': + // case 'BILL_SUPPLIER_UNVALIDATE': + // case 'LINEBILL_SUPPLIER_CREATE': + // case 'LINEBILL_SUPPLIER_UPDATE': + // case 'LINEBILL_SUPPLIER_DELETE': - // Payments - case 'PAYMENT_CUSTOMER_CREATE': - case 'PAYMENT_SUPPLIER_CREATE': - case 'PAYMENT_ADD_TO_BANK': - case 'PAYMENT_DELETE': + // Payments + // case 'PAYMENT_CUSTOMER_CREATE': + // case 'PAYMENT_SUPPLIER_CREATE': + // case 'PAYMENT_ADD_TO_BANK': + // case 'PAYMENT_DELETE': - // Online - case 'PAYMENT_PAYBOX_OK': - case 'PAYMENT_PAYPAL_OK': - case 'PAYMENT_STRIPE_OK': + // Online + // case 'PAYMENT_PAYBOX_OK': + // case 'PAYMENT_PAYPAL_OK': + // case 'PAYMENT_STRIPE_OK': - // Donation - case 'DON_CREATE': - case 'DON_UPDATE': - case 'DON_DELETE': + // Donation + // case 'DON_CREATE': + // case 'DON_UPDATE': + // case 'DON_DELETE': - // Interventions - case 'FICHINTER_CREATE': - case 'FICHINTER_MODIFY': - case 'FICHINTER_VALIDATE': - case 'FICHINTER_DELETE': - case 'LINEFICHINTER_CREATE': - case 'LINEFICHINTER_UPDATE': - case 'LINEFICHINTER_DELETE': + // Interventions + // case 'FICHINTER_CREATE': + // case 'FICHINTER_MODIFY': + // case 'FICHINTER_VALIDATE': + // case 'FICHINTER_DELETE': + // case 'LINEFICHINTER_CREATE': + // case 'LINEFICHINTER_UPDATE': + // case 'LINEFICHINTER_DELETE': - // Members - case 'MEMBER_CREATE': - case 'MEMBER_VALIDATE': - case 'MEMBER_SUBSCRIPTION': - case 'MEMBER_MODIFY': - case 'MEMBER_NEW_PASSWORD': - case 'MEMBER_RESILIATE': - case 'MEMBER_DELETE': + // Members + // case 'MEMBER_CREATE': + // case 'MEMBER_VALIDATE': + // case 'MEMBER_SUBSCRIPTION': + // case 'MEMBER_MODIFY': + // case 'MEMBER_NEW_PASSWORD': + // case 'MEMBER_RESILIATE': + // case 'MEMBER_DELETE': - // Categories - case 'CATEGORY_CREATE': - case 'CATEGORY_MODIFY': - case 'CATEGORY_DELETE': - case 'CATEGORY_SET_MULTILANGS': + // Categories + // case 'CATEGORY_CREATE': + // case 'CATEGORY_MODIFY': + // case 'CATEGORY_DELETE': + // case 'CATEGORY_SET_MULTILANGS': - // Projects - case 'PROJECT_CREATE': - case 'PROJECT_MODIFY': - case 'PROJECT_DELETE': + // Projects + // case 'PROJECT_CREATE': + // case 'PROJECT_MODIFY': + // case 'PROJECT_DELETE': - // Project tasks - case 'TASK_CREATE': - case 'TASK_MODIFY': - case 'TASK_DELETE': + // Project tasks + // case 'TASK_CREATE': + // case 'TASK_MODIFY': + // case 'TASK_DELETE': - // Task time spent - case 'TASK_TIMESPENT_CREATE': - case 'TASK_TIMESPENT_MODIFY': - case 'TASK_TIMESPENT_DELETE': + // Task time spent + // case 'TASK_TIMESPENT_CREATE': + // case 'TASK_TIMESPENT_MODIFY': + // case 'TASK_TIMESPENT_DELETE': - // Shipping - case 'SHIPPING_CREATE': - case 'SHIPPING_MODIFY': - case 'SHIPPING_VALIDATE': - case 'SHIPPING_SENTBYMAIL': - case 'SHIPPING_BILLED': - case 'SHIPPING_CLOSED': - case 'SHIPPING_REOPEN': - //$logtriggeraction = true; - break; - case 'SHIPPING_DELETE': - //$logtriggeraction = true; - break; + // Shipping + // case 'SHIPPING_CREATE': + // case 'SHIPPING_MODIFY': + // case 'SHIPPING_VALIDATE': + // case 'SHIPPING_SENTBYMAIL': + // case 'SHIPPING_BILLED': + // case 'SHIPPING_CLOSED': + // case 'SHIPPING_REOPEN': + // case 'SHIPPING_DELETE': } if ($logtriggeraction) { dol_syslog("Trigger '" . $this->name . "' for action '.$action.' launched by " . __FILE__ . " id=" . $object->id); From 44cb9738d696067fa8188151f776a8e33c6f5baf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Sep 2019 14:35:47 +0200 Subject: [PATCH 407/982] Fix trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a84a052094a..a8f7f9643ce 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -218,7 +218,7 @@ DoliStoreDesc=DoliStore, the official market place for Dolibarr ERP/CRM external DoliPartnersDesc=List of companies providing custom-developed modules or features.
    Note: since Dolibarr is an open source application, anyone experienced in PHP programming may develop a module. WebSiteDesc=External websites for more add-on (non-core) modules... DevelopYourModuleDesc=Some solutions to develop your own module... -URL=Link +URL=URL BoxesAvailable=Widgets available BoxesActivated=Widgets activated ActivateOn=Activate on From bd4c9a64a868f17b58c37a26a7333377e5a0b601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 7 Sep 2019 14:48:25 +0200 Subject: [PATCH 408/982] wip --- htdocs/comm/action/class/actioncomm.class.php | 3 +- .../action/class/api_agendaevents.class.php | 33 ++++++++++--------- htdocs/contact/class/contact.class.php | 3 +- htdocs/contrat/class/api_contracts.class.php | 2 +- htdocs/societe/class/api_contacts.class.php | 7 ++-- .../societe/class/api_thirdparties.class.php | 7 ++-- htdocs/societe/class/societe.class.php | 3 +- 7 files changed, 35 insertions(+), 23 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 12926f9b360..4da7686b0a2 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1637,7 +1637,7 @@ class ActionComm extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int >0 if ok */ public function initAsSpecimen() { @@ -1669,6 +1669,7 @@ class ActionComm extends CommonObject $this->userownerid=$user->id; $this->userassigned[$user->id]=array('id'=>$user->id, 'transparency'=> 1); + return 1; } /** diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 833f97b3b6b..1109112284a 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -64,25 +64,28 @@ class AgendaEvents extends DolibarrApi public function get($id) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->read) { - throw new RestException(401, "Insuffisant rights to read an event"); + throw new RestException(401, "Insufficient rights to read an event"); + } + if ($id == 0) { + $result = $this->actioncomm->initAsSpecimen(); + } else { + $result = $this->actioncomm->fetch($id); + if ($result) { + $this->actioncomm->fetch_optionals(); + $this->actioncomm->fetchObjectLinked(); + } } - - $result = $this->actioncomm->fetch($id); if ( ! $result ) { throw new RestException(404, 'Agenda Events not found'); } if (! DolibarrApiAccess::$user->rights->agenda->allactions->read && $this->actioncomm->ownerid != DolibarrApiAccess::$user->id) { - throw new RestException(401, "Insuffisant rights to read event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); + throw new RestException(401, "Insufficient rights to read event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } if ( ! DolibarrApi::_checkAccessToResource('agenda', $this->actioncomm->id, 'actioncomm', '', 'fk_soc', 'id')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - - $result = $this->actioncomm->fetch_optionals(); - - $this->actioncomm->fetchObjectLinked(); return $this->_cleanObjectDatas($this->actioncomm); } @@ -106,7 +109,7 @@ class AgendaEvents extends DolibarrApi $obj_ret = array(); if (! DolibarrApiAccess::$user->rights->agenda->myactions->read) { - throw new RestException(401, "Insuffisant rights to read events"); + throw new RestException(401, "Insufficient rights to read events"); } // case of external user @@ -191,10 +194,10 @@ class AgendaEvents extends DolibarrApi public function post($request_data = null) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) { - throw new RestException(401, "Insuffisant rights to create your Agenda Event"); + throw new RestException(401, "Insufficient rights to create your Agenda Event"); } if (! DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) { - throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); + throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } // Check mandatory fields @@ -230,10 +233,10 @@ class AgendaEvents extends DolibarrApi public function put($id, $request_data = null) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) { - throw new RestException(401, "Insuffisant rights to create your Agenda Event"); + throw new RestException(401, "Insufficient rights to create your Agenda Event"); } if (! DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) { - throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); + throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } $result = $this->actioncomm->fetch($id); @@ -266,13 +269,13 @@ class AgendaEvents extends DolibarrApi public function delete($id) { if(! DolibarrApiAccess::$user->rights->agenda->myactions->delete) { - throw new RestException(401, "Insuffisant rights to delete your Agenda Event"); + throw new RestException(401, "Insufficient rights to delete your Agenda Event"); } $result = $this->actioncomm->fetch($id); if(! DolibarrApiAccess::$user->rights->agenda->allactions->delete && DolibarrApiAccess::$user->id != $this->actioncomm->userownerid) { - throw new RestException(401, "Insuffisant rights to delete an Agenda Event of owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); + throw new RestException(401, "Insufficient rights to delete an Agenda Event of owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } if( ! $result ) { diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index ebfafa698b7..177f2dd2e93 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1288,7 +1288,7 @@ class Contact extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int >0 if ok */ public function initAsSpecimen() { @@ -1325,6 +1325,7 @@ class Contact extends CommonObject $this->socid = $socid; $this->statut=1; + return 1; } /** diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 194e145210f..d49214dfb4d 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -187,7 +187,7 @@ class Contracts extends DolibarrApi public function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { - throw new RestException(401, "Insuffisant rights"); + throw new RestException(401, "Insufficient rights"); } // Check mandatory fields $result = $this->_validate($request_data); diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index 38dfdf71fd8..b2adc8ce5ff 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -74,8 +74,11 @@ class Contacts extends DolibarrApi { throw new RestException(401, 'No permission to read contacts'); } - - $result = $this->contact->fetch($id); + if ($id ==0) { + $result = $this->contact->intiAsSpecimen(); + } else { + $result = $this->contact->fetch($id); + } if (!$result) { diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index ddb19c563fe..919961b4f8f 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -76,8 +76,11 @@ class Thirdparties extends DolibarrApi if(! DolibarrApiAccess::$user->rights->societe->lire) { throw new RestException(401); } - - $result = $this->company->fetch($id); + if ($id ==0) { + $result = $this->company->intiAsSpecimen(); + } else { + $result = $this->company->fetch($id); + } if( ! $result ) { throw new RestException(404, 'Thirdparty not found'); } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 26ad0c6bed9..86408c482cc 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3539,7 +3539,7 @@ class Societe extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int >0 if ok */ public function initAsSpecimen() { @@ -3586,6 +3586,7 @@ class Societe extends CommonObject $this->idprof4='idprof4'; $this->idprof5='idprof5'; $this->idprof6='idprof6'; + return 1; } /** From 452c248a0d5c2579689ab7c6c00d488b6a187a1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Sep 2019 14:49:48 +0200 Subject: [PATCH 409/982] Show list of menus and permission on the modulebuilder. --- htdocs/modulebuilder/index.php | 231 +++++++++++++++------------------ 1 file changed, 105 insertions(+), 126 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1c3c899b19c..30fd315dde3 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2195,7 +2195,7 @@ elseif (! empty($module)) print '
    '; - print '
    '.$langs->trans("EditPredifinedPriceHTAbility").''; -print $form->selectyesno("activate_EditPredifinedPriceHT",$conf->global->EDIT_PREDEF_PRICEHT,1); -print '
    '; print $proptype; print ''; + print ''; if ($proparrayofkeyval) { print json_encode($proparrayofkeyval); } @@ -2344,7 +2344,7 @@ elseif (! empty($module)) { $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; - //$menus = $moduleobj->; + $menus = $moduleobj->menu; if ($action != 'editfile' || empty($file)) { @@ -2361,9 +2361,6 @@ elseif (! empty($module)) print '
    '; print load_fiche_titre($langs->trans("ListOfMenusEntries"), '', ''); - // @TODO - print $langs->trans("FeatureNotYetAvailable"); - print '
    '; print ''; print ''; @@ -2371,77 +2368,90 @@ elseif (! empty($module)) print ''; print ''; - /* - print '
    '; - print ''; + print '
    '; + print '
    '; - print ''; - print_liste_field_titre("Menu",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("CronTask",'','',"",$param,'',$sortfield,$sortorder); - print_liste_field_titre("CronFrequency",'',"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("StatusAtInstall",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print "\n"; + print ''; + print_liste_field_titre("Type",$_SERVER["PHP_SELF"],'',"",$param,'',$sortfield,$sortorder); + print_liste_field_titre("fk_menu",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Title",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("mainmenu",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("leftmenu",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("URL",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("LanguageFile",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Position",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Enabled",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("perms",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Target",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("UserType",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print "\n"; - if (count($menus)) - { - foreach ($cronjobs as $cron) - { - print ''; + if (count($menus)) + { + foreach ($menus as $menu) + { + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; - } + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + } } else { - print ''; + print ''; } print '
    '; - print $cron['label']; - print ''; + print $menu['type']; + print ''; - if ($cron['jobtype']=='method') - { - $text=$langs->trans("CronClass"); - $texttoshow=$langs->trans('CronModule').': '.$module.'
    '; - $texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'
    '; - $texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'
    '; - $texttoshow.=$langs->trans('CronMethod').': '. $cron['method']; - $texttoshow.='
    '.$langs->trans('CronArgs').': '. $cron['parameters']; - $texttoshow.='
    '.$langs->trans('Comment').': '. $langs->trans($cron['comment']); - } - elseif ($cron['jobtype']=='command') - { - $text=$langs->trans('CronCommand'); - $texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']); - $texttoshow.='
    '.$langs->trans('CronArgs').': '. $cron['parameters']; - $texttoshow.='
    '.$langs->trans('Comment').': '. $langs->trans($cron['comment']); - } - print $form->textwithpicto($text, $texttoshow, 1); - print '
    '; + print $menu['fk_menu']; + print ''; - if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes'); - if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours'); - if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days'); - if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks'); - print ''; + print $menu['titre']; + print ''; - print $cron['status']; - print ''; + print $menu['mainmenu']; + print ''; - if (!empty($cron['comment'])) {print $cron['comment'];} - print ''; + print $menu['left']; + print '
    '; + print $menu['url']; + print ''; + print $menu['langs']; + print ''; + print $menu['position']; + print ''; + print $menu['enabled']; + print ''; + print $menu['perms']; + print ''; + print $menu['target']; + print ''; + print $menu['user']; + print '
    '.$langs->trans("None").'
    '.$langs->trans("None").'
    '; print '
    '; print '
    '; - */ } else { @@ -2474,7 +2484,7 @@ elseif (! empty($module)) { $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; - //$perms = $moduleobj->; + $perms = $moduleobj->rights; if ($action != 'editfile' || empty($file)) { @@ -2492,10 +2502,6 @@ elseif (! empty($module)) print '
    '; print load_fiche_titre($langs->trans("ListOfPermissionsDefined"), '', ''); - - // @TODO - print $langs->trans("FeatureNotYetAvailable"); - print '
    '; print ''; print ''; @@ -2503,77 +2509,50 @@ elseif (! empty($module)) print ''; print ''; - /* - print '
    '; - print ''; + print '
    '; + print '
    '; - print ''; - print_liste_field_titre("CronLabel",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("CronTask",'','',"",$param,'',$sortfield,$sortorder); - print_liste_field_titre("CronFrequency",'',"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("StatusAtInstall",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print "\n"; + print ''; + print_liste_field_titre("ID",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Label",$_SERVER["PHP_SELF"],'',"",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Permission",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print "\n"; - if (count($cronjobs)) - { - foreach ($cronjobs as $cron) - { - print ''; + if (count($perms)) + { + foreach ($perms as $perm) + { + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; + } + } + else + { + print ''; + } - print ''; - } - } - else - { - print ''; - } + print '
    '; - print $cron['label']; - print ''; + print $perm[0]; + print ''; - if ($cron['jobtype']=='method') - { - $text=$langs->trans("CronClass"); - $texttoshow=$langs->trans('CronModule').': '.$module.'
    '; - $texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'
    '; - $texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'
    '; - $texttoshow.=$langs->trans('CronMethod').': '. $cron['method']; - $texttoshow.='
    '.$langs->trans('CronArgs').': '. $cron['parameters']; - $texttoshow.='
    '.$langs->trans('Comment').': '. $langs->trans($cron['comment']); - } - elseif ($cron['jobtype']=='command') - { - $text=$langs->trans('CronCommand'); - $texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']); - $texttoshow.='
    '.$langs->trans('CronArgs').': '. $cron['parameters']; - $texttoshow.='
    '.$langs->trans('Comment').': '. $langs->trans($cron['comment']); - } - print $form->textwithpicto($text, $texttoshow, 1); - print '
    '; + print $perm[1]; + print ''; - if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes'); - if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours'); - if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days'); - if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks'); - print ''; + print $perm[4]; + print ''; - print $cron['status']; - print ''; + print $perm[5]; + print ''; - if (!empty($cron['comment'])) {print $cron['comment'];} - print '
    '.$langs->trans("None").'
    '.$langs->trans("None").'
    '; + print '
    '; - print '
    '; - print ''; - - print ''; - */ + print ''; } else { From 4054ebaf27da13e7d607d232997aba35d8071796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 7 Sep 2019 15:12:07 +0200 Subject: [PATCH 410/982] wip --- htdocs/core/modules/modZapier.class.php | 10 +++++--- .../mysql/tables}/llx_zapier_hook.key.sql | 6 ++--- .../mysql/tables}/llx_zapier_hook.sql | 24 +++++++++--------- .../tables}/llx_zapier_hook_extrafields.sql | 4 +-- .../img/{zapier.png => object_zapier.png} | Bin .../zapier/img/object_zapierfordolibarr.png | Bin 360 -> 0 bytes 6 files changed, 23 insertions(+), 21 deletions(-) rename htdocs/{zapier/sql => install/mysql/tables}/llx_zapier_hook.key.sql (66%) rename htdocs/{zapier/sql => install/mysql/tables}/llx_zapier_hook.sql (68%) rename htdocs/{zapier/sql => install/mysql/tables}/llx_zapier_hook_extrafields.sql (93%) rename htdocs/zapier/img/{zapier.png => object_zapier.png} (100%) delete mode 100644 htdocs/zapier/img/object_zapierfordolibarr.png diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php index 7f7ee47ba1e..da6a8aa1547 100644 --- a/htdocs/core/modules/modZapier.class.php +++ b/htdocs/core/modules/modZapier.class.php @@ -67,7 +67,7 @@ class modZapier extends DolibarrModules // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' - $this->picto = 'technic'; + $this->picto = 'zapier@zapier'; // Define some features supported by module (triggers, login, substitutions, menus, css, etc...) $this->module_parts = array( // Set this to 1 if module has its own trigger directory (core/triggers) @@ -109,7 +109,9 @@ class modZapier extends DolibarrModules // Example: this->dirs = array("/zapier/temp","/zapier/subdir"); $this->dirs = array("/zapier/temp"); // Config pages. Put here list of php page, stored into zapier/admin directory, to use to setup module. - $this->config_page_url = array("setup.php@zapier"); + $this->config_page_url = array( + // "setup.php@zapier" + ); // Dependencies // A condition to hide module $this->hidden = false; @@ -119,7 +121,7 @@ class modZapier extends DolibarrModules $this->requiredby = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); - $this->langfiles = array("zapier@zapier"); + $this->langfiles = array("zapier"); // Minimum version of PHP required by module //$this->phpmin = array(5, 5); // Minimum version of Dolibarr required by module @@ -148,7 +150,7 @@ class modZapier extends DolibarrModules 'fr_FR:ParentCompany'=>'Maison mère ou revendeur' )*/ if (! isset($conf->zapier) || ! isset($conf->zapier->enabled)) { - $conf->zapier=new stdClass(); + $conf->zapier = new stdClass(); $conf->zapier->enabled=0; } // Array to add new pages in new tabs diff --git a/htdocs/zapier/sql/llx_zapier_hook.key.sql b/htdocs/install/mysql/tables/llx_zapier_hook.key.sql similarity index 66% rename from htdocs/zapier/sql/llx_zapier_hook.key.sql rename to htdocs/install/mysql/tables/llx_zapier_hook.key.sql index d707e6bba1a..4bce26ae0ea 100644 --- a/htdocs/zapier/sql/llx_zapier_hook.key.sql +++ b/htdocs/install/mysql/tables/llx_zapier_hook.key.sql @@ -14,9 +14,9 @@ -- along with this program. If not, see http://www.gnu.org/licenses/. ---ALTER TABLE llx_zapierfordolibarr_hook ADD INDEX idx_fieldobject (fieldobject); +--ALTER TABLE llx_zapier_hook ADD INDEX idx_fieldobject (fieldobject); ---ALTER TABLE llx_zapierfordolibarr_hook ADD UNIQUE INDEX uk_zapierfordolibarr_hook_fieldxy(fieldx, fieldy); +--ALTER TABLE llx_zapier_hook ADD UNIQUE INDEX uk_zapier_hook_fieldxy(fieldx, fieldy); ---ALTER TABLE llx_zapierfordolibarr_hook ADD CONSTRAINT llx_zapierfordolibarr_hook_fk_field FOREIGN KEY (fk_field) REFERENCES llx_zapierfordolibarr_myotherobject(rowid); +--ALTER TABLE llx_zapier_hook ADD CONSTRAINT llx_zapier_hook_fk_field FOREIGN KEY (fk_field) REFERENCES llx_zapier_myotherobject(rowid); diff --git a/htdocs/zapier/sql/llx_zapier_hook.sql b/htdocs/install/mysql/tables/llx_zapier_hook.sql similarity index 68% rename from htdocs/zapier/sql/llx_zapier_hook.sql rename to htdocs/install/mysql/tables/llx_zapier_hook.sql index 829ec2bfdc4..27d56352bff 100644 --- a/htdocs/zapier/sql/llx_zapier_hook.sql +++ b/htdocs/install/mysql/tables/llx_zapier_hook.sql @@ -14,16 +14,16 @@ -- along with this program. If not, see http://www.gnu.org/licenses/. -CREATE TABLE llx_zapierfordolibarr_hook( - rowid integer AUTO_INCREMENT PRIMARY KEY, - entity integer DEFAULT 1 NOT NULL, - url varchar(255), - event varchar(255), - module varchar(128), - action varchar(128), - status integer, - date_creation DATETIME NOT NULL, +CREATE TABLE llx_zapier_hook( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, + url varchar(255), + event varchar(255), + module varchar(128), + action varchar(128), + status integer, + date_creation DATETIME NOT NULL, fk_user integer NOT NULL, - tms TIMESTAMP NOT NULL, - import_key varchar(14) -) ENGINE=innodb; \ No newline at end of file + tms TIMESTAMP NOT NULL, + import_key varchar(14) +) ENGINE=innodb; diff --git a/htdocs/zapier/sql/llx_zapier_hook_extrafields.sql b/htdocs/install/mysql/tables/llx_zapier_hook_extrafields.sql similarity index 93% rename from htdocs/zapier/sql/llx_zapier_hook_extrafields.sql rename to htdocs/install/mysql/tables/llx_zapier_hook_extrafields.sql index c840007412b..09fef4cc399 100644 --- a/htdocs/zapier/sql/llx_zapier_hook_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_zapier_hook_extrafields.sql @@ -13,11 +13,11 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see http://www.gnu.org/licenses/. -create table llx_zapierfordolibarr_hook_extrafields +create table llx_zapier_hook_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, fk_object integer NOT NULL, - import_key varchar(14) -- import key + import_key varchar(14) -- import key ) ENGINE=innodb; diff --git a/htdocs/zapier/img/zapier.png b/htdocs/zapier/img/object_zapier.png similarity index 100% rename from htdocs/zapier/img/zapier.png rename to htdocs/zapier/img/object_zapier.png diff --git a/htdocs/zapier/img/object_zapierfordolibarr.png b/htdocs/zapier/img/object_zapierfordolibarr.png deleted file mode 100644 index 5a307bfc62f85df909a3cf024f27ee87d44be275..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xamSQK*5Dp-y;YjHK@;M7UB8!3Q zuY)k7lg8`{prB-lYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt)eIT^vI+ zChono-m4{0gyqBiz=Ju)w^;&N<{#X1a0!1>bC%GsW3bBL=<%|p84;9-@5SwA|2OIEL% zb=QtBT0T9C&(LA{syqXqqW_DHn`b;(x5}@uA-g2{Ncy)Mhpp~Sy0eY()*3IP6|4C4 z(mDEHWvtPCEP7WZe7{4e?P9&>AE%^j|Mz!&9rL?{G_w^d>;^y&GkCiCxvX Date: Sat, 7 Sep 2019 15:44:48 +0200 Subject: [PATCH 411/982] Work on MRP module --- htdocs/core/class/conf.class.php | 3 --- htdocs/core/menus/standard/auguria.lib.php | 4 ++-- htdocs/core/menus/standard/eldy.lib.php | 13 +++++++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 3c03f9ea14c..b85056fe5e8 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -552,9 +552,6 @@ class Conf if (! isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) $this->global->MAIN_PDF_DASH_BETWEEN_LINES=1; // use dash between lines if (! isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT=1; // allow html content into free footer text - // Set default value to MAIN_SHOW_LOGO - if (! isset($this->global->MAIN_SHOW_LOGO)) $this->global->MAIN_SHOW_LOGO=1; - // Default max file size for upload $this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : (int) $this->global->MAIN_UPLOAD_DOC * 1024); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index b321c0da621..438ff8246ea 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -53,8 +53,8 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout if (empty($noout)) print_start_menu_array_auguria(); - $usemenuhider = 1; global $usemenuhider; + $usemenuhider = 1; // Show/Hide vertical menu if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) @@ -265,8 +265,8 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $mainmenu=($forcemainmenu?$forcemainmenu:$_SESSION["mainmenu"]); $leftmenu=($forceleftmenu?'':(empty($_SESSION["leftmenu"])?'none':$_SESSION["leftmenu"])); - $usemenuhider = 0; global $usemenuhider; + $usemenuhider = 0; // Show logo company if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index e3f26b1ccd7..9efb4dd1e27 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1580,8 +1580,17 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $langs->load("mrp"); $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom'); - $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write); - $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read); + $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write, '', $mainmenu, 'bom'); + $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read, '', $mainmenu, 'bom'); + } + + if (! empty($conf->mrp->enabled)) + { + $langs->load("mrp"); + + $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo'); + $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->rights->mrp->write, '', $mainmenu, 'mo'); + $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->rights->mrp->read, '', $mainmenu, 'mo'); } } From 3a8d8ee902ccdb2eb40960c2fe12f021b46ca521 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 8 Sep 2019 03:56:01 +0200 Subject: [PATCH 412/982] FIX #11401 Adherent unknown language key --- htdocs/adherents/class/adherent_type.class.php | 2 +- htdocs/adherents/type.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 0d3980318a4..9591a24fa78 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -424,7 +424,7 @@ class AdherentType extends CommonObject global $langs; if ($morphy == 'phy') { return $langs->trans("Physical"); } elseif ($morphy == 'mor') { return $langs->trans("Moral"); } - else return $langs->trans("Physical & Morale"); + else return $langs->trans("MorPhy"); //return $morphy; } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 019388aeaab..f41275a4c71 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -283,7 +283,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') print '
    '; if ($objp->morphy == 'phy') { print $langs->trans("Physical"); } elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); } - else print $langs->trans("Physical & Morale"); + else print $langs->trans("MorPhy"); print ''.yn($objp->subscription).''.yn($objp->vote).''; - if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2).' %'; + if ($total_projectlinesa_planned) print $totalCalculatedProgress.' %'; print ''; - if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2).' %'; + if ($total_projectlinesa_planned) print ''.$totalAverageDeclaredProgress.' %'; print ''; + if ($total_projectlinesa_planned){ + print ''; + print '
    '; + print '
    '; + print '
    '; + print ''; + } + print '
    '; From a639724b923cdb13f2b07c4579dd64823696d37d Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 8 Sep 2019 18:13:15 +0200 Subject: [PATCH 419/982] Fix follow tasks and time spent --- htdocs/core/boxes/box_task.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 3a0b2c67af9..cf1d5241753 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -156,6 +156,8 @@ class box_task extends ModeleBoxes $sql.= " pt.entity = ".$conf->entity; $sql.= " AND p.fk_statut = ".Project::STATUS_VALIDATED; $sql.= " AND (pt.progress < 100 OR pt.progress IS NULL ) "; // 100% is done and not displayed + $sql.= " AND p.usage_task = 1 "; + $sql.= " ORDER BY pt.datee ASC, pt.dateo ASC"; $sql.= $db->plimit($max, 0); From ecddeb2b8bf6e54c283599bb26aa9500c8a9cd64 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 8 Sep 2019 21:19:15 +0200 Subject: [PATCH 420/982] Add progress to global task list --- htdocs/core/lib/project.lib.php | 4 +++- htdocs/projet/tasks/list.php | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 5e9d05057be..d37c7d5f960 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -565,7 +565,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // resume print ''; - print getTaskProgressView($taskstatic, false, false); + if ($lines[$i]->progress != '' && $lines[$i]->duration) { + print getTaskProgressView($taskstatic, false, false); + } print ''; if ($obj->progress != '') { - print $obj->progress.' %'; + print getTaskProgressBadge($object); } print ''; + if($obj->progress != '' && $obj->duration_effective){ + print getTaskProgressView($object, false, false); + } + print ''.($totalarray['totalplannedworkload'] > 0 ? round(100 * $totalarray['totaldurationdeclared'] / $totalarray['totalplannedworkload'], 2).' %' : '').''.convertSecondToTime($totalarray['totaltobill'], $plannedworkloadoutputformat).''.convertSecondToTime($totalarray['totalbilled'], $plannedworkloadoutputformat).'
    '; print ''; - print_liste_field_titre("Type",$_SERVER["PHP_SELF"],'',"",$param,'',$sortfield,$sortorder); - print_liste_field_titre("fk_menu",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("Title",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("mainmenu",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("leftmenu",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("URL",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("LanguageFile",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("Position",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("Enabled",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("perms",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("Target",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("UserType",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("fk_menu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("URL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("perms", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("UserType", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print "\n"; if (count($menus)) @@ -2513,10 +2513,10 @@ elseif (! empty($module)) print '
    '; print ''; - print_liste_field_titre("ID",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("Label",$_SERVER["PHP_SELF"],'',"",$param,'',$sortfield,$sortorder); - print_liste_field_titre("Permission",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre("",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("ID", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print "\n"; if (count($perms)) From 6d38d58000c39109ea40ad973c2f5946d5453865 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Sep 2019 21:31:10 +0200 Subject: [PATCH 425/982] Trans --- htdocs/langs/en_US/mrp.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 360f4303f07..96efb3be55f 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -15,3 +15,5 @@ ManufacturingEfficiency=Manufacturing efficiency ValueOfMeansLoss=Value of 0.95 means an average of 5%% of loss during the production DeleteBillOfMaterials=Delete Bill Of Materials ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Material? +MenuMRP=Manufacturing Orders +NewMO=New Manufacturing Order \ No newline at end of file From 1d74387125d9f975619b5e9b8e77500cb0f0bd53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 08:47:23 +0200 Subject: [PATCH 426/982] Removed deprecated property ->numero (We must use ->num_payment) --- htdocs/adherents/class/adherent.class.php | 3 +-- .../compta/paiement/cheque/class/remisecheque.class.php | 2 +- htdocs/compta/paiement/class/paiement.class.php | 8 +++++--- htdocs/fourn/class/paiementfourn.class.php | 9 ++++++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 1b516e1c94e..7085f08be91 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1740,8 +1740,7 @@ class Adherent extends CommonObject $paiement->datepaye = $paymentdate; $paiement->amounts = $amounts; $paiement->paiementid = dol_getIdFromCode($this->db, $operation, 'c_paiement', 'code', 'id', 1); - $paiement->num_paiement = $num_chq; - $paiement->note = $label; + $paiement->num_payment = $num_chq; $paiement->note_public = $label; if (! $error) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 316215a5caf..a582c95ce6b 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -813,7 +813,7 @@ class RemiseCheque extends CommonObject $rejectedPayment->amounts = array(); $rejectedPayment->datepaye = $rejection_date; $rejectedPayment->paiementid = dol_getIdFromCode($this->db, 'CHQ', 'c_paiement', 'code', 'id', 1); - $rejectedPayment->num_paiement = $payment->numero; + $rejectedPayment->num_payment = $payment->num_payment; while($obj = $db->fetch_object($resql)) { diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index a96a3d12f26..96f74fdae48 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -117,6 +117,7 @@ class Paiement extends CommonObject /** * @var int bank account id of payment * @deprecated + * @see $fk_account */ public $bank_account; @@ -182,7 +183,6 @@ class Paiement extends CommonObject $this->ref = $obj->ref?$obj->ref:$obj->rowid; $this->date = $this->db->jdate($obj->dp); $this->datepaye = $this->db->jdate($obj->dp); - $this->numero = $obj->num_payment; // deprecated $this->num_paiement = $obj->num_payment; // deprecated $this->num_payment = $obj->num_payment; $this->montant = $obj->amount; // deprecated @@ -286,10 +286,12 @@ class Paiement extends CommonObject $total = $totalamount_converted; // Maybe use price2num with MT for the converted value $mtotal = $totalamount; } + + $num_payment = ($this->num_payment?$this->num_payment:$this->num_paiement); $note = ($this->note_public?$this->note_public:$this->note); $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, ext_payment_id, ext_payment_site, fk_user_creat)"; - $sql.= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($this->num_paiement)."', '".$this->db->escape($note)."', ".($this->ext_payment_id?"'".$this->db->escape($this->ext_payment_id)."'":"null").", ".($this->ext_payment_site?"'".$this->db->escape($this->ext_payment_site)."'":"null").", ".$user->id.")"; + $sql.= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($num_payment)."', '".$this->db->escape($note)."', ".($this->ext_payment_id?"'".$this->db->escape($this->ext_payment_id)."'":"null").", ".($this->ext_payment_site?"'".$this->db->escape($this->ext_payment_site)."'":"null").", ".$user->id.")"; dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG); $resql = $this->db->query($sql); @@ -885,7 +887,7 @@ class Paiement extends CommonObject $result = $this->db->query($sql); if ($result) { - $this->numero = $this->db->escape($num); + $this->num_payment = $this->db->escape($num); return 0; } else diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 51485a7db5e..9ba504bb876 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -88,7 +88,7 @@ class PaiementFourn extends Paiement $sql = 'SELECT p.rowid, p.ref, p.entity, p.datep as dp, p.amount, p.statut, p.fk_bank,'; $sql.= ' c.code as paiement_code, c.libelle as paiement_type,'; - $sql.= ' p.num_paiement, p.note, b.fk_account'; + $sql.= ' p.num_paiement as num_payment, p.note, b.fk_account'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid '; @@ -113,12 +113,15 @@ class PaiementFourn extends Paiement $this->entity = $obj->entity; $this->date = $this->db->jdate($obj->dp); $this->datepaye = $this->db->jdate($obj->dp); - $this->numero = $obj->num_paiement; - $this->num_paiement = $obj->num_paiement; + $this->num_paiement = $obj->num_payment; + $this->num_payment = $obj->num_payment; $this->bank_account = $obj->fk_account; + $this->fk_account = $obj->fk_account; $this->bank_line = $obj->fk_bank; $this->montant = $obj->amount; + $this->amount = $obj->amount; $this->note = $obj->note; + $this->note_private = $obj->note; $this->type_code = $obj->paiement_code; $this->type_libelle = $obj->paiement_type; $this->statut = $obj->statut; From 66611f40971344a15d0118cd7051a39c3de0e445 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 9 Sep 2019 09:29:43 +0200 Subject: [PATCH 427/982] FIX rename "resource" (reserved) by "dolresource" --- htdocs/comm/action/card.php | 2 +- htdocs/resource/element_resource.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index c9a4f782b4d..44d6b000efe 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -520,7 +520,7 @@ if ($action == 'update') $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'resource'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; $sql .= " WHERE ac.id != " . $object->id; $sql .= " AND er.resource_id IN ("; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index b842ad6c832..bb9a54a9bf0 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -105,7 +105,7 @@ if (empty($reshook)) // TODO : add this check at update_linked_resource and when modifying event start or end date // check if an event resource is already in use - if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='resource' && intval($busy)==1) { + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='dolresource' && intval($busy)==1) { $eventDateStart = $objstat->datep; $eventDateEnd = $objstat->datef; $isFullDayEvent = intval($objstat->fulldayevent); @@ -185,7 +185,7 @@ if (empty($reshook)) $object->busy = $busy; $object->mandatory = $mandatory; - if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='resource' && intval($object->busy)==1) { + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='dolresource' && intval($object->busy)==1) { $eventDateStart = $object->objelement->datep; $eventDateEnd = $object->objelement->datef; $isFullDayEvent = intval($objstat->fulldayevent); From 15eaa5cbd890f9fb0122a9198d0c609715b048f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 10:27:56 +0200 Subject: [PATCH 428/982] NEW Public holidays are now in a table (no more hard coded per country) --- htdocs/core/lib/date.lib.php | 258 +++++++----------- .../mysql/data/llx_c_hrm_public_holiday.sql | 58 +++- .../install/mysql/migration/10.0.0-11.0.0.sql | 60 +++- .../tables/llx_c_hrm_public_holiday.key.sql | 2 +- .../mysql/tables/llx_c_hrm_public_holiday.sql | 2 +- 5 files changed, 209 insertions(+), 171 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 8b30f56c0d2..04518dade2f 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -82,7 +82,6 @@ function getServerTimeZoneString() */ function getServerTimeZoneInt($refgmtdate = 'now') { - global $conf; if (method_exists('DateTimeZone', 'getOffset')) { // Method 1 (include daylight) @@ -329,6 +328,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date) */ function dol_stringtotime($string, $gm = 1) { + $reg=array(); // Convert date with format DD/MM/YYY HH:MM:SS. This part of code should not be used. if (preg_match('/^([0-9]+)\/([0-9]+)\/([0-9]+)\s?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $string, $reg)) { @@ -595,39 +595,45 @@ function dol_get_first_day_week($day, $month, $year, $gm = false) } /** - * Fonction retournant le nombre de jour feries, samedis et dimanches entre 2 dates entrees en timestamp. Dates must be UTC with hour, day, min to 0 + * Return the number of non working days including saturday and sunday (or not) between 2 dates in timestamp. + * Dates must be UTC with hour, day, min to 0. * Called by function num_open_day * * @param int $timestampStart Timestamp de debut * @param int $timestampEnd Timestamp de fin * @param string $countrycode Country code * @param int $lastday Last day is included, 0: no, 1:yes - * @return int Nombre de jours feries + * @param int $includesaturday Include saturday as non working day (-1=use setup, 0=no, 1=yes) + * @param int $includesunday Include sunday as non working day (-1=use setup, 0=no, 1=yes) + * @return int|string Number of non working days or error message string if error * @see num_between_day(), num_open_day() */ -function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', $lastday = 0) +function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', $lastday = 0, $includesaturday = -1, $includesunday = -1) { - global $conf; + global $db, $conf, $mysoc; $nbFerie = 0; + $specialdayrule = array(); // Check to ensure we use correct parameters if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates'; + if ($includesaturday < 0) $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1); + if ($includesunday < 0) $includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1); + + $i=0; while (( ($lastday == 0 && $timestampStart < $timestampEnd) || ($lastday && $timestampStart <= $timestampEnd) ) && ($i < 50000)) // Loop end when equals (Test on i is a security loop to avoid infinite loop) { $ferie=false; - $countryfound=0; - $includesaturdayandsunday=1; $jour = date("d", $timestampStart); $mois = date("m", $timestampStart); $annee = date("Y", $timestampStart); - // Check into var $conf->global->HOLIDAY_MORE_DAYS MM-DD,YYYY-MM-DD, ... + // Do not use this anymore, use instead the dictionary of public holidays. if (! empty($conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS)) { $arrayofdaystring=explode(',', $conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS); @@ -645,29 +651,59 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', } } - if ($countrycode == 'FR') + // Loop on public holiday defined into hrm_public_holiday + $sql = "SELECT code, entity, fk_country, dayrule, year, month, day, active"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday"; + $sql.= " WHERE active = 1 and fk_country IN (0, ".$mysoc->country_id.")"; + + $resql = $db->query($sql); + if ($resql) { - $countryfound=1; + $num_rows = $db->num_rows($resql); + $i=0; + while ($i < $num_rows) + { + $obj = $db->fetch_object($resql); - // Definition of fixed working days - if($jour == 1 && $mois == 1) $ferie=true; // 1er january - if($jour == 1 && $mois == 5) $ferie=true; // 1er may - if($jour == 8 && $mois == 5) $ferie=true; // 5 may - if($jour == 14 && $mois == 7) $ferie=true; // 14 july - if($jour == 15 && $mois == 8) $ferie=true; // 15 august - if($jour == 1 && $mois == 11) $ferie=true; // 1 november - if($jour == 11 && $mois == 11) $ferie=true; // 11 november - if($jour == 25 && $mois == 12) $ferie=true; // 25 december + if (! empty($obj->dayrule) && $obj->dayrule != 'date') // For example 'easter', '...' + { + $specialdayrule[$obj->dayrule] = $obj->dayrule; + } + else + { + $match = 1; + if (! empty($obj->year) && $obj->year != $annee) $match = 0; + if ($obj->month != $mois) $match = 0; + if ($obj->day != $jour) $match = 0; + if ($match) $ferie = true; + } + + $i++; + } + } + else + { + dol_syslog($db->lasterror(), LOG_ERR); + return 'Error sql '.$db->lasterror(); + } + + // Special dayrules + if (in_array('easter', $specialdayrule)) + { // Calculation for easter date $date_paques = easter_date($annee); $jour_paques = date("d", $date_paques); $mois_paques = date("m", $date_paques); if($jour_paques == $jour && $mois_paques == $mois) $ferie=true; - // Pâques + // Easter (sunday) + } + if (in_array('eastermonday', $specialdayrule)) + { // Calculation for the monday of easter date - $date_lundi_paques = mktime( + $date_paques = easter_date($annee); + $date_lundi_paques = mktime( date("H", $date_paques), date("i", $date_paques), date("s", $date_paques), @@ -677,11 +713,15 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', ); $jour_lundi_ascension = date("d", $date_lundi_paques); $mois_lundi_ascension = date("m", $date_lundi_paques); - if($jour_lundi_ascension == $jour && $mois_lundi_ascension == $mois) $ferie=true; - // Lundi de Pâques + if ($jour_lundi_ascension == $jour && $mois_lundi_ascension == $mois) $ferie=true; + // Easter (monday) + } - // Calcul du jour de l'ascension (38 days after easter day) - $date_ascension = mktime( + if (in_array('ascension', $specialdayrule)) + { + // Calcul du jour de l'ascension (39 days after easter day) + $date_paques = easter_date($annee); + $date_ascension = mktime( date("H", $date_paques), date("i", $date_paques), date("s", $date_paques), @@ -692,10 +732,14 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', $jour_ascension = date("d", $date_ascension); $mois_ascension = date("m", $date_ascension); if($jour_ascension == $jour && $mois_ascension == $mois) $ferie=true; - // Ascension + // Ascension (thursday) + } - // Calculation of "Pentecote" (11 days after easter day) - $date_pentecote = mktime( + if (in_array('pentecote', $specialdayrule)) + { + // Calculation of "Pentecote" (49 days after easter day) + $date_paques = easter_date($annee); + $date_pentecote = mktime( date("H", $date_paques), date("i", $date_paques), date("s", $date_paques), @@ -706,71 +750,31 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', $jour_pentecote = date("d", $date_pentecote); $mois_pentecote = date("m", $date_pentecote); if($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie=true; - // "Pentecote" + // "Pentecote" (sunday) } - - // Pentecoste and Ascensione in Italy go to the sunday after: isn't holiday. - // Pentecoste is 50 days after Easter, Ascensione 40 - if ($countrycode == 'IT') + if (in_array('pentecotemonday', $specialdayrule)) { - $countryfound=1; - - // Definition des dates feriees fixes - if($jour == 1 && $mois == 1) $ferie=true; // Capodanno - if($jour == 6 && $mois == 1) $ferie=true; // Epifania - if($jour == 25 && $mois == 4) $ferie=true; // Anniversario Liberazione - if($jour == 1 && $mois == 5) $ferie=true; // Festa del Lavoro - if($jour == 2 && $mois == 6) $ferie=true; // Festa della Repubblica - if($jour == 15 && $mois == 8) $ferie=true; // Ferragosto - if($jour == 1 && $mois == 11) $ferie=true; // Tutti i Santi - if($jour == 8 && $mois == 12) $ferie=true; // Immacolata Concezione - if($jour == 25 && $mois == 12) $ferie=true; // 25 decembre - if($jour == 26 && $mois == 12) $ferie=true; // Santo Stefano - - // Calcul du jour de paques + // Calculation of "Pentecote" (49 days after easter day) $date_paques = easter_date($annee); - $jour_paques = date("d", $date_paques); - $mois_paques = date("m", $date_paques); - if($jour_paques == $jour && $mois_paques == $mois) $ferie=true; - // Paques + $date_pentecote = mktime( + date("H", $date_paques), + date("i", $date_paques), + date("s", $date_paques), + date("m", $date_paques), + date("d", $date_paques) + 50, + date("Y", $date_paques) + ); + $jour_pentecote = date("d", $date_pentecote); + $mois_pentecote = date("m", $date_pentecote); + if($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie=true; + // "Pentecote" (monday) } - if ($countrycode == 'IN') + if (in_array('viernessanto', $specialdayrule)) { - $countryfound=1; - - if($jour == 1 && $mois == 1) $ferie=true; // New Year's Day - if($jour == 26 && $mois == 1) $ferie=true; // Republic Day - if($jour == 1 && $mois == 5) $ferie=true; // May Day - if($jour == 15 && $mois == 8) $ferie=true; // Independence Day - if($jour == 2 && $mois == 10) $ferie=true; // Gandhi Jayanti - if($jour == 25 && $mois == 12) $ferie=true; // Christmas - } - - if ($countrycode == 'ES') - { - $countryfound=1; - - // Definition des dates feriees fixes - if($jour == 1 && $mois == 1) $ferie=true; // Año nuevo - if($jour == 6 && $mois == 1) $ferie=true; // Día Reyes - if($jour == 1 && $mois == 5) $ferie=true; // 1 Mayo - if($jour == 15 && $mois == 8) $ferie=true; // 15 Agosto - if($jour == 12 && $mois == 10) $ferie=true; // Día Hispanidad - if($jour == 1 && $mois == 11) $ferie=true; // 1 noviembre - if($jour == 6 && $mois == 12) $ferie=true; // Constitución - if($jour == 8 && $mois == 12) $ferie=true; // Inmaculada - if($jour == 25 && $mois == 12) $ferie=true; // 25 diciembre - - // Calcul día de Pascua - $date_paques = easter_date($annee); - $jour_paques = date("d", $date_paques); - $mois_paques = date("m", $date_paques); - if($jour_paques == $jour && $mois_paques == $mois) $ferie=true; - // Paques - // Viernes Santo - $date_viernes = mktime( + $date_paques = easter_date($annee); + $date_viernes = mktime( date("H", $date_paques), date("i", $date_paques), date("s", $date_paques), @@ -784,74 +788,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', //Viernes Santo } - if ($countrycode == 'AT') + if (in_array('fronleichnam', $specialdayrule)) { - $countryfound=1; - - // Definition des dates feriees fixes - if($jour == 1 && $mois == 1) $ferie=true; // Neujahr - if($jour == 6 && $mois == 1) $ferie=true; // Hl. 3 Koenige - if($jour == 1 && $mois == 5) $ferie=true; // 1. Mai - if($jour == 15 && $mois == 8) $ferie=true; // Mariae Himmelfahrt - if($jour == 26 && $mois == 10) $ferie=true; // 26. Oktober - if($jour == 1 && $mois == 11) $ferie=true; // Allerheiligen - if($jour == 8 && $mois == 12) $ferie=true; // Mariae Empfaengnis - if($jour == 24 && $mois == 12) $ferie=true; // Heilig abend - if($jour == 25 && $mois == 12) $ferie=true; // Christtag - if($jour == 26 && $mois == 12) $ferie=true; // Stefanietag - if($jour == 31 && $mois == 12) $ferie=true; // Silvester - - // Easter calculation - $date_paques = easter_date($annee); - $jour_paques = date("d", $date_paques); - $mois_paques = date("m", $date_paques); - if($jour_paques == $jour && $mois_paques == $mois) $ferie=true; - // Easter sunday - - // Monday after easter - $date_eastermonday = mktime( - date("H", $date_paques), - date("i", $date_paques), - date("s", $date_paques), - date("m", $date_paques), - date("d", $date_paques) + 1, - date("Y", $date_paques) - ); - $jour_eastermonday = date("d", $date_eastermonday); - $mois_eastermonday = date("m", $date_eastermonday); - if($jour_eastermonday == $jour && $mois_eastermonday == $mois) $ferie=true; - // Easter monday - - // Christi Himmelfahrt (39 days after easter sunday) - $date_ch = mktime( - date("H", $date_paques), - date("i", $date_paques), - date("s", $date_paques), - date("m", $date_paques), - date("d", $date_paques) + 39, - date("Y", $date_paques) - ); - $jour_ch = date("d", $date_ch); - $mois_ch = date("m", $date_ch); - if($jour_ch == $jour && $mois_ch == $mois) $ferie=true; - // Christi Himmelfahrt - - // Pfingsten (50 days after easter sunday) - $date_pentecote = mktime( - date("H", $date_paques), - date("i", $date_paques), - date("s", $date_paques), - date("m", $date_paques), - date("d", $date_paques) + 50, - date("Y", $date_paques) - ); - $jour_pentecote = date("d", $date_pentecote); - $mois_pentecote = date("m", $date_pentecote); - if($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie=true; - // Pfingsten - // Fronleichnam (60 days after easter sunday) - $date_fronleichnam = mktime( + $date_fronleichnam = mktime( date("H", $date_paques), date("i", $date_paques), date("s", $date_paques), @@ -866,15 +806,21 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', } // If we have to include saturday and sunday - if ($includesaturdayandsunday) + if ($includesaturday || $includesunday) { $jour_julien = unixtojd($timestampStart); $jour_semaine = jddayofweek($jour_julien, 0); - if($jour_semaine == 0 || $jour_semaine == 6) $ferie=true; - //Saturday (6) and Sunday (0) + if ($includesaturday) //Saturday (6) and Sunday (0) + { + if ($jour_semaine == 6) $ferie=true; + } + if ($includesunday) //Saturday (6) and Sunday (0) + { + if($jour_semaine == 0) $ferie=true; + } } - // On incremente compteur + // We increase the counter of non working day if ($ferie) $nbFerie++; // Increase number of days (on go up into loop) diff --git a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql index 312c30210c8..e66132865de 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql @@ -31,14 +31,52 @@ -- A lot of countries -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('NEWYEARDAY1', 0, 0, 0, 1, 1, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('LABORDAY1', 0, 0, 0, 5, 1, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('CHRISTMASDAY1', 0, 0, 0, 12, 25, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('NEWYEARDAY1', 0, 0, 0, 1, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('LABORDAY1', 0, 0, 0, 5, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('ASSOMPTIONDAY1', 0, 0, 0, 8, 15, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('CHRISTMASDAY1', 0, 0, 0, 12, 25, 1); + +-- France only (1) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-VICTORYDAY', 0, 1, '', 0, 5, 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-NATIONALDAY', 0, 1, '', 0, 7, 14, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-ASSOMPTION', 0, 1, '', 0, 8, 15, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-TOUSSAINT', 0, 1, '', 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-ARMISTICE', 0, 1, '', 0, 11, 11, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-EASTER', 0, 1, 'eastermonday', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-ASCENSION', 0, 1, 'ascension', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-PENTECOST', 0, 1, 'pentecost', 0, 0, 0, 1); + +-- Italy (3) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-LIBEAZIONE', 0, 3, 0, 4, 25, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-EPIPHANY', 0, 3, 0, 6, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-REPUBBLICA', 0, 3, 0, 6, 2, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-TUTTISANTIT', 0, 3, 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-IMMACULE', 0, 3, 0, 12, 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-SAINTSTEFAN', 0, 3, 0, 12, 26, 1); + +-- Spain (4) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-EASTER', 0, 4, 'easter', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-REYE', 0, 4, '', 0, 6, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-HISPANIDAD', 0, 4, '', 0, 10, 12, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-TOUSSAINT', 0, 4, '', 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-CONSTITUIZION', 0, 4, '', 0, 12, 6, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-IMMACULE', 0, 4, '', 0, 12, 8, 1); + +-- Austria (41) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-EASTER', 0, 41, 'eastermonday', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-ASCENSION', 0, 41, 'ascension', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-PENTECOST', 0, 41, 'pentecost', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Fronleichnam', 0, 41, 'fronleichnam', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-KONEGIE', 0, 41, '', 0, 6, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-26OKT', 0, 41, '', 0, 10, 26, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-TOUSSAINT', 0, 41, '', 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-IMMACULE', 0, 41, '', 0, 12 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-24DEC', 0, 41, '', 0, 12, 24, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-SAINTSTEFAN', 0, 41, '', 0, 12, 26, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Silvester', 0, 41, '', 0, 12, 31, 1); + +-- India (117) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-REPUBLICDAY', 0, 117, '', 0, 1, 26, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1); + --- France only -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRVICTORYDAY', 0, 1, 0, 5, 8, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRNATIONALDAY', 0, 1, 0, 7, 14, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRASSOMPTION', 0, 1, 0, 8, 15, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRTOUSSAINT', 0, 1, 0, 11, 1, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRARMISTICE', 0, 1, 0, 11, 11, 1); ---INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('EASTER', 0, 1, 'easter', 0, 0, 0, 1); diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 85dba76eb2e..1d43df2eda9 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -90,6 +90,10 @@ ALTER TABLE llx_projet ADD COLUMN usage_organize_event integer DEFAULT 0; UPDATE llx_projet set usage_opportunity = 1 WHERE fk_opp_status > 0; ALTER TABLE llx_accounting_account MODIFY COLUMN rowid bigint AUTO_INCREMENT; + + +ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL; +ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL; create table llx_c_hrm_public_holiday @@ -98,7 +102,7 @@ create table llx_c_hrm_public_holiday entity integer DEFAULT 0 NOT NULL, -- multi company id, 0 = all fk_country integer, code varchar(62), - dayrule varchar(255) DEFAULT 'date', -- 'date', 'xxx', ... + dayrule varchar(64) DEFAULT 'date', -- 'date', 'xxx', ... day integer, month integer, year integer, -- 0 for all years @@ -106,7 +110,57 @@ create table llx_c_hrm_public_holiday import_key varchar(14) )ENGINE=innodb; +ALTER TABLE llx_c_hrm_public_holiday ADD UNIQUE INDEX uk_c_hrm_public_holiday(entity, code); +ALTER TABLE llx_c_hrm_public_holiday ADD UNIQUE INDEX uk_c_hrm_public_holiday2(entity, fk_country, dayrule, day, month, year); + + +-- A lot of countries +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('NEWYEARDAY1', 0, 0, 0, 1, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('LABORDAY1', 0, 0, 0, 5, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('ASSOMPTIONDAY1', 0, 0, 0, 8, 15, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('CHRISTMASDAY1', 0, 0, 0, 12, 25, 1); + +-- France only (1) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-VICTORYDAY', 0, 1, '', 0, 5, 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-NATIONALDAY', 0, 1, '', 0, 7, 14, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-ASSOMPTION', 0, 1, '', 0, 8, 15, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-TOUSSAINT', 0, 1, '', 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-ARMISTICE', 0, 1, '', 0, 11, 11, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-EASTER', 0, 1, 'eastermonday', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-ASCENSION', 0, 1, 'ascension', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('FR-PENTECOST', 0, 1, 'pentecost', 0, 0, 0, 1); + +-- Italy (3) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-LIBEAZIONE', 0, 3, 0, 4, 25, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-EPIPHANY', 0, 3, 0, 6, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-REPUBBLICA', 0, 3, 0, 6, 2, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-TUTTISANTIT', 0, 3, 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-IMMACULE', 0, 3, 0, 12, 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('IT-SAINTSTEFAN', 0, 3, 0, 12, 26, 1); + +-- Spain (4) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-EASTER', 0, 4, 'easter', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-REYE', 0, 4, '', 0, 6, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-HISPANIDAD', 0, 4, '', 0, 10, 12, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-TOUSSAINT', 0, 4, '', 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-CONSTITUIZION', 0, 4, '', 0, 12, 6, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-IMMACULE', 0, 4, '', 0, 12, 8, 1); + +-- Austria (41) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-EASTER', 0, 41, 'eastermonday', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-ASCENSION', 0, 41, 'ascension', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-PENTECOST', 0, 41, 'pentecost', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Fronleichnam', 0, 41, 'fronleichnam', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-KONEGIE', 0, 41, '', 0, 6, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-26OKT', 0, 41, '', 0, 10, 26, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-TOUSSAINT', 0, 41, '', 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-IMMACULE', 0, 41, '', 0, 12, 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-24DEC', 0, 41, '', 0, 12, 24, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-SAINTSTEFAN', 0, 41, '', 0, 12, 26, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Silvester', 0, 41, '', 0, 12, 31, 1); + +-- India (117) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-REPUBLICDAY', 0, 117, '', 0, 1, 26, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1); -ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL; -ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql index 23dcbf355b4..453eda6b4c3 100644 --- a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql +++ b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql @@ -17,5 +17,5 @@ -- ======================================================================== ALTER TABLE llx_c_hrm_public_holiday ADD UNIQUE INDEX uk_c_hrm_public_holiday(entity, code); -ALTER TABLE llx_c_hrm_public_holiday ADD UNIQUE INDEX uk_c_hrm_public_holiday2(entity, day, month, year); +ALTER TABLE llx_c_hrm_public_holiday ADD UNIQUE INDEX uk_c_hrm_public_holiday2(entity, fk_country, dayrule, day, month, year); diff --git a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql index 7efbe314875..879643213b9 100644 --- a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql +++ b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql @@ -22,7 +22,7 @@ create table llx_c_hrm_public_holiday entity integer DEFAULT 0 NOT NULL, -- multi company id, 0 = all fk_country integer, code varchar(62), - dayrule varchar(255) DEFAULT 'date', -- 'date', 'xxx', ... + dayrule varchar(64) DEFAULT 'date', -- 'date', 'xxx', ... day integer, month integer, year integer, -- 0 for all years From 73c3fa40bf65b498751dc787e0938913419090fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 10:53:13 +0200 Subject: [PATCH 429/982] Update phpunit --- htdocs/core/lib/date.lib.php | 10 +++++--- test/phpunit/DateLibTest.php | 47 ++++++++++++++++++++++++++++++++---- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 04518dade2f..9f1963dc9b9 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -601,14 +601,14 @@ function dol_get_first_day_week($day, $month, $year, $gm = false) * * @param int $timestampStart Timestamp de debut * @param int $timestampEnd Timestamp de fin - * @param string $countrycode Country code + * @param string $country_code Country code * @param int $lastday Last day is included, 0: no, 1:yes * @param int $includesaturday Include saturday as non working day (-1=use setup, 0=no, 1=yes) * @param int $includesunday Include sunday as non working day (-1=use setup, 0=no, 1=yes) * @return int|string Number of non working days or error message string if error * @see num_between_day(), num_open_day() */ -function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', $lastday = 0, $includesaturday = -1, $includesunday = -1) +function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includesaturday = -1, $includesunday = -1) { global $db, $conf, $mysoc; @@ -618,6 +618,8 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', // Check to ensure we use correct parameters if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates'; + if (empty($country_code)) $country_code = $mysoc->country_code; + if ($includesaturday < 0) $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1); if ($includesunday < 0) $includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1); @@ -651,10 +653,12 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', } } + $country_id = dol_getIdFromCode($db, $country_code, 'c_country', 'code', 'rowid'); + // Loop on public holiday defined into hrm_public_holiday $sql = "SELECT code, entity, fk_country, dayrule, year, month, day, active"; $sql.= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday"; - $sql.= " WHERE active = 1 and fk_country IN (0, ".$mysoc->country_id.")"; + $sql.= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")"; $resql = $db->query($sql); if ($resql) diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index cc4f50705e0..29b34297a38 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -185,16 +185,33 @@ class DateLibTest extends PHPUnit\Framework\TestCase // With same hours - Tuesday/Wednesday jan 2013 $date1=dol_mktime(0, 0, 0, 1, 1, 2013); $date2=dol_mktime(0, 0, 0, 1, 2, 2013); + $date3=dol_mktime(0, 0, 0, 1, 3, 2013); $result=num_public_holiday($date1, $date2, 'FR', 1); print __METHOD__." result=".$result."\n"; - $this->assertEquals(1, $result, 'NumPublicHoliday for Tuesday/Wednesday jan 2013 for FR'); // 1 closed days + $this->assertEquals(1, $result, 'NumPublicHoliday for Tuesday 1 - Wednesday 2 jan 2013 for FR'); // 1 closed days (country france) $result=num_public_holiday($date1, $date2, 'XX', 1); print __METHOD__." result=".$result."\n"; - $this->assertEquals(0, $result, 'NumPublicHoliday for Tuesday/Wednesday jan 2013 for XX'); // no closed days (country unknown) + $this->assertEquals(1, $result, 'NumPublicHoliday for Tuesday 1 - Wednesday 2 jan 2013 for XX'); // 1 closed days (country unknown) - // With same hours - Friday/Sunday jan 2013 + $result=num_public_holiday($date2, $date3, 'FR', 1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(0, $result, 'NumPublicHoliday for Wednesday 2 - Thursday 3 jan 2013 for FR'); // no closed days + + // Check with easter monday + $date1=dol_mktime(0, 0, 0, 4, 21, 2019); + $date2=dol_mktime(0, 0, 0, 4, 23, 2019); + + $result=num_public_holiday($date1, $date2, 'XX', 1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(1, $result, 'NumPublicHoliday including eastermonday for XX'); // 2 opened day, 1 closed days (sunday) + + $result=num_public_holiday($date1, $date2, 'FR', 1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(2, $result, 'NumPublicHoliday including eastermonday for FR'); // 1 opened day, 2 closed days (sunday + easter monday) + + // Check for sunday/saturday - Friday 4 - Sunday 6 jan 2013 $date1=dol_mktime(0, 0, 0, 1, 4, 2013); $date2=dol_mktime(0, 0, 0, 1, 6, 2013); @@ -202,10 +219,25 @@ class DateLibTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals(2, $result, 'NumPublicHoliday for FR'); // 1 opened day, 2 closed days + $result=num_public_holiday($date1, $date2, 'FR', 1, 1, 1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(2, $result, 'NumPublicHoliday for FR'); // 1 opened day, 2 closed days + + $result=num_public_holiday($date1, $date2, 'FR', 1, 1, 0); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(1, $result, 'NumPublicHoliday for FR'); // 2 opened day, 1 closed days + + $result=num_public_holiday($date1, $date2, 'FR', 1, 0, 0); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(0, $result, 'NumPublicHoliday for FR'); // 3 opened day, 0 closed days + $result=num_public_holiday($date1, $date2, 'XX', 1); print __METHOD__." result=".$result."\n"; $this->assertEquals(2, $result, 'NumPublicHoliday for XX'); // 1 opened day, 2 closed days (even if country unknown) + + + // Add more holiday with constant HOLIDAY_MORE_PUBLIC_HOLIDAYS $conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS='12-13,2019-12-14'; $date1=dol_mktime(0, 0, 0, 12, 13, 2018); @@ -243,14 +275,19 @@ class DateLibTest extends PHPUnit\Framework\TestCase // With same hours - Tuesday/Wednesday jan 2013 $date1=dol_mktime(0, 0, 0, 1, 1, 2013); $date2=dol_mktime(0, 0, 0, 1, 2, 2013); + $date3=dol_mktime(0, 0, 0, 1, 3, 2013); $result=num_open_day($date1, $date2, 0, 1, 0, 'FR'); print __METHOD__." result=".$result."\n"; - $this->assertEquals(1, $result, 'NumOpenDay Tuesday/Wednesday jan 2013 for FR'); // 1 opened days + $this->assertEquals(1, $result, 'NumOpenDay Tuesday 1 - Wednesday 2 jan 2013 for FR'); // 1 opened days (country france) $result=num_open_day($date1, $date2, 0, 1, 0, 'XX'); print __METHOD__." result=".$result."\n"; - $this->assertEquals(2, $result, 'NumOpenDay Tuesday/Wednesday jan 2013 for XX'); // 2 opened days (country unknown) + $this->assertEquals(1, $result, 'NumOpenDay Tuesday 1 - Wednesday 2 jan 2013 for XX'); // 1 opened days (country unknown) + + $result=num_open_day($date2, $date3, 0, 1, 0, 'FR'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(2, $result, 'NumOpenDay Wednesday 2 - Thursday 3 jan 2013 for FR'); // 2 opened days // With same hours - Friday/Sunday jan 2013 $date1=dol_mktime(0, 0, 0, 1, 4, 2013); From 8381b93e802fbffa832e9ed1d28942a45ae7e604 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 11:06:54 +0200 Subject: [PATCH 430/982] Fix init of public holidays --- htdocs/admin/dict.php | 12 ++++++------ .../install/mysql/data/llx_c_hrm_public_holiday.sql | 2 +- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 4 ++-- .../mysql/tables/llx_c_hrm_public_holiday.sql | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2c6b41b7796..ff4c3cc6a6b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -204,7 +204,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new $tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; $tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; //$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s"; -$tabsql[32]= "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country=c.rowid AND c.active=1"; +$tabsql[32]= "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.dayrule, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country=c.rowid AND c.active=1"; $tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department"; $tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function"; $tabsql[35]= "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c"; @@ -244,7 +244,7 @@ $tabsqlsort[28]="country ASC, code ASC"; $tabsqlsort[29]="position ASC"; $tabsqlsort[30]="code ASC"; //$tabsqlsort[31]="pcg_version ASC"; -$tabsqlsort[32]="year ASC, month ASC, day ASC"; +$tabsqlsort[32]="country, year ASC, month ASC, day ASC"; $tabsqlsort[33]="code ASC"; $tabsqlsort[34]="code ASC"; $tabsqlsort[35]="c.label ASC"; @@ -284,7 +284,7 @@ $tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country"; $tabfield[29]= "code,label,percent,position"; $tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfield[31]= "pcg_version,label"; -$tabfield[32]= "code,year,month,day,country_id,country"; +$tabfield[32]= "code,dayrule,year,month,day,country_id,country"; $tabfield[33]= "code,label"; $tabfield[34]= "code,label"; $tabfield[35]= "label"; @@ -324,7 +324,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country"; $tabfieldvalue[29]= "code,label,percent,position"; $tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldvalue[31]= "pcg_version,label"; -$tabfieldvalue[32]= "code,day,month,year,country"; +$tabfieldvalue[32]= "code,dayrule,day,month,year,country"; $tabfieldvalue[33]= "code,label"; $tabfieldvalue[34]= "code,label"; $tabfieldvalue[35]= "label"; @@ -365,7 +365,7 @@ $tabfieldinsert[29]= "code,label,percent,position"; $tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldinsert[31]= "pcg_version,label"; //$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country"; -$tabfieldinsert[32]= "code,day,month,year,fk_country"; +$tabfieldinsert[32]= "code,dayrule,day,month,year,fk_country"; $tabfieldinsert[33]= "code,label"; $tabfieldinsert[34]= "code,label"; $tabfieldinsert[35]= "label"; @@ -487,7 +487,7 @@ $tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$lan $tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList")); $tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize")); //$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode")); -$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'daterule'=>"Use 'date'", 'country'=>$langs->trans("EnterACountryOnlyIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear")); +$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'dayrule'=>"Keep empty for a date defined with month and day (most common case).
    Use a keyword like 'easter', 'eastermonday', ... for a date predefined by complex rules.", 'country'=>$langs->trans("EnterACountryOnlyIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear")); $tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[35] = array(); diff --git a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql index e66132865de..70750494a10 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql @@ -66,7 +66,7 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-EASTER', 0, 41, 'eastermonday', 0, 0, 0, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-ASCENSION', 0, 41, 'ascension', 0, 0, 0, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-PENTECOST', 0, 41, 'pentecost', 0, 0, 0, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Fronleichnam', 0, 41, 'fronleichnam', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-FRONLEICHNAM', 0, 41, 'fronleichnam', 0, 0, 0, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-KONEGIE', 0, 41, '', 0, 6, 1, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-26OKT', 0, 41, '', 0, 10, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-TOUSSAINT', 0, 41, '', 0, 11, 1, 1); diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 1d43df2eda9..cc375e72714 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -102,7 +102,7 @@ create table llx_c_hrm_public_holiday entity integer DEFAULT 0 NOT NULL, -- multi company id, 0 = all fk_country integer, code varchar(62), - dayrule varchar(64) DEFAULT 'date', -- 'date', 'xxx', ... + dayrule varchar(64) DEFAULT '', -- 'easter', 'eastermonday', ... day integer, month integer, year integer, -- 0 for all years @@ -150,7 +150,7 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-EASTER', 0, 41, 'eastermonday', 0, 0, 0, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-ASCENSION', 0, 41, 'ascension', 0, 0, 0, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-PENTECOST', 0, 41, 'pentecost', 0, 0, 0, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Fronleichnam', 0, 41, 'fronleichnam', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-FRONLEICHNAM', 0, 41, 'fronleichnam', 0, 0, 0, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-KONEGIE', 0, 41, '', 0, 6, 1, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-26OKT', 0, 41, '', 0, 10, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-TOUSSAINT', 0, 41, '', 0, 11, 1, 1); diff --git a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql index 879643213b9..e26d6ee4772 100644 --- a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql +++ b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql @@ -22,7 +22,7 @@ create table llx_c_hrm_public_holiday entity integer DEFAULT 0 NOT NULL, -- multi company id, 0 = all fk_country integer, code varchar(62), - dayrule varchar(64) DEFAULT 'date', -- 'date', 'xxx', ... + dayrule varchar(64) DEFAULT '', -- 'easter', 'eastermonday', ... day integer, month integer, year integer, -- 0 for all years From ac539d20b97510caf15095f01fe4a9ce685c7b8b Mon Sep 17 00:00:00 2001 From: david Date: Sun, 8 Sep 2019 05:15:26 +0200 Subject: [PATCH 431/982] FIX #10460 compatibility with MariaDB 10.4 --- htdocs/core/class/html.form.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 28053f5d441..b87f2118ac8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1152,9 +1152,8 @@ class Form $sql .= ", dictp.code as country_code"; } - $sql.= " FROM (".MAIN_DB_PREFIX ."societe as s"; + $sql.= " FROM ".MAIN_DB_PREFIX ."societe as s"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " )"; if ($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST) { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid=s.fk_pays"; } From ed02cdfddb8e8451bc7eb8831713026bc2ae17a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 11:23:53 +0200 Subject: [PATCH 432/982] Fix phpcs --- htdocs/modulebuilder/index.php | 122 ++++++++++++++++----------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4b7efffdfed..e5ba591dce7 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2390,68 +2390,68 @@ elseif (! empty($module)) { foreach ($menus as $menu) { - print '
    '; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; - } - } - else - { + print ''; + } + } + else + { print ''; - } + } - print '
    '; - print $menu['type']; - print ''; + print $menu['type']; + print ''; - print $menu['fk_menu']; - print ''; + print $menu['fk_menu']; + print ''; - print $menu['titre']; - print ''; + print $menu['titre']; + print ''; - print $menu['mainmenu']; - print ''; + print $menu['mainmenu']; + print ''; - print $menu['left']; - print ''; + print $menu['left']; + print ''; - print $menu['url']; - print ''; + print $menu['url']; + print ''; - print $menu['langs']; - print ''; + print $menu['langs']; + print ''; - print $menu['position']; - print ''; + print $menu['position']; + print ''; - print $menu['enabled']; - print ''; + print $menu['enabled']; + print ''; - print $menu['perms']; - print ''; + print $menu['perms']; + print ''; - print $menu['target']; - print ''; + print $menu['target']; + print ''; - print $menu['user']; - print ''; + print $menu['user']; + print '
    '.$langs->trans("None").'
    '; - print ''; + print ''; + print ''; - print ''; + print ''; } else { @@ -2523,26 +2523,26 @@ elseif (! empty($module)) { foreach ($perms as $perm) { - print ''; + print ''; - print ''; - print $perm[0]; - print ''; + print ''; + print $perm[0]; + print ''; - print ''; - print $perm[1]; - print ''; + print ''; + print $perm[1]; + print ''; - print ''; - print $perm[4]; - print ''; + print ''; + print $perm[4]; + print ''; - print ''; - print $perm[5]; - print ''; + print ''; + print $perm[5]; + print ''; - print ''; - } + print ''; + } } else { From 617e430998034d71b59b5b864f5a7e0911be9b9a Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 9 Sep 2019 12:31:17 +0200 Subject: [PATCH 433/982] fix stravis and sticker --- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 81b87b6f340..c7467922da5 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -755,7 +755,7 @@ class FormCompany extends Form * @param array $selected $key=>$val $val is selected Roles for input mode * @return string String with contacts roles */ - public function showRoles($htmlname = '', Contact $contact, $rendermode = 'view', $selected = array()) + public function showRoles($htmlname, Contact $contact, $rendermode = 'view', $selected = array()) { if ($rendermode === 'view') { $toprint = array(); diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index ec124c8a1a1..2caf438b471 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -175,4 +175,5 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-REPUBLICDAY', 0, 117, '', 0, 1, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1); - +ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL AFTER product_type; +ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL AFTER date_start; From 21d84f63a54f2f00cc2c5f6bafafd85ce9725f17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 12:58:32 +0200 Subject: [PATCH 434/982] Work on template --- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/core/modules/modBom.class.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 9efb4dd1e27..a4eb2d57053 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -176,7 +176,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $menu_arr[] = array( 'name' => 'TMenuMRP', 'link' => '/mrp/index.php?mainmenu=mrp&leftmenu=', - 'title' => $langs->trans("TMenuMRP"), + 'title' => "TMenuMRP", 'level' => 0, 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), 'target' => $atarget, diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index 8e1e1f1288b..d8d75eced2a 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -66,7 +66,7 @@ class modBom extends DolibarrModules $this->descriptionlong = "Bill of Materials definitions. They can be used to make Manufacturing Resource Planning"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = 'experimental'; + $this->version = 'dolibarr'; //Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; @@ -105,7 +105,7 @@ class modBom extends DolibarrModules // Dependencies $this->hidden = false; // A condition to hide module $this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) - $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) + $this->requiredby = array('modMrp'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); //$this->phpmin = array(5,4); // Minimum version of PHP required by module From c7bab8681ad001667d178e54b783c6d7a3dbf00a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 13:05:08 +0200 Subject: [PATCH 435/982] Fix sql error #11845 --- htdocs/adherents/list.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 3ddf739c813..f78059c2969 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -261,7 +261,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql.=preg_replace('/^,/', '', $hookmanager->resPrint); -$sql =preg_replace('/, $/', '', $sql); +$sql =preg_replace('/,\s*$/', '', $sql); $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)"; if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; // We need this table joined to the select in order to filter by categ diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 60f64834583..497f46919fd 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -222,7 +222,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=preg_replace('/^,/', '', $hookmanager->resPrint); -$sql =preg_replace('/, $/', '', $sql); +$sql =preg_replace('/,\s*$/', '', $sql); $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; From f6e04ba3142415c39968bc0dd3c0808ae9ab40d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 13:05:41 +0200 Subject: [PATCH 436/982] Fix sql error --- htdocs/modulebuilder/template/myobject_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 60f64834583..497f46919fd 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -222,7 +222,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=preg_replace('/^,/', '', $hookmanager->resPrint); -$sql =preg_replace('/, $/', '', $sql); +$sql =preg_replace('/,\s*$/', '', $sql); $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; From f2b9517dac9e8fc2a3b91e7f2713d8aa8d7fb540 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 13:16:31 +0200 Subject: [PATCH 437/982] FIX #11834 --- htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/perweek.php | 2 +- htdocs/projet/list.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 3c9fc7cd3dc..1f7209e1f65 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -443,7 +443,7 @@ $moreforfilter=''; // If the user can view user other than himself $moreforfilter.='
    '; $moreforfilter.='
    '.$langs->trans('User'). '
    '; -$includeonly='hierachyme'; +$includeonly='hierarchyme'; if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); $moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly'); $moreforfilter.='
    '; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 075245ec7d8..4dfdad7879a 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -480,7 +480,7 @@ if (! empty($conf->categorie->enabled)) // If the user can view user other than himself $moreforfilter.='
    '; $moreforfilter.='
    '.$langs->trans('User'). '
    '; -$includeonly='hierachyme'; +$includeonly='hierarchyme'; if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); $moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.='
    '; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index aa03eada135..a0e068c79f6 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -505,7 +505,7 @@ if (! empty($conf->categorie->enabled)) // If the user can view user other than himself $moreforfilter.='
    '; $moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': '; -$includeonly='hierachyme'; +$includeonly='hierarchyme'; if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); $moreforfilter.=$form->select_dolusers($search_project_user?$search_project_user:'', 'search_project_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.='
    '; From 28ba5abb89750db238ba2469517b612e35a89217 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 13:31:14 +0200 Subject: [PATCH 438/982] Clean code --- htdocs/comm/mailing/class/mailing.class.php | 36 ++++++++++--------- .../mailings/advthirdparties.modules.php | 2 -- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index d82ec07612d..1538cbd7c81 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -335,15 +335,15 @@ class Mailing extends CommonObject $target_array=array(); - $sql = "SELECT fk_contact, "; - $sql.=" lastname, "; - $sql.=" firstname,"; - $sql.=" email,"; - $sql.=" other,"; - $sql.=" source_url,"; - $sql.=" source_id ,"; - $sql.=" source_type "; - $sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles "; + $sql = "SELECT fk_contact,"; + $sql.= " lastname,"; + $sql.= " firstname,"; + $sql.= " email,"; + $sql.= " other,"; + $sql.= " source_url,"; + $sql.= " source_id ,"; + $sql.= " source_type"; + $sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql.= " WHERE fk_mailing = ".$fromid; $result=$this->db->query($sql); @@ -353,14 +353,16 @@ class Mailing extends CommonObject { while ($obj = $this->db->fetch_object($result)) { - $target_array[]=array('fk_contact'=>$obj->fk_contact, - 'lastname'=>$obj->lastname, - 'firstname'=>$obj->firstname, - 'email'=>$obj->email, - 'other'=>$obj->other, - 'source_url'=>$obj->source_url, - 'source_id'=>$obj->source_id, - 'source_type'=>$obj->source_type); + $target_array[]=array( + 'fk_contact'=>$obj->fk_contact, + 'lastname'=>$obj->lastname, + 'firstname'=>$obj->firstname, + 'email'=>$obj->email, + 'other'=>$obj->other, + 'source_url'=>$obj->source_url, + 'source_id'=>$obj->source_id, + 'source_type'=>$obj->source_type + ); } } } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index a29fdd119bf..370f05e4232 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -88,7 +88,6 @@ class mailing_advthirdparties extends MailingTargets dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found", LOG_DEBUG); - $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); @@ -144,7 +143,6 @@ class mailing_advthirdparties extends MailingTargets dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found"); - $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); From d061e61d25a06bbd74d497bd16275721382474c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 13:45:25 +0200 Subject: [PATCH 439/982] Fix add_to_target has only 1 param. --- .../mailings/mailinglist_mymodule_myobject.modules.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 07419af532d..854e7f37bd5 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -97,16 +97,14 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets * This is the main function that returns the array of emails * * @param int $mailing_id Id of emailing - * @param array $cibles Array with targets * @return int <0 if error, number of emails added if ok */ - public function add_to_target($mailing_id, $cibles) + public function add_to_target($mailing_id) { // phpcs:enable $target = array(); $j = 0; - $sql = " select rowid as id, email, firstname, lastname, plan, partner"; $sql.= " from ".MAIN_DB_PREFIX."myobject"; $sql.= " where email IS NOT NULL AND email != ''"; @@ -161,7 +159,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets // ----- Your code end here ----- - return parent::add_to_target($mailing_id, $target); + return parent::addTargetsToDatabase($mailing_id, $target); } From d2131a0be83c235427d46e62dd3c3ea9e3132380 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 14:08:10 +0200 Subject: [PATCH 440/982] Add filter on usage on project list --- .../modules/mailings/xinputuser.modules.php | 3 +- htdocs/langs/en_US/projects.lang | 5 +- htdocs/projet/list.php | 56 +++++++++++++++++-- 3 files changed, 58 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 62990ec6f90..cd3a6f79b0f 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -113,9 +113,10 @@ class mailing_xinputuser extends MailingTargets * Ajoute destinataires dans table des cibles * * @param int $mailing_id Id of emailing + * @param array $cibles Array with targets * @return int < 0 si erreur, nb ajout si ok */ - public function add_to_target($mailing_id) + public function add_to_target($mailing_id, $cibles) { // phpcs:enable global $conf,$langs,$_FILES; diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 4b4a787b6ad..8d3297b6587 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -249,4 +249,7 @@ TimeSpentForInvoice=Time spent OneLinePerUser=One line per user ServiceToUseOnLines=Service to use on lines InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project -ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). \ No newline at end of file +ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). +UsageOpportunity=Usage: Opportunity +UsageTasks=Usage: Tasks +UsageBillTimeShort=Usage: Bill time \ No newline at end of file diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 5aa28bcddc8..03c814d65bf 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -85,6 +85,9 @@ $search_budget_amount=GETPOST("search_budget_amount", 'alpha'); $search_public=GETPOST("search_public", 'int'); $search_project_user=GETPOST('search_project_user', 'int'); $search_sale=GETPOST('search_sale', 'int'); +$search_usage_opportunity=GETPOST('search_usage_opportunity', 'int'); +$search_usage_task=GETPOST('search_usage_task', 'int'); +$search_usage_bill_time=GETPOST('search_usage_bill_time', 'int'); $optioncss = GETPOST('optioncss', 'alpha'); $mine = $_REQUEST['mode']=='mine' ? 1 : 0; @@ -129,7 +132,9 @@ $arrayfields=array( 'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>104), 'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>105), 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), - 'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115), + 'p.usage_opportunity'=>array('label'=>$langs->trans("UsageOpportunity"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>115), + 'p.usage_task'=>array('label'=>$langs->trans("UsageTasks"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_HIDE_TASKS?0:1), 'position'=>116), + 'p.usage_bill_time'=>array('label'=>$langs->trans("UsageBillTimeShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_HIDE_TASKS?0:1), 'position'=>117), 'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500), 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), @@ -184,6 +189,9 @@ if (empty($reshook)) $search_eday=""; $search_emonth=""; $search_eyear=""; + $search_usage_opportunity=''; + $search_usage_task=''; + $search_usage_bill_time=''; $toselect=''; $search_array_options=array(); } @@ -279,7 +287,7 @@ if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; $distinct='DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. $sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut, p.fk_opp_status, p.public, p.fk_user_creat"; -$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount, p.usage_bill_time"; +$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount, p.usage_opportunity, p.usage_task, p.usage_bill_time"; $sql.= ", s.rowid as socid, s.nom as name, s.email"; $sql.= ", cls.code as opp_status_code"; // We'll need these fields in order to filter by categ @@ -364,6 +372,9 @@ if ($search_sale > 0) $sql.= " AND sc.fk_user = " .$search_sale; if ($search_project_user > 0) $sql.= " AND ecp.fk_c_type_contact IN (".join(',', array_keys($listofprojectcontacttype)).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_project_user; if ($search_opp_amount != '') $sql .= natural_search('p.opp_amount', $search_opp_amount, 1); if ($search_budget_amount != '') $sql .= natural_search('p.budget_amount', $search_budget_amount, 1); +if ($search_usage_opportunity != '' && $search_usage_opportunity >= 0) $sql .= natural_search('p.usage_opportunity', $search_usage_opportunity, 2); +if ($search_usage_task != '' && $search_usage_task >= 0) $sql .= natural_search('p.usage_task', $search_usage_task, 2); +if ($search_usage_bill_time != '' && $search_usage_bill_time >= 0) $sql .= natural_search('p.usage_bill_time', $search_usage_bill_time, 2); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -619,10 +630,23 @@ if (! empty($arrayfields['p.budget_amount']['checked'])) print ''; print ''; } +if (! empty($arrayfields['p.usage_opportunity']['checked'])) +{ + print ''; + print $form->selectyesno('search_usage_opportunity', $search_usage_opportunity, 1, false, 1); + print ''; + print ''; +} +if (! empty($arrayfields['p.usage_task']['checked'])) +{ + print ''; + print $form->selectyesno('search_usage_task', $search_usage_task, 1, false, 1); + print ''; +} if (! empty($arrayfields['p.usage_bill_time']['checked'])) { print ''; - print ''; + print $form->selectyesno('search_usage_bill_time', $search_usage_bill_time, 1, false, 1); print ''; } // Extra fields @@ -674,7 +698,9 @@ if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right '); -if (! empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); +if (! empty($arrayfields['p.usage_opportunity']['checked'])) print_liste_field_titre($arrayfields['p.usage_opportunity']['label'], $_SERVER["PHP_SELF"], 'p.usage_opportunity', "", $param, '', $sortfield, $sortorder, 'right '); +if (! empty($arrayfields['p.usage_task']['checked'])) print_liste_field_titre($arrayfields['p.usage_task']['label'], $_SERVER["PHP_SELF"], 'p.usage_task', "", $param, '', $sortfield, $sortorder, 'right '); +if (! empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -855,6 +881,28 @@ while ($i < min($num, $limit)) if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalbudgetfield']=$totalarray['nbfield']; } + // Usage opportunity + if (! empty($arrayfields['p.usage_opportunity']['checked'])) + { + print ''; + if ($obj->usage_opportunity) + { + print yn($obj->usage_opportunity); + } + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Usage task + if (! empty($arrayfields['p.usage_task']['checked'])) + { + print ''; + if ($obj->usage_task) + { + print yn($obj->usage_task); + } + print ''; + if (! $i) $totalarray['nbfield']++; + } // Bill time if (! empty($arrayfields['p.usage_bill_time']['checked'])) { From 42b3640a5a0cdb0ffc463e720c5f6e0a04fe9c15 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 9 Sep 2019 14:12:28 +0200 Subject: [PATCH 441/982] fix travis --- .../triggers/interface_90_modSociete_ContactRoles.class.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index 36a8274c602..8d2418a8a94 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -81,12 +81,11 @@ class InterfaceContactRoles extends DolibarrTriggers if(!empty($socid) && $socid != '-1') { global $db, $langs; - var_dump($socid); + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $contactdefault = new Contact($this->db); $contactdefault->socid=$socid; $TContact = $contactdefault->getContactRoles($object->element); - // Le trigger est appelé avant que le core n'ajoute lui-même des contacts (contact propale, clone), il ne faut pas les associer avant sinon bug $TContactAlreadyLinked = array(); if ($object->id > 0) { @@ -98,7 +97,6 @@ class InterfaceContactRoles extends DolibarrTriggers } foreach($TContact as $i => $infos) { - // Gestion du cas du clone foreach ($TContactAlreadyLinked as $contactData) { if($contactData['id'] == $infos['fk_socpeople'] && $contactData['fk_c_type_contact'] == $infos['type_contact']) unset($TContact[$i]); } @@ -106,7 +104,6 @@ class InterfaceContactRoles extends DolibarrTriggers $nb = 0; foreach($TContact as $infos) { - // Gestion du cas spécifique de la création de propale avec sélection du contact, cela créé un bug si le contact est ajouté par le module contactdefault $res = $object->add_contact($infos['fk_socpeople'], $infos['type_contact']); if($res > 0) $nb++; } From 66a9fabd06ee295870a8b14039d801a730816021 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 14:18:25 +0200 Subject: [PATCH 442/982] If you develop your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...) --- ChangeLog | 1 + htdocs/comm/mailing/class/mailing.class.php | 2 +- htdocs/core/modules/mailings/README | 3 +++ .../core/modules/mailings/advthirdparties.modules.php | 11 ++++++----- htdocs/core/modules/mailings/contacts1.modules.php | 2 +- htdocs/core/modules/mailings/example.modules.php | 2 +- htdocs/core/modules/mailings/fraise.modules.php | 2 +- htdocs/core/modules/mailings/modules_mailings.php | 6 ++---- htdocs/core/modules/mailings/pomme.modules.php | 2 +- htdocs/core/modules/mailings/thirdparties.modules.php | 2 +- .../thirdparties_services_expired.modules.php | 2 +- htdocs/core/modules/mailings/xinputfile.modules.php | 2 +- htdocs/core/modules/mailings/xinputuser.modules.php | 5 ++--- .../mailinglist_mymodule_myobject.modules.php | 2 +- 14 files changed, 23 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e0bbf78352..3aa4f789f3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ Following changes may create regressions for some external modules, but were nec * The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead. * The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french). * Removed deprecated method actioncomm->add(), use create() instead +* If you develop your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...) ***** ChangeLog for 10.0.1 compared to 10.0.0 ***** diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index d82ec07612d..adb817f418f 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -370,7 +370,7 @@ class Mailing extends CommonObject return -1; } - $mailing_target->add_to_target($object->id, $target_array); + $mailing_target->addTargetsToDatabase($object->id, $target_array); } } diff --git a/htdocs/core/modules/mailings/README b/htdocs/core/modules/mailings/README index 096f680bd38..a69265a9424 100644 --- a/htdocs/core/modules/mailings/README +++ b/htdocs/core/modules/mailings/README @@ -43,6 +43,9 @@ $target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0', $target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n', 'other'=>'other_n'); // ----- Your code end here ----- +and call the method + +parent::addTargetsToDatabase($mailing_id, $target); ***** STEP 3 ***** diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index a29fdd119bf..a27863cf055 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -65,7 +65,7 @@ class mailing_advthirdparties extends MailingTargets // phpcs:enable global $conf, $langs; - dol_syslog(get_class($this)."::add_to_target socid=".var_export($socid, true).' contactid='.var_export($contactid, true)); + dol_syslog(get_class($this)."::add_to_target_spec socid=".var_export($socid, true).' contactid='.var_export($contactid, true)); $cibles = array(); @@ -86,7 +86,7 @@ class mailing_advthirdparties extends MailingTargets $num = $this->db->num_rows($result); $i = 0; - dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found", LOG_DEBUG); + dol_syslog(get_class($this)."::add_to_target_spec mailing ".$num." targets found", LOG_DEBUG); $old = ''; while ($i < $num) @@ -142,7 +142,7 @@ class mailing_advthirdparties extends MailingTargets $num = $this->db->num_rows($result); $i = 0; - dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found"); + dol_syslog(get_class($this)."::add_to_target_spec mailing ".$num." targets found"); $old = ''; while ($i < $num) @@ -177,8 +177,9 @@ class mailing_advthirdparties extends MailingTargets } - dol_syslog(get_class($this)."::add_to_target mailing cibles=".var_export($cibles, true), LOG_DEBUG); - return parent::add_to_target($mailing_id, $cibles); + dol_syslog(get_class($this)."::add_to_target_spec mailing cibles=".var_export($cibles, true), LOG_DEBUG); + + return parent::addTargetsToDatabase($mailing_id, $cibles); } diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 79c58b1c7ce..bc67c8d3fec 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -447,6 +447,6 @@ class mailing_contacts1 extends MailingTargets return -1; } - return parent::add_to_target($mailing_id, $cibles); + return parent::addTargetsToDatabase($mailing_id, $cibles); } } diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php index 45af3dd5b4d..a96457c2625 100644 --- a/htdocs/core/modules/mailings/example.modules.php +++ b/htdocs/core/modules/mailings/example.modules.php @@ -80,7 +80,7 @@ class mailing_example extends MailingTargets // ----- Your code end here ----- - return parent::add_to_target($mailing_id, $target); + return parent::addTargetsToDatabase($mailing_id, $target); } diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 2ea4ba8e3b5..60196b23784 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -315,6 +315,6 @@ class mailing_fraise extends MailingTargets return -1; } - return parent::add_to_target($mailing_id, $cibles); + return parent::addTargetsToDatabase($mailing_id, $cibles); } } diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 6c97e165199..42a9868cf7c 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -151,17 +151,15 @@ class MailingTargets // This can't be abstract as it is used for some method return $nb; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Ajoute destinataires dans table des cibles + * Add a list of targets int the database * * @param int $mailing_id Id of emailing * @param array $cibles Array with targets * @return int < 0 si erreur, nb ajout si ok */ - public function add_to_target($mailing_id, $cibles) + public function addTargetsToDatabase($mailing_id, $cibles) { - // phpcs:enable global $conf; $this->db->begin(); diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 74dc86c1d9a..1f4fff68bf1 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -217,6 +217,6 @@ class mailing_pomme extends MailingTargets return -1; } - return parent::add_to_target($mailing_id, $cibles); + return parent::addTargetsToDatabase($mailing_id, $cibles); } } diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 10e5f9e93c9..00db6eb89ea 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -190,7 +190,7 @@ class mailing_thirdparties extends MailingTargets return -1; } - return parent::add_to_target($mailing_id, $cibles); + return parent::addTargetsToDatabase($mailing_id, $cibles); } diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index a19c5480722..75dc4b9499b 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -159,7 +159,7 @@ class mailing_thirdparties_services_expired extends MailingTargets // ----- Your code end here ----- - return parent::add_to_target($mailing_id, $cibles); + return parent::addTargetsToDatabase($mailing_id, $cibles); } diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index f4eac646db6..6a7af95b17b 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -221,6 +221,6 @@ class mailing_xinputfile extends MailingTargets ini_set('auto_detect_line_endings', false); - return parent::add_to_target($mailing_id, $cibles); + return parent::addTargetsToDatabase($mailing_id, $cibles); } } diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index cd3a6f79b0f..e56bfbc66a2 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -113,10 +113,9 @@ class mailing_xinputuser extends MailingTargets * Ajoute destinataires dans table des cibles * * @param int $mailing_id Id of emailing - * @param array $cibles Array with targets * @return int < 0 si erreur, nb ajout si ok */ - public function add_to_target($mailing_id, $cibles) + public function add_to_target($mailing_id) { // phpcs:enable global $conf,$langs,$_FILES; @@ -144,7 +143,7 @@ class mailing_xinputuser extends MailingTargets 'source_type' => 'file' ); - return parent::add_to_target($mailing_id, $cibles); + return parent::addTargetsToDatabase($mailing_id, $cibles); } else { diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 07419af532d..41974ca8b79 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -161,7 +161,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets // ----- Your code end here ----- - return parent::add_to_target($mailing_id, $target); + return parent::addTargetsToDatabase($mailing_id, $target); } From ee931d0f25dfe42fa9138b180815a9beca1f7ceb Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 9 Sep 2019 14:53:23 +0200 Subject: [PATCH 443/982] fix travis --- .../interface_90_modSociete_ContactRoles.class.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index 8d2418a8a94..e9bf9d38a50 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -53,14 +53,8 @@ class InterfaceContactRoles extends DolibarrTriggers * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * Following properties may be set before calling trigger. The may be completed by this trigger to be used for writing the event into database: - * $object->actiontypecode (translation action code: AC_OTH, ...) - * $object->actionmsg (note, long text) - * $object->actionmsg2 (label, short text) - * $object->sendtoid (id of contact or array of ids) - * $object->socid (id of thirdparty) - * $object->fk_project - * $object->fk_element - * $object->elementtype + * $object->socid or $object->fk_soc(id of thirdparty) + * $object->element (element type of object) * * @param string $action Event action code * @param Object $object Object @@ -113,5 +107,6 @@ class InterfaceContactRoles extends DolibarrTriggers } } } - } + return 0; + } } From ad92efaee14e8ad5e8523fd6064928ad917cee7a Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 9 Sep 2019 14:58:29 +0200 Subject: [PATCH 444/982] add trans --- htdocs/langs/en_US/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index c4611836a51..04f45f8de4b 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1004,3 +1004,4 @@ ContactDefault_project_task=Task ContactDefault_propal=Proposal ContactDefault_supplier_proposal=Supplier Proposal ContactDefault_ticketsup=Ticket +ContactAddedAutomatically=Contact added from contact thirdparty roles From 3ea2e0c915db93fca1ca696a4d6c25477d251fa9 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 9 Sep 2019 15:03:20 +0200 Subject: [PATCH 445/982] NEW add parent id or ref column in warehouse import --- htdocs/core/modules/modStock.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index f3864525d8d..93afcdaebd7 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -316,17 +316,21 @@ class modStock extends DolibarrModules $this->import_fields_array[$r]=array('e.ref'=>"LocationSummary*", 'e.description'=>"DescWareHouse",'e.lieu'=>"LieuWareHouse", 'e.address'=>"Address",'e.zip'=>'Zip','e.fk_pays'=>'CountryCode', - 'e.statut'=>'Status' + 'e.statut'=>'Status', + 'e.fk_parent'=>'ParentWarehouse' ); $this->import_convertvalue_array[$r]=array( - 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry') + 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'), + 'e.fk_parent'=>array('rule'=>'fetchidfromref','classfile'=>'/product/stock/class/entrepot.class.php','class'=>'Entrepot','method'=>'fetch','element'=>'ref') ); $this->import_regex_array[$r]=array('e.statut'=>'^[0|1]'); $this->import_examplevalues_array[$r]=array('e.ref'=>"ALM001", 'e.description'=>"Central Warehouse",'e.lieu'=>"Central", 'e.address'=>"Route 66",'e.zip'=>'28080','e.fk_pays'=>'US', - 'e.statut'=>'1'); + 'e.statut'=>'1', + 'e.fk_parent'=>'' + ); // Import stocks $r++; From f4a565544fc7ac106ccacf004c07e70b91c2914f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 9 Sep 2019 16:33:12 +0200 Subject: [PATCH 446/982] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 87 +++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 446b4fa3cfe..428ebe79c4a 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -178,6 +178,93 @@ class Products extends DolibarrApi } return $obj_ret; } + + /** + * List supplier's products + * + * Get a list of supplier's products + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service) + * @param int $category Use this param to filter list by category + * @param int $supplier Use this param to filter list by supplier + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" + * @return array Array of product objects + * + * @url GET supplier + */ + public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') + { + global $db, $conf; + $obj_ret = array(); + $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; + $sql = "SELECT t.rowid, t.ref, t.ref_ext"; + $sql.= " FROM ".MAIN_DB_PREFIX."product as t"; + if ($category > 0) { + $sql.= ", ".MAIN_DB_PREFIX."categorie_product as c"; + } + $sql.= ", ".MAIN_DB_PREFIX."product_fournisseur_price as s"; + + $sql.= ' WHERE t.entity IN ('.getEntity('product').')'; + + if ($supplier > 0) { + $sql.= " AND s.fk_soc = ".$db->escape($supplier); + } + $sql.= " AND s.fk_product = t.rowid "; + // Select products of given category + if ($category > 0) { + $sql.= " AND c.fk_categorie = ".$db->escape($category); + $sql.= " AND c.fk_product = t.rowid "; + } + if ($mode == 1) { + // Show only products + $sql.= " AND t.fk_product_type = 0"; + } elseif ($mode == 2) { + // Show only services + $sql.= " AND t.fk_product_type = 1"; + } + // Add sql filters + if ($sqlfilters) { + if (! DolibarrApi::_checkFilters($sqlfilters)) { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + $sql.= $db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + $sql.= $db->plimit($limit + 1, $offset); + } + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + $i = 0; + while ($i < $min) + { + $obj = $db->fetch_object($result); + $product_static = new Product($db); + if($product_static->fetch($obj->rowid)) { + $obj_ret[] = $this->_cleanObjectDatas($product_static); + } + $i++; + } + } + else { + throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); + } + if(! count($obj_ret)) { + throw new RestException(404, 'No product found'); + } + return $obj_ret; + } /** * Create product object From be66e1bd20ea9bc4de608e4f573c209ba77b9db8 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 9 Sep 2019 14:36:02 +0000 Subject: [PATCH 447/982] Fixing style errors. --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 428ebe79c4a..89dd7ff823a 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -193,7 +193,7 @@ class Products extends DolibarrApi * @param int $supplier Use this param to filter list by supplier * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" * @return array Array of product objects - * + * * @url GET supplier */ public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') From 6a734ea8289bf1f51cfb21e5a84e9344bb4932b7 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 9 Sep 2019 16:58:20 +0200 Subject: [PATCH 448/982] NEW add minimum stock filter in load warehoues for product form --- htdocs/expedition/card.php | 8 +- .../product/class/html.formproduct.class.php | 97 ++++++++++++------- 2 files changed, 68 insertions(+), 37 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index cc05bf686c3..4202607cbd2 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1262,7 +1262,13 @@ if ($action == 'create') if ($line->fk_product > 0) { print ''; - print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1); + + $stockMin = false; + if (empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { + $stockMin = 0; + } + print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', '', 1, $stockMin, 'stock DESC, e.ref'); + if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) { //print $stock.' '.$quantityToBeDelivered; diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index a0ebda88cd9..e356226dd2f 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -55,21 +55,24 @@ class FormProduct } - /** - * Load in cache array list of warehouses - * If fk_product is not 0, we do not use cache - * - * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. - * @param string $batch Add quantity of batch stock in label for product with batch name batch, batch name precedes batch_id. Nothing if ''. - * @param string $status warehouse status filter, following comma separated filter options can be used - * 'warehouseopen' = select products from open warehouses, - * 'warehouseclosed' = select products from closed warehouses, - * 'warehouseinternal' = select products from warehouses for internal correct/transfer only - * @param boolean $sumStock sum total stock of a warehouse, default true - * @param array $exclude warehouses ids to exclude - * @return int Nb of loaded lines, 0 if already loaded, <0 if KO - */ - public function loadWarehouses($fk_product = 0, $batch = '', $status = '', $sumStock = true, $exclude = '') + /** + * Load in cache array list of warehouses + * If fk_product is not 0, we do not use cache + * + * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. + * @param string $batch Add quantity of batch stock in label for product with batch name batch, batch name precedes batch_id. Nothing if ''. + * @param string $status warehouse status filter, following comma separated filter options can be used + * 'warehouseopen' = select products from open warehouses, + * 'warehouseclosed' = select products from closed warehouses, + * 'warehouseinternal' = select products from warehouses for internal correct/transfer only + * @param boolean $sumStock sum total stock of a warehouse, default true + * @param string $exclude warehouses ids to exclude + * @param bool|int $stockMin [=false] Value of minimum stock to filter or false not not filter by minimum stock + * @param string $orderBy [='e.ref'] Order by + * @return int Nb of loaded lines, 0 if already loaded, <0 if KO + * @throws Exception + */ + public function loadWarehouses($fk_product = 0, $batch = '', $status = '', $sumStock = true, $exclude = '', $stockMin = false, $orderBy = 'e.ref') { global $conf, $langs; @@ -130,8 +133,26 @@ class FormProduct if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$this->db->escape(implode(',', $exclude)).')'; - if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.ref, e.description, e.fk_parent"; - $sql.= " ORDER BY e.ref"; + // minimum stock + if ($stockMin !== false) { + if (!empty($fk_product)) { + if (!empty($batch)) { + $sql .= " AND pb.qty > " . $this->db->escape($stockMin); + } else { + $sql .= " AND ps.reel > " . $this->db->escape($stockMin); + } + } + } + + if ($sumStock && empty($fk_product)) { + $sql.= " GROUP BY e.rowid, e.ref, e.description, e.fk_parent"; + + // minimum stock + if ($stockMin !== false) { + $sql .= " HAVING sum(ps.reel) > " . $this->db->escape($stockMin); + } + } + $sql.= " ORDER BY " . $orderBy; dol_syslog(get_class($this).'::loadWarehouses', LOG_DEBUG); $resql = $this->db->query($sql); @@ -192,25 +213,29 @@ class FormProduct /** * Return list of warehouses * - * @param int $selected Id of preselected warehouse ('' for no value, 'ifone'=select value if one value otherwise no value) - * @param string $htmlname Name of html select html - * @param string $filterstatus warehouse status filter, following comma separated filter options can be used - * 'warehouseopen' = select products from open warehouses, - * 'warehouseclosed' = select products from closed warehouses, - * 'warehouseinternal' = select products from warehouses for internal correct/transfer only - * @param int $empty 1=Can be empty, 0 if not - * @param int $disabled 1=Select is disabled - * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. - * @param string $empty_label Empty label if needed (only if $empty=1) - * @param int $showstock 1=Show stock count - * @param int $forcecombo 1=Force combo iso ajax select2 - * @param array $events Events to add to select2 - * @param string $morecss Add more css classes to HTML select - * @param array $exclude Warehouses ids to exclude - * @param int $showfullpath 1=Show full path of name (parent ref into label), 0=Show only ref of current warehouse - * @return string HTML select + * @param string|int $selected Id of preselected warehouse ('' for no value, 'ifone'=select value if one value otherwise no value) + * @param string $htmlname Name of html select html + * @param string $filterstatus warehouse status filter, following comma separated filter options can be used + * 'warehouseopen' = select products from open warehouses, + * 'warehouseclosed' = select products from closed warehouses, + * 'warehouseinternal' = select products from warehouses for internal correct/transfer only + * @param int $empty 1=Can be empty, 0 if not + * @param int $disabled 1=Select is disabled + * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. + * @param string $empty_label Empty label if needed (only if $empty=1) + * @param int $showstock 1=Show stock count + * @param int $forcecombo 1=Force combo iso ajax select2 + * @param array $events Events to add to select2 + * @param string $morecss Add more css classes to HTML select + * @param string $exclude Warehouses ids to exclude + * @param int $showfullpath 1=Show full path of name (parent ref into label), 0=Show only ref of current warehouse + * @param bool|int $stockMin [=false] Value of minimum stock to filter or false not not filter by minimum stock + * @param string $orderBy [='e.ref'] Order by + * @return string HTML select + * + * @throws Exception */ - public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1) + public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref') { global $conf,$langs,$user; @@ -218,7 +243,7 @@ class FormProduct $out=''; if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = ''; - $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude); + $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude, $stockMin, $orderBy); $nbofwarehouses=count($this->cache_warehouses); if ($conf->use_javascript_ajax && ! $forcecombo) From 28785b31d70856eb5688bd431d2dd893222dda0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2019 19:18:01 +0200 Subject: [PATCH 449/982] Removed useless div --- build/doxygen/doxygen_footer.html | 20 ++++++++++++++++++-- build/doxygen/doxygen_header.html | 1 - 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/build/doxygen/doxygen_footer.html b/build/doxygen/doxygen_footer.html index 8ffdc5341fe..1426885a565 100644 --- a/build/doxygen/doxygen_footer.html +++ b/build/doxygen/doxygen_footer.html @@ -10,7 +10,6 @@ File added into doxygen generated documentation
    - @@ -24,13 +23,30 @@ File added into doxygen generated documentation + + + + + + - + + \ No newline at end of file diff --git a/build/doxygen/doxygen_header.html b/build/doxygen/doxygen_header.html index c83191268d7..5810182050f 100644 --- a/build/doxygen/doxygen_header.html +++ b/build/doxygen/doxygen_header.html @@ -30,7 +30,6 @@ src="https://www.facebook.com/tr?id=1998533953704960&ev=PageView&noscript=1" -
    From 08f8ad6f300894e15bd1beb5c6035b801ee2e481 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Sep 2019 00:09:18 +0200 Subject: [PATCH 450/982] FIX javascript error when using dol_use_jmobile=1 --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b87f2118ac8..dce42c79d33 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4237,7 +4237,7 @@ class Form $formconfirm.= ''; $formconfirm.= $this->selectyesno("confirm", $newselectedchoice); $formconfirm.= ''; - $formconfirm.= 'trans("Validate").'">'; + $formconfirm.= ''; $formconfirm.= ''."\n"; $formconfirm.= ''."\n"; From bf104f609afc098402c96fbe4e266d5f20333e65 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Sep 2019 01:44:36 +0200 Subject: [PATCH 451/982] NEW Add pagination on list of object of a category --- htdocs/categories/class/categorie.class.php | 23 ++- htdocs/categories/viewcat.php | 192 +++++++++++++++++--- 2 files changed, 181 insertions(+), 34 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b9a92f85d5e..60fb76293ea 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -746,13 +746,19 @@ class Categorie extends CommonObject /** * Return list of fetched instance of elements having this category * - * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') - * @param int $onlyids Return only ids of objects (consume less memory) - * @return array|int -1 if KO, array of instance of object if OK + * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') + * @param int $onlyids Return only ids of objects (consume less memory) + * @param int $limit Limit + * @param int $offset Offset + * @param string $sortfield Sort fields + * @param string $sortorder Sort order ('ASC' or 'DESC'); + * @return array|int -1 if KO, array of instance of object if OK * @see containsObject() */ - public function getObjectsInCateg($type, $onlyids = 0) + public function getObjectsInCateg($type, $onlyids = 0, $limit = 0, $offset = 0, $sortfield = '', $sortorder = 'ASC') { + global $user; + $objs = array(); $obj = new $this->MAP_OBJ_CLASS[$type]( $this->db ); @@ -761,8 +767,15 @@ class Categorie extends CommonObject $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as c"; $sql .= ", " . MAIN_DB_PREFIX . $this->MAP_OBJ_TABLE[$type] . " as o"; $sql .= " WHERE o.entity IN (" . getEntity($obj->element).")"; - $sql.= " AND c.fk_categorie = ".$this->id; + $sql .= " AND c.fk_categorie = ".$this->id; $sql .= " AND c.fk_" . $this->MAP_CAT_FK[$type] . " = o.rowid"; + // Protection for external users + if (($type == 'customer' || $type == 'supplier') && $user->societe_id > 0) + { + $sql.= " AND o.rowid = ".$user->societe_id; + } + if ($limit > 0 || $offset > 0) $sql .= $this->db->plimit($limit + 1, $offset); + $sql .= $this->db->order($sortfield, $sortorder); dol_syslog(get_class($this)."::getObjectsInCateg", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index a7a0767c6b5..67ef7905235 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -34,14 +34,33 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->load("categories"); -$id = GETPOST('id', 'int'); -$label= GETPOST('label', 'alpha'); -$type = GETPOST('type', 'az09'); -$action=GETPOST('action', 'aZ09'); -$confirm = GETPOST('confirm', 'alpha'); +$id = GETPOST('id', 'int'); +$label = GETPOST('label', 'alpha'); +$type = GETPOST('type', 'az09'); $removeelem = GETPOST('removeelem', 'int'); $elemid = GETPOST('elemid', 'int'); +$action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + + +// Load variable for pagination +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + if ($id == "" && $label == "") { dol_print_error('', 'Missing parameter id'); @@ -319,10 +338,20 @@ else } +// List of mass actions available +$arrayofmassactions = array( + //'validate'=>$langs->trans("Validate"), + //'generate_doc'=>$langs->trans("ReGeneratePDF"), + //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>$langs->trans("SendByMail"), +); +$massactionbutton=$form->selectMassAction('', $arrayofmassactions); + + // List of products or services (type is type of category) if ($type == Categorie::TYPE_PRODUCT) { - $prods = $object->getObjectsInCateg("product"); + $prods = $object->getObjectsInCateg("product", 0, $limit, $offset); if ($prods < 0) { dol_print_error($db, $prods->error, $prods->errors); @@ -351,14 +380,28 @@ if ($type == Categorie::TYPE_PRODUCT) print ''; } - print "
    "; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
    '; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = ''; $newcardbutton = ''; + print_barre_liste($langs->trans("ProductsAndServices"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); + print "\n"; - print ''."\n"; + print ''."\n"; if (count($prods) > 0) { + $i = 0; foreach ($prods as $prod) { + $i++; + if ($i > $limit) break; + print "\t".''."\n"; print ''; } print "
    '.$langs->trans("ProductsAndServices").' '.count($prods).'
    '.$langs->trans("Ref").'
    '; print $prod->getNomUrl(1); @@ -388,26 +431,42 @@ if ($type == Categorie::TYPE_PRODUCT) print '
    '.$langs->trans("ThisCategoryHasNoProduct").'
    \n"; + + print '
    '."\n"; } } if ($type == Categorie::TYPE_SUPPLIER) { - $socs = $object->getObjectsInCateg("supplier"); + $socs = $object->getObjectsInCateg("supplier", 0, $limit, $offset); if ($socs < 0) { dol_print_error($db, $socs->error, $socs->errors); } else { - print "
    "; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
    '; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = ''; + print_barre_liste($langs->trans("Suppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); + print ''."\n"; - print '\n"; + print '\n"; if (count($socs) > 0) { + $i = 0; foreach ($socs as $soc) { + $i++; + if ($i > $limit) break; + print "\t".''."\n"; print ''; } print "
    '.$langs->trans("Suppliers").' '.count($socs)."
    '.$langs->trans("Name")."
    '; print $soc->getNomUrl(1); @@ -437,30 +496,41 @@ if ($type == Categorie::TYPE_SUPPLIER) print '
    '.$langs->trans("ThisCategoryHasNoSupplier").'
    \n"; + + print '
    '."\n"; } } if($type == Categorie::TYPE_CUSTOMER) { - $socs = $object->getObjectsInCateg("customer"); + $socs = $object->getObjectsInCateg("customer", 0, $limit, $offset); if ($socs < 0) { dol_print_error($db, $socs->error, $socs->errors); } else { - print "
    "; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
    '; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = ''; + print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); + print ''."\n"; - print ''."\n"; + print ''."\n"; if (count($socs) > 0) { $i = 0; foreach ($socs as $key => $soc) { - if ($user->societe_id > 0 && $soc->id != $user->societe_id) continue; // External user always see only themself - $i++; + if ($i > $limit) break; print "\t".''."\n"; print ''; } print "
    '.$langs->trans("Customers").' '.count($socs).'
    '.$langs->trans("Name").'
    '; @@ -490,6 +560,8 @@ if($type == Categorie::TYPE_CUSTOMER) print '
    '.$langs->trans("ThisCategoryHasNoCustomer").'
    \n"; + + print '
    '."\n"; } } @@ -498,21 +570,35 @@ if ($type == Categorie::TYPE_MEMBER) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - $prods = $object->getObjectsInCateg("member"); + $prods = $object->getObjectsInCateg("member", 0, $limit, $offset); if ($prods < 0) { dol_print_error($db, $prods->error, $prods->errors); } else { - print "
    "; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
    '; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = ''; $newcardbutton = ''; + print_barre_liste($langs->trans("Member"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); + print "\n"; - print ''."\n"; + print ''."\n"; if (count($prods) > 0) { + $i = 0; foreach ($prods as $key => $member) { + $i++; + if ($i > $limit) break; + print "\t".''."\n"; print ''; } print "
    '.$langs->trans("Member").' '.count($prods).'
    '.$langs->trans("Name").'
    '; $member->ref=$member->login; @@ -543,22 +629,35 @@ if ($type == Categorie::TYPE_MEMBER) print '
    '.$langs->trans("ThisCategoryHasNoMember").'
    \n"; + + print '
    '."\n"; } } // Categorie contact if ($type == Categorie::TYPE_CONTACT) { - $contacts = $object->getObjectsInCateg("contact"); + $contacts = $object->getObjectsInCateg("contact", 0, $limit, $offset); if ($contacts < 0) { dol_print_error($db, $contacts->error, $contacts->errors); } else { - print "
    "; + + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
    '; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($contacts); $nbtotalofrecords = ''; $newcardbutton = ''; + print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); + print ''."\n"; - print ''."\n"; + print ''."\n"; if (count($contacts) > 0) { @@ -566,6 +665,7 @@ if ($type == Categorie::TYPE_CONTACT) foreach ($contacts as $key => $contact) { $i++; + if ($i > $limit) break; print "\t".''."\n"; print ''; } print "
    '.$langs->trans("Contact").' '.count($contacts).'
    '.$langs->trans("Ref").'
    '; @@ -595,6 +695,8 @@ if ($type == Categorie::TYPE_CONTACT) print '
    '.$langs->trans("ThisCategoryHasNoContact").'
    \n"; + + print '
    '."\n"; } } @@ -603,21 +705,35 @@ if ($type == Categorie::TYPE_ACCOUNT) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - $accounts = $object->getObjectsInCateg("account"); + $accounts = $object->getObjectsInCateg("account", 0, $limit, $offset); if ($accounts < 0) { dol_print_error($db, $accounts->error, $accounts->errors); } else { - print "
    "; - print "\n"; - print ''."\n"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
    '; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($accounts); $nbtotalofrecords = ''; $newcardbutton = ''; + print_barre_liste($langs->trans("Account"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); + + print "
    '.$langs->trans("Account").' '.count($accounts).'
    \n"; + print ''."\n"; if (count($accounts) > 0) { + $i = 0; foreach ($accounts as $key => $account) { + $i++; + if ($i > $limit) break; + print "\t".''."\n"; print ''; } print "
    '.$langs->trans("Ref").'
    '; print $account->getNomUrl(1, 0); @@ -647,6 +763,8 @@ if ($type == Categorie::TYPE_ACCOUNT) print '
    '.$langs->trans("ThisCategoryHasNoAccount").'
    \n"; + + print ''."\n"; } } @@ -655,21 +773,35 @@ if ($type == Categorie::TYPE_PROJECT) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - $projects = $object->getObjectsInCateg("project"); + $projects = $object->getObjectsInCateg("project", 0, $limit, $offset); if ($projects < 0) { dol_print_error($db, $object->error, $object->errors); } else { - print "
    "; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
    '; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($projects); $nbtotalofrecords = ''; $newcardbutton = ''; + print_barre_liste($langs->trans("Project"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); + print "\n"; - print ''."\n"; + print ''."\n"; if (count($projects) > 0) { + $i = 0; foreach ($projects as $key => $project) { + $i++; + if ($i > $limit) break; + print "\t".''."\n"; print ''; } print "
    '.$langs->trans("Project").' '.count($projects).'
    '.$langs->trans("Ref").'
    '; print $project->getNomUrl(1); @@ -699,6 +831,8 @@ if ($type == Categorie::TYPE_PROJECT) print '
    '.$langs->trans("ThisCategoryHasNoProject").'
    \n"; + + print '
    '."\n"; } } From 48419da7698617d50b69ebcdd56510f5850be975 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 10 Sep 2019 14:58:55 +0200 Subject: [PATCH 452/982] FIX new invoice with generic thirdparty in takepos by default, new invoice should always create with default thirdparty and avoid errors : creating new invoice with last customer and forget to change it... --- htdocs/takepos/invoice.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6ae5429d062..accc4befe82 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -280,8 +280,10 @@ if ($action == "delete") { $resql1 = $db->query($sql); $sql = "DELETE FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture = ".$placeid; $resql2 = $db->query($sql); + $sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}." where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $resql3 = $db->query($sql); - if ($resql1 && $resql2) + if ($resql1 && $resql2 && $resql3) { $db->commit(); } From d4e26fcc5517404159e0e11084583765e8b2c631 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Sep 2019 15:29:33 +0200 Subject: [PATCH 453/982] FIX missing include (dol_convert_file not found) --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dfc46eccddb..8d301275b5e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1436,6 +1436,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r { if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here. { + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $ret = dol_convert_file($file, 'png', $fileimage); if ($ret < 0) $error++; } From eb2f48332b0781594754f2c81278ab6226439aaa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Sep 2019 15:58:56 +0200 Subject: [PATCH 454/982] Show first line of code --- htdocs/core/lib/website.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 60016b2f2e9..b65dd813bfd 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -55,7 +55,7 @@ function dolStripPhpCode($str, $replacewith = '') //remove content before closing tag if (count($partlings) > 1) $partlings[0] = ''; // Todo why a count > 1 and not >= 1 ? //append to out string - $newstr .= ''.$replacewith.''.implode('', $partlings); + $newstr .= ''.$replacewith.''.implode('', $partlings); } } } From 95417d4c86129b1a55283d097ebece7857b87265 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 10 Sep 2019 16:24:04 +0200 Subject: [PATCH 455/982] allow standalone credit note even if no invoice --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d81467d64e4..3d363b60bb2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3047,7 +3047,7 @@ if ($action == 'create') { print '
    '; $tmp='global->INVOICE_CREDIT_NOTE_STANDALONE) ) $tmp.=' disabled'; $tmp.= '> '; // Show credit note options only if we checked credit note print ''."\n"; print ''."\n"; print ''."\n"; } @@ -2066,8 +2073,8 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ $bugbaseurl.= urlencode("## [Attached files](https://help.github.com/articles/issue-attachments) (Screenshots, screencasts, dolibarr.log, debugging informations…)\n"); $bugbaseurl.= urlencode("[*Files*]\n"); $bugbaseurl.= urlencode("\n"); - - + + // Execute hook printBugtrackInfo $parameters=array('bugbaseurl'=>$bugbaseurl); $reshook=$hookmanager->executeHooks('printBugtrackInfo', $parameters); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 47e3188f5ff..5d4c259bf9c 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2290,7 +2290,8 @@ if (! GETPOST('hide_websitemenu')) print '
    '; print '
    '; - print ''; + print ''."\n"; + print ''."\n"; print ''."\n"; - $urllogofull = 'http://home.destailleur.fr:805/dolibarr_dev/htdocs/viewimage.php?modulepart=mycompany&entity=1&file=logos%2Fthumbs%2Ffbm+logo_small.png'; print ''."\n"; // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code. From 8e836155338a47e6831760724e9d33141627b8dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 18:52:35 +0200 Subject: [PATCH 507/982] Add method getSetupIntent --- htdocs/stripe/class/stripe.class.php | 148 ++++++++++++++++++++++++++- 1 file changed, 146 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 9defab81a73..9c0bc9ebae3 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -293,7 +293,7 @@ class Stripe extends CommonObject } /** - * Get the Stripe payment intent. Create it with confirm=false + * Get the Stripe payment intent. Create it with confirmnow=false * Warning. If a payment was tried and failed, a payment intent was created. * But if we change something on object to pay (amount or other), reusing same payment intent is not allowed. * Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay), @@ -312,7 +312,7 @@ class Stripe extends CommonObject * @param int $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt * @param int $mode automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent * @param boolean $confirmnow false=default, true=try to confirm immediatly after create (if conditions are ok) - * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found + * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found and failed to create */ public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false) { @@ -503,6 +503,149 @@ class Stripe extends CommonObject } } + + /** + * Get the Stripe payment intent. Create it with confirmnow=false + * Warning. If a payment was tried and failed, a payment intent was created. + * But if we change something on object to pay (amount or other), reusing same payment intent is not allowed. + * Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay), + * that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old ones that will not be used) + * Note: This is used when option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on when making a payment from the public/payment/newpayment.php page + * but not when using the STRIPE_USE_NEW_CHECKOUT. + * + * @param string $description Description + * @param Societe $object Object to pay with Stripe + * @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() + * @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect + * @param int $status Status (0=test, 1=live) + * @param int $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt + * @param boolean $confirmnow false=default, true=try to confirm immediatly after create (if conditions are ok) + * @return \Stripe\SetupIntent|null Stripe SetupIntent or null if not found and failed to create + */ + public function getSetupIntent($description, $object, $customer, $key, $status, $usethirdpartyemailforreceiptemail = 0, $confirmnow = false) + { + global $conf; + + dol_syslog("getSetupIntent", LOG_INFO, 1); + + $error = 0; + + if (empty($status)) $service = 'StripeTest'; + else $service = 'StripeLive'; + + $setupintent = null; + + if (empty($setupintent)) + { + $ipaddress=getUserRemoteIP(); + $metadata = array('dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress); + if (is_object($object)) + { + $metadata['dol_type'] = $object->element; + $metadata['dol_id'] = $object->id; + if (is_object($object->thirdparty) && $object->thirdparty->id > 0) $metadata['dol_thirdparty_id'] = $object->thirdparty->id; + } + + $dataforintent = array( + "confirm" => $confirmnow, // Do not confirm immediatly during creation of intent + "payment_method_types" => array("card"), + "description" => $description, + "usage" => "off_session", + "metadata" => $metadata + ); + if (! is_null($customer)) $dataforintent["customer"]=$customer; + // payment_method = + // payment_method_types = array('card') + //var_dump($dataforintent); + + if ($usethirdpartyemailforreceiptemail && is_object($object) && $object->thirdparty->email) + { + $dataforintent["receipt_email"] = $object->thirdparty->email; + } + + try { + // Force to use the correct API key + global $stripearrayofkeysbyenv; + \Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$status]['secret_key']); + + // Note: If all data for payment intent are same than a previous on, even if we use 'create', Stripe will return ID of the old existing payment intent. + if (empty($key)) { // If the Stripe connect account not set, we use common API usage + //$setupintent = \Stripe\SetupIntent::create($dataforintent, array("idempotency_key" => "$description")); + $setupintent = \Stripe\SetupIntent::create($dataforintent, array()); + } else { + //$setupintent = \Stripe\SetupIntent::create($dataforintent, array("idempotency_key" => "$description", "stripe_account" => $key)); + $setupintent = \Stripe\SetupIntent::create($dataforintent, array("stripe_account" => $key)); + } + //var_dump($setupintent->id); + + // Store the setup intent + /*if (is_object($object)) + { + $setupintentalreadyexists = 0; + // Check that payment intent $setupintent->id is not already recorded. + $sql = "SELECT pi.rowid"; + $sql.= " FROM " . MAIN_DB_PREFIX . "prelevement_facture_demande as pi"; + $sql.= " WHERE pi.entity IN (".getEntity('societe').")"; + $sql.= " AND pi.ext_payment_site = '" . $service . "'"; + $sql.= " AND pi.ext_payment_id = '".$this->db->escape($setupintent->id)."'"; + + dol_syslog(get_class($this) . "::getPaymentIntent search if payment intent already in prelevement_facture_demande", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + if ($num) + { + $obj = $this->db->fetch_object($resql); + if ($obj) $setupintentalreadyexists++; + } + } + else dol_print_error($this->db); + + // If not, we create it. + if (! $setupintentalreadyexists) + { + $now=dol_now(); + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)"; + $sql .= " VALUES ('".$this->db->idate($now)."', '0', '".$this->db->escape($setupintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', " . $conf->entity . ", '" . $service . "')"; + $resql = $this->db->query($sql); + if (! $resql) + { + $error++; + $this->error = $this->db->lasterror(); + dol_syslog(get_class($this) . "::PaymentIntent failed to insert paymentintent with id=".$setupintent->id." into database."); + } + } + } + else + { + $_SESSION["stripe_setup_intent"] = $setupintent; + }*/ + } + catch(Exception $e) + { + /*var_dump($dataforintent); + var_dump($description); + var_dump($key); + var_dump($setupintent); + var_dump($e->getMessage());*/ + $error++; + $this->error = $e->getMessage(); + } + } + + dol_syslog("getSetupIntent return error=".$error, LOG_INFO, -1); + + if (! $error) + { + return $setupintent; + } + else + { + return null; + } + } + + /** * Get the Stripe card of a company payment mode (with option to create it on Stripe if not linked yet) * @@ -609,6 +752,7 @@ class Stripe extends CommonObject /** * Create charge with public/payment/newpayment.php, stripe/card.php, cronjobs or REST API + * This is using old Stripe API charge. * * @param int $amount Amount to pay * @param string $currency EUR, GPB... From aad6b003fb13ff1fd708450276d858b8bccecdff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 00:02:48 +0200 Subject: [PATCH 508/982] Add cache in fetch_optionnals() to avoid duplicate call to fetch_name_optionals_label --- htdocs/core/class/commonobject.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ebfe7f1abee..26102b9b42a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4517,7 +4517,7 @@ abstract class CommonObject $parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams); $reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - + if(empty($reshook)) { dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null')); @@ -4902,13 +4902,12 @@ abstract class CommonObject if (! is_array($optionsArray)) { // If $extrafields is not a known object, we initialize it. Best practice is to have $extrafields defined into card.php or list.php page. - // TODO Use of existing $extrafield is not yet ready (must mutualize code that use extrafields in form first) - // global $extrafields; - //if (! is_object($extrafields)) - //{ + global $extrafields; + if (! isset($extrafields) || ! is_object($extrafields)) + { require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - //} + } // Load array of extrafields for elementype = $this->table_element if (empty($extrafields->attributes[$this->table_element]['loaded'])) From 4420af683d206ae06a1956f4ada932efcbec39e2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 14 Sep 2019 05:44:28 +0200 Subject: [PATCH 509/982] Fix Bank entries - nowrap on amount --- htdocs/compta/bank/bankentries_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 5609bb6b598..0a63e70d992 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1356,7 +1356,7 @@ if ($resql) // Debit if (! empty($arrayfields['b.debit']['checked'])) { - print ''; + print ''; if ($objp->amount < 0) { print price($objp->amount * -1); @@ -1370,7 +1370,7 @@ if ($resql) // Credit if (! empty($arrayfields['b.credit']['checked'])) { - print ''; + print ''; if ($objp->amount > 0) { print price($objp->amount); From 08f056a0f44d3427494a666b193eeabe710a1b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 14 Sep 2019 09:09:41 +0200 Subject: [PATCH 510/982] Delete interface_50_modIFTTT_IFTTT.class.php IFTTT has been removed --- .../interface_50_modIFTTT_IFTTT.class.php | 147 ------------------ 1 file changed, 147 deletions(-) delete mode 100644 htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php diff --git a/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php b/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php deleted file mode 100644 index c7ce8f121fc..00000000000 --- a/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php +++ /dev/null @@ -1,147 +0,0 @@ - - * 2016 Christophe Battarel - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php - * \ingroup core - * \brief File of trigger for IFTTT module - */ -require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; - - -/** - * Class of triggers for IFTTT module - */ -class InterfaceIFTTT extends DolibarrTriggers -{ - /** - * @var DoliDB Database handler. - */ - public $db; - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct($db) - { - $this->db = $db; - - $this->name = preg_replace('/^Interface/i', '', get_class($this)); - $this->family = "ifttt"; - $this->description = "Triggers of the module IFTTT"; - $this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version - $this->picto = 'ifttt'; - } - - /** - * Return name of trigger file - * - * @return string Name of trigger file - */ - public function getName() - { - return $this->name; - } - - /** - * Return description of trigger file - * - * @return string Description of trigger file - */ - public function getDesc() - { - return $this->description; - } - - /** - * Return version of trigger file - * - * @return string Version of trigger file - */ - public function getVersion() - { - global $langs; - $langs->load("admin"); - - if ($this->version == 'development') { - return $langs->trans("Development"); - } elseif ($this->version == 'experimental') { - return $langs->trans("Experimental"); - } elseif ($this->version == 'dolibarr') { - return DOL_VERSION; - } elseif ($this->version) { - return $this->version; - } else { - return $langs->trans("Unknown"); - } - } - - /** - * Function called when a Dolibarrr business event is done. - * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers - * - * @param string $action Event action code - * @param Object $object Object - * @param User $user Object user - * @param Translate $langs Object langs - * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK - */ - public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) - { - $ok = 0; - - if (empty($conf->ifttt->enabled)) return 0; // Module not active, we do nothing - - switch ($action) { - case 'THIRDPARTY_CREATED': - dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); - - include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - - // See https://platform.ifttt.com/docs/api_reference#realtime-api - - $arrayofdata=array(); - $arrayofdata['user_id']=$conf->global->IFTTT_USER_ID; - $arrayofdata['trigger_identity']=$conf->global->IFTTT_TRIGGER_IDENTITY; - $arrayofdata['name']='testabcdef'; - $arrayofdata['email']='testemailabcdef'; - - $url = 'https://realtime.ifttt.com/v1/notifications'; - - $addheaders=array( - 'IFTTT-Service-Key'=>'123', - 'Accept'=>'application/json', - 'Accept-Charset'=>'utf-8', - 'Accept-Encoding'=>'gzip, deflate', - 'Content-Type'=>'application/json', - 'X-Request-ID'=>getRandomPassword(true, null) - ); - - $result = getURLContent($url, 'POSTALREADYFORMATED', '', 1, $addheaders); - - $ok = 1; - break; - } - - return $ok; - } -} From 76f478dc4417c4d97e2c9c7b054fcfa494aa413c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 14:25:47 +0200 Subject: [PATCH 511/982] Fix look and feel --- htdocs/societe/paymentmodes.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 3731cfe07fa..90d90b388ac 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -600,7 +600,7 @@ if (empty($reshook)) $db->rollback(); } } - + if ($action == 'setkey_account_supplier') { $error = 0; @@ -819,7 +819,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print '
    '; print '
    '; - print ''; + print '
    '; if ($object->client) { @@ -872,7 +872,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; } } - + if ($object->fournisseur) { print ''; print ''; print ''; - + if (is_array($balance->available) && count($balance->available)) { foreach ($balance->available as $cpt) @@ -1322,7 +1322,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; } } - + if (is_array($balance->pending) && count($balance->pending)) { foreach ($balance->pending as $cpt) @@ -1598,7 +1598,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' // Edit BAN if ($socid && $action == 'edit' && $user->rights->societe->creer) { - dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; @@ -1705,7 +1705,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) // Edit Card if ($socid && $action == 'editcard' && $user->rights->societe->creer) { - dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; @@ -1753,7 +1753,7 @@ if ($socid && $action == 'editcard' && $user->rights->societe->creer) // Create BAN if ($socid && $action == 'create' && $user->rights->societe->creer) { - dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; @@ -1854,7 +1854,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) // Create Card if ($socid && $action == 'createcard' && $user->rights->societe->creer) { - dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; From 7965804a34edf52bc8673a1b1975e1fc9d794f43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:35:00 +0200 Subject: [PATCH 512/982] Update ldap_groups.php --- htdocs/admin/ldap_groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 6dcc26a23e0..6412d2f6a59 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -58,7 +58,7 @@ if ($action == 'setvalue' && $user->admin) //if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS', GETPOST("fieldgroupmembers"), 'chaine', 0, '', $conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_GROUPID', GETPOST("fieldgroupid"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPID', GETPOST("fieldgroupid"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; From 9934f73574d32d8b51825a2407c674112f6e13a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:36:04 +0200 Subject: [PATCH 513/982] Update ldap_groups.php --- htdocs/admin/ldap_groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 6412d2f6a59..8ae918ce180 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -173,7 +173,7 @@ print ''; // Group id print ''; print ''; print ''; From d380ef1812535ea1adc2fdc571bf61a8d1d10e54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:37:07 +0200 Subject: [PATCH 514/982] Update usergroup.class.php --- htdocs/user/class/usergroup.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 03c514f79f3..a89126b122f 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -980,8 +980,8 @@ class UserGroup extends CommonObject } $info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:''); } - if(!empty($info[$conf->global->LDAP_FIELD_GROUPID])){ - $info[$conf->global->LDAP_FIELD_GROUPID]=$this->id; + if(!empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID])){ + $info[$conf->global->LDAP_GROUP_FIELD_GROUPID]=$this->id; } return $info; } From c015bbda14b79b0046d3ddeef356c66e4aa70daa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:39:08 +0200 Subject: [PATCH 515/982] Update ldap.class.php --- htdocs/core/class/ldap.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 266b41867e8..267949e2149 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -609,7 +609,7 @@ class Ldap } if ($result <= 0) { - $this->error = ldap_errno($this->connection)." ".$this->error; + $this->error = ldap_error($this->connection).' (Code '.ldap_errno($this->connection).") ".$this->error; dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); //print_r($info); return -1; From 54f0532073a3f72ef06ea7311a4bbabf4cf4a368 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:51:57 +0200 Subject: [PATCH 516/982] Work on #4432 --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 1 + htdocs/install/mysql/tables/llx_extrafields.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index cc375e72714..92dcdce1128 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -43,6 +43,7 @@ create table llx_entrepot_extrafields ALTER TABLE llx_entrepot_extrafields ADD INDEX idx_entrepot_extrafields (fk_object); +ALTER TABLE llx_extrafields ADD COLUMN printable boolean DEFAULT FALSE; ALTER TABLE llx_facture ADD COLUMN retained_warranty real DEFAULT NULL after situation_final; ALTER TABLE llx_facture ADD COLUMN retained_warranty_date_limit date DEFAULT NULL after retained_warranty; diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql index e7ec325d428..49480479a79 100644 --- a/htdocs/install/mysql/tables/llx_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_extrafields.sql @@ -36,6 +36,7 @@ create table llx_extrafields alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status param text, -- extra parameters to define possible values of field list varchar(255) DEFAULT '1', -- visibility of field. 0=Never visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing + printable boolean DEFAULT FALSE, -- is the extrafield output on documents totalizable boolean DEFAULT FALSE, -- is extrafield totalizable on list langs varchar(64), -- example: fileofmymodule@mymodule help text, -- to store help tooltip From 844f0903da2f769ab240806381649eeac5b595df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 17:34:57 +0200 Subject: [PATCH 517/982] Fix missing fields --- htdocs/fourn/commande/list.php | 4 +++- htdocs/modulebuilder/template/myobject_list.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 18ba697bc20..db427c24c43 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1090,7 +1090,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1155,6 +1155,8 @@ if ($resql) elseif ($totalarray['totalttcfield'] == $i) print ''; else print ''; } + + print ''; } diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 497f46919fd..a2bd9d39fe7 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -514,7 +514,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column From 3caa1bd43c88f180c432e8753f5693bde52381d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 18:21:37 +0200 Subject: [PATCH 518/982] FIX Debug feature orderstoinvoice for suppliers --- htdocs/fourn/card.php | 9 +-- htdocs/fourn/commande/card.php | 13 +++- htdocs/fourn/commande/orderstoinvoice.php | 76 +++++++++++++---------- htdocs/langs/en_US/orders.lang | 1 + 4 files changed, 60 insertions(+), 39 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index c65c1fde57f..90240e4cd2b 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -605,8 +605,9 @@ if ($object->id > 0) $sql2.= ' WHERE c.fk_soc = s.rowid'; $sql2.= " AND c.entity IN (".getEntity('commande_fournisseur').")"; $sql2.= ' AND s.rowid = '.$object->id; - // Show orders with status validated, shipping started and delivered (well any order we can bill) - $sql2.= " AND c.fk_statut IN (5)"; + // Show orders with status validated, shipping started and delivered (even if any order we can bill) + //$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.", ".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; + $sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; $sql2.= " AND c.billed = 0"; // Find order that are not already invoiced // just need to check received status because we have the billed status now @@ -826,7 +827,7 @@ if ($object->id > 0) { if (! empty($orders2invoice) && $orders2invoice > 0) { - if ($object->status == 1) + if ($object->status == 1) // Company is open { print ''; } @@ -835,7 +836,7 @@ if ($object->id > 0) print ''; } } - else print ''; + else print ''; } // Add action diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 1f6baa158da..829b82a6903 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2494,11 +2494,18 @@ elseif (! empty($object->id)) { print ''.$langs->trans("ClassifyBilled").''; } - elseif (!empty($object->linkedObjectsIds['invoice_supplier'])) + else { - if ($user->rights->fournisseur->facture->creer) + if (!empty($object->linkedObjectsIds['invoice_supplier'])) { - print ''.$langs->trans("ClassifyBilled").''; + if ($user->rights->fournisseur->facture->creer) + { + print ''.$langs->trans("ClassifyBilled").''; + } + } + else + { + print ''.$langs->trans("ClassifyBilled").''; } } } diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 093e0fd331b..75a78087366 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -73,18 +73,27 @@ $date_endy = dol_mktime(23, 59, 59, $_REQUEST["date_end_delymonth"], $_REQUEST[" $extrafields = new ExtraFields($db); + // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label('facture_fourn'); if ($action == 'create') { - if (! is_array($selected)) + if (! GETPOST('createbill')) { - $error++; - setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors'); - } else { - $origin = GETPOST('origin'); - $originid = GETPOST('originid'); + $action = ''; + } + else + { + if (! is_array($selected)) + { + //$error++; + setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors'); + $action = ''; + } else { + $origin = GETPOST('origin', 'alpha'); + $originid = GETPOST('originid', 'int'); + } } } @@ -286,7 +295,6 @@ if (($action == 'create' || $action == 'add') && ! $error) { $html = new Form($db); $htmlother = new FormOther($db); $formfile = new FormFile($db); -$companystatic = new Societe($db); // Mode creation if ($action == 'create' && !$error) { @@ -324,6 +332,8 @@ if ($action == 'create' && !$error) { print ''; print ''; print ''; + print ''; + print '
    '; @@ -891,12 +891,12 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->transnoentitiesnoconv('Invoices'); if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementTypeArray['contract']=$langs->transnoentitiesnoconv('Contracts'); } - + if (! empty($conf->stripe->enabled) && ! empty($conf->stripeconnect->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { $permissiontowrite = $user->rights->societe->creer; $stripesupplieracc = $stripe->getStripeAccount($service, $object->id); // Get Stripe OAuth connect account (no network access here) - + // Stripe customer key 'cu_....' stored into llx_societe_account print '
    '; print $form->editfieldkey("StripeConnectAccount", 'key_account_supplier', $stripesupplieracc, $object, $permissiontowrite, 'string', '', 0, 2, 'socid'); @@ -905,7 +905,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (! empty($conf->stripe->enabled) && $stripesupplieracc && $action != 'editkey_account_supplier') { $connect=''; - + $url='https://dashboard.stripe.com/test/connect/accounts/'.$stripesupplieracc; if ($servicestatus) { @@ -1299,7 +1299,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ""; print '
    '; } - + // List of Stripe payment modes if (! empty($conf->stripe->enabled) && ! empty($conf->stripeconnect->enabled) && $object->fournisseur && ! empty($stripesupplieracc)) { @@ -1311,7 +1311,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print '
    '.$langs->trans('Amount').''.$langs->trans('Currency').'
    '.$langs->trans("Available").''.price($amount, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).' '.$langs->trans("Currency".strtoupper($cpt->currency)).'
    '.$langs->trans("LDAPFieldGroupid").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldGroupidExample").' 
    '.price($totalarray['totalttc']).'
    '; // Ref @@ -333,13 +343,6 @@ if ($action == 'create' && !$error) { print ''; print ''; - // Third party - print ''; - print '' . "\n"; - // Date invoice print ''; - print ''; - print ''; + print ''; + // Private note if (empty($user->societe_id)) { print ''; - print ''; - print ''; + print ''; @@ -406,10 +410,10 @@ if ($action == 'create' && !$error) { print '
    ' . $langs->trans('RefSupplier') . '
    ' . $langs->trans('Customer') . ''; - print $soc->getNomUrl(1); - print ''; - print '
    ' . $langs->trans('Date') . ''; print $html->selectDate('', '', '', '', '', "add", 1, 1); @@ -387,18 +390,19 @@ if ($action == 'create' && !$error) { // Public note print '
    ' . $langs->trans('NotePublic') . ''; + print '' . $langs->trans('NotePublic') . ''; print '
    ' . $langs->trans('NotePrivate') . ''; + print '' . $langs->trans('NotePrivate') . ''; print '
    '; - while ( $i < $n ) { + while ($i < $n) { print ''; - $i ++; + $i++; } // Button "Create Draft" @@ -465,10 +469,16 @@ if (($action != 'create' && $action != 'add') && !$error) { } // Date filter - if ($date_start && $date_end) - $sql .= " AND c.date_commande >= '" . $db->idate($date_start) . "' AND c.date_commande <= '" . $db->idate($date_end) . "'"; - if ($date_starty && $date_endy) - $sql .= " AND c.date_livraison >= '" . $db->idate($date_starty) . "' AND c.date_livraison <= '" . $db->idate($date_endy) . "'"; + //$sql.= dolSqlDateFilter("c.date_commande", GETPOST("date_startday", 'int'), GETPOST("date_startmonth", 'int'), GETPOST("date_startyear", 'int')); + //$sql.= dolSqlDateFilter("c.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear); + if ($date_start) + $sql .= " AND c.date_commande >= '" . $db->idate($date_start) . "'"; + if ($date_end) + $sql .= " AND c.date_commande <= '" . $db->idate($date_end) . "'"; + if ($date_starty) + $sql .= " AND c.date_livraison >= '" . $db->idate($date_starty) . "'"; + if ($date_endy) + $sql .= " AND c.date_livraison <= '" . $db->idate($date_endy) . "'"; if (! empty($sref_client)) { $sql .= natural_search('c.ref_supplier', $sref_client); @@ -484,21 +494,21 @@ if (($action != 'create' && $action != 'add') && !$error) { } $title = $langs->trans('ListOfSupplierOrders'); $title .= ' - ' . $langs->trans('StatusOrderReceivedAllShort'); + $title .= ' - ' . $soc->getNomUrl(1, 'supplier'); + $num = $db->num_rows($resql); + print load_fiche_titre($title); + $i = 0; $period = $html->selectDate($date_start, 'date_start', 0, 0, 1, '', 1, 0) . ' - ' . $html->selectDate($date_end, 'date_end', 0, 0, 1, '', 1, 0); $periodely = $html->selectDate($date_starty, 'date_start_dely', 0, 0, 1, '', 1, 0) . ' - ' . $html->selectDate($date_endy, 'date_end_dely', 0, 0, 1, '', 1, 0); - if (! empty($socid)) { - // Company - $companystatic->id = $socid; - $companystatic->nom = $soc->nom; - print '

    ' . $companystatic->getNomUrl(1, 'customer') . '

    '; - } - print '
    '; + print ''; print ''; + + print ''; print ''; print_liste_field_titre('Ref', 'orderstoinvoice.php', 'c.ref', '', '&socid=' . $socid, '', $sortfield, $sortorder); @@ -511,10 +521,12 @@ if (($action != 'create' && $action != 'add') && !$error) { // Lignes des champs de filtre print ''; + print ''; + // print '
    '; // REF print ''; print ''; print ''; print ''; @@ -604,7 +616,7 @@ if (($action != 'create' && $action != 'add') && !$error) { print ''; print '
    '; // print ''.$langs->trans("GoBack").''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index c170e4c1248..66de42094a6 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -156,3 +156,4 @@ OptionToSetOrderBilledNotEnabled=Option from module Workflow, to set order to 'B IfValidateInvoiceIsNoOrderStayUnbilled=If invoice validation is 'No', the order will remain to status 'Unbilled' until the invoice is validated. CloseReceivedSupplierOrdersAutomatically=Close order to status "%s" automatically if all products are received. SetShippingMode=Set shipping mode +WithReceptionFinished=With reception finished \ No newline at end of file From f45abc1b2af6ec4abc8c63b2951bc68a22f58672 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 18:26:38 +0200 Subject: [PATCH 519/982] Removed useless header --- htdocs/accountancy/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 6982475b53a..0bede00d86d 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -51,7 +51,7 @@ $hookmanager->initHooks(array('accountancyindex')); llxHeader('', $langs->trans("AccountancyArea")); print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy'); -dol_fiche_head(); +//dol_fiche_head(); $step = 0; @@ -177,7 +177,7 @@ else { print $langs->trans("Module10Desc")."
    \n"; } -dol_fiche_end(); +//dol_fiche_end(); // End of page llxFooter(); From e0238705cc89222c1ecce9b8319f09c1b21f1f91 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 14 Sep 2019 19:04:43 +0200 Subject: [PATCH 520/982] Check if childtablesoncascade is not empty --- htdocs/core/class/commonobject.class.php | 26 +++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d20a8d2785b..f08be052e96 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7536,18 +7536,20 @@ abstract class CommonObject } // Delete cascade first - foreach($this->childtablesoncascade as $table) - { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id; - $resql = $this->db->query($sql); - if (! $resql) - { - $this->error=$this->db->lasterror(); - $this->errors[]=$this->error; - $this->db->rollback(); - return -1; - } - } + if (! empty($this->childtablesoncascade)) { + foreach($this->childtablesoncascade as $table) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id; + $resql = $this->db->query($sql); + if (! $resql) + { + $this->error=$this->db->lasterror(); + $this->errors[]=$this->error; + $this->db->rollback(); + return -1; + } + } + } if (! $error) { if (! $notrigger) { From bbb62f27c72271f71e7eb89bae2a52101b3ebf4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 19:25:09 +0200 Subject: [PATCH 521/982] Update doc --- htdocs/fourn/card.php | 4 ++-- htdocs/fourn/commande/orderstoinvoice.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 90240e4cd2b..5ebe8ffed56 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -605,9 +605,9 @@ if ($object->id > 0) $sql2.= ' WHERE c.fk_soc = s.rowid'; $sql2.= " AND c.entity IN (".getEntity('commande_fournisseur').")"; $sql2.= ' AND s.rowid = '.$object->id; - // Show orders with status validated, shipping started and delivered (even if any order we can bill) + // Show orders with status validated, shipping started and delivered (even if any order we can bill). //$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.", ".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; - $sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; + $sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/orderstoinvoice.php $sql2.= " AND c.billed = 0"; // Find order that are not already invoiced // just need to check received status because we have the billed status now diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 75a78087366..39f33bebb73 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -450,7 +450,7 @@ if (($action != 'create' && $action != 'add') && !$error) { $sql .= ' AND c.fk_soc = s.rowid'; // Show orders with status validated, shipping started and delivered (well any order we can bill) - $sql .= " AND c.fk_statut IN (5)"; + $sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/card.php $sql .= " AND c.billed = 0"; // Find order that are not already invoiced From 21e27389d411b3fc9ba3556282ca25f095038c9b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 14 Sep 2019 20:58:12 +0200 Subject: [PATCH 522/982] NEW Bank Add an option for colorize background color of debit or credit movement --- htdocs/admin/agenda_extsites.php | 2 +- htdocs/admin/bank.php | 120 +++++++++++++++++++++++- htdocs/compta/bank/bankentries_list.php | 24 ++++- htdocs/langs/en_US/banks.lang | 4 + 4 files changed, 143 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 6979c49aabc..b59c311eb2f 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -44,7 +44,7 @@ $actionsave=GETPOST('save', 'alpha'); if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=$conf->global->AGENDA_EXT_NB; -// List of aviable colors +// List of available colors $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5'); diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 2a0a66fe269..44cdd5e611b 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -1,5 +1,4 @@ * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand @@ -28,6 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; @@ -38,6 +38,7 @@ if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'alpha'); +$actionsave=GETPOST('save', 'alpha'); $value = GETPOST('value', 'alpha'); $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); @@ -60,7 +61,7 @@ if ($action == 'setbankorder') { } } -//Auto report last num releve on conciliate +// Auto report last num releve on conciliate if ($action == 'setreportlastnumreleve') { if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, '', $conf->entity) > 0) { @@ -82,6 +83,58 @@ elseif ($action == 'unsetreportlastnumreleve') { } } +// Colorize movements +if ($action == 'setbankcolorizemovement') { + if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 1, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: " . $_SERVER["PHP_SELF"]); + exit; + } + else { + dol_print_error($db); + } +} +elseif ($action == 'unsetbankcolorizemovement') { + if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 0, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: " . $_SERVER["PHP_SELF"]); + exit; + } + else { + dol_print_error($db); + } +} + +if ($actionsave) +{ + $db->begin(); + + $i=1; $errorsaved=0; + $error=0; + + // Save colors + while ($i <= 2) + { + $color=trim(GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha')); + if ($color=='-1') $color=''; + + $res=dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + $i++; + } + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + if ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -157,10 +210,11 @@ elseif ($action == 'setdoc') { /* - * view + * View */ $form = new Form($db); +$formother=new FormOther($db); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -169,6 +223,10 @@ llxHeader("", $langs->trans("BankSetupModule")); $linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); +print ''; +print ''; +print ''; + $head = bank_admin_prepare_head(null); dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account'); @@ -372,7 +430,56 @@ foreach ($dirmodels as $reldir) { print '
    '; //} +print '

    '; +print load_fiche_titre($langs->trans("BankColorizeMovement"), '', ''); +print ''; +print "\n"; +print ''; +print ''."\n"; +print "\n"; + +print '"; +// Active +if ($conf->global->BANK_COLORIZE_MOVEMENT) { + print ''; +} +else +{ + print '"; +} + +print "\n"; + +if(! empty($conf->global->BANK_COLORIZE_MOVEMENT)) +{ + $i=1; + while ($i <= 2) + { + $key=$i; + $color='BANK_COLORIZE_MOVEMENT_COLOR'.$key; + + print ''; + + // Label + print '"; + // Color + print ''; + print ""; + $i++; + } +} +print '
    ' . $langs->trans("Name") . ''.$langs->trans("Value").'
    '; +print $langs->trans('BankColorizeMovementDesc'); +print "' . "\n"; + print ''; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; + print '' . "\n"; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; + print "
    '.$langs->trans("BankColorizeMovementName".$key)."'; + print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key)?GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key):$conf->global->$color), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, '', 'right hideifnotset'); + print '
    '; print '

    '; @@ -384,7 +491,6 @@ print '

    '; //{ print load_fiche_titre($langs->trans("Other"), '', ''); - print "\n"; print "\n"; print ''; @@ -416,6 +522,12 @@ print "\n"; print '
    ' . $langs->trans("Name") . '
    '; dol_fiche_end(); +print '
    '; +print ''; +print '
    '; + +print "
    \n"; + // End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index a8002c179be..3522d8b6c9d 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017-2019 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Frédéric France * @@ -1110,7 +1110,27 @@ if ($resql) $bankaccount = $cachebankaccount[$objp->bankid]; } - print ''; + if (empty($conf->global->BANK_COLORIZE_MOVEMENT)) { + $backgroundcolor = "class='oddeven'"; + } else { + if ($objp->amount < 0) + { + if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR1)) { + $color = '#fca955'; + } else { + $color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR1; + } + $backgroundcolor = 'style="background-color: ' . $color . ';"'; + } else { + if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) { + $color = '#7fdb86'; + } else { + $color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR2; + } + $backgroundcolor = 'style="background-color: ' . $color . ';"'; + } + } + print ''; // Ref if (! empty($arrayfields['b.rowid']['checked'])) diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 47295ec7e31..44f80c7c3b7 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -169,3 +169,7 @@ FindYourSEPAMandate=This is your SEPA mandate to authorize our company to make d AutoReportLastAccountStatement=Automatically fill the field 'number of bank statement' with last statement number when making reconciliation CashControl=POS cash fence NewCashFence=New cash fence +BankColorizeMovement=Colorize movements +BankColorizeMovementDesc=If this function is enable, you can choose specific background color for debit or credit movements +BankColorizeMovementName1=Background color for debit movement +BankColorizeMovementName2=Background color for credit movement From 84640d0cd5c3da3d655caa7d805e17e65d31e742 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 10:21:38 +0200 Subject: [PATCH 523/982] Update messaging.php --- htdocs/ticket/messaging.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index aac9cdc4e7b..fa029e65582 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -239,7 +239,7 @@ if (!empty($object->id)) // Show link to add a message (if read and not closed) $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; $url = 'card.php?track_id=' . $object->track_id . '&action=presend_addmessage&mode=init'; - $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment', $url, 'add-new-ticket-title-button', $btnstatus); + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-comment', $url, 'add-new-ticket-title-button', $btnstatus); From 5ba6a90acc48905c95ed371d915edb025f257573 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 10:49:40 +0200 Subject: [PATCH 524/982] Fix responsive --- htdocs/societe/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 4657a3e3f64..2010edeb217 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -288,7 +288,7 @@ if ($result) print ''; // Name - print ''; + print ''; print $thirdparty_static->getNomUrl(1); print "\n"; // Type From 6c078bdcb07112798a1620e4b1437cb6751df459 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 10:53:41 +0200 Subject: [PATCH 525/982] Fix translation --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3eb9f24112d..9202e31308b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1059,7 +1059,7 @@ BackgroundImageLogin=Background image PermanentLeftSearchForm=Permanent search form on left menu DefaultLanguage=Default language EnableMultilangInterface=Enable multilanguage support -EnableShowLogo=Show logo on left menu +EnableShowLogo=Show the company logo in the menu CompanyInfo=Company/Organization CompanyIds=Company/Organization identities CompanyName=Name From 7019e69ee2d5825da1174220041b6ca596770ef7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:09:36 +0200 Subject: [PATCH 526/982] FIX regression with option to hide picto on top menu --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/theme/eldy/global.inc.php | 51 ++++++++++++++++++++++++++----- htdocs/theme/md/style.css.php | 46 +++++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 12b5f63d7e1..86d02bcf22c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7265,7 +7265,7 @@ function printCommonFooter($zone = 'private') { print "\n"; print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n"; - print 'jQuery(".menuhider").click(function(event) {'; + print 'jQuery("li.menuhider").click(function(event) {'; print ' if (!$( "body" ).hasClass( "sidebar-collapse" )){ event.preventDefault(); }'."\n"; print ' console.log("We click on .menuhider");'."\n"; print ' $("body").toggleClass("sidebar-collapse")'."\n"; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index cbb69df74f9..5a12e50eaef 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1058,6 +1058,41 @@ div.blockvmenulogo { border-bottom: 0 !important; } +.backgroundforcompanylogo { + margin: px; + margin-left: 6px; + margin-right: 8px; + background-color: rgba(255,255,255,0.7); + padding: 0; + border-radius: 5px; + height: px; + /* width: 100px; */ + max-width: 100px; + vertical-align: middle; +} +.backgroundforcompanylogo img.mycompany { + object-fit: contain; + width: inherit; + height: inherit; +} +#mainmenutd_companylogo::after, #mainmenutd_menu::after { + content: unset !important; +} +li#mainmenutd_companylogo .tmenucenter { + width: unset; +} +li#mainmenutd_companylogo { + min-width: unset !important; +} + + li#mainmenutd_home { + min-width: unset !important; + } + li#mainmenutd_home .tmenucenter { + width: unset; + } + + div.blockvmenupair, div.blockvmenuimpair { border-top: none !important; border-left: none !important; @@ -1504,9 +1539,6 @@ li.tmenu, li.tmenusel { li.menuhider:hover { background-image: none !important; } -li.tmenusel, li.tmenu:hover { - /* background: rgba(0, 0, 0, 0.1); */ -} li.tmenusel::after, li.tmenu:hover::after{ content: ""; @@ -1559,7 +1591,7 @@ div.tmenucenter padding-top: 2px; height: px; - width: 100%; + /* width: 100%; */ } #menu_titre_logo { padding-top: 0; @@ -1965,8 +1997,8 @@ div.login_block_other { padding-top: 0; text-align: right; margin-right: 8px; } float: right; vertical-align: top; padding: 0px 3px 0px 4px !important; - line-height: 50px; - height: 50px; + line-height: px; + height: px; } .atoplogin, .atoplogin:hover { color: # !important; @@ -2003,8 +2035,8 @@ img.login, img.printer, img.entity { font-weight: bold; } .userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto { /* size for user photo in login bar */ - width: 32px; - height: 32px; + width: px; + height: px; border-radius: 50%; background-size: contain; background-size: contain; @@ -5676,6 +5708,9 @@ div.tabsElem a.tab { /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ @media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ { + li.tmenucompanylogo { + display: none; + } div.mainmenu { height: 23px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ebf6b1df23d..8c78e8be88b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1948,6 +1948,11 @@ foreach($mainmenuusedarray as $val) display: none; } +.topmenuimage { + + display: none; + +} a.tmenuimage { display: block; } @@ -2232,6 +2237,41 @@ div.blockvmenulogo { border-bottom: 0 !important; } +.backgroundforcompanylogo { + margin: px; + margin-left: 12px; + margin-right: 6px; + background-color: rgba(255,255,255,0.7); + padding: 0; + border-radius: 5px; + height: px; + /* width: 100px; */ + max-width: 100px; + vertical-align: middle; +} +.backgroundforcompanylogo img.mycompany { + object-fit: contain; + width: inherit; + height: inherit; +} +#mainmenutd_companylogo::after { + content: unset; +} +li#mainmenutd_companylogo .tmenucenter { + width: unset; +} +li#mainmenutd_companylogo { + min-width: unset !important; +} + + li#mainmenutd_home { + min-width: unset !important; + } + li#mainmenutd_home .tmenucenter { + width: unset; + } + + div.blockvmenupair, div.blockvmenuimpair { font-family: ; @@ -5624,7 +5664,7 @@ border-top-right-radius: 6px; } .menuhider { - width: 40px; + width: px; } /* nboftopmenuentries = , fontsize= */ @@ -5659,6 +5699,10 @@ border-top-right-radius: 6px; /* rule to reduce top menu - 2nd reduction */ @media only screen and (max-width: px) { + li.tmenucompanylogo { + display: none; + } + div.tmenucenter { max-width: px; /* size of viewport */ text-overflow: clip; From 544a1237bc0cc0d65cf3150d536e8f23a0d9cced Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:09:36 +0200 Subject: [PATCH 527/982] FIX regression with option to hide picto on top menu --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/theme/eldy/global.inc.php | 51 ++++++++++++++++++++++++++----- htdocs/theme/md/style.css.php | 46 +++++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3d7c9ad0ae2..b6b691117a5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7226,7 +7226,7 @@ function printCommonFooter($zone = 'private') { print "\n"; print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n"; - print 'jQuery(".menuhider").click(function(event) {'; + print 'jQuery("li.menuhider").click(function(event) {'; print ' if (!$( "body" ).hasClass( "sidebar-collapse" )){ event.preventDefault(); }'."\n"; print ' console.log("We click on .menuhider");'."\n"; print ' $("body").toggleClass("sidebar-collapse")'."\n"; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 82001a31a41..c3ddd4ff7e2 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1026,6 +1026,41 @@ div.blockvmenulogo { border-bottom: 0 !important; } +.backgroundforcompanylogo { + margin: px; + margin-left: 6px; + margin-right: 8px; + background-color: rgba(255,255,255,0.7); + padding: 0; + border-radius: 5px; + height: px; + /* width: 100px; */ + max-width: 100px; + vertical-align: middle; +} +.backgroundforcompanylogo img.mycompany { + object-fit: contain; + width: inherit; + height: inherit; +} +#mainmenutd_companylogo::after, #mainmenutd_menu::after { + content: unset !important; +} +li#mainmenutd_companylogo .tmenucenter { + width: unset; +} +li#mainmenutd_companylogo { + min-width: unset !important; +} + + li#mainmenutd_home { + min-width: unset !important; + } + li#mainmenutd_home .tmenucenter { + width: unset; + } + + div.blockvmenupair, div.blockvmenuimpair { border-top: none !important; border-left: none !important; @@ -1469,9 +1504,6 @@ li.tmenu, li.tmenusel { li.menuhider:hover { background-image: none !important; } -li.tmenusel, li.tmenu:hover { - /* background: rgba(0, 0, 0, 0.1); */ -} li.tmenusel::after, li.tmenu:hover::after{ content: ""; @@ -1524,7 +1556,7 @@ div.tmenucenter padding-top: 2px; height: px; - width: 100%; + /* width: 100%; */ } #menu_titre_logo { padding-top: 0; @@ -1930,8 +1962,8 @@ div.login_block_other { padding-top: 0; text-align: right; margin-right: 8px; } float: right; vertical-align: top; padding: 0px 3px 0px 4px !important; - line-height: 50px; - height: 50px; + line-height: px; + height: px; } .atoplogin, .atoplogin:hover { color: # !important; @@ -1968,8 +2000,8 @@ img.login, img.printer, img.entity { font-weight: bold; } .userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto { /* size for user photo in login bar */ - width: 32px; - height: 32px; + width: px; + height: px; border-radius: 50%; background-size: contain; background-size: contain; @@ -5621,6 +5653,9 @@ div.tabsElem a.tab { /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ @media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ { + li.tmenucompanylogo { + display: none; + } div.mainmenu { height: 23px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3b9064e51a1..ee0515da6fe 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1938,6 +1938,11 @@ foreach($mainmenuusedarray as $val) display: none; } +.topmenuimage { + + display: none; + +} a.tmenuimage { display: block; } @@ -2222,6 +2227,41 @@ div.blockvmenulogo { border-bottom: 0 !important; } +.backgroundforcompanylogo { + margin: px; + margin-left: 12px; + margin-right: 6px; + background-color: rgba(255,255,255,0.7); + padding: 0; + border-radius: 5px; + height: px; + /* width: 100px; */ + max-width: 100px; + vertical-align: middle; +} +.backgroundforcompanylogo img.mycompany { + object-fit: contain; + width: inherit; + height: inherit; +} +#mainmenutd_companylogo::after { + content: unset; +} +li#mainmenutd_companylogo .tmenucenter { + width: unset; +} +li#mainmenutd_companylogo { + min-width: unset !important; +} + + li#mainmenutd_home { + min-width: unset !important; + } + li#mainmenutd_home .tmenucenter { + width: unset; + } + + div.blockvmenupair, div.blockvmenuimpair { font-family: ; @@ -5743,7 +5783,7 @@ border-top-right-radius: 6px; } .menuhider { - width: 40px; + width: px; } /* nboftopmenuentries = , fontsize= */ @@ -5778,6 +5818,10 @@ border-top-right-radius: 6px; /* rule to reduce top menu - 2nd reduction */ @media only screen and (max-width: px) { + li.tmenucompanylogo { + display: none; + } + div.tmenucenter { max-width: px; /* size of viewport */ text-overflow: clip; From 755057c99f6110ee30a622cb488f55ab8e956c07 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:15:46 +0200 Subject: [PATCH 528/982] FIX regression with option to hide picto on top menu --- htdocs/core/menus/standard/eldy.lib.php | 55 ++++++++++++------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index a4eb2d57053..ba4fd896cd6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -55,22 +55,23 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $usemenuhider = 1; - // Show/Hide vertical menu + // Show/Hide vertical menu. The hamburger icon for .menuhider action. if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $showmode=1; $classname = 'class="tmenu menuhider"'; $idsel='menu'; - $menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); + $menu->add('#', (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); } $menu_arr = array(); + // Home $menu_arr[] = array( 'name' => 'Home', 'link' => '/index.php?mainmenu=home&leftmenu=home', - 'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)? '   ' : "Home") , + 'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '' : "Home") , 'level' => 0, 'enabled' => $showmode = 1, 'target' => $atarget, @@ -473,8 +474,30 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $menu->liste = dol_sort_array($menu->liste, 'position'); // Output menu entries + // Show logo company + if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; + if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + { + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); + } + else + { + $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + } + $title=$langs->trans("GoIntoSetupToChangeLogo"); + + print "\n".''."\n"; + print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1); + + print ''."\n"; + + print_end_menu_entry(4); + } + if (empty($noout)) { - foreach($menu->liste as $menkey => $menuval) { + foreach($menu->liste as $menuval) { print_start_menu_entry($menuval['idsel'], $menuval['classname'], $menuval['enabled']); print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url']!='#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget)); print_end_menu_entry($menuval['enabled']); @@ -615,30 +638,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $usemenuhider = 0; - // Show logo company - if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) - { - $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; - if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) - { - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); - } - else - { - $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; - } - $title=$langs->trans("GoIntoSetupToChangeLogo"); - print "\n".''."\n"; - print ''."\n"; - } - if (is_array($moredata) && ! empty($moredata['searchform'])) // searchform can contains select2 code or link to show old search form or link to switch on search page { print "\n"; From 76b366836877de877796f9bf99cac21488c241ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:15:59 +0200 Subject: [PATCH 529/982] FIX regression with option to hide picto on top menu --- htdocs/core/menus/standard/eldy.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b1c3111034f..dbf3ede88f9 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -55,14 +55,14 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $usemenuhider = 1; - // Show/Hide vertical menu - if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + // Show/Hide vertical menu. The hamburger icon for .menuhider action. + if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $showmode=1; $classname = 'class="tmenu menuhider"'; $idsel='menu'; - $menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); + $menu->add('#', (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); } $menu_arr = array(); @@ -70,7 +70,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $menu_arr[] = array( 'name' => 'Home', 'link' => '/index.php?mainmenu=home&leftmenu=home', - 'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)? '   ' : "Home") , + 'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '' : "Home") , 'level' => 0, 'enabled' => $showmode = 1, 'target' => $atarget, From f5771e49d8c45ae98e821277dd96abb187ed7e42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:21:52 +0200 Subject: [PATCH 530/982] css --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 5a12e50eaef..5beebb89a36 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1060,7 +1060,7 @@ div.blockvmenulogo } .backgroundforcompanylogo { margin: px; - margin-left: 6px; + margin-left: 8px; margin-right: 8px; background-color: rgba(255,255,255,0.7); padding: 0; From 27e3a2cb1d4db962246298b2a6940b71ce43e103 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:32:43 +0200 Subject: [PATCH 531/982] Update perms.php --- htdocs/user/perms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 209e68048c7..137ac659fd7 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -59,7 +59,7 @@ $socid=0; if (isset($user->societe_id) && $user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); // A user can always read its own card if not advanced perms enabled, or if he has advanced perms, except for admin -if ($user->id == $id && (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms)) && empty($user->admin)) +if ($user->id == $id && (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms) && empty($user->admin))) { accessforbidden(); } From 4d0ef334713b80f7010d86770be2933d6d252f13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:43:03 +0200 Subject: [PATCH 532/982] FIX #11857 --- htdocs/comm/action/index.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 48165361d7c..d42b1b7d134 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -607,9 +607,7 @@ if ($resql) $event->fk_element=$obj->fk_element; $event->elementtype=$obj->elementtype; - $event->societe->id=$obj->fk_soc; $event->thirdparty_id=$obj->fk_soc; - $event->contact->id=$obj->fk_contact; $event->contact_id=$obj->fk_contact; // Defined date_start_in_calendar and date_end_in_calendar property @@ -1569,28 +1567,31 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->type_code == 'ICALEVENT') print '
    ('.dol_trunc($event->icalname, $maxnbofchar).')'; + $thirdparty_id = ($event->thirdparty_id > 0 ? $event->thirdparty_id : ((is_object($event->societe) && $event->societe->id > 0) ? $event->societe->id : 0)); + $contact_id = ($event->contact_id > 0 ? $event->contact_id : ((is_object($event->contact) && $event->cotact->id > 0) ? $event->contact->id : 0)); + // If action related to company / contact $linerelatedto=''; - if (! empty($event->societe->id) && $event->societe->id > 0) + if ($thirdparty_id > 0) { - if (! isset($cachethirdparties[$event->societe->id]) || ! is_object($cachethirdparties[$event->societe->id])) + if (! isset($cachethirdparties[$thirdparty_id]) || ! is_object($cachethirdparties[$thirdparty_id])) { $thirdparty=new Societe($db); - $thirdparty->fetch($event->societe->id); - $cachethirdparties[$event->societe->id]=$thirdparty; + $thirdparty->fetch($thirdparty_id); + $cachethirdparties[$thirdparty_id]=$thirdparty; } - else $thirdparty=$cachethirdparties[$event->societe->id]; + else $thirdparty=$cachethirdparties[$thirdparty_id]; if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1, '', 0); } - if (! empty($event->contact->id) && $event->contact->id > 0) + if (! empty($contact_id) && $contact_id > 0) { - if (! is_object($cachecontacts[$event->contact->id])) + if (! is_object($cachecontacts[$contact_id])) { $contact=new Contact($db); - $contact->fetch($event->contact->id); - $cachecontacts[$event->contact->id]=$contact; + $contact->fetch($contact_id); + $cachecontacts[$contact_id]=$contact; } - else $contact=$cachecontacts[$event->contact->id]; + else $contact=$cachecontacts[$contact_id]; if ($linerelatedto) $linerelatedto.=' '; if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1, '', 0); } From ab07da02c4cabdfecb9220d36bac3304ed6270c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:53:04 +0200 Subject: [PATCH 533/982] Fix scrutinizer --- htdocs/stripe/admin/stripe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 02039f3edc2..c3c008a5874 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -221,7 +221,7 @@ if (empty($conf->stripeconnect->enabled)) $endpoint = \Stripe\WebhookEndpoint::retrieve($conf->global->STRIPE_TEST_WEBHOOK_ID); $endpoint->enabled_events = $stripearrayofwebhookevents; if (GETPOST('webhook', 'alpha') == $conf->global->STRIPE_TEST_WEBHOOK_ID) { - if (empty(GETPOST('status', 'alpha'))) { + if (! GETPOST('status', 'alpha')) { $endpoint->disabled = true; } else { $endpoint->disabled = false; From 23860b15ee9b09ee146696eec9d235c875a5097a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 16:00:01 +0200 Subject: [PATCH 534/982] Try a fix for #11852 --- htdocs/societe/class/societe.class.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 26ad0c6bed9..0172d67e5c7 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3914,17 +3914,17 @@ class Societe extends CommonObject while($obj=$this->db->fetch_object($resql)) { $tmpobject->id=$obj->rowid; - if ($obj->fk_statut != Facture::STATUS_DRAFT // Not a draft - && ! ($obj->fk_statut == Facture::STATUS_ABANDONED && $obj->close_code == 'replaced') // Not a replaced invoice + if ($obj->fk_statut != $tmpobject::STATUS_DRAFT // Not a draft + && ! ($obj->fk_statut == $tmpobject::STATUS_ABANDONED && $obj->close_code == 'replaced') // Not a replaced invoice ) { $outstandingTotal+= $obj->total_ht; $outstandingTotalIncTax+= $obj->total_ttc; } if ($obj->paye == 0 - && $obj->fk_statut != Facture::STATUS_DRAFT // Not a draft - && $obj->fk_statut != Facture::STATUS_ABANDONED // Not abandonned - && $obj->fk_statut != Facture::STATUS_CLOSED) // Not classified as paid + && $obj->fk_statut != $tmpobject::STATUS_DRAFT // Not a draft + && $obj->fk_statut != $tmpobject::STATUS_ABANDONED // Not abandonned + && $obj->fk_statut != $tmpobject::STATUS_CLOSED) // Not classified as paid //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason { $paiement = $tmpobject->getSommePaiement(); @@ -3935,7 +3935,11 @@ class Societe extends CommonObject } //if credit note is converted but not used - if($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $tmpobject->isCreditNoteUsed())$outstandingOpened-=$tmpobject->getSumFromThisCreditNotesNotUsed(); + // TODO Do this also for customer ? + if($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $tmpobject->isCreditNoteUsed()) + { + $outstandingOpened-=$tmpobject->getSumFromThisCreditNotesNotUsed(); + } } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } From 5d4f7029209ab1d2daf0c49b417d3f34014b3956 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 15 Sep 2019 16:38:03 +0200 Subject: [PATCH 535/982] Remove bas copy / paste --- htdocs/societe/paymentmodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 4a34a2b360f..922fea064ec 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -481,7 +481,7 @@ if (empty($reshook)) $_POST['lang_id'] = GETPOST('lang_idrib'.GETPOST('companybankid', 'int'), 'alpha'); $_POST['model'] = GETPOST('modelrib'.GETPOST('companybankid', 'int'), 'alpha'); } - https://dashboard.stripe.com/search?query=risk_level%3Ahighest&account=acct_1CVGWQLYhjvFj9Sz + $id = $socid; $upload_dir = $conf->societe->multidir_output[$object->entity]; $permissioncreate=$user->rights->societe->creer; From 5d0ba10f34a24d2f288b6150ad4c4d49402a0d79 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 17:04:08 +0200 Subject: [PATCH 536/982] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 89dd7ff823a..524e36fda6e 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -194,7 +194,7 @@ class Products extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" * @return array Array of product objects * - * @url GET supplier + * @url GET supplier_prices */ public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') { From 48cbcdc7571922af74a829c11e5253b24a28e567 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 15 Sep 2019 17:08:21 +0200 Subject: [PATCH 537/982] Fix #11876 --- htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql index 70750494a10..737fe66f9da 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql @@ -70,7 +70,7 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-KONEGIE', 0, 41, '', 0, 6, 1, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-26OKT', 0, 41, '', 0, 10, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-TOUSSAINT', 0, 41, '', 0, 11, 1, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-IMMACULE', 0, 41, '', 0, 12 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-IMMACULE', 0, 41, '', 0, 12, 8, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-24DEC', 0, 41, '', 0, 12, 24, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-SAINTSTEFAN', 0, 41, '', 0, 12, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Silvester', 0, 41, '', 0, 12, 31, 1); From 12d67c5f855de196a56823d2c844ec3c589ad5d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 17:18:10 +0200 Subject: [PATCH 538/982] Rename api to get all purchase prices --- htdocs/product/class/api_products.class.php | 177 ++++++++++---------- 1 file changed, 89 insertions(+), 88 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 524e36fda6e..812c2df7459 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -178,93 +178,6 @@ class Products extends DolibarrApi } return $obj_ret; } - - /** - * List supplier's products - * - * Get a list of supplier's products - * - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Limit for list - * @param int $page Page number - * @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service) - * @param int $category Use this param to filter list by category - * @param int $supplier Use this param to filter list by supplier - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" - * @return array Array of product objects - * - * @url GET supplier_prices - */ - public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') - { - global $db, $conf; - $obj_ret = array(); - $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; - $sql = "SELECT t.rowid, t.ref, t.ref_ext"; - $sql.= " FROM ".MAIN_DB_PREFIX."product as t"; - if ($category > 0) { - $sql.= ", ".MAIN_DB_PREFIX."categorie_product as c"; - } - $sql.= ", ".MAIN_DB_PREFIX."product_fournisseur_price as s"; - - $sql.= ' WHERE t.entity IN ('.getEntity('product').')'; - - if ($supplier > 0) { - $sql.= " AND s.fk_soc = ".$db->escape($supplier); - } - $sql.= " AND s.fk_product = t.rowid "; - // Select products of given category - if ($category > 0) { - $sql.= " AND c.fk_categorie = ".$db->escape($category); - $sql.= " AND c.fk_product = t.rowid "; - } - if ($mode == 1) { - // Show only products - $sql.= " AND t.fk_product_type = 0"; - } elseif ($mode == 2) { - // Show only services - $sql.= " AND t.fk_product_type = 1"; - } - // Add sql filters - if ($sqlfilters) { - if (! DolibarrApi::_checkFilters($sqlfilters)) { - throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); - } - $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; - $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; - } - $sql.= $db->order($sortfield, $sortorder); - if ($limit) { - if ($page < 0) { - $page = 0; - } - $offset = $limit * $page; - $sql.= $db->plimit($limit + 1, $offset); - } - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $min = min($num, ($limit <= 0 ? $num : $limit)); - $i = 0; - while ($i < $min) - { - $obj = $db->fetch_object($result); - $product_static = new Product($db); - if($product_static->fetch($obj->rowid)) { - $obj_ret[] = $this->_cleanObjectDatas($product_static); - } - $i++; - } - } - else { - throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); - } - if(! count($obj_ret)) { - throw new RestException(404, 'No product found'); - } - return $obj_ret; - } /** * Create product object @@ -554,6 +467,94 @@ class Products extends DolibarrApi ); } + + /** + * List purchase prices + * + * Get a list of all purchase prices of products + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service) + * @param int $category Use this param to filter list by category of product + * @param int $supplier Use this param to filter list by supplier + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" + * @return array Array of product objects + * + * @url GET purchase_prices + */ + public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') + { + global $db, $conf; + $obj_ret = array(); + $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; + $sql = "SELECT t.rowid, t.ref, t.ref_ext"; + $sql.= " FROM ".MAIN_DB_PREFIX."product as t"; + if ($category > 0) { + $sql.= ", ".MAIN_DB_PREFIX."categorie_product as c"; + } + $sql.= ", ".MAIN_DB_PREFIX."product_fournisseur_price as s"; + + $sql.= ' WHERE t.entity IN ('.getEntity('product').')'; + + if ($supplier > 0) { + $sql.= " AND s.fk_soc = ".$db->escape($supplier); + } + $sql.= " AND s.fk_product = t.rowid "; + // Select products of given category + if ($category > 0) { + $sql.= " AND c.fk_categorie = ".$db->escape($category); + $sql.= " AND c.fk_product = t.rowid "; + } + if ($mode == 1) { + // Show only products + $sql.= " AND t.fk_product_type = 0"; + } elseif ($mode == 2) { + // Show only services + $sql.= " AND t.fk_product_type = 1"; + } + // Add sql filters + if ($sqlfilters) { + if (! DolibarrApi::_checkFilters($sqlfilters)) { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + $sql.= $db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + $sql.= $db->plimit($limit + 1, $offset); + } + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + $i = 0; + while ($i < $min) + { + $obj = $db->fetch_object($result); + $product_static = new Product($db); + if($product_static->fetch($obj->rowid)) { + $obj_ret[] = $this->_cleanObjectDatas($product_static); + } + $i++; + } + } + else { + throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); + } + if(! count($obj_ret)) { + throw new RestException(404, 'No product found'); + } + return $obj_ret; + } + /** * Get purchase prices for a product * @@ -602,7 +603,7 @@ class Products extends DolibarrApi if($result) { $this->product = new ProductFournisseur($this->db); $this->product->fetch($id, $ref); - $this->product->list_product_fournisseur_price($id, $sortfield, $sortorder, 0, 0); + $this->product->list_product_fournisseur_price($id, '', '', 0, 0); } return $this->_cleanObjectDatas($this->product); From ea1baefe9a5edab606f20588169943860c954e95 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 15 Sep 2019 20:50:18 +0200 Subject: [PATCH 539/982] NEW: delete purchase price API --- htdocs/product/class/api_products.class.php | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 756bbde5b29..ad8170921ae 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -467,6 +467,41 @@ class Products extends DolibarrApi ); } + /** + * Delete purchase price for a product + * + * @param int $id Product ID + * @param int $priceid purchase price ID + * + * @url DELETE {id}/purchase_prices/{priceid} + * + * @return array + * + * @throws 401 + * @throws 404 + * + */ + public function deletePurchasePrice($id, $priceid) + { + if(! DolibarrApiAccess::$user->rights->produit->supprimer) { + throw new RestException(401); + } + $result = $this->product->fetch($id); + if(! $result ) { + throw new RestException(404, 'Product not found'); + } + + if(! DolibarrApi::_checkAccessToResource('product', $this->product->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + if($result) { + $this->product = new ProductFournisseur($this->db); + $this->product->fetch($id); + } + + return $this->product->remove_product_fournisseur_price($priceid); + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** From 4db6badfc2bd954ff11a918601d6fb4ce41a650f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 10:24:41 +0200 Subject: [PATCH 540/982] Fix link when no title in search of website content --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 5d4c259bf9c..6394428bd42 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3308,7 +3308,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print ''; print ''.$langs->trans("Container").''; print ''; - print ''.$answerrecord->title.''; + print ''.($answerrecord->title ? $answerrecord->title : $langs->trans("NoTitle")).''; print ''; print ''.$answerrecord->description; print ''; From 6e806a5aed63476c464c5e58c0aad80388c44e59 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 16 Sep 2019 10:37:55 +0200 Subject: [PATCH 541/982] FIX empty cache when we want to load specific warehouses in select --- htdocs/product/class/html.formproduct.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index e356226dd2f..56d5b4bea74 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -243,6 +243,7 @@ class FormProduct $out=''; if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = ''; + if (!empty($fk_product)) $this->cache_warehouses = array(); $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude, $stockMin, $orderBy); $nbofwarehouses=count($this->cache_warehouses); From eb70411ae0d7fd2faeccad56a50d5ab3d303d597 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 11:01:09 +0200 Subject: [PATCH 542/982] Css demo --- htdocs/public/demo/demo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index d137b7be456..e84b67f4b7d 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -99,7 +99,7 @@ img.demothumb { width: 110px; } .demobackground { - background-image: url('dolibarr_demo_ban.jpg'); + background-image: linear-gradient(to bottom, rgba(200,200,255,0.8), rgba(210,220,255,0.5)), url('dolibarr_demo_ban.jpg'); background-size: cover; object-fit: contain; height: 140px; From f5dd4f4f9e9252d22de40542df2370ddea47f6ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 11:08:34 +0200 Subject: [PATCH 543/982] css --- htdocs/public/demo/demo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index e84b67f4b7d..99cda615b48 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -99,7 +99,7 @@ img.demothumb { width: 110px; } .demobackground { - background-image: linear-gradient(to bottom, rgba(200,200,255,0.8), rgba(210,220,255,0.5)), url('dolibarr_demo_ban.jpg'); + background-image: linear-gradient(to bottom, rgba(250,250,255,0.7), rgba(250,250,255,0.4)), url('dolibarr_demo_ban.jpg'); background-size: cover; object-fit: contain; height: 140px; From abee6dceaa872333fc50b4afdb73a68da2c53fb5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 11:16:58 +0200 Subject: [PATCH 544/982] Fix css demo --- htdocs/public/demo/demo.css | 5 +++-- htdocs/public/demo/index.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index 99cda615b48..f84aa4ab14c 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -28,8 +28,9 @@ a:hover { /*border: 1px solid #bbb; border-radius: 8px; -moz-border-radius: 8px;*/ - background: -webkit-linear-gradient(bottom, rgb(255,255,255) 85%, rgb(255,255,255) 100%); + + max-width: 346px; } .csscolumns { margin-top: 6px; @@ -99,7 +100,7 @@ img.demothumb { width: 110px; } .demobackground { - background-image: linear-gradient(to bottom, rgba(250,250,255,0.7), rgba(250,250,255,0.4)), url('dolibarr_demo_ban.jpg'); + background-image: linear-gradient(to bottom, rgba(250,250,255,0.5), rgba(250,250,255,0.4)), url('dolibarr_demo_ban.jpg'); background-size: cover; object-fit: contain; height: 140px; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 62de885eac6..d2633d9c708 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -336,7 +336,7 @@ foreach ($demoprofiles as $profilearray) print ''."\n"; print ''."\n"; - print '
    '."\n"; + print '
    '."\n"; print '
    '; From 23777fd5ff4ca3ed7748f49dea6461555f2ee463 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 11:19:02 +0200 Subject: [PATCH 545/982] Fix css --- htdocs/public/demo/demo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index f84aa4ab14c..7f482367eba 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -23,7 +23,7 @@ a:hover { font-weight: normal; color: #444444 !important; - margin: 8px 0px 8px 2px; + margin: 8px 2px 8px 2px; /*border: 1px solid #bbb; border-radius: 8px; From 1c5a5eb5938aef26e2143a40b119d0fe99e8b140 Mon Sep 17 00:00:00 2001 From: Daniel Seichter Date: Mon, 16 Sep 2019 13:24:21 +0200 Subject: [PATCH 546/982] Added hint for setting up database (issue #11815) --- build/docker/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/docker/README.md b/build/docker/README.md index 5a0997cf121..616cbd8fa78 100644 --- a/build/docker/README.md +++ b/build/docker/README.md @@ -23,3 +23,6 @@ The URL to go to the Dolibarr is : The URL to go to PhpMyAdmin is (login/password is root/root) : http://0.0.0.0:8080 + +Setup the database connection during the installation process, please use mariad +b (name of the database container) as database host. From 010e58d9570b6dd115b1bd82453ed1f8a0797bc0 Mon Sep 17 00:00:00 2001 From: John Botella Date: Mon, 16 Sep 2019 13:56:07 +0200 Subject: [PATCH 547/982] Add switch view behavior --- htdocs/core/lib/ticket.lib.php | 21 ++++++++++++------ htdocs/langs/en_US/ticket.lang | 2 ++ htdocs/ticket/agenda.php | 24 ++++++++++++++++++++- htdocs/ticket/messaging.php | 39 ++++++++++++++++++++++------------ 4 files changed, 66 insertions(+), 20 deletions(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 86f02d0ebd5..fb274d06c20 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -108,7 +108,21 @@ function ticket_prepare_head($object) // History - $head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id=' . $object->track_id; + $ticketViewType = "messaging"; + if(empty($_SESSION['ticket-view-type'])){ + $_SESSION['ticket-view-type'] = $ticketViewType; + } + else{ + $ticketViewType = $_SESSION['ticket-view-type']; + } + + if($ticketViewType == "messaging"){ + $head[$h][0] = DOL_URL_ROOT.'/ticket/messaging.php?track_id=' . $object->track_id; + } + else{ + // $ticketViewType == "list" + $head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id=' . $object->track_id; + } $head[$h][1] = $langs->trans('Events'); if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) { @@ -118,11 +132,6 @@ function ticket_prepare_head($object) $head[$h][2] = 'tabTicketLogs'; $h++; - // History - $head[$h][0] = DOL_URL_ROOT.'/ticket/messaging.php?track_id=' . $object->track_id; - $head[$h][1] = $langs->trans('Messaging'); - $head[$h][2] = 'tabTicketMessaging'; - $h++; complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'remove'); diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index bc2632a4254..6dbc13ec306 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -139,6 +139,8 @@ TicketViewNonClosedOnly=View only open tickets TicketStatByStatus=Tickets by status OrderByDateAsc=Sort by ascending date OrderByDateDesc=Sort by descending date +MessagingViewType=Show as messaging list +MessageListViewType=Show as table list # # Ticket card diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index ed689b4e966..3d1c41b711c 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -103,6 +103,12 @@ $parameters=array('id'=>$socid); $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if(empty($reshook)) +{ + // Set view style + $_SESSION['ticket-view-type'] = "list"; +} + // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { @@ -225,7 +231,23 @@ if (!empty($object->id)) if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - print_barre_liste($langs->trans("ActionsOnTicket"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 1); + $morehtmlright = ''; + + $messagingUrl = DOL_URL_ROOT.'/ticket/messaging.php?track_id=' . $object->track_id; + $morehtmlright .= dolGetButtonTitle($langs->trans('MessagingViewType'), '', 'fa fa-comments', $messagingUrl, $id = '', $status = 1); + + // Show link to add a message (if read and not closed) + $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $url = 'card.php?track_id=' . $object->track_id . '&action=presend_addmessage&mode=init'; + $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-title-button', $btnstatus); + + // Show link to add event (if read and not closed) + $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"]); + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-calendar-plus', $url, 'add-new-ticket-even-button', $btnstatus); + + + print_barre_liste($langs->trans("ActionsOnTicket"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); // List of all actions $filters=array(); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index fa029e65582..5966973d4ca 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -103,6 +103,12 @@ $parameters=array('id'=>$socid); $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if(empty($reshook)) +{ + // Set view style + $_SESSION['ticket-view-type'] = "messaging"; +} + // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { @@ -143,7 +149,7 @@ if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) { } $head = ticket_prepare_head($object); -dol_fiche_head($head, 'tabTicketMessaging', $langs->trans("Ticket"), 0, 'ticket'); +dol_fiche_head($head, 'tabTicketLogs', $langs->trans("Ticket"), 0, 'ticket'); $morehtmlref ='
    '; $morehtmlref.= $object->subject; @@ -227,20 +233,27 @@ if (!empty($object->id)) $morehtmlright = ''; - if($sortorder === 'desc') { - $sortUrl = $_SERVER["PHP_SELF"] . '?sortfield=a.datep&sortorder=asc' . $param; - $morehtmlright .= dolGetButtonTitle($langs->trans('Date'), $langs->trans('OrderByDateAsc'), 'fa fa-sort-numeric-down', $sortUrl, $id = '', $status = 1); - } - else{ - $sortUrl = $_SERVER["PHP_SELF"] . '?sortfield=a.datep&sortorder=desc' . $param; - $morehtmlright .= dolGetButtonTitle($langs->trans('Date'), $langs->trans('OrderByDateDesc'), 'fa fa-sort-numeric-down-alt', $sortUrl, $id = '', $status = 1); - } + if($sortorder === 'desc') { + $sortUrl = $_SERVER["PHP_SELF"] . '?sortfield=a.datep&sortorder=asc' . $param; + $morehtmlright .= dolGetButtonTitle($langs->trans('Date'), $langs->trans('OrderByDateAsc'), 'fa fa-sort-numeric-down', $sortUrl, $id = '', $status = 1); + } + else{ + $sortUrl = $_SERVER["PHP_SELF"] . '?sortfield=a.datep&sortorder=desc' . $param; + $morehtmlright .= dolGetButtonTitle($langs->trans('Date'), $langs->trans('OrderByDateDesc'), 'fa fa-sort-numeric-down-alt', $sortUrl, $id = '', $status = 1); + } - // Show link to add a message (if read and not closed) - $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = 'card.php?track_id=' . $object->track_id . '&action=presend_addmessage&mode=init'; - $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-comment', $url, 'add-new-ticket-title-button', $btnstatus); + $messagingUrl = DOL_URL_ROOT.'/ticket/agenda.php?track_id=' . $object->track_id; + $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-tasks', $messagingUrl, $id = '', $status = 1); + // Show link to add a message (if read and not closed) + $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $url = 'card.php?track_id=' . $object->track_id . '&action=presend_addmessage&mode=init'; + $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-title-button', $btnstatus); + + // Show link to add event (if read and not closed) + $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"]); + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-calendar-plus', $url, 'add-new-ticket-even-button', $btnstatus); print_barre_liste($langs->trans("ActionsOnTicket"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); From 36326fa5c04e498a0b0b73c3df4e38908bfd7553 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 15:18:35 +0200 Subject: [PATCH 548/982] Add squarre logo --- htdocs/theme/dolibarr_512x512.png | Bin 0 -> 9520 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 htdocs/theme/dolibarr_512x512.png diff --git a/htdocs/theme/dolibarr_512x512.png b/htdocs/theme/dolibarr_512x512.png new file mode 100644 index 0000000000000000000000000000000000000000..bd8d7ac3bfd32616c1231e0fc626ae9d5a7d5cae GIT binary patch literal 9520 zcma)i2|Sfu*Y|adWvE1vOm`(Rm3hjLArvwbnWK>Tn5RP-O1P1dp+qRNP%@qjDKcd$ z!imHo6pnfL)}{M-zx#cj`~BX}?}zK`v#zz*UVE+o8uq@eqpe0y!%Bl72)%~7iXMWH z!6O;6hYJ2J`Sz~EKMGGJ4TC-K6S(JU6nx(6rheHILCy}KzZi$4Drp!zf>kxa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>bf6H2k`=4*9{D-XQ>B&FH>JBI4 z|GG`{o9jQzisl!8-LYx Date: Mon, 16 Sep 2019 15:26:13 +0200 Subject: [PATCH 549/982] Introduce a logo squarred into setup (MAIN_INFO_SOCIETE_LOGO_SQUARRED, MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI, ...) --- htdocs/core/menus/standard/eldy.lib.php | 9 +++++++-- ...ibarr_512x512.png => dolibarr_logo_squarred.png} | Bin 2 files changed, 7 insertions(+), 2 deletions(-) rename htdocs/theme/{dolibarr_512x512.png => dolibarr_logo_squarred.png} (100%) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ba4fd896cd6..2eead6da81d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -478,13 +478,18 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; - if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + $mysoc->logo_squarred_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI; + if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) + { + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); + } + elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); } else { - $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png'; } $title=$langs->trans("GoIntoSetupToChangeLogo"); diff --git a/htdocs/theme/dolibarr_512x512.png b/htdocs/theme/dolibarr_logo_squarred.png similarity index 100% rename from htdocs/theme/dolibarr_512x512.png rename to htdocs/theme/dolibarr_logo_squarred.png From 555ea977c9e3a5758b94dcaa9088acd186264808 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 16 Sep 2019 15:32:31 +0200 Subject: [PATCH 550/982] NEW Add units in select products lines --- htdocs/core/class/html.form.class.php | 132 +++++++++++++++++++++----- 1 file changed, 106 insertions(+), 26 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c470231e5de..52be1cec2b0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2064,6 +2064,11 @@ class Form $out=''; $outarray=array(); + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $langs->load('other'); + } + $warehouseStatusArray = array(); if (! empty($warehouseStatus)) { @@ -2114,7 +2119,7 @@ class Form } // Units if (! empty($conf->global->PRODUCT_USE_UNITS)) { - $sql .= ', u.label as unit_long, u.short_label as unit_short'; + $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; $selectFields .= ', unit_long, unit_short'; } @@ -2408,6 +2413,42 @@ class Form $outdurationvalue=$outtype == Product::TYPE_SERVICE?substr($objp->duration, 0, dol_strlen($objp->duration)-1):''; $outdurationunit=$outtype == Product::TYPE_SERVICE?substr($objp->duration, -1):''; + // Units + $outvalUnits = ''; + if ($conf->global->PRODUCT_USE_UNITS) { + if (!empty($objp->unit_short)) { + $outvalUnits .= ' - ' . $objp->unit_short; + } + if (!empty($objp->weight)) { + $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) { + $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuring_units_string($objp->length_units, 'size'); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->surface)) { + $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->volume)) { + $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if ($outdurationvalue && $outdurationunit) { + $da = array( + 'h' => $langs->trans('Hour'), + 'd' => $langs->trans('Day'), + 'w' => $langs->trans('Week'), + 'm' => $langs->trans('Month'), + 'y' => $langs->trans('Year') + ); + if (isset($da[$outdurationunit])) { + $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); + } + } + } + $opt = '\n"; $optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit); } @@ -2679,16 +2708,28 @@ class Form $outarray=array(); $langs->load('stocks'); + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $langs->load('other'); + } $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, p.fk_product_type,"; $sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,"; $sql.= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.fk_soc, s.nom as name,"; $sql.= " pfp.supplier_reputation"; + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; + } if (! empty($conf->barcode->enabled)) $sql.= " ,pfp.barcode"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; if ($socid) $sql.= " AND pfp.fk_soc = ".$socid; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_units u ON u.rowid = p.fk_unit"; + } $sql.= " WHERE p.entity IN (".getEntity('product').")"; $sql.= " AND p.tobuy = 1"; if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$this->db->escape($filtertype); @@ -2749,6 +2790,42 @@ class Form $outdurationvalue=$outtype == Product::TYPE_SERVICE?substr($objp->duration, 0, dol_strlen($objp->duration)-1):''; $outdurationunit=$outtype == Product::TYPE_SERVICE?substr($objp->duration, -1):''; + // Units + $outvalUnits = ''; + if ($conf->global->PRODUCT_USE_UNITS) { + if (!empty($objp->unit_short)) { + $outvalUnits .= ' - ' . $objp->unit_short; + } + if (!empty($objp->weight)) { + $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) { + $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuring_units_string($objp->length_units, 'size'); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->surface)) { + $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->volume)) { + $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if ($outdurationvalue && $outdurationunit) { + $da = array( + 'h' => $langs->trans('Hour'), + 'd' => $langs->trans('Day'), + 'w' => $langs->trans('Week'), + 'm' => $langs->trans('Month'), + 'y' => $langs->trans('Year') + ); + if (isset($da[$outdurationunit])) { + $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); + } + } + } + $opt = '\n"; From 8d7d14c7305c74df7708c842d659e923614ff523 Mon Sep 17 00:00:00 2001 From: madx666 Date: Mon, 16 Sep 2019 15:39:58 +0200 Subject: [PATCH 551/982] Fix return to list on page 1 When are on page 1 on any list and we go on an object, when return to the list, we are back on page 0 --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 014ca843236..1c0b86dff88 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -748,7 +748,7 @@ if (! defined('NOLOGIN')) $_SESSION['lastsearch_contextpage_'.$relativepathstring]=$_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]; unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]); } - if (! empty($_SESSION['lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_page_tmp_'.$relativepathstring] > 1) + if (! empty($_SESSION['lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_page_tmp_'.$relativepathstring] > 0) { $_SESSION['lastsearch_page_'.$relativepathstring]=$_SESSION['lastsearch_page_tmp_'.$relativepathstring]; unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]); @@ -2271,7 +2271,7 @@ if (! function_exists("llxFooter")) unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]); if (! empty($contextpage)) $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]=$contextpage; - if (! empty($page) && $page > 1) $_SESSION['lastsearch_page_tmp_'.$relativepathstring]=$page; + if (! empty($page) && $page > 0) $_SESSION['lastsearch_page_tmp_'.$relativepathstring]=$page; if (! empty($limit) && $limit != $conf->limit) $_SESSION['lastsearch_limit_tmp_'.$relativepathstring]=$limit; unset($_SESSION['lastsearch_contextpage_'.$relativepathstring]); From 872f5ed85f8f0a298faaa49d33f856914c65de14 Mon Sep 17 00:00:00 2001 From: John Botella Date: Mon, 16 Sep 2019 16:49:08 +0200 Subject: [PATCH 552/982] fix_missing_expedition_table_line_tag --- htdocs/expedition/card.php | 53 ++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 4202607cbd2..cab0ec3a189 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2036,27 +2036,28 @@ elseif ($id || $ref) print '
    '; print '
    '; - print ''; + print '
    '; + print ''; print ''; // Adds a line numbering column if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { - print ''; + print ''; } // Product/Service - print ''; + print ''; // Qty - print ''; + print ''; if ($origin && $origin_id > 0) { - print ''; + print ''; } if ($action == 'editline') { $editColspan = 3; if (empty($conf->stock->enabled)) $editColspan--; if (empty($conf->productbatch->enabled)) $editColspan--; - print ''; + print ''; } else { - print ''; + print ''; } if (! empty($conf->stock->enabled)) { - print ''; + print ''; } if (! empty($conf->productbatch->enabled)) { - print ''; + print ''; } } - print ''; - print ''; + print ''; + print ''; //print ''; if ($object->statut == 0) { @@ -2104,7 +2105,7 @@ elseif ($id || $ref) print ''; } print "\n"; - + print ''; $var=false; if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) @@ -2164,6 +2165,7 @@ elseif ($id || $ref) //var_dump($alreadysent); } + print ''; // Loop on each product to send/sent for ($i = 0 ; $i < $num_prod ; $i++) { @@ -2174,12 +2176,12 @@ elseif ($id || $ref) if(empty($reshook)) { print ''; // id of order line - print ''; + print ''; // # if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { - print ''; + print ''; } // Predefined product or service @@ -2195,7 +2197,7 @@ elseif ($id || $ref) else $label = (! empty($lines[$i]->label)?$lines[$i]->label:$lines[$i]->product_label); - print ''; + print ''; // Qty in other shipments (with shipment and warehouse used) if ($origin && $origin_id > 0) { - print ''; + print ''; // Warehouse source if (! empty($conf->stock->enabled)) { - print ''; } else { - print ''; + print ''; } } } // Weight - print ''; // Volume - print ''; @@ -2473,6 +2475,7 @@ elseif ($id || $ref) // TODO Show also lines ordered but not delivered print "
      '.$langs->trans("Products").''.$langs->trans("Products").''.$langs->trans("QtyOrdered").''.$langs->trans("QtyOrdered").''.$langs->trans("QtyInOtherShipments").''.$langs->trans("QtyInOtherShipments").''; + print ''; if ($object->statut <= 1) { print $langs->trans("QtyToShip").' - '; @@ -2079,24 +2080,24 @@ elseif ($id || $ref) { if ($object->statut <= 1) { - print ''.$langs->trans("QtyToShip").''.$langs->trans("QtyToShip").''.$langs->trans("QtyShipped").''.$langs->trans("QtyShipped").''.$langs->trans("WarehouseSource").''.$langs->trans("WarehouseSource").''.$langs->trans("Batch").''.$langs->trans("Batch").''.$langs->trans("CalculatedWeight").''.$langs->trans("CalculatedVolume").''.$langs->trans("CalculatedWeight").''.$langs->trans("CalculatedVolume").''.$langs->trans("Size").'
    '.($i+1).''.($i+1).''; + print ''; // Show product and description $product_static->type=$lines[$i]->fk_product_type; @@ -2215,7 +2217,7 @@ elseif ($id || $ref) } else { - print ""; + print ''; if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -2231,12 +2233,12 @@ elseif ($id || $ref) } // Qty ordered - print ''.$lines[$i]->qty_asked.''.$lines[$i]->qty_asked.''; + print ''; foreach ($alreadysent as $key => $val) { if ($lines[$i]->fk_origin_line == $key) @@ -2350,12 +2352,12 @@ elseif ($id || $ref) else { // Qty to ship or shipped - print ''.$lines[$i]->qty_shipped.''.$lines[$i]->qty_shipped.''; + print ''; if ($lines[$i]->entrepot_id > 0) { $entrepot = new Entrepot($db); @@ -2385,7 +2387,7 @@ elseif ($id || $ref) if (isset($lines[$i]->detail_batch)) { print ''; - print ''; + print ''; if ($lines[$i]->product_tobatch) { $detail = ''; @@ -2405,19 +2407,19 @@ elseif ($id || $ref) } print ''; + print ''; if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->weight*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->weight_units, "weight"); else print ' '; print ''; + print ''; if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units, "volume"); else print ' '; print '
    \n"; + print ''; print '
    '; } From 5c00712c0a142d1a472c469845c872f67e1f1663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 17:57:40 +0200 Subject: [PATCH 553/982] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 86d02bcf22c..f018bdefe53 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3015,7 +3015,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithoutext, array( 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', - 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', + 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow',, '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'jabber','skype','twitter','facebook','linkedin', 'chevron-left','chevron-right','chevron-down','chevron-top' ) From e43f3a0f58d03864e3fd4dd47c1d9a4b4b77f7b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 18:07:06 +0200 Subject: [PATCH 554/982] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f018bdefe53..ad72b8cf22e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3015,7 +3015,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithoutext, array( 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', - 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow',, '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', + 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'jabber','skype','twitter','facebook','linkedin', 'chevron-left','chevron-right','chevron-down','chevron-top' ) From 5233e7d8adcff6e95f5886a828a731050c9d63ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 18:29:04 +0200 Subject: [PATCH 555/982] FIX do not output return code on screen after a select of bank account --- htdocs/cashdesk/index.php | 6 +++--- htdocs/compta/bank/ligne.php | 2 +- htdocs/paybox/admin/paybox.php | 2 +- htdocs/paypal/admin/paypal.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 8bd64c76e2b..9efe1b8ed7f 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -157,7 +157,7 @@ print ''.$langs->trans("CashDeskBankAccountForSell").''; print ''; $defaultknown=0; if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && $conf->global->CASHDESK_ID_BANKACCOUNT_CASH > 0) $defaultknown=1; // If a particular stock is defined, we disable choice -print $form->select_comptes(((GETPOST('bankid_cash') > 0)?GETPOST('bankid_cash'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH), 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", ($defaultknown?0:2)); +$form->select_comptes(((GETPOST('bankid_cash') > 0)?GETPOST('bankid_cash'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH), 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", ($defaultknown?0:2)); print ''; print "\n"; @@ -166,7 +166,7 @@ print ''.$langs->trans("CashDeskBankAccountForCheque").' print ''; $defaultknown=0; if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE) && $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE > 0) $defaultknown=1; // If a particular stock is defined, we disable choice -print $form->select_comptes(((GETPOST('bankid_cheque') > 0)?GETPOST('bankid_cheque'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE), 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", ($defaultknown?0:2)); +$form->select_comptes(((GETPOST('bankid_cheque') > 0)?GETPOST('bankid_cheque'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE), 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", ($defaultknown?0:2)); print ''; print "\n"; @@ -175,7 +175,7 @@ print ''.$langs->trans("CashDeskBankAccountForCB").''; print ''; $defaultknown=0; if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB) && $conf->global->CASHDESK_ID_BANKACCOUNT_CB > 0) $defaultknown=1; // If a particular stock is defined, we disable choice -print $form->select_comptes(((GETPOST('bankid_cb') > 0)?GETPOST('bankid_cb'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB), 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", ($defaultknown?0:2)); +$form->select_comptes(((GETPOST('bankid_cb') > 0)?GETPOST('bankid_cb'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB), 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", ($defaultknown?0:2)); print ''; print "\n"; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 40906bfd455..7581b0c4985 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -323,7 +323,7 @@ if ($result) print ''; if (! $objp->rappro && ! $bankline->getVentilExportCompta()) { - print $form->select_comptes($acct->id, 'accountid', 0, '', 0); + $form->select_comptes($acct->id, 'accountid', 0, '', 0); } else { diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index abad76ce228..8f946a30001 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -197,7 +197,7 @@ if (! empty($conf->banque->enabled)) { print ''; print $langs->trans("BankAccount").''; - print $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); + $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); print ''; } diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index aefcb50369a..545fe9c368c 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -214,7 +214,7 @@ if (! empty($conf->banque->enabled)) { print ''; print $langs->trans("BankAccount").''; - print $form->select_comptes($conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); + $form->select_comptes($conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); print ''; } From e3480780cfd6a89bd06142ccc7d10e48aeea83da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 18:31:40 +0200 Subject: [PATCH 556/982] Fix label on "Connect" button on Simple POS module --- htdocs/cashdesk/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 9efe1b8ed7f..94b3e4445f7 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -191,7 +191,7 @@ print "\n";
    -
    +
    From 8d794049148f49af4d9531922606752ee6a38288 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 18:40:58 +0200 Subject: [PATCH 557/982] Fix css for responsive --- htdocs/cashdesk/index.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 94b3e4445f7..57dc1cbb394 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -96,11 +96,11 @@ else trans("Login"); ?> - + trans("Password"); ?> - + Date: Mon, 16 Sep 2019 19:08:45 +0200 Subject: [PATCH 558/982] Fix css for company logo in top menu --- htdocs/theme/eldy/global.inc.php | 6 +++--- htdocs/theme/md/style.css.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 5beebb89a36..2ee73a7889b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5673,7 +5673,7 @@ div.tabsElem a.tab { /* nboftopmenuentries = , fontsize= */ /* rule to reduce top menu - 1st reduction: Reduce width of top menu icons */ -@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1) ? round($nbtopmenuentries * 90, 0) + 240 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1; ?>px) /* reduction 1 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1) ? round($nbtopmenuentries * 90, 0) + 340 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1; ?>px) /* reduction 1 */ { div.tmenucenter { width: px; /* size of viewport */ @@ -5706,7 +5706,7 @@ div.tabsElem a.tab { } } /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ -@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ { li.tmenucompanylogo { display: none; @@ -5733,7 +5733,7 @@ div.tabsElem a.tab { } } /* rule to reduce top menu - 3rd reduction: The menu for user is on left */ -@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ { .side-nav { z-index: 200; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8c78e8be88b..ab965b1d3d3 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5670,7 +5670,7 @@ border-top-right-radius: 6px; /* nboftopmenuentries = , fontsize= */ /* disableimages = */ /* rule to reduce top menu - 1st reduction */ -@media only screen and (max-width: px) +@media only screen and (max-width: px) { div.tmenucenter { max-width: px; /* size of viewport */ @@ -5697,7 +5697,7 @@ border-top-right-radius: 6px; } } /* rule to reduce top menu - 2nd reduction */ -@media only screen and (max-width: px) +@media only screen and (max-width: px) { li.tmenucompanylogo { display: none; From 67b73cf0e6a6f731f340c0c5141615b966019028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 20:57:20 +0200 Subject: [PATCH 559/982] Update actioncomm.class.php --- htdocs/comm/action/class/actioncomm.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 12926f9b360..7e8bd88e5bc 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -772,6 +772,7 @@ class ActionComm extends CommonObject $error=0; $this->db->begin(); + $this->oldcopy = clone $this; $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; $sql.= " WHERE id=".$this->id; From f369c1a80a41dfa032dd875add059edd7a87dcb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 20:59:13 +0200 Subject: [PATCH 560/982] Update card.php --- htdocs/comm/action/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 173770d725c..b2438175123 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -608,6 +608,7 @@ if ($action == 'update') if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') { $object->fetch($id); + $object->fetch_optionals(); if ($user->rights->agenda->myactions->delete || $user->rights->agenda->allactions->delete) From fb7ef3cefc6ca9765e0e4db5f8058ea390d6c63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 23:12:11 +0200 Subject: [PATCH 561/982] Update card.php --- htdocs/comm/action/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b2438175123..1df5c06f51f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -421,6 +421,7 @@ if ($action == 'update') if ($p2min == -1) $p2min='0'; $object->fetch($id); + $object->fetch_optionals(); $object->fetch_userassigned(); $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); From 78386871f37daa2fab0c5da8acaff4e70777710f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 03:33:58 +0200 Subject: [PATCH 562/982] css --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2ee73a7889b..533608aa132 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2650,7 +2650,7 @@ table.liste th, table.noborder th, table.noborder tr.liste_titre td, table.nobor } table.liste td, table.noborder td, div.noborder form div, table.tableforservicepart1 td, table.tableforservicepart2 td { padding: 7px 8px 7px 8px; /* t r b l */ - line-height: 22px; + /* line-height: 22px; This create trouble on cell login on list of last events of a contract*/ height: 22px; } div.liste_titre_bydiv .divsearchfield { From a2d3cde2915aee620e791a5472420e3a0c75cd77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 07:59:46 +0200 Subject: [PATCH 563/982] some update after night --- htdocs/comm/action/card.php | 6 +++++- htdocs/comm/action/class/actioncomm.class.php | 1 - htdocs/comm/action/class/api_agendaevents.class.php | 12 +++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 1df5c06f51f..4eeb87a5b61 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -422,7 +422,9 @@ if ($action == 'update') $object->fetch($id); $object->fetch_optionals(); - $object->fetch_userassigned(); + $object->fetch_userassigned(); + $object->oldcopy = clone $object; + $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); @@ -610,6 +612,8 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') { $object->fetch($id); $object->fetch_optionals(); + $object->fetch_userassigned(); + $object->oldcopy = clone $object; if ($user->rights->agenda->myactions->delete || $user->rights->agenda->allactions->delete) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 7e8bd88e5bc..12926f9b360 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -772,7 +772,6 @@ class ActionComm extends CommonObject $error=0; $this->db->begin(); - $this->oldcopy = clone $this; $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; $sql.= " WHERE id=".$this->id; diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 833f97b3b6b..53d0ad61b90 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -237,6 +237,11 @@ class AgendaEvents extends DolibarrApi } $result = $this->actioncomm->fetch($id); + if ($result) { + $this->actioncomm->fetch_optionals(); + $this->actioncomm->fetch_userassigned(); + $this->actioncomm->oldcopy = clone $this->actioncomm; + } if ( ! $result ) { throw new RestException(404, 'actioncomm not found'); } @@ -269,7 +274,12 @@ class AgendaEvents extends DolibarrApi throw new RestException(401, "Insuffisant rights to delete your Agenda Event"); } - $result = $this->actioncomm->fetch($id); + $result = $this->actioncomm->fetch($id); + if ($result) { + $this->actioncomm->fetch_optionals(); + $this->actioncomm->fetch_userassigned(); + $this->actioncomm->oldcopy = clone $this->actioncomm; + } if(! DolibarrApiAccess::$user->rights->agenda->allactions->delete && DolibarrApiAccess::$user->id != $this->actioncomm->userownerid) { throw new RestException(401, "Insuffisant rights to delete an Agenda Event of owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); From ecac1f9f404f5640ab502ff2fe43050c84d928e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 08:02:55 +0200 Subject: [PATCH 564/982] wip --- htdocs/comm/action/class/api_agendaevents.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 53d0ad61b90..3f21e94f53d 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -274,7 +274,7 @@ class AgendaEvents extends DolibarrApi throw new RestException(401, "Insuffisant rights to delete your Agenda Event"); } - $result = $this->actioncomm->fetch($id); + $result = $this->actioncomm->fetch($id); if ($result) { $this->actioncomm->fetch_optionals(); $this->actioncomm->fetch_userassigned(); From 0d63c43ccd239b116b9c0283ddd79ec29f911570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 08:15:01 +0200 Subject: [PATCH 565/982] add doaction to actioncommcard --- htdocs/comm/action/card.php | 49 +++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 003203940a8..31b2f22a194 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -86,6 +86,18 @@ $form = new Form($db); $formfile = new FormFile($db); $formactions = new FormActions($db); +// Load object +if ($id > 0 && $action!='add') { + $ret = $object->fetch($id); + if ($ret > 0) { + $ret = $object->fetch_optionals(); + $ret1 = $object->fetch_userassigned(); + } + if ($ret < 0 || $ret1 < 0) { + dol_print_error('', $object->error); + } +} + // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); @@ -94,6 +106,9 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('actioncard','globalcard')); +$parameters = array('socid' => $socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); /* * Actions @@ -101,7 +116,7 @@ $hookmanager->initHooks(array('actioncard','globalcard')); $listUserAssignedUpdated = false; // Remove user to assigned list -if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0') +if (empty($reshook) && (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')) { $idtoremove=GETPOST('removedassigned'); @@ -122,7 +137,7 @@ if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0') } // Add user to assigned list -if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser')) +if (empty($reshook) && (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))) { // Add a new user if (GETPOST('assignedtouser') > 0) @@ -143,15 +158,15 @@ if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser')) } // Link to a project -if ($action == 'classin' && ($user->rights->agenda->allactions->create || +if (empty($reshook) && $action == 'classin' && ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))) { - $object->fetch($id); + //$object->fetch($id); $object->setProject(GETPOST('projectid', 'int')); } // Action clone object -if ($action == 'confirm_clone' && $confirm == 'yes') +if (empty($reshook) && $action == 'confirm_clone' && $confirm == 'yes') { if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) { @@ -160,7 +175,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') else { if ($id > 0) { - $object->fetch($id); + //$object->fetch($id); if (!empty($object->socpeopleassigned)) { reset($object->socpeopleassigned); $object->contactid = key($object->socpeopleassigned); @@ -178,7 +193,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') } // Add event -if ($action == 'add') +if (empty($reshook) && $action == 'add') { $error=0; @@ -403,7 +418,7 @@ if ($action == 'add') /* * Action update event */ -if ($action == 'update') +if (empty($reshook) && $action == 'update') { if (empty($cancel)) { @@ -420,8 +435,8 @@ if ($action == 'update') if ($p2hour == -1) $p2hour='0'; if ($p2min == -1) $p2min='0'; - $object->fetch($id); - $object->fetch_userassigned(); + //$object->fetch($id); + //$object->fetch_userassigned(); $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); @@ -546,9 +561,9 @@ if ($action == 'update') /* * delete event */ -if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') +if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes') { - $object->fetch($id); + //$object->fetch($id); if ($user->rights->agenda->myactions->delete || $user->rights->agenda->allactions->delete) @@ -571,10 +586,10 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') * Action move update, used when user move an event in calendar by drag'n drop * TODO Move this into page comm/action/index that trigger this call by the drag and drop of event. */ -if (GETPOST('actionmove', 'alpha') == 'mupdate') +if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { - $object->fetch($id); - $object->fetch_userassigned(); + //$object->fetch($id); + //$object->fetch_userassigned(); $shour = dol_print_date($object->datep, "%H"); $smin = dol_print_date($object->datep, "%M"); @@ -614,7 +629,9 @@ if (GETPOST('actionmove', 'alpha') == 'mupdate') // Actions to delete doc $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); $permissioncreate = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); -include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; +if (empty($reshook) { + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; +} /* From 155e8fb50083934adca79862db73d0de76d137b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 08:18:01 +0200 Subject: [PATCH 566/982] fix syntax --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 31b2f22a194..6418869bf1d 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -629,7 +629,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') // Actions to delete doc $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); $permissioncreate = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); -if (empty($reshook) { +if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } From e4984492b3173a053362da42bd11f59b7d511ed4 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 17 Sep 2019 09:32:43 +0200 Subject: [PATCH 567/982] Dejarlo igual que develop --- htdocs/compta/facture/class/facture-rec.class.php | 6 +----- htdocs/compta/facture/class/facture.class.php | 1 - htdocs/install/mysql/tables/llx_facture_rec.sql | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 57ecc836acf..37a031198bc 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -77,7 +77,6 @@ class FactureRec extends CommonInvoice public $total; public $db_table; public $propalid; - public $ref_client; public $date_last_gen; public $date_when; @@ -168,7 +167,6 @@ class FactureRec extends CommonInvoice $sql.= ", fk_account"; $sql.= ", fk_cond_reglement"; $sql.= ", fk_mode_reglement"; - $sql.= ", ref_client"; $sql.= ", usenewprice"; $sql.= ", frequency"; $sql.= ", unit_frequency"; @@ -197,7 +195,6 @@ class FactureRec extends CommonInvoice $sql.= ", ".(! empty($facsrc->fk_account)?"'".$facsrc->fk_account."'":"null"); $sql.= ", ".($facsrc->cond_reglement_id > 0 ? $this->db->escape($facsrc->cond_reglement_id) : "null"); $sql.= ", ".($facsrc->mode_reglement_id > 0 ? $this->db->escape($facsrc->mode_reglement_id) : "null"); - $sql.= ",'".$this->db->escape($this->ref_client)."'"; $sql.= ", ".$this->usenewprice; $sql.= ", ".$this->frequency; $sql.= ", '".$this->db->escape($this->unit_frequency)."'"; @@ -386,7 +383,7 @@ class FactureRec extends CommonInvoice $sql.= ', f.note_private, f.note_public, f.fk_user_author'; $sql.= ', f.modelpdf'; $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet as fk_project'; - $sql.= ', f.fk_account, f.ref_client'; + $sql.= ', f.fk_account'; $sql.= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.usenewprice, f.auto_validate'; $sql.= ', f.generate_pdf'; $sql.= ", f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc"; @@ -1147,7 +1144,6 @@ class FactureRec extends CommonInvoice $facture->brouillon = 1; $facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; - $facture->ref_client = $facturerec->ref_client; $invoiceidgenerated = $facture->create($user); if ($invoiceidgenerated <= 0) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 70ecf6500f5..131f0ee90fd 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -372,7 +372,6 @@ class Facture extends CommonInvoice $this->socid = $_facrec->socid; // Invoice created on same thirdparty than template $this->entity = $_facrec->entity; // Invoice created in same entity than template - $this->ref_client = $_facrec->ref_client; // Fields coming from GUI (priority on template). TODO Value of template should be used as default value on GUI so we can use here always value from GUI $this->fk_project = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_project; diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql index 2c1c2514488..1add07c6e8c 100644 --- a/htdocs/install/mysql/tables/llx_facture_rec.sql +++ b/htdocs/install/mysql/tables/llx_facture_rec.sql @@ -29,7 +29,6 @@ create table llx_facture_rec tms timestamp, -- date creation/modification suspended integer DEFAULT 0, -- 1=suspended - ref_client varchar(255), -- reference for customer amount double(24,8) DEFAULT 0 NOT NULL, remise real DEFAULT 0, From 3f25a8d8d57d38792f46ac736dd6ce75630075da Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 17 Sep 2019 09:38:08 +0200 Subject: [PATCH 568/982] New: Load invoices only if showed --- htdocs/compta/facture/card.php | 88 +++++++++++++++++----------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ff5a280a118..6d0bf2f56bc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013 Jean-Francois FERRY * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2014-2018 Ferran Marcet + * Copyright (C) 2014-2019 Ferran Marcet * Copyright (C) 2015-2016 Marcos García * Copyright (C) 2018 Frédéric France * @@ -2862,49 +2862,6 @@ if ($action == 'create') } } - // Type de facture - $facids = $facturestatic->list_replacable_invoices($soc->id); - if ($facids < 0) { - dol_print_error($db, $facturestatic); - exit(); - } - $options = ""; - foreach ($facids as $facparam) - { - $options .= ''; - } - - // Show link for credit note - $facids=$facturestatic->list_qualified_avoir_invoices($soc->id); - if ($facids < 0) - { - dol_print_error($db, $facturestatic); - exit; - } - $optionsav = ""; - $newinvoice_static = new Facture($db); - foreach ($facids as $key => $valarray) - { - $newinvoice_static->id = $key; - $newinvoice_static->ref = $valarray ['ref']; - $newinvoice_static->statut = $valarray ['status']; - $newinvoice_static->type = $valarray ['type']; - $newinvoice_static->paye = $valarray ['paye']; - - $optionsav .= ''; - } - print '' . $langs->trans('Type') . ''; print '
    ' . "\n"; @@ -2981,6 +2938,23 @@ if ($action == 'create') // Replacement if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT)) { + // Type de facture + $facids = $facturestatic->list_replacable_invoices($soc->id); + if ($facids < 0) { + dol_print_error($db, $facturestatic); + exit(); + } + $options = ""; + foreach ($facids as $facparam) + { + $options .= ''; + } + print ''; print '
    '; $tmp='global->INVOICE_DISABLE_CREDIT_NOTE)) { + // Show link for credit note + $facids=$facturestatic->list_qualified_avoir_invoices($soc->id); + if ($facids < 0) + { + dol_print_error($db, $facturestatic); + exit; + } + $optionsav = ""; + $newinvoice_static = new Facture($db); + foreach ($facids as $key => $valarray) + { + $newinvoice_static->id = $key; + $newinvoice_static->ref = $valarray ['ref']; + $newinvoice_static->statut = $valarray ['status']; + $newinvoice_static->type = $valarray ['type']; + $newinvoice_static->paye = $valarray ['paye']; + + $optionsav .= ''; + } + print '
    '; $tmp=' Date: Tue, 17 Sep 2019 09:43:15 +0200 Subject: [PATCH 569/982] New: Load invoices only if showed --- htdocs/fourn/facture/card.php | 87 ++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ae042b4c4b8..db5b87e590f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -10,6 +10,7 @@ * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2016-2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 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 @@ -1765,49 +1766,6 @@ if ($action == 'create') print ''.$langs->trans('RefSupplier').''; print ''; - // Type invoice - $facids = $facturestatic->list_replacable_supplier_invoices($societe->id); - if ($facids < 0) { - dol_print_error($db, $facturestatic); - exit(); - } - $options = ""; - foreach ($facids as $facparam) - { - $options .= ''; - } - - // Show link for credit note - $facids=$facturestatic->list_qualified_avoir_supplier_invoices($societe->id); - if ($facids < 0) - { - dol_print_error($db, $facturestatic); - exit; - } - $optionsav = ""; - $newinvoice_static = new FactureFournisseur($db); - foreach ($facids as $key => $valarray) - { - $newinvoice_static->id = $key; - $newinvoice_static->ref = $valarray ['ref']; - $newinvoice_static->statut = $valarray ['status']; - $newinvoice_static->type = $valarray ['type']; - $newinvoice_static->paye = $valarray ['paye']; - - $optionsav .= ''; - } - print ''.$langs->trans('Type').''; print '
    ' . "\n"; @@ -1860,6 +1818,23 @@ if ($action == 'create') // Replacement if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT)) { + // Type invoice + $facids = $facturestatic->list_replacable_supplier_invoices($societe->id); + if ($facids < 0) { + dol_print_error($db, $facturestatic); + exit(); + } + $options = ""; + foreach ($facids as $facparam) + { + $options .= ''; + } + print ''; print '
    '; $tmp='global->INVOICE_DISABLE_CREDIT_NOTE)) { + // Show link for credit note + $facids=$facturestatic->list_qualified_avoir_supplier_invoices($societe->id); + if ($facids < 0) + { + dol_print_error($db, $facturestatic); + exit; + } + $optionsav = ""; + $newinvoice_static = new FactureFournisseur($db); + foreach ($facids as $key => $valarray) + { + $newinvoice_static->id = $key; + $newinvoice_static->ref = $valarray ['ref']; + $newinvoice_static->statut = $valarray ['status']; + $newinvoice_static->type = $valarray ['type']; + $newinvoice_static->paye = $valarray ['paye']; + + $optionsav .= ''; + } + print '
    '; $tmp=' Date: Tue, 17 Sep 2019 10:05:35 +0200 Subject: [PATCH 570/982] FIX selectFields for GROUP BY and show only if units defined --- htdocs/core/class/html.form.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 52be1cec2b0..5c2d89cdf60 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2120,7 +2120,7 @@ class Form // Units if (! empty($conf->global->PRODUCT_USE_UNITS)) { $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; - $selectFields .= ', unit_long, unit_short'; + $selectFields .= ', unit_long, unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units'; } // Multilang : we add translation @@ -2419,19 +2419,19 @@ class Form if (!empty($objp->unit_short)) { $outvalUnits .= ' - ' . $objp->unit_short; } - if (!empty($objp->weight)) { + if (!empty($objp->weight) && $objp->weight_units!==null) { $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) { + if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units!==null) { $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuring_units_string($objp->length_units, 'size'); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->surface)) { + if (!empty($objp->surface) && $objp->surface_units!==null) { $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->volume)) { + if (!empty($objp->volume) && $objp->volume_units!==null) { $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); $outvalUnits .= ' - ' . $unitToShow; } @@ -2796,19 +2796,19 @@ class Form if (!empty($objp->unit_short)) { $outvalUnits .= ' - ' . $objp->unit_short; } - if (!empty($objp->weight)) { + if (!empty($objp->weight) && $objp->weight_units!==null) { $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) { + if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units!==null) { $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuring_units_string($objp->length_units, 'size'); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->surface)) { + if (!empty($objp->surface) && $objp->surface_units!==null) { $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->volume)) { + if (!empty($objp->volume) && $objp->volume_units!==null) { $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); $outvalUnits .= ' - ' . $unitToShow; } From a44836ae406ac4feaf7fbdcf9e8b562d003e0574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 10:15:55 +0200 Subject: [PATCH 571/982] Update CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 43ad52b5f47..864f2869b82 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -80,6 +80,18 @@ class CMailFile public $headers; public $message; + /** + * @var array fullfilenames list + */ + public $filename_list = array(); + /** + * @var array mimetypes of files list + */ + public $mimetype_list = array(); + /** + * @var array filenames list + */ + public $mimefilename_list = array(); // Image public $html; @@ -125,6 +137,9 @@ class CMailFile global $conf, $dolibarr_main_data_root; $this->sendcontext = $sendcontext; + $this->filename_list = $filename_list; + $this->mimetype_list = $mimetype_list; + $this->mimefilename_list = $mimefilename_list; if (empty($replyto)) $replyto=$from; From 2ac8bd4e1629f27e5f5c745ade6db6f0b3933fd3 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 17 Sep 2019 11:59:58 +0200 Subject: [PATCH 572/982] FIX : If we share invoice, we need to see discount created from a deposit on each entity --- htdocs/core/class/discount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 2e99a83ec42..d464e986c32 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -91,7 +91,7 @@ class DiscountAbsolute $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fsup ON sr.fk_invoice_supplier_source = fsup.rowid"; - $sql.= " WHERE sr.entity = " . $conf->entity; + $sql.= " WHERE sr.entity IN (".getEntity('invoice').")"; if ($rowid) $sql.= " AND sr.rowid=".$rowid; if ($fk_facture_source) $sql.= " AND sr.fk_facture_source=".$fk_facture_source; if ($fk_invoice_supplier_source) $sql.= " AND sr.fk_invoice_supplier_source=".$fk_invoice_supplier_source; From d3b17f4f2d4df244f0023fa3b683a122f1fb32d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 12:08:33 +0200 Subject: [PATCH 573/982] FIX form not closed. --- htdocs/projet/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index c025fe91ab5..e1938fa05be 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -48,7 +48,6 @@ $sortorder = GETPOST("sortorder", 'alpha'); $max=3; - /* * View */ @@ -76,12 +75,14 @@ else $titleall=$langs->trans("AllAllowedProjects").'

    '; $morehtml=''; -$morehtml.='
    '; +$morehtml.=''; +$morehtml.=''; $morehtml.=''; $morehtml.=''; +$morehtml.='
    '; print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, -1, 'title_project.png', 0, $morehtml); From a91f39ea3e99501512dc5fb6a52dc67d4610f615 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 12:08:33 +0200 Subject: [PATCH 574/982] FIX selection of project i am contact of. --- htdocs/projet/index.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index c025fe91ab5..22be3ab35db 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -48,19 +48,17 @@ $sortorder = GETPOST("sortorder", 'alpha'); $max=3; - /* * View */ $companystatic=new Societe($db); $projectstatic=new Project($db); -$userstatic=new User($db); $form=new Form($db); $formfile=new FormFile($db); $projectset = ($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)); -$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projetset, 1); +$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projectset, 1); //var_dump($projectsListId); llxHeader("", $langs->trans("Projects"), "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"); @@ -74,14 +72,15 @@ $titleall=$langs->trans("AllAllowedProjects"); if (! empty($user->rights->projet->all->lire) && ! $socid) $titleall=$langs->trans("AllProjects"); else $titleall=$langs->trans("AllAllowedProjects").'

    '; - $morehtml=''; -$morehtml.='
    '; +$morehtml.=''; +$morehtml.=''; $morehtml.=''; $morehtml.=''; +$morehtml.='
    '; print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, -1, 'title_project.png', 0, $morehtml); @@ -164,7 +163,6 @@ print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 0, $listofoppst print '
    '; - // Last modified projects $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.tms as datem,"; $sql.= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.canvas"; From 64c53e2e8556c0e2f28b645c223fb70c5235fc3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 12:19:33 +0200 Subject: [PATCH 575/982] Fix "project i am contact for" filter --- htdocs/projet/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 4c4ae4c71cf..3ca6296f81d 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -57,7 +57,7 @@ $form=new Form($db); $formfile=new FormFile($db); $projectset = ($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)); -$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projetset, 1); +$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projectset, 1); //var_dump($projectsListId); From 24cb1390e4e4327b84dcc5e58e42b153b72aa0cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 13:17:25 +0200 Subject: [PATCH 576/982] FIX Update of leave request when CSRF with token is on FIX Export of leave request show the number of open days --- htdocs/core/modules/modHoliday.class.php | 5 +++-- htdocs/exports/class/export.class.php | 9 ++++++++- htdocs/holiday/card.php | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index ba792ad28ad..61217d91686 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -202,13 +202,13 @@ class modHoliday extends DolibarrModules $this->export_permission[$r]=array(array("holiday","read_all")); $this->export_fields_array[$r]=array( 'd.rowid'=>"LeaveId",'d.fk_type'=>'TypeOfLeaveId','t.code'=>'TypeOfLeaveCode','t.label'=>'TypeOfLeaveLabel','d.fk_user'=>'UserID', - 'u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>"Login",'d.date_debut'=>'DateStart','d.date_fin'=>'DateEnd','d.halfday'=>'HalfDay', + 'u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>"Login",'d.date_debut'=>'DateStart','d.date_fin'=>'DateEnd','d.halfday'=>'HalfDay','none.num_open_days'=>'NbUseDaysCP', 'd.date_valid'=>'DateApprove','d.fk_validator'=>"UserForApprovalID",'ua.lastname'=>"UserForApprovalLastname",'ua.firstname'=>"UserForApprovalFirstname", 'ua.login'=>"UserForApprovalLogin",'d.description'=>'Description','d.statut'=>'Status' ); $this->export_TypeFields_array[$r]=array( 'd.rowid'=>"Numeric",'t.code'=>'Text', 't.label'=>'Text','d.fk_user'=>'Numeric', - 'u.lastname'=>'Text','u.firstname'=>'Text','u.login'=>"Text",'d.date_debut'=>'Date','d.date_fin'=>'Date', + 'u.lastname'=>'Text','u.firstname'=>'Text','u.login'=>"Text",'d.date_debut'=>'Date','d.date_fin'=>'Date','none.num_open_days'=>'NumericCompute', 'd.date_valid'=>'Date','d.fk_validator'=>"Numeric",'ua.lastname'=>"Text",'ua.firstname'=>"Text", 'ua.login'=>"Text",'d.description'=>'Text','d.statut'=>'Numeric' ); @@ -216,6 +216,7 @@ class modHoliday extends DolibarrModules 'u.lastname'=>'user','u.firstname'=>'user','u.login'=>'user','ua.lastname'=>'user','ua.firstname'=>'user','ua.login'=>'user' ); $this->export_alias_array[$r]=array('d.rowid'=>"idholiday"); + $this->export_special_array[$r] = array('none.num_open_days'=>'getNumOpenDays'); $this->export_dependencies_array[$r]=array(); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_sql_start[$r]='SELECT DISTINCT '; diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 51a16f717b2..f6ef6a27e2b 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -540,7 +540,7 @@ class Export public function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery = '') { // phpcs:enable - global $conf,$langs; + global $conf,$langs,$mysoc; $indice=0; asort($array_selected); @@ -634,6 +634,13 @@ class Export $alias=str_replace(array('.', '-','(',')'), '_', $key); if ($obj->$alias < 0) $obj->$alias='0'; } + // Operation GETNUMOPENDAYS (for Holiday module) + elseif ($this->array_export_special[$indice][$key]=='getNumOpenDays') + { + //$alias=$this->array_export_alias[$indice][$key]; + $alias=str_replace(array('.', '-','(',')'), '_', $key); + $obj->$alias=num_open_day(dol_stringtotime($obj->d_date_debut, 1), dol_stringtotime($obj->d_date_fin, 1), 0, 1, $obj->d_halfday, $mysoc->country_code); + } // Operation INVOICEREMAINTOPAY elseif ($this->array_export_special[$indice][$key]=='getRemainToPay') { diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 204d832a94c..1f597f2ddc2 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1134,6 +1134,7 @@ else if ($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) $edit = true; print '
    '."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; } From 214bf4375eb9cfafa32723131e597ff01643e0ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 13:28:36 +0200 Subject: [PATCH 577/982] Fix missing include --- htdocs/exports/class/export.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index f6ef6a27e2b..da184f27574 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -637,6 +637,7 @@ class Export // Operation GETNUMOPENDAYS (for Holiday module) elseif ($this->array_export_special[$indice][$key]=='getNumOpenDays') { + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; //$alias=$this->array_export_alias[$indice][$key]; $alias=str_replace(array('.', '-','(',')'), '_', $key); $obj->$alias=num_open_day(dol_stringtotime($obj->d_date_debut, 1), dol_stringtotime($obj->d_date_fin, 1), 0, 1, $obj->d_halfday, $mysoc->country_code); From 5e7b7bbc33c846f36768bb3dc8688d4b76879945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 13:31:45 +0200 Subject: [PATCH 578/982] Update eldy.lib.php --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2eead6da81d..e7764be3ceb 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; */ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode = '') { - global $user,$conf,$langs,$dolibarr_main_db_name; + global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; $mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]); $leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]); From c8bfd2c7c25ed51ce2bc7894c9b62c9d13531df5 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 17 Sep 2019 13:37:34 +0200 Subject: [PATCH 579/982] NEW translation for member type usefull for sync with API and multilanguage front end or application --- htdocs/core/lib/member.lib.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 27df67aedac..3628c9cdc51 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -127,6 +127,15 @@ function member_type_prepare_head(AdherentType $object) $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; + + // Multilangs + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $head[$h][0] = DOL_URL_ROOT."/adherents/traduction.php?rowid=".$object->id; + $head[$h][1] = $langs->trans("Translation"); + $head[$h][2] = 'translation'; + $h++; + } if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin))) From cff6da34df676f08e99d9fa0f750ec0a7411c80d Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 17 Sep 2019 13:53:06 +0200 Subject: [PATCH 580/982] Create traduction.php --- htdocs/adherents/traduction.php | 323 ++++++++++++++++++++++++++++++++ 1 file changed, 323 insertions(+) create mode 100644 htdocs/adherents/traduction.php diff --git a/htdocs/adherents/traduction.php b/htdocs/adherents/traduction.php new file mode 100644 index 00000000000..23ed3775735 --- /dev/null +++ b/htdocs/adherents/traduction.php @@ -0,0 +1,323 @@ + + * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2010-2012 Destailleur Laurent + * Copyright (C) 2014 Henry Florian + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/product/traduction.php + * \ingroup product + * \brief Page de traduction des produits + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array('members', 'languages')); + +$id = GETPOST('rowid', 'int'); +$action=GETPOST('action', 'alpha'); +$cancel=GETPOST('cancel', 'alpha'); + +// Security check +$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); +$fieldtype = (! empty($ref) ? 'ref' : 'rowid'); +if ($user->societe_id) $socid=$user->societe_id; +// Security check +$result=restrictedArea($user, 'adherent', $id, 'adherent_type'); + + +/* + * Actions + */ + +// retour a l'affichage des traduction si annulation +if ($cancel == $langs->trans("Cancel")) +{ + $action = ''; +} + +if ($action == 'delete' && GETPOST('langtodelete', 'alpha')) +{ + $object = new AdherentType($db); + $object->fetch($id); + $object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user); +} + +// Add translation +if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->adherent->configurer) +{ + $object = new AdherentType($db); + $object->fetch($id); + $current_lang = $langs->getDefaultLang(); + + // update de l'objet + if ( $_POST["forcelangprod"] == $current_lang ) + { + $object->label = $_POST["libelle"]; + $object->description = dol_htmlcleanlastbr($_POST["desc"]); + $object->other = dol_htmlcleanlastbr($_POST["other"]); + } + else + { + $object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"]; + $object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]); + $object->multilangs[$_POST["forcelangprod"]]["other"] = dol_htmlcleanlastbr($_POST["other"]); + } + + // sauvegarde en base + if ( $object->setMultiLangs($user) > 0 ) + { + $action = ''; + } + else + { + $action = 'add'; + setEventMessages($object->error, $object->errors, 'errors'); + } +} + +// Edit translation +if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->adherent->configurer) +{ + $object = new AdherentType($db); + $object->fetch($id); + $current_lang = $langs->getDefaultLang(); + + foreach ($object->multilangs as $key => $value) // enregistrement des nouvelles valeurs dans l'objet + { + if ( $key == $current_lang ) + { + $object->label = $_POST["libelle-".$key]; + $object->description = dol_htmlcleanlastbr($_POST["desc-".$key]); + $object->other = dol_htmlcleanlastbr($_POST["other-".$key]); + } + else + { + $object->multilangs[$key]["label"] = $_POST["libelle-".$key]; + $object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]); + $object->multilangs[$key]["other"] = dol_htmlcleanlastbr($_POST["other-".$key]); + } + } + + if ( $object->setMultiLangs($user) > 0 ) + { + $action = ''; + } + else + { + $action = 'edit'; + setEventMessages($object->error, $object->errors, 'errors'); + } +} + +// Delete translation +if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && $user->rights->adherent->configurer) +{ + $object = new AdherentType($db); + $object->fetch($id); + $langtodelete=GETPOST('langdel', 'alpha'); + + + if ( $object->delMultiLangs($langtodelete, $user) > 0 ) + { + $action = ''; + } + else + { + $action = 'edit'; + setEventMessages($object->error, $object->errors, 'errors'); + } +} + +$object = new AdherentType($db); +$result = $object->fetch($id); + + +/* + * View + */ + +$title = $langs->trans('MemberTypeCard'); +$helpurl = ''; +$shortlabel = dol_trunc($object->label, 16); + +$title = $langs->trans('MemberType')." ". $shortlabel ." - ".$langs->trans('Translation'); +$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + +llxHeader('', $title, $helpurl); + +$form = new Form($db); +$formadmin=new FormAdmin($db); + +$head = member_type_prepare_head($object); +$titre=$langs->trans("MemberType".$object->type); + +// Calculate $cnt_trans +$cnt_trans = 0; +if (! empty($object->multilangs)) +{ + foreach ($object->multilangs as $key => $value) + { + $cnt_trans++; + } +} + + +dol_fiche_head($head, 'translation', $titre, 0, 'group'); + +$linkback = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'rowid', $linkback); + +dol_fiche_end(); + + + +/* ************************************************************************** */ +/* */ +/* Barre d'action */ +/* */ +/* ************************************************************************** */ + +print "\n
    \n"; + +if ($action == '') +{ + if ($user->rights->produit->creer || $user->rights->service->creer) + { + print ''.$langs->trans("Add").''; + if ($cnt_trans > 0) print ''.$langs->trans("Update").''; + } +} + +print "\n
    \n"; + + + +if ($action == 'edit') +{ + //WYSIWYG Editor + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + + print ''; + print ''; + print ''; + print ''; + + if (! empty($object->multilangs)) + { + foreach ($object->multilangs as $key => $value) + { + $s=picto_from_langcode($key); + print "
    ".($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"')."
    "; + + print '
    '; + print ''; + print ''; + print ''; + print ''; + print '
    '.$langs->trans('Label').'
    '.$langs->trans('Description').''; + $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); + $doleditor->Create(); + print '
    '; + } + } + + print '
    '; + + print '
    '; + print ''; + print '     '; + print ''; + print '
    '; + + print ''; +} +elseif ($action != 'add') +{ + if (! empty($object->multilangs)) + { + foreach ($object->multilangs as $key => $value) + { + $s=picto_from_langcode($key); + print ($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"').''; + + print '
    '; + print '
    '; + print ''; + print ''; + print ''; + print '
    '.$langs->trans('Label').''.$object->multilangs[$key]["label"].'
    '.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
    '; + print '
    '; + } + } + if (! $cnt_trans && $action != 'add') print '
    '. $langs->trans('NoTranslation').'
    '; +} + + + +/* + * Form to add a new translation + */ + +if ($action == 'add' && $user->rights->adherent->configurer) +{ + //WYSIWYG Editor + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + + print '
    '; + print '
    '; + print ''; + print ''; + print ''; + + dol_fiche_head(); + + print ''; + print ''; + print ''; + print ''; + + print '
    '.$langs->trans('Language').''; + print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1); + print '
    '.$langs->trans('Label').'
    '.$langs->trans('Description').''; + $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); + $doleditor->Create(); + print '
    '; + + dol_fiche_end(); + + print '
    '; + print ''; + print '     '; + print ''; + print '
    '; + + print '
    '; + + print '
    '; +} + +// End of page +llxFooter(); +$db->close(); From c01ab4ab53cbfd81284aced4aae976f27f36e82f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 17 Sep 2019 13:53:34 +0200 Subject: [PATCH 581/982] Update adherent_type.class.php --- .../adherents/class/adherent_type.class.php | 206 +++++++++++++++++- 1 file changed, 203 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 9591a24fa78..1ed576a362d 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -88,6 +88,8 @@ class AdherentType extends CommonObject /** @var array Array of members */ public $members=array(); + + public $multilangs=array(); /** @@ -101,6 +103,185 @@ class AdherentType extends CommonObject $this->statut = 1; } + /** + * Load array this->multilangs + * + * @return int <0 if KO, >0 if OK + */ + public function getMultiLangs() + { + global $langs; + + $current_lang = $langs->getDefaultLang(); + + $sql = "SELECT lang, label, description, email"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type_lang"; + $sql.= " WHERE fk_type=".$this->id; + + $result = $this->db->query($sql); + if ($result) { + while ($obj = $this->db->fetch_object($result)) + { + //print 'lang='.$obj->lang.' current='.$current_lang.'
    '; + if ($obj->lang == $current_lang) // si on a les traduct. dans la langue courante on les charge en infos principales. + { + $this->label = $obj->label; + $this->description = $obj->description; + $this->email = $obj->email; + } + $this->multilangs["$obj->lang"]["label"] = $obj->label; + $this->multilangs["$obj->lang"]["description"] = $obj->description; + $this->multilangs["$obj->lang"]["email"] = $obj->email; + } + return 1; + } + else + { + $this->error="Error: ".$this->db->lasterror()." - ".$sql; + return -1; + } + } + + /** + * Update or add a translation for a product + * + * @param User $user Object user making update + * @return int <0 if KO, >0 if OK + */ + public function setMultiLangs($user) + { + global $conf, $langs; + + $langs_available = $langs->get_available_languages(DOL_DOCUMENT_ROOT, 0, 2); + $current_lang = $langs->getDefaultLang(); + + foreach ($langs_available as $key => $value) + { + if ($key == $current_lang) { + $sql = "SELECT rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type_lang"; + $sql.= " WHERE fk_type=".$this->id; + $sql.= " AND lang='".$key."'"; + + $result = $this->db->query($sql); + + if ($this->db->num_rows($result)) // if there is already a description line for this language + { + $sql2 = "UPDATE ".MAIN_DB_PREFIX."adherent_type_lang"; + $sql2.= " SET "; + $sql2.= " label='".$this->db->escape($this->label)."',"; + $sql2.= " description='".$this->db->escape($this->description)."'"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.= ", email='".$this->db->escape($this->other)."'"; + } + $sql2.= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'"; + } + else + { + $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.=", email"; + } + $sql2.= ")"; + $sql2.= " VALUES(".$this->id.",'".$this->db->escape($key)."','". $this->db->escape($this->label)."',"; + $sql2.= " '".$this->db->escape($this->description)."'"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.= ", '".$this->db->escape($this->other)."'"; + } + $sql2.= ")"; + } + dol_syslog(get_class($this).'::setMultiLangs key = current_lang = '.$key); + if (! $this->db->query($sql2)) { + $this->error=$this->db->lasterror(); + return -1; + } + } + elseif (isset($this->multilangs[$key])) { + $sql = "SELECT rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type_lang"; + $sql.= " WHERE fk_type=".$this->id; + $sql.= " AND lang='".$key."'"; + + $result = $this->db->query($sql); + + if ($this->db->num_rows($result)) // if there is already a description line for this language + { + $sql2 = "UPDATE ".MAIN_DB_PREFIX."adherent_type_lang"; + $sql2.= " SET "; + $sql2.= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',"; + $sql2.= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.= ", email='".$this->db->escape($this->multilangs["$key"]["other"])."'"; + } + $sql2.= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'"; + } + else + { + $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.=", email"; + } + $sql2.= ")"; + $sql2.= " VALUES(".$this->id.",'".$this->db->escape($key)."','". $this->db->escape($this->multilangs["$key"]["label"])."',"; + $sql2.= " '".$this->db->escape($this->multilangs["$key"]["description"])."'"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2.= ", '".$this->db->escape($this->multilangs["$key"]["other"])."'"; + } + $sql2.= ")"; + } + + // We do not save if main fields are empty + if ($this->multilangs["$key"]["label"] || $this->multilangs["$key"]["description"]) { + if (! $this->db->query($sql2)) { + $this->error=$this->db->lasterror(); + return -1; + } + } + } + else + { + // language is not current language and we didn't provide a multilang description for this language + } + } + + // Call trigger + $result = $this->call_trigger('MEMBER_TYPE_SET_MULTILANGS', $user); + if ($result < 0) { + $this->error = $this->db->lasterror(); + return -1; + } + // End call triggers + + return 1; + } + + /** + * Delete a language for this product + * + * @param string $langtodelete Language code to delete + * @param User $user Object user making delete + * + * @return int <0 if KO, >0 if OK + */ + public function delMultiLangs($langtodelete, $user) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang"; + $sql.= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($langtodelete)."'"; + + dol_syslog(get_class($this).'::delMultiLangs', LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + // Call trigger + $result = $this->call_trigger('ADHERENT_TYPE_DEL_MULTILANGS', $user); + if ($result < 0) { + $this->error = $this->db->lasterror(); + dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR); + return -1; + } + // End call triggers + return 1; + } + else + { + $this->error=$this->db->lasterror(); + dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR); + return -1; + } + } /** * Fonction qui permet de creer le status de l'adherent @@ -111,7 +292,7 @@ class AdherentType extends CommonObject */ public function create($user, $notrigger = 0) { - global $conf; + global $langs, $conf; $error=0; @@ -180,7 +361,7 @@ class AdherentType extends CommonObject */ public function update($user, $notrigger = 0) { - global $conf, $hookmanager; + global $langs, $conf, $hookmanager; $error=0; @@ -202,6 +383,17 @@ class AdherentType extends CommonObject $result = $this->db->query($sql); if ($result) { + + $this->description = $this->db->escape($this->note); + + // Multilangs + if (! empty($conf->global->MAIN_MULTILANGS)) { + if ($this->setMultiLangs($user) < 0) { + $this->error=$langs->trans("Error")." : ".$this->db->error()." - ".$sql; + return -2; + } + } + $action='update'; // Actions on extra fields @@ -283,6 +475,8 @@ class AdherentType extends CommonObject */ public function fetch($rowid) { + global $langs, $conf; + $sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.subscription, d.mail_valid, d.note, d.vote"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; $sql .= " WHERE d.rowid = ".(int) $rowid; @@ -299,12 +493,18 @@ class AdherentType extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->rowid; $this->label = $obj->label; - $this->morphy = $obj->morphy; + $this->morphy = $obj->morphy; $this->statut = $obj->statut; $this->subscription = $obj->subscription; $this->mail_valid = $obj->mail_valid; $this->note = $obj->note; $this->vote = $obj->vote; + + // multilangs + if (! empty($conf->global->MAIN_MULTILANGS)) { + $this->getMultiLangs(); + } + } return 1; From a295d57e0c79cd40523fb8d565590352065e43c6 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 17 Sep 2019 13:54:17 +0200 Subject: [PATCH 582/982] Update adherent_type.class.php --- htdocs/adherents/class/adherent_type.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 1ed576a362d..4e90390c223 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -493,7 +493,7 @@ class AdherentType extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->rowid; $this->label = $obj->label; - $this->morphy = $obj->morphy; + $this->morphy = $obj->morphy; $this->statut = $obj->statut; $this->subscription = $obj->subscription; $this->mail_valid = $obj->mail_valid; From 8d8ded324d2b0eb5fade1cb5360c5d40d9593f00 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 17 Sep 2019 11:56:16 +0000 Subject: [PATCH 583/982] Fixing style errors. --- htdocs/adherents/class/adherent_type.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 4e90390c223..cd8a69e0f7d 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -504,7 +504,6 @@ class AdherentType extends CommonObject if (! empty($conf->global->MAIN_MULTILANGS)) { $this->getMultiLangs(); } - } return 1; From 50be1a634c9eed41e92be80e803fbe3db1f0254a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 17 Sep 2019 14:02:19 +0200 Subject: [PATCH 584/982] Create llx_adherent_type_lang.php --- .../mysql/tables/llx_adherent_type_lang.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_adherent_type_lang.php diff --git a/htdocs/install/mysql/tables/llx_adherent_type_lang.php b/htdocs/install/mysql/tables/llx_adherent_type_lang.php new file mode 100644 index 00000000000..5f1ceee1f49 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_adherent_type_lang.php @@ -0,0 +1,30 @@ +-- ============================================================================ +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2005-2010 Regis Houssin +-- Copyright (C) 2009 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ============================================================================ + +create table llx_adherent_type_lang +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_type integer DEFAULT 0 NOT NULL, + lang varchar(5) DEFAULT 0 NOT NULL, + label varchar(255) NOT NULL, + description text, + email text, + import_key varchar(14) DEFAULT NULL +)ENGINE=innodb; From afb055c8a668882d7ae8e73925d677f3a89a9766 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 17 Sep 2019 14:03:09 +0200 Subject: [PATCH 585/982] Create llx_adherent_type_lang.sql --- .../mysql/tables/llx_adherent_type_lang.sql | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_adherent_type_lang.sql diff --git a/htdocs/install/mysql/tables/llx_adherent_type_lang.sql b/htdocs/install/mysql/tables/llx_adherent_type_lang.sql new file mode 100644 index 00000000000..cbccac26020 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_adherent_type_lang.sql @@ -0,0 +1,30 @@ +-- ============================================================================ +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2005-2010 Regis Houssin +-- Copyright (C) 2009 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ============================================================================ + +create table llx_product_lang +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_product integer DEFAULT 0 NOT NULL, + lang varchar(5) DEFAULT 0 NOT NULL, + label varchar(255) NOT NULL, + description text, + note text, + import_key varchar(14) DEFAULT NULL +)ENGINE=innodb; From 430ffae8adc0d0ed870f2a72dfccef9572276619 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 17 Sep 2019 14:03:22 +0200 Subject: [PATCH 586/982] Delete llx_adherent_type_lang.php --- .../mysql/tables/llx_adherent_type_lang.php | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_adherent_type_lang.php diff --git a/htdocs/install/mysql/tables/llx_adherent_type_lang.php b/htdocs/install/mysql/tables/llx_adherent_type_lang.php deleted file mode 100644 index 5f1ceee1f49..00000000000 --- a/htdocs/install/mysql/tables/llx_adherent_type_lang.php +++ /dev/null @@ -1,30 +0,0 @@ --- ============================================================================ --- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2005-2010 Regis Houssin --- Copyright (C) 2009 Laurent Destailleur --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- ============================================================================ - -create table llx_adherent_type_lang -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_type integer DEFAULT 0 NOT NULL, - lang varchar(5) DEFAULT 0 NOT NULL, - label varchar(255) NOT NULL, - description text, - email text, - import_key varchar(14) DEFAULT NULL -)ENGINE=innodb; From 4c59f6bffaad3f6c79a94430e8308f628a8092cf Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 17 Sep 2019 14:03:55 +0200 Subject: [PATCH 587/982] Update llx_adherent_type_lang.sql --- htdocs/install/mysql/tables/llx_adherent_type_lang.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_adherent_type_lang.sql b/htdocs/install/mysql/tables/llx_adherent_type_lang.sql index cbccac26020..179a9418790 100644 --- a/htdocs/install/mysql/tables/llx_adherent_type_lang.sql +++ b/htdocs/install/mysql/tables/llx_adherent_type_lang.sql @@ -18,13 +18,13 @@ -- -- ============================================================================ -create table llx_product_lang +create table llx_adherent_type_lang ( rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_product integer DEFAULT 0 NOT NULL, + fk_type integer DEFAULT 0 NOT NULL, lang varchar(5) DEFAULT 0 NOT NULL, label varchar(255) NOT NULL, description text, - note text, + email text, import_key varchar(14) DEFAULT NULL )ENGINE=innodb; From b969de46bc0934029f0050309e69c963e605a602 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 17 Sep 2019 14:05:39 +0200 Subject: [PATCH 588/982] Update 10.0.0-11.0.0.sql --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 92dcdce1128..4ad51248700 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -164,4 +164,13 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-REPUBLICDAY', 0, 117, '', 0, 1, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1); - +create table llx_adherent_type_lang +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_type integer DEFAULT 0 NOT NULL, + lang varchar(5) DEFAULT 0 NOT NULL, + label varchar(255) NOT NULL, + description text, + email text, + import_key varchar(14) DEFAULT NULL +)ENGINE=innodb; From ea5ff59076935967ae95b80057c16d9523a420b0 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 17 Sep 2019 16:43:36 +0200 Subject: [PATCH 589/982] FIX check if a resource is in use after a drag and drop from events --- htdocs/comm/action/card.php | 76 +++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 173770d725c..3ef20a71a9c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -632,6 +632,8 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') */ if (GETPOST('actionmove', 'alpha') == 'mupdate') { + $error = 0; + $object->fetch($id); $object->fetch_userassigned(); @@ -653,10 +655,76 @@ if (GETPOST('actionmove', 'alpha') == 'mupdate') $object->datef+=$datep-$object->datep; } $object->datep=$datep; - $result=$object->update($user); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); + + if (!$error) { + // check if an event resource is already in use + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element == 'action') { + $eventDateStart = $object->datep; + $eventDateEnd = $object->datef; + + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= " WHERE ac.id != " . $object->id; + $sql .= " AND er.resource_id IN ("; + $sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources"; + $sql .= " WHERE element_id = " . $object->id; + $sql .= " AND element_type = '" . $db->escape($object->element) . "'"; + $sql .= " AND busy = 1"; + $sql .= ")"; + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $object->error = $db->lasterror(); + $object->errors[] = $object->error; + } else { + if ($db->num_rows($resql) > 0) { + // already in use + $error++; + $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $object->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $object->errors[] = $object->error; + } + $db->free($resql); + } + + if ($error) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } + + if (!$error) { + $db->begin(); + $result = $object->update($user); + if ($result < 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + $db->rollback(); + } else { + $db->commit(); + } } } if (! empty($backtopage)) From 49b75e3f52d0c7393d3b4f3e257a0048f1ab56c9 Mon Sep 17 00:00:00 2001 From: Laurent De Coninck Date: Tue, 17 Sep 2019 17:40:42 +0200 Subject: [PATCH 590/982] support referent in the beluga export. The beluga export of a project, now supports additional referents, coming from the hooks. When the element is present in the view of all elements of the project, the beluga export will also export this element. [see: X] --- .../project/doc/pdf_beluga.modules.php | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 32a2d10f72d..f7314476023 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -361,6 +361,11 @@ class pdf_beluga extends ModelePDFProjects 'lang'=>'agenda') ); + $hookmanager->initHooks(array('completeListOfReferent')); + $hookmanager->executeHooks('completeListOfReferent', ['listofreferent'=>$listofreferent], $object, $action); + if(!empty($hookmanager->resArray)) { + $listofreferent = array_merge($listofreferent, $hookmanager->resArray); + } foreach ($listofreferent as $key => $value) { @@ -370,17 +375,13 @@ class pdf_beluga extends ModelePDFProjects $datefieldname=$value['datefieldname']; $qualified=$value['test']; $langstoload=$value['lang']; + $projectField=isset($value['project_field']) ? $value['project_field'] : 'fk_projet'; $langs->load($langstoload); if (! $qualified) continue; //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); - - if ($key == 'agenda') - { -// var_dump($elementarray); - } + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, $projectField); $num = count($elementarray); if ($num >= 0) @@ -394,7 +395,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); - $selectList = $formproject->select_element($tablename, $project->thirdparty->id); + $selectList = $formproject->select_element($tablename, $project->thirdparty->id, '', -2, $projectField); $nexY = $pdf->GetY() + 1; $curY = $nexY; $pdf->SetXY($this->posxref, $curY); @@ -569,9 +570,9 @@ class pdf_beluga extends ModelePDFProjects // Amount without tax if (empty($value['disableamount'])) { $pdf->SetXY($this->posxamountht, $curY); - $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : ' '), 1, 'R'); + $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : ''), 1, 'R'); $pdf->SetXY($this->posxamountttc, $curY); - $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($element->total_ttc) : ' '), 1, 'R'); + $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($element->total_ttc) : ''), 1, 'R'); } else { $pdf->SetXY($this->posxamountht, $curY); if ($key == 'agenda') @@ -608,9 +609,9 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxamountttc - $this->posxref, 3, "TOTAL", 1, 'L'); $pdf->SetXY($this->posxamountht, $curY); - $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($total_ht) : ' '), 1, 'R'); + $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($total_ht) : ''), 1, 'R'); $pdf->SetXY($this->posxamountttc, $curY); - $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($total_ttc) : ' '), 1, 'R'); + $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($total_ttc) : ''), 1, 'R'); $pdf->SetXY($this->posxstatut, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Nb") . " " . $num, 1, 'L'); } From 3f6afa810c7b7dc2cede1cb867dc9e47637fa315 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 17:55:30 +0200 Subject: [PATCH 591/982] Code comment --- htdocs/core/lib/date.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 6ed17305096..ea5027de1ee 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -323,6 +323,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date) * 0 =Input date is local date using PHP server timezone * @return int Date as a timestamp * 19700101020000 -> 7200 with gm=1 + * 19700101000000 -> 0 with gm=1 * * @see dol_print_date(), dol_mktime(), dol_getdate() */ From a43253eab844c8caecc148c23b4dd5025e5ee1a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 18:49:56 +0200 Subject: [PATCH 592/982] Fix for deposit not correctly closed --- htdocs/compta/facture/card.php | 2 +- htdocs/install/mysql/migration/repair.sql | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ff5a280a118..6b24807c007 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4982,7 +4982,7 @@ elseif ($id > 0 || ! empty($ref)) } // Classify paid - if ($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0)) + if (($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))) || ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id)) ) { diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 51fe48dcda2..4d87203b068 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -468,6 +468,12 @@ UPDATE llx_accounting_bookkeeping set date_creation = tms where date_creation IS -- UPDATE llx_facturedet_rec set label = NULL WHERE label IS NOT NULL; +-- Note to make all deposit as payed when there is already a discount generated from it. +--drop table tmp_invoice_deposit_mark_as_available; +--create table tmp_invoice_deposit_mark_as_available as select * from llx_facture as f where f.type = 3 and f.paye = 0 and f.rowid in (select fk_facture_source from llx_societe_remise_except); +--update llx_facture set paye = 1 where rowid in (select rowid from tmp_invoice_deposit_mark_as_available); + + -- Note to migrate from old counter aquarium to new one -- drop table tmp; From 87d41256d456a3c68b6822458ce15bf1ee17e905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 22:59:23 +0200 Subject: [PATCH 593/982] Update box_contacts.php --- htdocs/core/boxes/box_contacts.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 667f892bc0a..fb5cf2db7fb 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -83,8 +83,8 @@ class box_contacts extends ModeleBoxes if ($user->rights->societe->lire && $user->rights->societe->contact->lire) { $sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status"; - $sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile"; - $sql.= ", s.nom as socname, s.name_alias"; + $sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile, sp.email as spemail"; + $sql.= ", s.nom as socname, s.name_alias, s.email as semail"; $sql.= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; @@ -117,12 +117,14 @@ class box_contacts extends ModeleBoxes $contactstatic->phone_pro = $objp->phone; $contactstatic->phone_perso = $objp->phone_perso; $contactstatic->phone_mobile = $objp->phone_mobile; + $contactstatic->email = $objp->spemail; $contactstatic->address = $objp->address; $contactstatic->zip = $objp->zip; $contactstatic->town = $objp->town; $societestatic->id = $objp->fk_soc; $societestatic->name = $objp->socname; + $societestatic->email = $objp->semail; $societestatic->name_alias = $objp->name_alias; $societestatic->code_client = $objp->code_client; $societestatic->code_fournisseur = $objp->code_fournisseur; From c38c0bec1c0932b976d060084371301e4c5d6851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 23:03:37 +0200 Subject: [PATCH 594/982] Update box_fournisseurs.php --- htdocs/core/boxes/box_fournisseurs.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 8d231cc472b..b80f9c27975 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic 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 @@ -85,7 +85,7 @@ class box_fournisseurs extends ModeleBoxes if ($user->rights->societe->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status,"; - $sql.= " s.code_fournisseur,"; + $sql.= " s.code_fournisseur, s.email as semail,"; $sql.= " s.logo"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -109,6 +109,7 @@ class box_fournisseurs extends ModeleBoxes $datem=$db->jdate($objp->tms); $thirdpartytmp->id = $objp->socid; $thirdpartytmp->name = $objp->name; + $thirdpartytmp->email = $objp->email; $thirdpartytmp->code_client = $objp->code_client; $thirdpartytmp->logo = $objp->logo; From c01ab451cc21c4c90c4bfdc8579dbedc973fb307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 23:04:43 +0200 Subject: [PATCH 595/982] Update box_fournisseurs.php --- htdocs/core/boxes/box_fournisseurs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index b80f9c27975..a90336753da 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -109,7 +109,7 @@ class box_fournisseurs extends ModeleBoxes $datem=$db->jdate($objp->tms); $thirdpartytmp->id = $objp->socid; $thirdpartytmp->name = $objp->name; - $thirdpartytmp->email = $objp->email; + $thirdpartytmp->email = $objp->semail; $thirdpartytmp->code_client = $objp->code_client; $thirdpartytmp->logo = $objp->logo; From ca18448b48f6a041ed13762ac56233a095c5c6c7 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 18 Sep 2019 10:36:13 +0200 Subject: [PATCH 596/982] NEW add units fields in buying price tab of product card --- htdocs/product/fournisseurs.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index cb56ff63cfc..d8cfcae0bb7 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -491,6 +491,13 @@ if ($id > 0 || $ref) { print ''; } + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $unit = $object->getLabelOfUnit(); + if ($unit !== '') { + print '  ' . $langs->trans($unit); + } + } print ''; // Vat rate @@ -778,11 +785,11 @@ SCRIPT; $num = count($product_fourn_list); if (($num + ($offset * $limit)) < $nbtotalofrecords) $num++; - print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVER ['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1); + print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1); // Suppliers list title print '
    '; - print ''; + print '
    '; $param="&id=".$object->id; @@ -851,6 +858,13 @@ SCRIPT; // Quantity print ''; // VAT rate From 7455d772a2cda7032e0201be030b96f4382f2d25 Mon Sep 17 00:00:00 2001 From: com4WEB <42214196+com4WEB@users.noreply.github.com> Date: Wed, 18 Sep 2019 10:50:07 +0200 Subject: [PATCH 597/982] Update README.md --- README.md | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8100cabddbe..0ae6d1b9de5 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ If you don't have time to install it yourself, you can try some commercial 'read ## UPGRADING +- At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect your to the "install/" page to follow the upgrade process.  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). @@ -90,18 +91,19 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) ### Main application/modules (all optional) -- Customers, Prospects and/or Suppliers directory +- Customers, Prospects (Leads) and/or Suppliers directory - Products and/or Services catalog - Commercial proposals management - Customer and Supplier Orders management - Invoices and payment management - Standing orders management (European SEPA) - Bank accounts management +- Accounting management - Shared calendar/agenda (with ical and vcal export for third party tools integration) - Opportunities and/or project management - Projects management - Contracts management -- Stock management +- Warehouse/Stock management - Shipping management - Interventions management - Employee's leave requests management @@ -111,7 +113,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Foundations members management - Mass emailing - Surveys -- Point of Sale +- Point of Sale (POS) - … ### Other application/modules @@ -131,15 +133,15 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) ### Other general features -- Localization in most major languages. -- Multi-Users and groups with finely grained rights. -- Multi-currency. -- Multi-company by adding of an external module. -- Very user friendly and easy to use. +- Localization in most major languages +- Multi-Users and groups with finely grained rights +- Multi-currency +- Multi-company by adding of an external module +- Very user friendly and easy to use +- customizable Dashboard - Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one) -- Works with PHP 5.5+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)) -- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites. -- APIs. + +- APIs - An easy to understand, maintain and develop code (PHP with no heavy framework; trigger and hook architecture) - Support a lot of country specific features: - Spanish Tax RE and ISPF @@ -153,6 +155,12 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - PDF or ODT generation for invoice, proposals, orders... - … +### System Environment / Requirements + +- Works with PHP 5.5+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)) +- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites. + + ### Extending Dolibarr can be extended with a lot of other external application or modules from third party developers available at the [DoliStore](https://www.dolistore.com). From cf7193691f4d853ca45b4d95efe1b1f157a8a0ee Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 18 Sep 2019 11:22:32 +0200 Subject: [PATCH 598/982] FIX dol_print_date format in buying price tooltip --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 6847af5edf1..e18e02d4930 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -998,7 +998,7 @@ class ProductFournisseur extends Product //$out .= ''; $out .= ''; foreach ($productFournLogList as $productFournLog) { - $out.= ''; + $out.= ''; $out.= ''; //$out.= ''; $out.= ''; From 2da50716421b46fdeaa9a9b300d7754ab05a59bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Sep 2019 13:12:22 +0200 Subject: [PATCH 599/982] Fix VAT in New caledonia is now called TGC --- htdocs/langs/fr_NC/admin.lang | 6 ++--- htdocs/langs/fr_NC/companies.lang | 4 ++-- htdocs/langs/fr_NC/compta.lang | 40 +++++++++++++++---------------- htdocs/langs/fr_NC/main.lang | 8 +++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/htdocs/langs/fr_NC/admin.lang b/htdocs/langs/fr_NC/admin.lang index d86b324fdc5..f7c25610e3f 100644 --- a/htdocs/langs/fr_NC/admin.lang +++ b/htdocs/langs/fr_NC/admin.lang @@ -1,4 +1,4 @@ # Dolibarr language file - Source file is en_US - admin -VATManagement=Gestion TSS -VATIsUsedDesc=Le taux de TSS proposé par défaut lors de la création de proposition commerciale, facture, commande, etc... répond à la règle standard suivante :
    Si vendeur non assujetti à TSS, TSS par défaut=0. Fin de règle.
    Si le (pays vendeur= pays acheteur) alors TSS par défaut=TSS du produit vendu. Fin de règle.
    Si vendeur et acheteur dans Communauté européenne et bien vendu= moyen de transport neuf (auto, bateau, avion), TSS par défaut=0 (La TSS doit être payée par acheteur au centre d'impôts de son pays et non au vendeur). Fin de règle.
    Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TSS par défaut=TSS du produit vendu. Fin de règle.
    Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TSS par défaut=0. Fin de règle.
    Sinon TSS proposée par défaut=0. Fin de règle.
    -VATIsNotUsedDesc=Le taux de TSS proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés. +VATManagement=Gestion TGC +VATIsUsedDesc=Le taux de TGC proposé par défaut lors de la création de proposition commerciale, facture, commande, etc... répond à la règle standard suivante :
    Si vendeur non assujetti à TGC, TGC par défaut=0. Fin de règle.
    Si le (pays vendeur= pays acheteur) alors TGC par défaut=TGC du produit vendu. Fin de règle.
    Si vendeur et acheteur dans Communauté européenne et bien vendu= moyen de transport neuf (auto, bateau, avion), TGC par défaut=0 (La TGC doit être payée par acheteur au centre d'impôts de son pays et non au vendeur). Fin de règle.
    Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TGC par défaut=TGC du produit vendu. Fin de règle.
    Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TGC par défaut=0. Fin de règle.
    Sinon TGC proposée par défaut=0. Fin de règle.
    +VATIsNotUsedDesc=Le taux de TGC proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés. diff --git a/htdocs/langs/fr_NC/companies.lang b/htdocs/langs/fr_NC/companies.lang index 9853f7e7e21..c3520226e42 100644 --- a/htdocs/langs/fr_NC/companies.lang +++ b/htdocs/langs/fr_NC/companies.lang @@ -1,3 +1,3 @@ # Dolibarr language file - Source file is en_US - companies -VATIsUsed=Assujetti à la TSS -VATIsNotUsed=Non assujetti à la TSS +VATIsUsed=Assujetti à la TGC +VATIsNotUsed=Non assujetti à la TGC diff --git a/htdocs/langs/fr_NC/compta.lang b/htdocs/langs/fr_NC/compta.lang index f22e834c4a5..2d7a5468f84 100644 --- a/htdocs/langs/fr_NC/compta.lang +++ b/htdocs/langs/fr_NC/compta.lang @@ -1,21 +1,21 @@ # Dolibarr language file - Source file is en_US - compta -VATToPay=TSS ventes -VATReceived=TSS collectée -VATToCollect=TSS achats -VATSummary=Balance de TSS -VATPaid=TSS payée -VATCollected=TSS récupérée -PaymentVat=Règlement TSS -VATPayment=Règlement TSS -VATPayments=Règlements TSS -ShowVatPayment=Affiche paiement TSS -RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TSS.
    - Il se base sur la date de règlement de ces factures, charges et TSS. -VATReportByCustomersInInputOutputMode=Rapport par client des TSS collectées et payées (TSS sur encaissement) -VATReportByQuartersInInputOutputMode=Rapport par taux des TSS collectées et payées (TSS sur encaissement) -SeeVATReportInInputOutputMode=Voir le rapport %sTSS encaissement%s pour mode de calcul standard -SeeVATReportInDueDebtMode=Voir le rapport %sTSS sur débit%s pour mode de calcul avec option sur les débits -RulesVATInServices=- Pour les services, le rapport inclut les TSS des règlements effectivement reçus ou émis en se basant sur la date du règlement. -RulesVATInProducts=- Pour les biens matériels, il inclut les TSS des factures en se basant sur la date de facture. -RulesVATDueServices=- Pour les services, le rapport inclut les TSS des factures dues, payées ou non en se basant sur la date de facture. -RulesVATDueProducts=- Pour les biens matériels, il inclut les TSS des factures en se basant sur la date de facture. -CalculationRuleDesc=Pour calculer le total de TSS, il existe 2 modes:
    Le mode 1 consiste à arrondir la TSS de chaque ligne et à sommer cet arrondi.
    Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.
    Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode %s. +VATToPay=TGC ventes +VATReceived=TGC collectée +VATToCollect=TGC achats +VATSummary=Balance de TGC +VATPaid=TGC payée +VATCollected=TGC récupérée +PaymentVat=Règlement TGC +VATPayment=Règlement TGC +VATPayments=Règlements TGC +ShowVatPayment=Affiche paiement TGC +RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TGC.
    - Il se base sur la date de règlement de ces factures, charges et TGC. +VATReportByCustomersInInputOutputMode=Rapport par client des TGC collectées et payées (TGC sur encaissement) +VATReportByQuartersInInputOutputMode=Rapport par taux des TGC collectées et payées (TGC sur encaissement) +SeeVATReportInInputOutputMode=Voir le rapport %sTGC encaissement%s pour mode de calcul standard +SeeVATReportInDueDebtMode=Voir le rapport %sTGC sur débit%s pour mode de calcul avec option sur les débits +RulesVATInServices=- Pour les services, le rapport inclut les TGC des règlements effectivement reçus ou émis en se basant sur la date du règlement. +RulesVATInProducts=- Pour les biens matériels, il inclut les TGC des factures en se basant sur la date de facture. +RulesVATDueServices=- Pour les services, le rapport inclut les TGC des factures dues, payées ou non en se basant sur la date de facture. +RulesVATDueProducts=- Pour les biens matériels, il inclut les TGC des factures en se basant sur la date de facture. +CalculationRuleDesc=Pour calculer le total de TGC, il existe 2 modes:
    Le mode 1 consiste à arrondir la TGC de chaque ligne et à sommer cet arrondi.
    Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.
    Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode %s. diff --git a/htdocs/langs/fr_NC/main.lang b/htdocs/langs/fr_NC/main.lang index 82c7a4ee746..23b739d83e5 100644 --- a/htdocs/langs/fr_NC/main.lang +++ b/htdocs/langs/fr_NC/main.lang @@ -20,7 +20,7 @@ FormatDateHourSecShort=%d/%m/%Y %H:%M:%S FormatDateHourTextShort=%d %b %Y %H:%M FormatDateHourText=%d %B %Y %H:%M ErrorNoVATRateDefinedForSellerCountry=Erreur, aucun taux de taxe défini pour le pays '%s'. -AmountVAT=Montant TSS -TotalVAT=Total TSS -VAT=TSS -VATRate=Taux TSS +AmountVAT=Montant TGC +TotalVAT=Total TGC +VAT=TGC +VATRate=Taux TGC From d72548bd76173b2ad8a0c0d2e980bfff97f83563 Mon Sep 17 00:00:00 2001 From: John Botella Date: Wed, 18 Sep 2019 13:43:34 +0200 Subject: [PATCH 600/982] add filters --- htdocs/core/lib/ticket.lib.php | 87 ++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 29 deletions(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index fb274d06c20..21761286131 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -485,27 +485,50 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $userstatic=new User($db); $contactstatic = new Contact($db); $userGetNomUrlCache = array(); -// $out.='
    '; -// if ($objcon && get_class($objcon) == 'Contact' && -// (is_null($filterobj) || get_class($filterobj) == 'Societe')) -// { -// $out.=''; -// } -// else -// { -// $out.=''; -// } -// if ($filterobj && get_class($filterobj) == 'Societe') $out.=''; -// -// -// $out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1); -// -// $out.=''; -// -// $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); -// $out.=$searchpicto; -// -// $out.=''; + + $out.='
    '; + $out.='
    '; + if ($objcon && get_class($objcon) == 'Contact' && + (is_null($filterobj) || get_class($filterobj) == 'Societe')) + { + $out.=''; + } + else + { + $out.=''; + } + if ($filterobj && get_class($filterobj) == 'Societe') $out.=''; + + $out.="\n"; + + $out.='
    '; + $out.='
    '; print $productfourn->fourn_qty; + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $unit = $object->getLabelOfUnit(); + if ($unit !== '') { + print '  ' . $langs->trans($unit); + } + } print ''.$langs->trans("QtyMin").''.$langs->trans("User").'
    '.dol_print_date($productFournLog['datec'], 'dayhour', 'tzuser').'
    '.dol_print_date($this->db->jdate($productFournLog['datec']), 'dayhour', 'tzuser').''.price($productFournLog['price']).''.$productFournLog['quantity'].''.$productFournLog['lastname'].'
    '; + + $out.=''; + $out.=''; + if ($donetodo) + { + $out.=''; + } + $out.=''; + $out.=''; + + $out.=''; + $out.=''; + + + $out.='
    '.$langs->trans("Search").' : '.$langs->trans("Type").' '; + $out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1); + $out.=''; + $out.=$langs->trans("Label").' '; + $out.=''; + $out.=''; + $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + $out.=$searchpicto; + $out.='
    '; + + $out.=''; + $out.='
    '; $out.="\n"; @@ -614,7 +637,19 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $out.=''; - //$out.=''.$langs->trans('Show').''; + if (isset($histo[$key]['type']) && $histo[$key]['type']=='mailing') { + $out.=''.img_object($langs->trans("ShowEMailing"), "email").' '; + $out.=$histo[$key]['id']; + $out.=' '; + } else { + $out.=$actionstatic->getNomUrl(1, -1).' '; + } + +// if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id) +// { +// $out.=''.$langs->trans('Show').''; +// } + if ($user->rights->agenda->allactions->create || (($actionstatic->authorid == $user->id || $actionstatic->userownerid == $user->id) && $user->rights->agenda->myactions->create)) @@ -645,13 +680,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no // Ref $out.='

    '; -// if (isset($histo[$key]['type']) && $histo[$key]['type']=='mailing') { -// $out.=''.img_object($langs->trans("ShowEMailing"), "email").' '; -// $out.=$histo[$key]['id']; -// $out.=''; -// } else { -// $out.=$actionstatic->getNomUrl(1, -1); -// } + // Author of event $out.=''; From 7b512587aadc3eca9e3565eed17f46c36498c643 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Sep 2019 14:15:20 +0200 Subject: [PATCH 601/982] FIX XSS --- htdocs/admin/mails_templates.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index e0dfcd75277..573d4c5fbaa 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -50,7 +50,7 @@ $confirm = GETPOST('confirm','alpha'); // Result of a confirmation $id = GETPOST('id','int'); $rowid = GETPOST('rowid','alpha'); -$search_label=GETPOST('search_label','alpha'); +$search_label=GETPOST('search_label', 'alphanohtml'); // Must allow value like 'Abc Def' or '(MyTemplateName)' $search_type_template=GETPOST('search_type_template','alpha'); $search_lang=GETPOST('search_lang','alpha'); $search_fk_user=GETPOST('search_fk_user','intcomma'); @@ -262,6 +262,7 @@ if (empty($reshook)) { //var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value); $keycode=$listfieldvalue[$i]; + if ($value == 'label') $_POST[$keycode] = dol_escape_htmltag($_POST[$keycode]); if ($value == 'lang') $keycode='langcode'; if ($value == 'entity') $_POST[$keycode] = $conf->entity; if ($i) $sql.=","; @@ -666,8 +667,6 @@ if ($resql) print ''; foreach ($fieldlist as $field => $value) { - // Determine le nom du champ par rapport aux noms possibles - // dans les dictionnaires de donnees $showfield=1; // By defaut $align="left"; $sortable=1; @@ -694,7 +693,7 @@ if ($resql) if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;} if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; } - // Affiche nom du champ + // Show fields if ($showfield) { if (! empty($tabhelp[$id][$value])) @@ -812,6 +811,10 @@ if ($resql) $showfield=1; $align="left"; $valuetoshow=$obj->{$fieldlist[$field]}; + if ($value == 'label' || $value == 'topic') + { + $valuetoshow = dol_escape_htmltag($valuetoshow); + } if ($value == 'type_template') { $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; From 345ac28c8999d53ed541fb14cd08f4692e21aec6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Aug 2019 16:22:24 +0200 Subject: [PATCH 602/982] Fix js injection Conflicts: htdocs/core/lib/functions.lib.php htdocs/user/group/card.php --- htdocs/core/lib/functions.lib.php | 8 ++++++-- htdocs/main.inc.php | 16 +++++++++------- htdocs/user/group/card.php | 4 ++-- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 20930ca52c4..bf79b2070d5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -966,11 +966,15 @@ function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0) * @param string $stringtoescape String to escape * @param int $keepb 1=Preserve b tags (otherwise, remove them) * @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value). Set to 1 when escaping for a '."\n"; - print ''; + print ''; print ''."\n"; - print ''; + print ''; print ''."\n"; // Country - print ''; + print ''; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''."\n"; - print ''; + print ''; $formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id'); print ''."\n"; - print ''; + print ''; print ''; print ''."\n"; - print ''; + print ''; print ''; print ''."\n"; - print ''; + print ''; print ''; print ''."\n"; // Web - print ''; + print ''; print ''; print ''."\n"; // Code - print ''; + print ''; print ''."\n"; // Note - print ''; + print ''; print ''; print ''; @@ -189,24 +189,24 @@ else print '
    '; print ''; - print ''; + print ''; - print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; - if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; print '
    '.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
    '.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
    '.$langs->trans("CompanyName").''; + print '
    '.$langs->trans("CompanyName").''; print $conf->global->MAIN_INFO_ACCOUNTANT_NAME; print '
    '.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) . '
    '.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) . '
    '.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ZIP) . '
    '.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ZIP) . '
    '.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN)?'':$conf->global->MAIN_INFO_ACCOUNTANT_TOWN) . '
    '.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN)?'':$conf->global->MAIN_INFO_ACCOUNTANT_TOWN) . '
    '.$langs->trans("CompanyCountry").''; + print '
    '.$langs->trans("CompanyCountry").''; if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY)) { $code = getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 2); @@ -217,23 +217,23 @@ else print '
    '.$langs->trans("Region-State").''; - else print '
    '.$langs->trans("State").''; + if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '
    '.$langs->trans("Region-State").''; + else print '
    '.$langs->trans("State").''; if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE)) print getState($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); else print ' '; print '
    '.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE, $mysoc->country_code) . '
    '.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE, $mysoc->country_code) . '
    '.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX, $mysoc->country_code) . '
    '.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX, $mysoc->country_code) . '
    '.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL, 0, 0, 0, 80) . '
    '.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL, 0, 0, 0, 80) . '
    '.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB, '_blank', 80) . '
    '.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB, '_blank', 80) . '
    '.$langs->trans("AccountantFileNumber").'' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . '
    '.$langs->trans("AccountantFileNumber").'' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . '
    '.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? nl2br($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) : '') . '
    '.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? nl2br($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) : '') . '
    '; print "
    "; From b30c55a2ee610bbe0176000b49ce9d10a06e6d1f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Sep 2019 23:40:38 +0200 Subject: [PATCH 617/982] CSS --- htdocs/theme/eldy/global.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 17532380337..334fbe00ba1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -655,6 +655,14 @@ select.flat.selectlimit { max-width: 0; overflow: auto; } +.divintdwithtwolinesmax { + width: 75px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} + .tablelistofcalendars { margin-top: 25px !important; } From 278312f38f3bbdb528e6741efb946dd0e0678643 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 20 Sep 2019 07:02:14 +0200 Subject: [PATCH 618/982] Translate --- htdocs/adherents/card.php | 8 ++++---- htdocs/adherents/subscription.php | 4 ++-- htdocs/admin/bank.php | 2 +- htdocs/admin/chequereceipts.php | 3 +-- htdocs/admin/delais.php | 2 +- htdocs/admin/dict.php | 14 ++++++------- htdocs/admin/emailcollector_card.php | 2 +- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/expensereport.php | 2 +- htdocs/core/modules/action/rapport.pdf.php | 2 +- .../core/modules/bank/doc/pdf_ban.modules.php | 2 +- .../bank/doc/pdf_sepamandate.modules.php | 2 +- .../modules/cheque/doc/pdf_blochet.class.php | 6 +++--- .../commande/doc/pdf_einstein.modules.php | 2 +- .../doc/doc_generic_contract_odt.modules.php | 2 +- .../contract/doc/pdf_strato.modules.php | 4 ++-- .../modules/dons/html_cerfafr.modules.php | 2 +- .../doc/doc_generic_shipment_odt.modules.php | 2 +- .../expedition/doc/pdf_espadon.modules.php | 2 +- .../expedition/doc/pdf_merou.modules.php | 2 +- .../expedition/doc/pdf_rouget.modules.php | 2 +- .../doc/pdf_standard.modules.php | 4 ++-- .../modules/facture/doc/pdf_crabe.modules.php | 20 +++++++++---------- .../fichinter/doc/pdf_soleil.modules.php | 4 ++-- .../modules/member/doc/pdf_standard.class.php | 2 +- .../doc/pdf_standardlabel.class.php | 2 +- .../printsheet/doc/pdf_tcpdflabel.class.php | 2 +- .../product/doc/pdf_standard.modules.php | 6 +++--- .../doc/doc_generic_project_odt.modules.php | 2 +- .../project/doc/pdf_baleine.modules.php | 2 +- .../project/doc/pdf_beluga.modules.php | 2 +- .../project/doc/pdf_timespent.modules.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 4 ++-- .../societe/doc/doc_generic_odt.modules.php | 2 +- .../stock/doc/pdf_standard.modules.php | 6 +++--- .../stock/doc/pdf_stdmovement.modules.php | 6 +++--- .../doc/pdf_aurore.modules.php | 4 ++-- htdocs/core/tpl/card_presend.tpl.php | 2 +- htdocs/public/members/new.php | 2 +- htdocs/public/payment/paymentok.php | 2 +- 40 files changed, 72 insertions(+), 73 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 5836bf48332..badf93b4e80 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -638,7 +638,7 @@ if (empty($reshook)) // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; @@ -719,7 +719,7 @@ if (empty($reshook)) // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; @@ -1483,7 +1483,7 @@ else // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; @@ -1544,7 +1544,7 @@ else // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 0922ca4f572..49e1cbbc553 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -360,7 +360,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template @@ -1093,7 +1093,7 @@ if ($rowid > 0) // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 44cdd5e611b..a40448acdc8 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -49,7 +49,7 @@ $type = 'bankaccount'; * Actions */ -//Order display of bank account +// Order display of bank account if ($action == 'setbankorder') { if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) { diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index efc192e6de1..7e136bf6978 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -91,7 +91,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') } /* - * view + * View */ $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -233,7 +233,6 @@ print '
    '; /* * Other options - * */ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 1fe8b2285c3..6d6ebe13333 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -222,7 +222,7 @@ if ($action == 'edit') else { /* - * Affichage des parametres + * Show parameters */ print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ff4c3cc6a6b..28dd36b5442 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -251,7 +251,7 @@ $tabsqlsort[35]="c.label ASC"; $tabsqlsort[36]="r.fk_c_exp_tax_cat ASC, r.range_ik ASC"; $tabsqlsort[37]="r.unit_type ASC, r.scale ASC, r.code ASC"; -// Nom des champs en resultat de select pour affichage du dictionnaire +// Field names in select result for dictionary display $tabfield=array(); $tabfield[1] = "code,libelle,country"; $tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,region,country_code-country" @@ -291,7 +291,7 @@ $tabfield[35]= "label"; $tabfield[36]= "range_ik,fk_c_exp_tax_cat"; $tabfield[37]= "code,label,short_label,unit_type,scale"; -// Nom des champs d'edition pour modification d'un enregistrement +// Edit field names for editing a record $tabfieldvalue=array(); $tabfieldvalue[1] = "code,libelle,country"; $tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region" @@ -331,7 +331,7 @@ $tabfieldvalue[35]= "label"; $tabfieldvalue[36]= "range_ik,fk_c_exp_tax_cat"; $tabfieldvalue[37]= "code,label,short_label,unit_type,scale"; -// Nom des champs dans la table pour insertion d'un enregistrement +// Field names in the table for inserting a record $tabfieldinsert=array(); $tabfieldinsert[1] = "code,libelle,fk_pays"; $tabfieldinsert[2] = "code_departement,nom,fk_region"; @@ -1283,8 +1283,8 @@ if ($id) { if ($fieldlist[$field] == 'entity') continue; - // Determine le nom du champ par rapport aux noms possibles - // dans les dictionnaires de donnees + // Determines the name of the field in relation to the possible names + // in data dictionaries $showfield=1; // By defaut $align="left"; $cssprefix=''; @@ -1850,14 +1850,14 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang'); print ''; } - // Le type de l'element (pour les type de contact) + // The type of the element (for contact types) elseif ($fieldlist[$field] == 'element') { print ''; } - // La source de l'element (pour les type de contact) + // The source of the element (for contact types) elseif ($fieldlist[$field] == 'source') { print ''."\n"; -//Use draft Watermark +// Use draft Watermark print ''."\n"; print ''."\n"; - // Pour chaque position possible, on affiche un lien d'activation si boite non deja active pour cette position + // For each possible position, an activation link is displayed if the box is not already active for that position print '
    '; print $form->selectarray('element', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); print ''; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 6d1b640f45b..011f04b0882 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -36,7 +36,7 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; if (!$user->admin) accessforbidden(); if (empty($conf->emailcollector->enabled)) accessforbidden(); -// Load traductions files requiredby by page +// Load traductions files required by page $langs->loadLangs(array("admin", "mails", "other")); // Get parameters diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 14cb63cd923..a55f6ee962e 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -34,7 +34,7 @@ dol_include_once('/emailcollector/class/emailcollector.class.php'); if (!$user->admin) accessforbidden(); if (empty($conf->emailcollector->enabled)) accessforbidden(); -// Load traductions files requiredby by page +// Load traductions files required by page $langs->loadLangs(array("admin", "other")); $action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index da77c0e78d3..d0ba9c63a3c 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -496,7 +496,7 @@ else } print '
    '; print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
    '; diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index 52b70caf47f..b63b2785e44 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -117,7 +117,7 @@ class CommActionRapport // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products")); $dir = $conf->agenda->dir_temp."/"; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 23fef1ef2c5..eeee238ac80 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -106,7 +106,7 @@ class pdf_ban extends ModeleBankAccountDoc // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); if ($conf->bank->dir_output) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index e3990bc8ccc..e94af011b1e 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -109,7 +109,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "withdrawals", "companies", "projects", "bills")); if (! empty($conf->bank->dir_output)) diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 71866464084..09148746fe9 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -49,7 +49,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts { global $conf,$langs,$mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("main", "bills")); $this->db = $db; @@ -98,7 +98,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $sav_charset_output=$outputlangs->charset_output; if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "companies", "bills", "products", "compta")); $dir = $_dir . "/".get_exdir($number, 0, 1, 0, $object, 'cheque').$number; @@ -225,7 +225,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts global $langs; $default_font_size = pdf_getPDFFontSize($outputlangs); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("compta", "banks")); $title = $outputlangs->transnoentities("CheckReceipt"); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f74291ecac9..4a81f94ed29 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1236,7 +1236,7 @@ class pdf_einstein extends ModelePDFCommandes // phpcs:enable global $conf,$langs,$hookmanager; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 124d51a33ad..7cff0c19e6b 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -217,7 +217,7 @@ class doc_generic_contract_odt extends ModelePDFContract $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); if ($conf->contrat->dir_output) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index b04ce5890ab..f7ae9834a65 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -181,7 +181,7 @@ class pdf_strato extends ModelePDFContract // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "contracts")); if ($conf->contrat->dir_output) @@ -602,7 +602,7 @@ class pdf_strato extends ModelePDFContract $default_font_size = pdf_getPDFFontSize($outputlangs); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "contract", "companies")); pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 6ef76d21b78..f871cd3e2b0 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -83,7 +83,7 @@ class html_cerfafr extends ModeleDon if (! is_object($outputlangs)) $outputlangs=$langs; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "donations")); $currency = !empty($currency) ? $currency : $conf->currency; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 9f94dd86867..52c810fd965 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -227,7 +227,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); if ($conf->expedition->dir_output."/sending") diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 996e8035316..8f3441c332c 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -165,7 +165,7 @@ class pdf_espadon extends ModelePdfExpedition // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); $nblines = count($object->lines); diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 4293f29ed6d..dbdfd722168 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -165,7 +165,7 @@ class pdf_merou extends ModelePdfExpedition // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); if ($conf->expedition->dir_output) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 18ba0ef9d44..d3e254c6132 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -195,7 +195,7 @@ class pdf_rouget extends ModelePdfExpedition // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); $nblines = count($object->lines); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index fb977c19b63..5cfc6c3287e 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -217,7 +217,7 @@ class pdf_standard extends ModeleExpenseReport // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "trips", "projects", "dict", "bills", "banks")); $nblines = count($object->lines); @@ -635,7 +635,7 @@ class pdf_standard extends ModeleExpenseReport // global $conf, $langs, $hookmanager; global $user, $langs, $conf, $mysoc, $db, $hookmanager; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "trips", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 8876137f877..7ec496d385b 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -243,7 +243,7 @@ class pdf_crabe extends ModelePDFFactures // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); $nblines = count($object->lines); @@ -1351,7 +1351,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); - + // Retained warranty if( !empty($object->situation_final) && ( $object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) ) ) ) { @@ -1367,29 +1367,29 @@ class pdf_crabe extends ModelePDFFactures } } } - + if($displayWarranty){ $pdf->SetTextColor(40, 40, 40); $pdf->SetFillColor(255, 255, 255); - + $retainedWarranty = $object->total_ttc * $object->retained_warranty / 100; $billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty ; - + // Billed - retained warranty $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); - + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1); - + // retained warranty $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - + $retainedWarrantyToPayOn = $outputlangs->transnoentities("RetainedWarranty") . ' ('.$object->retained_warranty.'%)'; $retainedWarrantyToPayOn.= !empty($object->retained_warranty_date_limit)?' '.$outputlangs->transnoentities("toPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')):''; - + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1); @@ -1591,7 +1591,7 @@ class pdf_crabe extends ModelePDFFactures { global $conf, $langs; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "propal", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 847f1de7087..9d39eb5e858 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -173,7 +173,7 @@ class pdf_soleil extends ModelePDFFicheinter // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "interventions", "dict", "companies")); if ($conf->ficheinter->dir_output) @@ -562,7 +562,7 @@ class pdf_soleil extends ModelePDFFicheinter global $conf,$langs; $default_font_size = pdf_getPDFFontSize($outputlangs); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "interventions")); pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index f3a105f99f1..13c28514211 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -329,7 +329,7 @@ class pdf_standard extends CommonStickerGenerator // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "admin", "members")); if (empty($mode) || $mode == 'member') diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index e178d16d5bc..f72ca14cc25 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -260,7 +260,7 @@ class pdf_standardlabel extends CommonStickerGenerator // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "admin")); $title=$outputlangs->transnoentities('Labels'); diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index f6bb3bc46a7..a2705adcb7d 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -301,7 +301,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "admin")); $title=$outputlangs->transnoentities('Labels'); diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 019d67518a4..88ec5204845 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -119,7 +119,7 @@ class pdf_standard extends ModelePDFProduct { global $conf,$langs,$mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("main", "companies")); $this->db = $db; @@ -169,7 +169,7 @@ class pdf_standard extends ModelePDFProduct // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries")); $nblines = count($object->lines); @@ -709,7 +709,7 @@ class pdf_standard extends ModelePDFProduct { global $conf,$langs,$hookmanager; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills", "orders")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index e682cfd9507..6d67a36c010 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -82,7 +82,7 @@ class doc_generic_project_odt extends ModelePDFProjects { global $conf, $langs, $mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("companies", "main")); $this->db = $db; diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 154c8e067b0..bc2019bfce8 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -183,7 +183,7 @@ class pdf_baleine extends ModelePDFProjects // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); if ($conf->projet->dir_output) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 05100fbe8eb..ba815810f28 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -155,7 +155,7 @@ class pdf_beluga extends ModelePDFProjects // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); if ($conf->projet->dir_output) diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 061ae7a0b58..7685c07b480 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -115,7 +115,7 @@ class pdf_timespent extends ModelePDFProjects // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); if ($conf->projet->dir_output) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 77c41d01927..59267e25272 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -224,7 +224,7 @@ class pdf_azur extends ModelePDFPropales // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "propal", "products")); $nblines = count($object->lines); @@ -1438,7 +1438,7 @@ class pdf_azur extends ModelePDFPropales { global $conf,$langs; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index a6738ddcc90..f8bbf568d86 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -94,7 +94,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc { global $conf,$langs; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("companies", "errors")); $form = new Form($this->db); diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index e0c831732ba..61bfa916fe2 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -119,7 +119,7 @@ class pdf_standard extends ModelePDFStock { global $conf,$langs,$mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("main", "companies")); $this->db = $db; @@ -198,7 +198,7 @@ class pdf_standard extends ModelePDFStock // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "stocks", "orders", "deliveries")); $nblines = count($object->lines); @@ -875,7 +875,7 @@ class pdf_standard extends ModelePDFStock { global $conf,$langs,$db,$hookmanager; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills", "orders", "stocks")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 380b9ceffa5..6a607de6d37 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -119,7 +119,7 @@ class pdf_stdmovement extends ModelePDFMovement { global $conf,$langs,$mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("main", "companies")); $this->db = $db; @@ -200,7 +200,7 @@ class pdf_stdmovement extends ModelePDFMovement // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "stocks", "orders", "deliveries")); /** @@ -954,7 +954,7 @@ class pdf_stdmovement extends ModelePDFMovement { global $conf,$langs,$db,$hookmanager; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills", "orders", "stocks")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index d243c209848..44fe533f0eb 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -215,7 +215,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "supplier_proposal")); $nblines = count($object->lines); @@ -1278,7 +1278,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { global $conf, $langs; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "supplier_proposal", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index a8594ec1b62..06b2a8414c0 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -76,7 +76,7 @@ if ($action == 'presend') { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($newlang); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array('commercial','bills','orders','contracts','members','propal','products','supplier_proposal','interventions')); } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 873a6858a1a..81f46897cc6 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -281,7 +281,7 @@ if ($action == 'add') // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 52413921f90..6c9711e4055 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -516,7 +516,7 @@ if ($ispaymentok) // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; From bf6fd2a5e2f904aaade31cb6293885835ce0885c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 20 Sep 2019 09:25:46 +0200 Subject: [PATCH 619/982] Translate & style --- htdocs/admin/agenda_reminder.php | 4 ++-- htdocs/admin/boxes.php | 14 ++++++++------ htdocs/admin/dict.php | 4 ++-- htdocs/admin/ihm.php | 6 ++++-- htdocs/admin/limits.php | 20 +++++++++++--------- htdocs/admin/payment.php | 10 ++++++---- 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 3af179ba2e7..43e031a8ce9 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -148,8 +148,8 @@ elseif ($action == 'setdoc') { if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { - // La constante qui a ete lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage coherent + // The constant that has been read in front of the new set + // is therefore passed through a variable to have a coherent display $conf->global->ACTION_EVENT_ADDON_PDF = $value; } diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 2e81a2c6dad..796d9c7a42b 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -63,7 +63,7 @@ if ($action == 'add') { { $pos = $boxid['pos']; - // Initialize distinct fkuser with all already existing values of fk_user (user that use a personalized view of boxes for page "pos") + // Initialize distinct fk_user with all already existing values of fk_user (user that use a personalized view of boxes for page "pos") $distinctfkuser=array(); if (! $error) { @@ -225,8 +225,8 @@ print load_fiche_titre($langs->trans("Boxes"), '', 'title_setup'); print $langs->trans("BoxesDesc")." ".$langs->trans("OnlyActiveElementsAreShown")."
    \n"; /* - * Recherche des boites actives par defaut pour chaque position possible - * On stocke les boites actives par defaut dans $boxes[position][id_boite]=1 + * Search for the default active boxes for each possible position + * We store the active boxes by default in $boxes[position][id_boite]=1 */ $actives = array(); @@ -257,7 +257,7 @@ if ($resql) array_push($actives, $obj->box_id); if ($obj->box_order == '' || $obj->box_order == '0' || $decalage) $decalage++; - // On renumerote l'ordre des boites si l'une d'elle est a '' + // We renumber the order of the boxes if one of them is in '' // This occurs just after an insert. if ($decalage) { @@ -268,7 +268,7 @@ if ($resql) if ($decalage) { - // Si on a renumerote, on corrige champ box_order + // If we have renumbered, we correct the field box_order // This occurs just after an insert. $sql = "SELECT box_order"; $sql.= " FROM ".MAIN_DB_PREFIX."boxes"; @@ -366,7 +366,7 @@ foreach($boxtoadd as $box) print '
    ' . $box->sourcefile . ''; print $form->selectarray("boxid[".$box->box_id."][pos]", $pos_name, 0, 1, 0, 0, '', 1)."\n"; print ''."\n"; @@ -483,7 +483,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIV print '
    '; +print '
    '; print '
    '; +print '
    '; print ''; print "\n".''."\n"; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 28dd36b5442..9033819b540 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -979,7 +979,7 @@ if ($sortfield) $paramwithsearch.= '&sortfield='.urlencode($sortfield); if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from', 'alpha')); -// Confirmation de la suppression de la ligne +// Confirmation of the deletion of the line if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); @@ -991,7 +991,7 @@ if ($action == 'delete') */ if ($id) { - // Complete requete recherche valeurs avec critere de tri + // Complete search values request with sort criteria $sql=$tabsql[$id]; if (! preg_match('/ WHERE /', $sql)) $sql.= " WHERE 1 = 1"; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 37c997ee306..7b0a7983b5a 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -432,11 +432,13 @@ if ($action == 'edit') // Edit print ''."\n"; - print '
    '; + print '
    '; + print '
    '; print ''; - print '   '; + print '   '; print ''; print '
    '; + print '
    '; print ''; } diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index a43f86d0e28..5eb3532e47d 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -102,7 +102,7 @@ if ($action == 'edit') clearstatcache(); print ''; - print ''; + print ''; print ''; - print ''; - print ''; + print ''; - print ''; print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '.$langs->trans("Parameters").''.$langs->trans("Value").'
    '; @@ -110,23 +110,25 @@ if ($action == 'edit') print '
    '; + print '
    '; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
    '.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
    '.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
    '; + print '
    '; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
    '; - print '
    '; + print '
    '; + print '
    '; print ''; print '
    '; + print '
    '; print ''; print '
    '; @@ -142,21 +144,21 @@ else print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.''; - print ''; + print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.''; - print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.''; + print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.''; - print ''; + print ''; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.''; print ''; - print '
    '; + print '
    '; print ''.$langs->trans("Modify").''; print '
    '; } diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 4e80fe55e25..eb3261f46c6 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -252,14 +252,16 @@ print "\n"; print ''; -print '
    '; +dol_fiche_end(); + +print '
    '; +print '
    '; print ''; -print '
    '; +print '
    '; +print '
    '; print ''; -dol_fiche_end(); - // End of page llxFooter(); $db->close(); From e32772fdc52befab1a903989e6a7fc9089bc7754 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 20 Sep 2019 09:44:49 +0200 Subject: [PATCH 620/982] Translate --- htdocs/adherents/htpasswd.php | 3 +-- .../facture/class/paymentterm.class.php | 1 - .../compta/localtax/class/localtax.class.php | 1 - htdocs/compta/tva/class/tva.class.php | 1 - htdocs/core/class/antivir.class.php | 1 - htdocs/core/modules/action/rapport.pdf.php | 2 +- .../core/modules/bank/doc/pdf_ban.modules.php | 6 +++--- .../bank/doc/pdf_sepamandate.modules.php | 6 +++--- .../modules/cheque/doc/pdf_blochet.class.php | 6 +++--- .../doc/doc_generic_order_odt.modules.php | 2 +- .../doc/doc_generic_contract_odt.modules.php | 2 +- .../contract/doc/pdf_strato.modules.php | 2 +- .../doc/doc_generic_shipment_odt.modules.php | 2 +- .../doc/pdf_standard.modules.php | 2 +- .../modules/export/export_csv.modules.php | 1 - .../modules/export/export_excel.modules.php | 1 - .../export/export_excel2007.modules.php | 1 - .../export/export_excel2007new.modules.php | 1 - .../modules/export/export_tsv.modules.php | 1 - .../doc/doc_generic_invoice_odt.modules.php | 2 +- .../fichinter/doc/pdf_soleil.modules.php | 2 +- .../livraison/doc/pdf_typhon.modules.php | 3 +-- .../doc/doc_generic_product_odt.modules.php | 2 +- .../product/doc/pdf_standard.modules.php | 2 +- .../doc/doc_generic_project_odt.modules.php | 2 +- .../project/doc/pdf_baleine.modules.php | 21 +++++++++---------- .../project/doc/pdf_beluga.modules.php | 11 +++++----- .../project/doc/pdf_timespent.modules.php | 11 +++++----- .../task/doc/doc_generic_task_odt.modules.php | 2 +- .../doc/doc_generic_proposal_odt.modules.php | 2 +- .../modules/rapport/pdf_paiement.class.php | 2 +- .../doc/doc_generic_reception_odt.modules.php | 2 +- .../societe/doc/doc_generic_odt.modules.php | 4 ++-- .../doc/doc_generic_stock_odt.modules.php | 2 +- .../stock/doc/pdf_standard.modules.php | 2 +- .../stock/doc/pdf_stdmovement.modules.php | 2 +- .../pdf/pdf_canelle.modules.php | 4 ++-- ...doc_generic_supplier_order_odt.modules.php | 4 ++-- .../supplier_order/pdf/pdf_cornas.modules.php | 2 +- .../pdf/pdf_muscadet.modules.php | 2 +- .../doc/pdf_standard.modules.php | 4 ++-- ..._generic_supplier_proposal_odt.modules.php | 2 +- .../doc/pdf_aurore.modules.php | 2 +- .../user/doc/doc_generic_user_odt.modules.php | 2 +- .../doc/doc_generic_usergroup_odt.modules.php | 2 +- htdocs/ecm/dir_card.php | 1 - htdocs/public/agenda/index.php | 1 - htdocs/public/donations/index.php | 1 - htdocs/public/index.php | 1 - htdocs/public/members/index.php | 1 - htdocs/public/paybox/index.php | 1 - htdocs/public/paybox/newpayment.php | 1 - htdocs/public/payment/index.php | 1 - htdocs/public/paypal/index.php | 1 - htdocs/public/stripe/index.php | 1 - htdocs/public/theme/common/index.php | 1 - htdocs/public/theme/index.php | 1 - 57 files changed, 63 insertions(+), 89 deletions(-) diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index 885e453c6f1..79de1971dbc 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -20,8 +20,7 @@ /** * \file htdocs/adherents/htpasswd.php * \ingroup member - * \brief Page d'export htpasswd du fichier des adherents - * \author Rodolphe Quiedeville + * \brief Export page htpasswd of the membership file */ require '../main.inc.php'; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index d3b4bd83743..f37c7046633 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -19,7 +19,6 @@ * \file compta/facture/class/paymentterm.class.php * \ingroup facture * \brief This file is an example for a CRUD class file (Create/Read/Update/Delete) - * \author Put author name here */ diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 247db26715a..1a8606054e6 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -18,7 +18,6 @@ /** * \file htdocs/compta/localtax/class/localtax.class.php * \ingroup tax - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 55a94d685cc..29194d21ec6 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -22,7 +22,6 @@ /** * \file htdocs/compta/tva/class/tva.class.php * \ingroup tax - * \author Laurent Destailleur */ // Put here all includes required by your class file diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php index 4be4d175b47..df2dcd1f94a 100644 --- a/htdocs/core/class/antivir.class.php +++ b/htdocs/core/class/antivir.class.php @@ -22,7 +22,6 @@ /** * \file htdocs/core/class/antivir.class.php * \brief File of class to scan viruses - * \author Laurent Destailleur. */ /** diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index b63b2785e44..2fcf6ef7c4f 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -84,7 +84,7 @@ class CommActionRapport $this->month = $month; $this->year = $year; - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index eeee238ac80..91fe828963c 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -61,7 +61,7 @@ class pdf_ban extends ModeleBankAccountDoc $this->name = "ban"; $this->description = $langs->trans("DocumentModelBan").' (Volunteer wanted to finish)'; - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -76,11 +76,11 @@ class pdf_ban extends ModeleBankAccountDoc $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxworkload=$this->marge_gauche+100; diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index e94af011b1e..f66d005e6c3 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -63,7 +63,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->name = "sepamandate"; $this->description = $langs->transnoentitiesnoconv("DocumentModelSepaMandate"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -78,11 +78,11 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->posxref=$this->marge_gauche; } diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 09148746fe9..eaf4047e107 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -57,7 +57,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->tab_top = 60; - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -68,11 +68,11 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->line_height = 5; $this->line_per_page = 40; $this->tab_height = 200; //$this->line_height * $this->line_per_page; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index eced22d03d8..8f1b0f3a3c8 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -75,7 +75,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'COMMANDE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 7cff0c19e6b..aaec1127963 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -74,7 +74,7 @@ class doc_generic_contract_odt extends ModelePDFContract $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'CONTRACT_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index f7ae9834a65..d73ddd4297b 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -132,7 +132,7 @@ class pdf_strato extends ModelePDFContract $this->name = 'strato'; $this->description = $langs->trans("StandardContractsTemplate"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 52c810fd965..e27eb9b7bf0 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -76,7 +76,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'EXPEDITION_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 5cfc6c3287e..2c24c4338c5 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -133,7 +133,7 @@ class pdf_standard extends ModeleExpenseReport $this->name = ""; $this->description = $langs->trans('PDFStandardExpenseReports'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 9d606aadc33..9dfe8efe28c 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -19,7 +19,6 @@ * \file htdocs/core/modules/export/export_csv.modules.php * \ingroup export * \brief File of class to build exports with CSV format - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 0e7fd0f1169..2651762998d 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -20,7 +20,6 @@ * \file htdocs/core/modules/export/export_excel.modules.php * \ingroup export * \brief File of class to generate export file with Excel format - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 7460d71ff13..982b42b3ec5 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -20,7 +20,6 @@ * \file htdocs/core/modules/export/export_excel2007.modules.php * \ingroup export * \brief File of class to generate export file with Excel format - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 038446643a2..42ffd3b5fba 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -20,7 +20,6 @@ * \file htdocs/core/modules/export/export_excelnew.modules.php * \ingroup export * \brief File of class to generate export file with Excel format - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index b40da3cd539..f87bcf4fbdb 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -20,7 +20,6 @@ * \file htdocs/core/modules/export/export_csv.modules.php * \ingroup export * \brief File of class to build export files with format TSV - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 642140e0ce8..8463f1449ed 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -75,7 +75,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'FACTURE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 9d39eb5e858..2b5158e6f48 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -125,7 +125,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->name = 'soleil'; $this->description = $langs->trans("DocumentModelStandardPDF"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 963de1494a7..4c10b7c7864 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -25,7 +25,6 @@ * \file htdocs/core/modules/livraison/doc/pdf_typhon.modules.php * \ingroup livraison * \brief File of class to manage receving receipts with template Typhon - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; @@ -128,7 +127,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->name = "typhon"; $this->description = $langs->trans("DocumentModelTyphon"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index f8861380b2f..9a3381319a7 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -73,7 +73,7 @@ class doc_generic_product_odt extends ModelePDFProduct $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'PRODUCT_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 88ec5204845..119ce6ad632 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -126,7 +126,7 @@ class pdf_standard extends ModelePDFProduct $this->name = "standard"; $this->description = $langs->trans("DocumentModelStandardPDF"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 6d67a36c010..6c1aa5b418b 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -90,7 +90,7 @@ class doc_generic_project_odt extends ModelePDFProjects $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'PROJECT_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index bc2019bfce8..67b530ef96c 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -20,8 +20,7 @@ /** * \file htdocs/core/modules/project/doc/pdf_baleine.modules.php * \ingroup project - * \brief File of class to generate project document Baleine - * \author Regis Houssin + * \brief File of the class allowing to generate projects with the baleine model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; @@ -128,7 +127,7 @@ class pdf_baleine extends ModelePDFProjects $this->name = "baleine"; $this->description = $langs->trans("DocumentModelBaleine"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -143,11 +142,11 @@ class pdf_baleine extends ModelePDFProjects $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxworkload=$this->marge_gauche+120; @@ -295,7 +294,7 @@ class pdf_baleine extends ModelePDFProjects $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-2, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+2); @@ -410,7 +409,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font // Ref of task $pdf->SetXY($this->posxref, $curY); @@ -483,7 +482,7 @@ class pdf_baleine extends ModelePDFProjects $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - // Pied de page + // Footer of the page $this->_pagefoot($pdf, $object, $outputlangs); if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); @@ -507,7 +506,7 @@ class pdf_baleine extends ModelePDFProjects $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -545,10 +544,10 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetDrawColor(128, 128, 128); - // Draw rect of all tab (title + lines). Rect prend une longueur en 3eme param + // Draw rect of all tab (title + lines). Rect takes a length in 3rd parameter $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); - // line prend une position y en 3eme param + // line takes a position y in 3rd parameter $pdf->line($this->marge_gauche, $tab_top+$heightoftitleline, $this->page_largeur-$this->marge_droite, $tab_top+$heightoftitleline); $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index ba815810f28..7721b29a1bf 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -21,8 +21,7 @@ /** * \file htdocs/core/modules/project/doc/pdf_beluga.modules.php * \ingroup project - * \brief Fichier de la classe permettant de generer les projets au modele beluga - * \author Charlie Benke + * \brief File of the class allowing to generate projects with the beluga model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; @@ -50,7 +49,7 @@ if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/com /** - * Class to manage generation of project document Baleine + * Class to manage generation of project document Beluga */ class pdf_beluga extends ModelePDFProjects @@ -83,7 +82,7 @@ class pdf_beluga extends ModelePDFProjects $this->name = "beluga"; $this->description = $langs->trans("DocumentModelBeluga"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->orientation = 'L'; @@ -104,11 +103,11 @@ class pdf_beluga extends ModelePDFProjects $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position if ($this->orientation == 'L' || $this->orientation == 'Landscape') { $this->posxref=$this->marge_gauche+1; $this->posxdate=$this->marge_gauche+105; diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 7685c07b480..e4a32541aa9 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -17,10 +17,9 @@ */ /** - * \file htdocs/core/modules/project/doc/pdf_baleine.modules.php + * \file htdocs/core/modules/project/doc/pdf_timespent.modules.php * \ingroup project * \brief File of class to generate project document Baleine - * \author Regis Houssin */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; @@ -33,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; /** - * Class to manage generation of project document Baleine + * Class to manage generation of project document Timespent */ class pdf_timespent extends ModelePDFProjects @@ -60,7 +59,7 @@ class pdf_timespent extends ModelePDFProjects $this->name = "timespent"; $this->description = $langs->trans("DocumentModelTimeSpent"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -75,11 +74,11 @@ class pdf_timespent extends ModelePDFProjects $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxtimespent=$this->marge_gauche+120; diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index f6da1061c89..a12b1079caf 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -91,7 +91,7 @@ class doc_generic_task_odt extends ModelePDFTask $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'PROJECT_TASK_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 7b274ac0c9a..8c8b566259a 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -72,7 +72,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'PROPALE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 127c7a92352..0fb5c1412b2 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -47,7 +47,7 @@ class pdf_paiement $this->db = $db; $this->description = $langs->transnoentities("ListOfCustomerPayments"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 588b848f3d3..fd3a93c130f 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -70,7 +70,7 @@ class doc_generic_reception_odt extends ModelePdfReception $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'RECEPTION_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index f8bbf568d86..cba1a3d894e 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -66,7 +66,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'COMPANY_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; @@ -78,7 +78,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $this->option_logo = 1; // Affiche logo - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini } diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index ac9c0423694..55a6caea5a2 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -73,7 +73,7 @@ class doc_generic_stock_odt extends ModelePDFStock $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'STOCK_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 61bfa916fe2..08e0894bd04 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -126,7 +126,7 @@ class pdf_standard extends ModelePDFStock $this->name = "standard"; $this->description = $langs->trans("DocumentModelStandardPDF"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 6a607de6d37..45edfb72cde 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -126,7 +126,7 @@ class pdf_stdmovement extends ModelePDFMovement $this->name = "stdmouvement"; $this->description = $langs->trans("DocumentModelStandardPDF"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 00e981dfdd6..2f2e28b5463 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -128,7 +128,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->name = "canelle"; $this->description = $langs->trans('SuppliersInvoiceModel'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -148,7 +148,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->franchise=!$mysoc->tva_assuj; - // Defini position des colonnes + // Define column position $this->posxdesc=$this->marge_gauche+1; $this->posxtva=112; $this->posxup=126; diff --git a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php index d9e9112ec54..06fc7d2ae87 100644 --- a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php @@ -76,7 +76,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'SUPPLIER_ORDER_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; @@ -233,7 +233,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders if ($conf->fournisseur->commande->dir_output) { $object->fetch_thirdparty(); - + if ($object->specimen) { $dir = $conf->fournisseur->commande->dir_output; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php index 02b11366816..07070c261cc 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php @@ -131,7 +131,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->name = "cornas"; $this->description = $langs->trans('SuppliersCommandModel'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 116b77117e4..61982a05621 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -131,7 +131,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->name = "muscadet"; $this->description = $langs->trans('SuppliersCommandModel'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 81093d9adff..3670797da67 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -128,7 +128,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->name = "standard"; $this->description = $langs->trans('DocumentModelStandardPDF'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -144,7 +144,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->franchise=!$mysoc->tva_assuj; - // Defini position des colonnes + // Define column position $this->posxdate=$this->marge_gauche+1; $this->posxreffacturefourn=30; $this->posxreffacture=65; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 7b38ec52c0e..ac1868f6313 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -74,7 +74,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 44fe533f0eb..2ed06067944 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -128,7 +128,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->name = "aurore"; $this->description = $langs->trans('DocModelAuroreDescription'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 80576bfcca0..f67cc02ff2d 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -71,7 +71,7 @@ class doc_generic_user_odt extends ModelePDFUser $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'USER_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 023bc714ac3..750d523b4e2 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -74,7 +74,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'USERGROUP_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index b6cb7dbfb7f..f0992160d09 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -20,7 +20,6 @@ * \file htdocs/ecm/dir_card.php * \ingroup ecm * \brief Card of a directory for ECM module - * \author Laurent Destailleur */ require '../main.inc.php'; diff --git a/htdocs/public/agenda/index.php b/htdocs/public/agenda/index.php index 112a07951b8..f55eb4d941b 100644 --- a/htdocs/public/agenda/index.php +++ b/htdocs/public/agenda/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/agenda/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/donations/index.php b/htdocs/public/donations/index.php index 08e7650a152..7404698becd 100644 --- a/htdocs/public/donations/index.php +++ b/htdocs/public/donations/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/donations/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/index.php b/htdocs/public/index.php index e1030c9973a..a1eeeffe9c6 100644 --- a/htdocs/public/index.php +++ b/htdocs/public/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../master.inc.php'; diff --git a/htdocs/public/members/index.php b/htdocs/public/members/index.php index 42bfa7713cf..c31d0e10449 100644 --- a/htdocs/public/members/index.php +++ b/htdocs/public/members/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/members/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/paybox/index.php b/htdocs/public/paybox/index.php index 58d748aba72..60da64aad9d 100644 --- a/htdocs/public/paybox/index.php +++ b/htdocs/public/paybox/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/paybox/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index 319c40f2c18..9524b1be9ed 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -21,7 +21,6 @@ * \file htdocs/public/paybox/newpayment.php * \ingroup paybox * \brief File to offer a way to make a payment for a particular Dolibarr entity - * \author Laurent Destailleur */ define("NOLOGIN", 1); // This means this output page does not require to be logged. diff --git a/htdocs/public/payment/index.php b/htdocs/public/payment/index.php index 21786830df6..b0772b576c0 100644 --- a/htdocs/public/payment/index.php +++ b/htdocs/public/payment/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/payment/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/paypal/index.php b/htdocs/public/paypal/index.php index 0cba12e6aa2..54e81788f49 100644 --- a/htdocs/public/paypal/index.php +++ b/htdocs/public/paypal/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/paypal/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/stripe/index.php b/htdocs/public/stripe/index.php index 6958940ea48..792aa7c5f10 100644 --- a/htdocs/public/stripe/index.php +++ b/htdocs/public/stripe/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/stripe/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/theme/common/index.php b/htdocs/public/theme/common/index.php index 2a9d8b8c2a9..3d4eec0ee31 100644 --- a/htdocs/public/theme/common/index.php +++ b/htdocs/public/theme/common/index.php @@ -20,7 +20,6 @@ * \file htdocs/public/theme/common/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../../master.inc.php'; diff --git a/htdocs/public/theme/index.php b/htdocs/public/theme/index.php index 6b5d38f5e94..bf856f24280 100644 --- a/htdocs/public/theme/index.php +++ b/htdocs/public/theme/index.php @@ -20,7 +20,6 @@ * \file htdocs/public/theme/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; From d3b51979565f63a38900969c58d573fb08af1a1e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 20 Sep 2019 13:02:50 +0200 Subject: [PATCH 621/982] FIX new display for stripe account invert col and row for better display --- htdocs/societe/paymentmodes.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index a9f0d9aed0b..6154a8a7c3a 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1307,19 +1307,21 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $balance = \Stripe\Balance::retrieve(array("stripe_account" => $stripesupplieracc)); print ''."\n"; print ''; - print ''; - print ''; print ''; + print ''; + print ''; + print ''; print ''; + $currencybalance = array(); if (is_array($balance->available) && count($balance->available)) { foreach ($balance->available as $cpt) { $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); - if (! in_array($cpt->currency, $arrayzerounitcurrency)) $amount = $cpt->amount / 100; - else $amount = $cpt->amount; - print ''; + if (! in_array($cpt->currency, $arrayzerounitcurrency)) $currencybalance[$cpt->currency]->available=$cpt->amount / 100; + else $currencybalance[$cpt->currency]->available=$cpt->amount; + $currencybalance[$cpt->currency]->currency=$cpt->currency; } } @@ -1328,11 +1330,19 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' foreach ($balance->pending as $cpt) { $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); - if (! in_array($cpt->currency, $arrayzerounitcurrency)) $amount = $cpt->amount / 100; - else $amount = $cpt->amount; - print ''; + if (! in_array($cpt->currency, $arrayzerounitcurrency)) $currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount / 100; + else $currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount; } } + + if (is_array($currencybalance)) + { + foreach ($currencybalance as $cpt) + { + print ''; + } + } + print '
    '.$langs->trans('Status').''.$langs->trans('Amount').''.$langs->trans('Currency').''.$langs->trans('Available').''.$langs->trans('Pending').''.$langs->trans('Total').'
    '.$langs->trans("Available").''.price($amount, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).' '.$langs->trans("Currency".strtoupper($cpt->currency)).'
    '.$langs->trans("Pending").''.price($amount, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).' '.$langs->trans("Currency".strtoupper($cpt->currency)).'
    '.$langs->trans("Currency".strtoupper($cpt->currency)).''.price($cpt->available, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).''.price($cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).''.price($cpt->available+$cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).'
    '; print '
    '; } From 1e49fd0d45b259de9df24aa6cdd4401faafabb4b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 20 Sep 2019 15:07:58 +0200 Subject: [PATCH 622/982] Translate --- htdocs/adherents/subscription/card.php | 6 +++--- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 6 +++--- .../modules/bank/doc/pdf_sepamandate.modules.php | 10 +++++----- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 2 +- .../modules/commande/doc/pdf_einstein.modules.php | 10 +++++----- .../modules/commande/doc/pdf_eratosthene.modules.php | 8 ++++---- .../core/modules/contract/doc/pdf_strato.modules.php | 4 ++-- .../modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- .../modules/expedition/doc/pdf_merou.modules.php | 2 +- .../modules/expedition/doc/pdf_rouget.modules.php | 6 +++--- .../expensereport/doc/pdf_standard.modules.php | 6 +++--- .../core/modules/facture/doc/pdf_crabe.modules.php | 8 ++++---- .../core/modules/facture/doc/pdf_sponge.modules.php | 6 +++--- .../modules/fichinter/doc/pdf_soleil.modules.php | 4 ++-- .../modules/livraison/doc/pdf_typhon.modules.php | 8 ++++---- .../modules/product/doc/pdf_standard.modules.php | 8 ++++---- .../core/modules/project/doc/pdf_beluga.modules.php | 6 +++--- .../modules/project/doc/pdf_timespent.modules.php | 6 +++--- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 10 +++++----- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 8 ++++---- .../modules/reception/doc/pdf_squille.modules.php | 6 +++--- .../core/modules/stock/doc/pdf_standard.modules.php | 8 ++++---- .../modules/stock/doc/pdf_stdmovement.modules.php | 8 ++++---- .../supplier_invoice/pdf/pdf_canelle.modules.php | 10 +++++----- .../supplier_order/pdf/pdf_cornas.modules.php | 8 ++++---- .../supplier_order/pdf/pdf_muscadet.modules.php | 10 +++++----- .../supplier_payment/doc/pdf_standard.modules.php | 4 ++-- .../supplier_proposal/doc/pdf_aurore.modules.php | 12 ++++++------ 28 files changed, 99 insertions(+), 99 deletions(-) diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index e44995b263f..21b5b68794f 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -68,7 +68,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, if ($user->rights->adherent->cotisation->creer && $action == 'update' && ! $cancel) { - // Charge objet actuel + // Load current object $result=$object->fetch($rowid); if ($result > 0) { @@ -101,7 +101,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && ! $canc if (! $errmsg) { - // Modifie valeures + // Modify values $object->dateh=dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $object->datef=dol_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']); $object->fk_type=$_POST["typeid"]; @@ -389,7 +389,7 @@ if ($rowid && $action != 'edit') } } - // Supprimer + // Delete if ($user->rights->adherent->cotisation->creer) { print '\n"; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 91fe828963c..9a6ee697833 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -197,7 +197,7 @@ class pdf_ban extends ModeleBankAccountDoc $nexY = $pdf->GetY(); $height_note=$nexY-($tab_top-2); - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-3, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -231,7 +231,7 @@ class pdf_ban extends ModeleBankAccountDoc } /* - * Pied de page + * Footer of the page */ $this->_pagefoot($pdf, $object, $outputlangs); if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); @@ -261,7 +261,7 @@ class pdf_ban extends ModeleBankAccountDoc $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index f66d005e6c3..c7206000982 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -109,7 +109,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files required by page + // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "withdrawals", "companies", "projects", "bills")); if (! empty($conf->bank->dir_output)) @@ -194,7 +194,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $tab_top_newpage = 40; $tab_height_newpage = 210; - // Affiche notes + // Show notes if (! empty($object->note_public)) { $pdf->SetFont('', '', $default_font_size - 1); @@ -202,7 +202,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $nexY = $pdf->GetY(); $height_note=$nexY-($tab_top-2); - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-3, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -374,7 +374,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); /* - * Pied de page + * Footer of the page */ $this->_pagefoot($pdf, $object, $outputlangs); if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); @@ -404,7 +404,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index eaf4047e107..70985902ad7 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -205,7 +205,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->result = array('fullpath'=>$file); $outputlangs->charset_output=$sav_charset_output; - return 1; // Pas d'erreur + return 1; // No error } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 4a81f94ed29..6f46a9b70a9 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -353,7 +353,7 @@ class pdf_einstein extends ModelePDFCommandes $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -388,7 +388,7 @@ class pdf_einstein extends ModelePDFCommandes $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -633,7 +633,7 @@ class pdf_einstein extends ModelePDFCommandes $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1156,11 +1156,11 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index afe1213fa23..eeb0fa930ac 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -383,7 +383,7 @@ class pdf_eratosthene extends ModelePDFCommandes $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -831,7 +831,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1343,13 +1343,13 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index d73ddd4297b..76dafb4f10a 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -279,7 +279,7 @@ class pdf_strato extends ModelePDFContract $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -556,7 +556,7 @@ class pdf_strato extends ModelePDFContract */ // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+3); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+3); // Rect takes a length in 3rd parameter and 4th parameter } /** diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 8f3441c332c..66a86e4345f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -320,7 +320,7 @@ class pdf_espadon extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -377,7 +377,7 @@ class pdf_espadon extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -788,13 +788,13 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index dbdfd722168..761201e1836 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -281,7 +281,7 @@ class pdf_merou extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index d3e254c6132..96a166d4ff8 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -350,7 +350,7 @@ class pdf_rouget extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -407,7 +407,7 @@ class pdf_rouget extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -800,7 +800,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFont('', '', $default_font_size - 2); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetDrawColor(128, 128, 128); $pdf->SetFont('', '', $default_font_size - 1); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 2c24c4338c5..65db52ddce3 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -334,7 +334,7 @@ class pdf_standard extends ModeleExpenseReport $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -525,7 +525,7 @@ class pdf_standard extends ModeleExpenseReport $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -883,7 +883,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetDrawColor(128, 128, 128); - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); // line prend une position y en 3eme param if (empty($hidetop)) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 7ec496d385b..fd684801096 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -420,7 +420,7 @@ class pdf_crabe extends ModelePDFFactures $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -455,7 +455,7 @@ class pdf_crabe extends ModelePDFFactures $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -1498,11 +1498,11 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 10bea53032f..7a41a72ba3b 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -414,7 +414,7 @@ class pdf_sponge extends ModelePDFFactures $nexY = max($pdf->GetY(), $nexY); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -1795,13 +1795,13 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 2b5158e6f48..aec300c634d 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -282,7 +282,7 @@ class pdf_soleil extends ModelePDFFicheinter $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -529,7 +529,7 @@ class pdf_soleil extends ModelePDFFicheinter */ // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+1, 0, 0); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+1, 0, 0); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidebottom)) { diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 4c10b7c7864..796f58a6743 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -334,7 +334,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -353,7 +353,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -623,7 +623,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->result = array('fullpath'=>$file); - return 1; // pas d'erreur + return 1; // No error } else { @@ -694,7 +694,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetFont('', '', $default_font_size - 2); // Output Rec - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 119ce6ad632..098adc71c57 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -328,7 +328,7 @@ class pdf_standard extends ModelePDFProduct $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -572,7 +572,7 @@ class pdf_standard extends ModelePDFProduct $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -630,11 +630,11 @@ class pdf_standard extends ModelePDFProduct $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 7721b29a1bf..1d7e30e7e6c 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -267,7 +267,7 @@ class pdf_beluga extends ModelePDFProjects $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-2, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+2); @@ -679,7 +679,7 @@ class pdf_beluga extends ModelePDFProjects $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -717,7 +717,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetDrawColor(128, 128, 128); - // Draw rect of all tab (title + lines). Rect prend une longueur en 3eme param + // Draw rect of all tab (title + lines). Rect takes a length in 3rd parameter $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); // line prend une position y en 3eme param diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index e4a32541aa9..2e475a05731 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -225,7 +225,7 @@ class pdf_timespent extends ModelePDFProjects $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -437,7 +437,7 @@ class pdf_timespent extends ModelePDFProjects $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -475,7 +475,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->SetDrawColor(128, 128, 128); - // Draw rect of all tab (title + lines). Rect prend une longueur en 3eme param + // Draw rect of all tab (title + lines). Rect takes a length in 3rd parameter $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); // line prend une position y en 3eme param diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 59267e25272..c29fc14685a 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -415,7 +415,7 @@ class pdf_azur extends ModelePDFPropales $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -458,7 +458,7 @@ class pdf_azur extends ModelePDFPropales $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -818,7 +818,7 @@ class pdf_azur extends ModelePDFPropales $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1350,11 +1350,11 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index f5784ab1b2b..11c4ac111d1 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -392,7 +392,7 @@ class pdf_cyan extends ModelePDFPropales $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -933,7 +933,7 @@ class pdf_cyan extends ModelePDFPropales $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1457,13 +1457,13 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 4a16724d614..c3e287a4366 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -274,7 +274,7 @@ class pdf_squille extends ModelePdfReception $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -331,7 +331,7 @@ class pdf_squille extends ModelePdfReception $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -716,7 +716,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetFont('', '', $default_font_size - 2); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetDrawColor(128, 128, 128); $pdf->SetFont('', '', $default_font_size - 1); diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 08e0894bd04..bff8f8b4c43 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -558,7 +558,7 @@ class pdf_standard extends ModelePDFStock $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -738,7 +738,7 @@ class pdf_standard extends ModelePDFStock $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -796,7 +796,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetFont('', 'B', $default_font_size - 3); // Output Rect - //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); $pdf->SetDrawColor(220, 26, 26); @@ -807,7 +807,7 @@ class pdf_standard extends ModelePDFStock if (empty($hidetop)) { - //$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + //$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell($this->wref, 3, $outputlangs->transnoentities("Ref"), '', 'L'); } diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 45edfb72cde..e589654feb3 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -732,7 +732,7 @@ class pdf_stdmovement extends ModelePDFMovement $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -794,7 +794,7 @@ class pdf_stdmovement extends ModelePDFMovement $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -852,7 +852,7 @@ class pdf_stdmovement extends ModelePDFMovement $pdf->SetFont('', 'B', $default_font_size - 3); // Output Rect - //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); $pdf->SetDrawColor(220, 26, 26); @@ -864,7 +864,7 @@ class pdf_stdmovement extends ModelePDFMovement //Ref mouv if (empty($hidetop)) { - //$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + //$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxidref, $tab_top+1); $pdf->MultiCell($this->posxdatemouv-$this->posxdatemouv-0.8, 3, $outputlangs->transnoentities("Ref"), '', 'L'); } diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 2f2e28b5463..a2393d7f63e 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -340,7 +340,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -358,7 +358,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -590,7 +590,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -858,11 +858,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php index 07070c261cc..ffa0d9edc08 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php @@ -355,7 +355,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -785,7 +785,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1141,7 +1141,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter foreach ($this->cols as $colKey => $colDef) { @@ -1165,7 +1165,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders } if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 61982a05621..9201a586d31 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -388,7 +388,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -406,7 +406,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -687,7 +687,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1043,11 +1043,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 3670797da67..3f2dca2757d 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -502,7 +502,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -619,7 +619,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 2ed06067944..e39e8434a8b 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -24,7 +24,7 @@ /** * \file htdocs/core/modules/propale/doc/pdf_azur.modules.php * \ingroup propale - * \brief Fichier de la classe permettant de generer les propales au modele Azur + * \brief File of the class allowing to generate the supplier propals to the Aurore model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier_proposal.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** - * Class to generate PDF proposal Azur + * Class to generate PDF supplier proposal Aurore */ class pdf_aurore extends ModelePDFSupplierProposal { @@ -391,7 +391,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -685,7 +685,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1201,11 +1201,11 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); From 44ba0deae69c4dc291bff0c04edfc55dbe588a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 20 Sep 2019 17:58:22 +0200 Subject: [PATCH 623/982] fix badge linked resources on fichinter --- htdocs/core/lib/fichinter.lib.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 8f8dea33b97..c17080d53f5 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -66,19 +66,20 @@ function fichinter_prepare_head($object) if ($conf->resource->enabled) { require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; - $nbResource = 0; - $objectres=new Dolresource($db); - if (is_array($objectres->available_resources)) - { - foreach ($objectres->available_resources as $modresources => $resources) - { - $resources=(array) $resources; // To be sure $resources is an array - foreach($resources as $resource_obj) - { - $linked_resources = $object->getElementResources('fichinter', $object->id, $resource_obj); - } - } - } + $objectres = new Dolresource($db); + $linked_resources = $objectres->getElementResources('fichinter', $object->id); + $nbResource = (is_array($linked_resources)?count($linked_resources):0); + // if (is_array($objectres->available_resources)) + // { + // foreach ($objectres->available_resources as $modresources => $resources) + // { + // $resources=(array) $resources; // To be sure $resources is an array + // foreach($resources as $resource_obj) + // { + // $linked_resources = $object->getElementResources('fichinter', $object->id, $resource_obj); + // } + // } + // } $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id; $head[$h][1] = $langs->trans("Resources"); From 86e8abde65635e41479af3dd250014ff10108f92 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 11:18:54 +0200 Subject: [PATCH 624/982] Fix warning --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2eead6da81d..9c2f8ea737c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; */ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode = '') { - global $user,$conf,$langs,$dolibarr_main_db_name; + global $user,$conf,$langs,$dolibarr_main_db_name, $mysoc; $mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]); $leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]); From 14c98bea157941f4cbaafb985b108f41ecbaff02 Mon Sep 17 00:00:00 2001 From: oscim Date: Sun, 22 Sep 2019 11:34:28 +0200 Subject: [PATCH 625/982] Update livraison.class.php for correct display object link in card other object (shipping) --- htdocs/livraison/class/livraison.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 093a1c3ab1e..aa1f59cdfc4 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -844,6 +844,12 @@ class Livraison extends CommonObject elseif ($statut==0) return $langs->trans($this->statuts[$statut]); elseif ($statut==1) return $langs->trans($this->statuts[$statut]); } + elseif ($mode == 3) + { + if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'),'statut5'); + if ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'),'statut0'); + if ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'),'statut4'); + } elseif ($mode == 4) { if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5').' '.$langs->trans('StatusDeliveryCanceled'); From aed017deab26924d048f169d8b7e25186ce1e743 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 22 Sep 2019 09:36:18 +0000 Subject: [PATCH 626/982] Fixing style errors. --- htdocs/livraison/class/livraison.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index aa1f59cdfc4..afc1d89538c 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -846,9 +846,9 @@ class Livraison extends CommonObject } elseif ($mode == 3) { - if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'),'statut5'); - if ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'),'statut0'); - if ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'),'statut4'); + if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5'); + if ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0'); + if ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4'); } elseif ($mode == 4) { From 98acfd6929369ff11a0e6fb2f1583b16b4c36b4a Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 11:57:33 +0200 Subject: [PATCH 627/982] Add basic stats to new dashboard --- htdocs/index.php | 51 ++++++++++++++++++++++++++++-- htdocs/theme/eldy/info-box.inc.php | 28 ++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index d50b5248fab..9151ead38b8 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -514,47 +514,55 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'project' => array( 'groupName' => 'Projects', + 'globalStatsKey' => 'projects', 'stats' => array('project', 'project_task'), ), 'propal' => array( 'groupName' => 'Proposals', + 'globalStatsKey' => 'proposals', 'stats' => array('propal_opened', 'propal_signed'), ), 'commande' => array( 'groupName' => 'Orders', + 'globalStatsKey' => 'orders', 'stats' => array('commande'), ), 'facture' => array( 'groupName' => 'Invoices', + 'globalStatsKey' => 'invoices', 'stats' => array('facture'), ), 'contrat' => array( 'groupName' => 'Contracts', + 'globalStatsKey' => 'Contracts', 'stats' => array('contrat_inactive', 'contrat_active'), ), 'supplier_proposal' => array( 'groupName' => 'SupplierProposals', + 'globalStatsKey' => 'askprice', 'stats' => array('supplier_proposal_opened', 'supplier_proposal_signed'), ), 'order_supplier' => array( 'groupName' => 'SuppliersOrders', + 'globalStatsKey' => 'supplier_orders', 'stats' => array('order_supplier'), ), 'invoice_supplier' => array( 'groupName' => 'BillsSuppliers', + 'globalStatsKey' => 'supplier_invoices', 'stats' => array('invoice_supplier'), ), @@ -567,18 +575,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'Adherent' => array( 'groupName' => 'Members', + 'globalStatsKey' => 'members', 'stats' => array('Adherent'), ), 'ExpenseReport' => array( 'groupName' => 'ExpenseReport', + 'globalStatsKey' => 'expensereports', 'stats' => array('ExpenseReport'), ), 'Holiday' => array( 'groupName' => 'Holidays', + 'globalStatsKey' => 'holidays', 'stats' => array('Holiday'), ), @@ -672,12 +683,46 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { if (!empty($boards)) { $groupName = $langs->trans($groupElement['groupName']); $groupKeyLowerCase = strtolower($groupKey); + $nbTotalForGroup = 0; + + // global stats + $globalStatsKey = false; + if (!empty($groupElement['globalStatsKey']) && empty($groupElement['globalStats'])){ // can be filled by hook + $globalStatsKey = $groupElement['globalStatsKey']; + $groupElement['globalStats'] = array(); + + if(in_array($globalStatsKey, $keys)) + { + // get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links + $keyIndex = array_search($globalStatsKey, $keys); + + $classe=$classes[$keyIndex]; + if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) + { + $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey]?$boardloaded[$classe]->nb[$globalStatsKey]:0; + $nbTotal = doubleval($groupElement['globalStats']['total']); + if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000 , 2) .'k'; } + $groupElement['globalStats']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')'; + $groupElement['globalStats']['total'] = $nbTotal; + $groupElement['globalStats']['link'] = $links[$keyIndex]; + } + } + } + $openedDashBoard .= '
    ' . "\n"; $openedDashBoard .= '
    ' . "\n"; - $openedDashBoard .= ' ' . "\n"; - $openedDashBoard .= '
    ' . "\n"; - $openedDashBoard .= ' ' . $groupName . '' . "\n"; + $openedDashBoard.= ' '."\n"; + $openedDashBoard.= ' '."\n"; + + if(!empty($groupElement['globalStats'])){ + $openedDashBoard.= ' '.$nbTotal.''."\n"; + } + + $openedDashBoard.= ' '."\n"; + $openedDashBoard .= '
    ' . "\n"; + + $openedDashBoard .= ' '.$groupName.'' . "\n"; foreach ($boards as $board) { if (!empty($board->labelShort)) { diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 3586d310dfa..34254812848 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -8,6 +8,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> */ .info-box { display: block; + position: relative; min-height: 90px; background: #fff; width: 100%; @@ -54,6 +55,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> border-bottom-right-radius: 0; border-bottom-left-radius: 2px; display: block; + overflow: hidden; float: left; height: 90px; width: 90px; @@ -71,6 +73,32 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .info-box-icon > img { max-width: 100%; } +.info-box-icon-text{ + box-sizing: border-box; + display: block; + position: absolute; + width: 90px; + bottom: 0px; + color: #ffffff; + background-color: rgba(0,0,0,0.1); + cursor: default; + + font-size: 10px; + line-height: 15px; + padding: 0px 3px; + text-align: center; + opacity: 0; + -webkit-transition: opacity 0.5s, visibility 0s 0.5s; + transition: opacity 0.5s, visibility 0s 0.5s; +} +.info-box-sm .info-box-icon-text{ + overflow: hidden; + width: 80px; +} +.info-box:hover .info-box-icon-text{ + opacity: 1; +} + .info-box-content { padding: 5px 10px; margin-left: 90px; From 0660229602b642a9b7188b0ee8501a586d856463 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 22 Sep 2019 10:05:13 +0000 Subject: [PATCH 628/982] Fixing style errors. --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 9151ead38b8..b18ba2cf3be 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -701,7 +701,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { { $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey]?$boardloaded[$classe]->nb[$globalStatsKey]:0; $nbTotal = doubleval($groupElement['globalStats']['total']); - if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000 , 2) .'k'; } + if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000, 2) .'k'; } $groupElement['globalStats']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')'; $groupElement['globalStats']['total'] = $nbTotal; $groupElement['globalStats']['link'] = $links[$keyIndex]; From 9e55fee6e44825e47204bec4d6fc55e35b185b25 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 13:46:11 +0200 Subject: [PATCH 629/982] Prepare global stats replacement --- htdocs/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 9151ead38b8..a8158f6e473 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -662,7 +662,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Show dashboard $nbworkboardempty = 0; - $isIntopOpenedDashBoard = array(); + $isIntopOpenedDashBoard = $globalStatInTopOpenedDashBoard = array(); if (!empty($valid_dashboardlines)) { $openedDashBoard = ''; @@ -716,6 +716,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $openedDashBoard.= ' '."\n"; if(!empty($groupElement['globalStats'])){ + $globalStatInTopOpenedDashBoard[] = $groupElement['globalStats']; $openedDashBoard.= ' '.$nbTotal.''."\n"; } From 913c298a9178bd84870a4f64c78073a959e8fce8 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 20:59:28 +0200 Subject: [PATCH 630/982] Auto remove basic stats if in new opened dashboard --- htdocs/index.php | 98 +++++++++++++++++++----------- htdocs/theme/eldy/info-box.inc.php | 7 +++ 2 files changed, 70 insertions(+), 35 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 45c7e1509e2..28a1a54e2ad 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -107,27 +107,21 @@ if (! empty($conf->global->MAIN_MOTD)) * Dashboard Dolibarr states (statistics) * Hidden for external users */ -$boxstat=''; + + +$boxstatItems = array(); +$boxstatFromHook = ''; // Load translation files required by page $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) { - $boxstat.='
    '; - $boxstat.=''; - $boxstat.=''; - $boxstat.=''; - $boxstat.=''; - $boxstat.=''; - $boxstat.='
    '; - $boxstat.='
    '.$langs->trans("DolibarrStateBoard").'
    '; - $boxstat.='
    '; - $object=new stdClass(); $parameters=array(); $action=''; $reshook=$hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - $boxstat.=$hookmanager->resPrint; + $boxstatFromHook=$hookmanager->resPrint; if (empty($reshook)) { @@ -318,6 +312,7 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT { if ($conditions[$key]) { + $boxstatItem = ''; $classe=$classes[$key]; // Search in cache if load_state_board is already realized if (! isset($boardloaded[$classe]) || ! is_object($boardloaded[$classe])) @@ -336,28 +331,17 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT if (!empty($langfile[$key])) $langs->load($langfile[$key]); $text=$langs->trans($titres[$key]); - $boxstat.=''; - $boxstat.='
    '; - $boxstat.=''.$text.'
    '; - $boxstat.=''.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val]?$board->nb[$val]:0).''; - $boxstat.='
    '; - $boxstat.='
    '; + $boxstatItem.=''; + $boxstatItem.='
    '; + $boxstatItem.=''.$text.'
    '; + $boxstatItem.=''.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val]?$board->nb[$val]:0).''; + $boxstatItem.='
    '; + $boxstatItem.='
    '; + + $boxstatItems[$val] = $boxstatItem; } } } - - $boxstat.='
    '; - $boxstat.='
    '; - $boxstat.='
    '; - $boxstat.='
    '; - $boxstat.='
    '; - $boxstat.='
    '; - $boxstat.='
    '; - $boxstat.='
    '; - - $boxstat.='
    '; - $boxstat.='
    '; } @@ -589,7 +573,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'Holiday' => array( 'groupName' => 'Holidays', - 'globalStatsKey' => 'holidays', + 'globalStatsKey' => 'holidays', 'stats' => array('Holiday'), ), @@ -710,18 +694,18 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } - $openedDashBoard .= '
    ' . "\n"; - $openedDashBoard .= '
    ' . "\n"; + $openedDashBoard.= '
    ' . "\n"; + $openedDashBoard.= '
    ' . "\n"; $openedDashBoard.= ' '."\n"; $openedDashBoard.= ' '."\n"; if(!empty($groupElement['globalStats'])){ - $globalStatInTopOpenedDashBoard[] = $groupElement['globalStats']; + $globalStatInTopOpenedDashBoard[] = $globalStatsKey; $openedDashBoard.= ' '.$nbTotal.''."\n"; } $openedDashBoard.= ' '."\n"; - $openedDashBoard .= '
    ' . "\n"; + $openedDashBoard .= '
    ' . "\n"; $openedDashBoard .= ' '.$groupName.'' . "\n"; @@ -900,6 +884,50 @@ $boxlist.=$resultboxes['boxlista']; $boxlist.= '
    '; + +if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) +{ + // Remove allready present info in new dash board + if(!empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD) && is_array($boxstatItems) && count($boxstatItems) > 0){ + foreach ( $boxstatItems as $boxstatItemKey => $boxstatItemHtml) { + if (in_array($boxstatItemKey, $globalStatInTopOpenedDashBoard)) { + unset($boxstatItems[$boxstatItemKey]); + } + } + } + + if(!empty($boxstatFromHook) || !empty($boxstatItems)){ + $boxstat.='
    '; + $boxstat.=''; + $boxstat.=''; + $boxstat.=''; + $boxstat.=''; + $boxstat.=''; + $boxstat.='
    '; + $boxstat.='
    '.$langs->trans("DolibarrStateBoard").'
    '; + $boxstat.='
    '; + + $boxstat.=$boxstatFromHook; + + if(is_array($boxstatItems) && count($boxstatItems) > 0) + { + $boxstat.= implode('', $boxstatItems); + } + + $boxstat.='
    '; + $boxstat.='
    '; + $boxstat.='
    '; + $boxstat.='
    '; + $boxstat.='
    '; + $boxstat.='
    '; + $boxstat.='
    '; + $boxstat.='
    '; + + $boxstat.='
    '; + $boxstat.='
    '; + } +} + $boxlist.= '
    '; $boxlist.=$boxstat; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 34254812848..a483b3d758d 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -91,6 +91,13 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> -webkit-transition: opacity 0.5s, visibility 0s 0.5s; transition: opacity 0.5s, visibility 0s 0.5s; } + +global->MAIN_DISABLE_GLOBAL_BOXSTATS) && !empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD)){ ?> +.info-box-icon-text{ + opacity: 1; +} + + .info-box-sm .info-box-icon-text{ overflow: hidden; width: 80px; From 3faca1dbd1d7b8d162c72126d20682dda5850622 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Sep 2019 21:09:01 +0200 Subject: [PATCH 631/982] Enhancement for SCA --- htdocs/stripe/class/stripe.class.php | 44 +++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 9c0bc9ebae3..6379aa36746 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -654,7 +654,7 @@ class Stripe extends CommonObject * @param string $stripeacc ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect * @param int $status Status (0=test, 1=live) * @param int $createifnotlinkedtostripe 1=Create the stripe card and the link if the card is not yet linked to a stripe card - * @return \Stripe\StripeCard|null Stripe Card or null if not found + * @return \Stripe\StripeCard|\Stripe\PaymentMethod|null Stripe Card or null if not found */ public function cardStripe($cu, CompanyPaymentMode $object, $stripeacc = '', $status = 0, $createifnotlinkedtostripe = 0) { @@ -680,10 +680,24 @@ class Stripe extends CommonObject { try { if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage - $card = $cu->sources->retrieve($cardref); + if (! preg_match('/^pm_/', $cardref)) + { + $card = $cu->sources->retrieve($cardref); + } + else + { + $card = \Stripe\PaymentMethod::retrieve($cardref); + } } else { - //$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided - $card = $cu->sources->retrieve($cardref); + if (! preg_match('/^pm_/', $cardref)) + { + //$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided + $card = $cu->sources->retrieve($cardref); + } + else { + //$card = \Stripe\PaymentMethod::retrieve($cardref, array("stripe_account" => $stripeacc)); // Don't know if this works + $card = \Stripe\PaymentMethod::retrieve($cardref); + } } } catch(Exception $e) @@ -707,12 +721,28 @@ class Stripe extends CommonObject //$a = \Stripe\Stripe::getApiKey(); //var_dump($a);var_dump($stripeacc);exit; - dol_syslog("Try to create card dataforcard = ".json_encode($dataforcard)); + dol_syslog("Try to create card with dataforcard = ".json_encode($dataforcard)); try { if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage - $card = $cu->sources->create($dataforcard); + if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) + { + $card = $cu->sources->create($dataforcard); + } + else + { + // TODO + dol_syslog("Error: This case is not supported", LOG_ERR); + } } else { - $card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc)); + if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) + { + $card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc)); + } + else + { + // TODO + dol_syslog("Error: This case is not supported", LOG_ERR); + } } if ($card) From cc5c6c0c76a7b8cef8ae69b842dde8ba4f171dc6 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 22 Sep 2019 19:09:02 +0000 Subject: [PATCH 632/982] Fixing style errors. --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 28a1a54e2ad..bce3b9dc083 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -889,7 +889,7 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT { // Remove allready present info in new dash board if(!empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD) && is_array($boxstatItems) && count($boxstatItems) > 0){ - foreach ( $boxstatItems as $boxstatItemKey => $boxstatItemHtml) { + foreach ($boxstatItems as $boxstatItemKey => $boxstatItemHtml) { if (in_array($boxstatItemKey, $globalStatInTopOpenedDashBoard)) { unset($boxstatItems[$boxstatItemKey]); } From 31094936c1ab3524c0e07ee17d1b2c91a5a2a92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 23 Sep 2019 10:56:11 +0200 Subject: [PATCH 633/982] wip --- htdocs/core/boxes/box_contracts.php | 5 ++++- htdocs/core/boxes/box_factures_fourn.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 43ade84ad20..c304800f4c1 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -84,7 +84,8 @@ class box_contracts extends ModeleBoxes $thirdpartytmp=new Societe($db); $sql = "SELECT s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; - $sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture"; + $sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture"; + $sql.= ", c.ref_customer, c.ref_supplier"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; @@ -117,6 +118,8 @@ class box_contracts extends ModeleBoxes $contractstatic->statut=$objp->fk_statut; $contractstatic->id=$objp->rowid; $contractstatic->ref=$objp->ref; + $contractstatic->ref_customer = $objp->ref_customer; + $contractstatic->ref_supplier = $objp->ref_supplier; $result=$contractstatic->fetch_lines(); $thirdpartytmp->name = $objp->name; diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 9d2e8e995e3..ce355f53e1e 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -87,7 +87,7 @@ class box_factures_fourn extends ModeleBoxes if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT s.nom as name, s.rowid as socid,"; - $sql.= " s.code_fournisseur,"; + $sql.= " s.code_fournisseur, s.email,"; $sql.= " s.logo,"; $sql.= " f.rowid as facid, f.ref, f.ref_supplier,"; $sql.= " f.total_ht,"; @@ -133,6 +133,7 @@ class box_factures_fourn extends ModeleBoxes $thirdpartytmp->id = $objp->socid; $thirdpartytmp->name = $objp->name; + $thirdpartytmp->email = $objp->email; $thirdpartytmp->fournisseur = 1; $thirdpartytmp->code_fournisseur = $objp->code_fournisseur; $thirdpartytmp->logo = $objp->logo; From bf9f25fd74553a6bd2962f3505233b184a9f4953 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 11:35:11 +0200 Subject: [PATCH 634/982] Ehance getPaymentIntent to use it for offline payment --- htdocs/stripe/class/stripe.class.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 6379aa36746..c8a9c69a5ae 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -305,16 +305,18 @@ class Stripe extends CommonObject * @param string $currency_code Currency code * @param string $tag Tag * @param string $description Description - * @param Societe $object Object to pay with Stripe + * @param mixed $object Object to pay with Stripe * @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() * @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect * @param int $status Status (0=test, 1=live) * @param int $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt * @param int $mode automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent * @param boolean $confirmnow false=default, true=try to confirm immediatly after create (if conditions are ok) + * @param string $payment_method 'pm_....' (if known) + * @param string $off_session If we use an already known payment method to pay off line. * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found and failed to create */ - public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false) + public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0) { global $conf; @@ -335,7 +337,7 @@ class Stripe extends CommonObject } elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { $fee = $conf->global->STRIPE_APPLICATION_FEE_MINIMAL; } - if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = round($fee * 100); + if (! in_array($currency_code, $arrayzerounitcurrency)) $stripefee = round($fee * 100); else $stripefee = round($fee); $paymentintent = null; @@ -411,6 +413,12 @@ class Stripe extends CommonObject // payment_method = // payment_method_types = array('card') //var_dump($dataforintent); + if ($off_session) + { + unset($dataforintent['setup_future_usage']); + $dataforintent["off_session"] = true; + } + if (! is_null($payment_method)) $dataforintent["payment_method"] = $payment_method; if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $stripefee > 0) { @@ -491,7 +499,7 @@ class Stripe extends CommonObject } } - dol_syslog("getPaymentIntent return error=".$error, LOG_INFO, -1); + dol_syslog("getPaymentIntent return error=".$error." this->error=".$this->error, LOG_INFO, -1); if (! $error) { From d5877e9c36fbda0040c67e6b63befbd558eb9480 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 11:36:45 +0200 Subject: [PATCH 635/982] FIX Bad currency var used in stripe for connect --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index abc875c370f..626f5533da4 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -325,7 +325,7 @@ class Stripe extends CommonObject } elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { $fee = $conf->global->STRIPE_APPLICATION_FEE_MINIMAL; } - if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = round($fee * 100); + if (! in_array($currency_code, $arrayzerounitcurrency)) $stripefee = round($fee * 100); else $stripefee = round($fee); $paymentintent = null; From 1584a4bf79b42b503e7cb39f37ebf20eba44c2e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 12:27:51 +0200 Subject: [PATCH 636/982] Add trigger event USER_SENTBYMAIL in agenda --- htdocs/core/class/events.class.php | 24 ------------------- .../mysql/data/llx_c_action_trigger.sql | 3 ++- .../install/mysql/migration/10.0.0-11.0.0.sql | 5 ++++ 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 57a076963fd..160e22f4c50 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -87,33 +87,9 @@ class Events // extends CommonObject array('id'=>'USER_NEW_PASSWORD', 'test'=>1), array('id'=>'USER_ENABLEDISABLE', 'test'=>1), array('id'=>'USER_DELETE', 'test'=>1), - /* array('id'=>'USER_SETINGROUP', 'test'=>1), deprecated. Replace with USER_MODIFY - array('id'=>'USER_REMOVEFROMGROUP', 'test'=>1), deprecated. Replace with USER_MODIFY */ array('id'=>'GROUP_CREATE', 'test'=>1), array('id'=>'GROUP_MODIFY', 'test'=>1), array('id'=>'GROUP_DELETE', 'test'=>1), - /* array('id'=>'ACTION_CREATE', 'test'=>$conf->societe->enabled), - array('id'=>'COMPANY_CREATE', 'test'=>$conf->societe->enabled), - array('id'=>'CONTRACT_VALIDATE', 'test'=>$conf->contrat->enabled), - array('id'=>'PROPAL_VALIDATE', 'test'=>$conf->propal->enabled), - array('id'=>'PROPAL_CLOSE_SIGNED', 'test'=>$conf->propal->enabled), - array('id'=>'PROPAL_CLOSE_REFUSED', 'test'=>$conf->propal->enabled), - array('id'=>'PROPAL_SENTBYMAIL', 'test'=>$conf->propal->enabled), - array('id'=>'ORDER_VALIDATE', 'test'=>$conf->commande->enabled), - array('id'=>'ORDER_SENTBYMAIL', 'test'=>$conf->commande->enabled), - array('id'=>'BILL_VALIDATE', 'test'=>$conf->facture->enabled), - array('id'=>'BILL_PAYED', 'test'=>$conf->facture->enabled), - array('id'=>'BILL_CANCEL', 'test'=>$conf->facture->enabled), - array('id'=>'BILL_SENTBYMAIL', 'test'=>$conf->facture->enabled), - array('id'=>'PAYMENT_CUSTOMER_CREATE','test'=>$conf->facture->enabled), - array('id'=>'PAYMENT_SUPPLIER_CREATE','test'=>$conf->fournisseur->enabled), - array('id'=>'MEMBER_CREATE', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_VALIDATE', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_SUBSCRIPTION', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_MODIFY', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_RESILIATE', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_DELETE', 'test'=>$conf->adherent->enabled), - */ ); diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index aaa96e3136a..0e2a1875e21 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -113,12 +113,13 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',165); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_SENTBYMAIL','Ticket message sent by email','Executed when a message is sent from the ticket record','ticket',166); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',167); --- actions not enabled by default (no constant created for that) when we enable module agenda +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',41); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',23); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',140); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_MODIFY','Project modified','Executed when a project is modified','project',142); +-- actions not enabled by default : they are excluded when we enable the module Agenda (except TASK_...) insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',150); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',152); diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 92dcdce1128..890411109f9 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -33,6 +33,11 @@ ALTER TABLE llx_account_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL ALTER TABLE llx_expensereport ADD COLUMN paid smallint default 0 NOT NULL; UPDATE llx_expensereport set paid = 1 WHERE fk_statut = 6 and paid = 0; + +-- For v11 + +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300); + create table llx_entrepot_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, From 8ac0383fa020b029365cb6e12de68de35bb4a481 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 12:36:12 +0200 Subject: [PATCH 637/982] FIX Send email from expense report card. FIX Alias name is not into the email recipient label. --- htdocs/core/actions_sendmails.inc.php | 54 +++++++++++---------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 836652ea819..de3a43d9ce6 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -113,8 +113,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO { $result=$object->fetch($id); - $sendtosocid=0; // Thirdparty on object - if (method_exists($object, "fetch_thirdparty") && ! in_array($object->element, array('societe','member','user','expensereport', 'contact'))) + $sendtosocid=0; // Id of related thirdparty + if (method_exists($object, "fetch_thirdparty") && ! in_array($object->element, array('societe', 'member', 'user', 'expensereport', 'contact'))) { $result=$object->fetch_thirdparty(); if ($object->element == 'user' && $result == 0) $result=1; // Even if not found, we consider ok @@ -124,7 +124,14 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO elseif ($object->element == 'member' || $object->element == 'user') { $thirdparty=$object; - if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id; + if ($object->socid > 0) $sendtosocid=$object->socid; + } + elseif ($object->element == 'expensereport') + { + $tmpuser=new User($db); + $tmpuser->fetch($object->fk_user_author); + $thirdparty=$tmpuser; + if ($object->socid > 0) $sendtosocid=$object->socid; } elseif ($object->element == 'societe') { @@ -136,7 +143,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $contact=$object; if ($contact->id > 0) $sendtosocid=$contact->fetch_thirdparty()->id; } - else dol_print_error('', 'Use actions_sendmails.in.php for an element/object that is not supported'); + else dol_print_error('', "Use actions_sendmails.in.php for an element/object '".$object->element."' that is not supported"); if (is_object($hookmanager)) { @@ -162,6 +169,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO if ($receiver == '-1') $receiver=array(); else $receiver=array($receiver); } + $tmparray=array(); if (trim($_POST['sendto'])) { @@ -173,22 +181,23 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO foreach($receiver as $key=>$val) { // Recipient was provided from combo list - if ($val == 'thirdparty') // Id of third party + if ($val == 'thirdparty') // Key selected means currentthird party (may be usd for current member or current user too) { - $tmparray[] = dol_string_nospecial($thirdparty->name, ' ', array(",")).' <'.$thirdparty->email.'>'; + $tmparray[] = dol_string_nospecial($thirdparty->getFullName($langs), ' ', array(",")).' <'.$thirdparty->email.'>'; } // Recipient was provided from combo list - elseif ($val == 'contact') // Id of contact + elseif ($val == 'contact') // Key selected means current contact { - $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; + $tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>'; } - elseif ($val) // Id du contact + elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); $sendtoid[] = $val; } } } + if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { $receiveruser=$_POST['receiveruser']; @@ -222,16 +231,16 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO foreach($receivercc as $key=>$val) { // Recipient was provided from combo list - if ($val == 'thirdparty') // Id of third party + if ($val == 'thirdparty') // Key selected means currentthird party (may be usd for current member or current user too) { $tmparray[] = dol_string_nospecial($thirdparty->name, ' ', array(",")).' <'.$thirdparty->email.'>'; } // Recipient was provided from combo list - elseif ($val == 'contact') // Id of contact + elseif ($val == 'contact') // Key selected means current contact { $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; } - elseif ($val) // Id du contact + elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); //$sendtoid[] = $val; TODO Add also id of contact in CC ? @@ -414,27 +423,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $result=$mailfile->sendfile(); if ($result) { - // Two hooks are available into method $mailfile->sendfile, so dedicated code is no more required - /* - if (! empty($conf->dolimail->enabled)) - { - $mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); // Original mail id is set ? - if ($mid) - { - // set imap flag answered if it is an answered mail - $dolimail=new DoliMail($db); - $dolimail->id = $mid; - $res=$dolimail->set_prop($user, 'answered',1); - } - if ($imap==1) - { - // write mail to IMAP Server - $movemail = $mailboxconfig->putMail($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$folder,$deliveryreceipt,$mailfile); - if ($movemail) setEventMessages($langs->trans("MailMovedToImapFolder",$folder), null, 'mesgs'); - else setEventMessages($langs->trans("MailMovedToImapFolder_Warning",$folder), null, 'warnings'); - } - }*/ - // Initialisation of datas of object to call trigger if (is_object($object)) { From 40f75b16d8fdb81a89266799846072f7b8970279 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 13:04:22 +0200 Subject: [PATCH 638/982] FIX Substitution of __PROJECT_XXX__ not done --- htdocs/comm/action/class/actioncomm.class.php | 2 +- htdocs/core/actions_massactions.inc.php | 4 ++ htdocs/core/lib/functions.lib.php | 46 ++++++++++++------- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index c3b698d3918..a52bdee82cc 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -676,7 +676,7 @@ class ActionComm extends CommonObject $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working $this->contactid = $obj->fk_contact; // To have fetch_contact method working - $this->fk_project = $obj->fk_project; // To have fetch_project method working + $this->fk_project = $obj->fk_project; // To have fetch_projet method working $this->societe->id = $obj->fk_soc; // deprecated //$this->contact->id = $obj->fk_contact; // deprecated diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index d54d2dd02ff..6cd98f00e48 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -384,6 +384,10 @@ if (! $error && $massaction == 'confirm_presend') foreach ($looparray as $objectid => $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object { // Make substitution in email content + if (! empty($conf->projet->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) + { + $objecttmp->fetch_projet(); + } $substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp); $substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ', array_keys($listofqualifiedobj)) : $objecttmp->id); $substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ', $listofqualifiedref) : $objecttmp->ref); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b6b691117a5..268b206919c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3831,6 +3831,8 @@ function dol_print_error($db = '', $error = '', $errors = null) if (empty($dolibarr_main_prod)) print $out; else { + print 'This website is currently temporarly offline. This may be due to a maintenance operation. Current status of operation are on next line...

    '."\n"; + $langs->load("errors"); print $langs->trans("DolibarrHasDetectedError").'. '; print $langs->trans("YouCanSetOptionDolibarrMainProdToZero"); define("MAIN_CORE_ERROR", 1); @@ -3859,7 +3861,7 @@ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages = $now=dol_now(); print '