diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.travis.yml b/.travis.yml index ff1b30f06e0..6f54232a1d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ # For syntax, see http://about.travis-ci.org/docs/user/languages/php/ # We use dist: precise to have php 5.3 available -dist: precise +dist: trusty sudo: required language: php @@ -140,137 +140,143 @@ install: echo "Adding path of binaries tools installed by composer to the PATH" export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH" echo - + + before_script: -- | - echo Start travis - echo Current dir is `pwd` - echo Home dir is `echo ~` - echo TRAVIS_BUILD_DIR is $TRAVIS_BUILD_DIR + - | + echo Start travis + echo Current dir is `pwd` + echo Home dir is `echo ~` + echo TRAVIS_BUILD_DIR is $TRAVIS_BUILD_DIR -- | - echo "Re-enabling Xdebug for PHP CodeSniffer and PHP Unit" - phpenv config-add /tmp/xdebug.ini - echo - -- | - echo "Setting up PHP" - echo - echo "Set timezone" - echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini - if [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then - #echo - #echo "Enabling APC for PHP <= 5.4" - # Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6! - #echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini + - | + echo "Re-enabling Xdebug for PHP CodeSniffer and PHP Unit" + phpenv config-add /tmp/xdebug.ini echo - echo "Enabling Memcached for PHP <= 5.4" - # Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1, 7.2 and nightly! - echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini - fi - phpenv rehash - echo -- | - if [ "$DEBUG" = true ]; then - echo "Debugging informations" + - | + echo "Setting up PHP" + echo + echo "Set timezone" + echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini + if [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then + #echo + #echo "Enabling APC for PHP <= 5.4" + # Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6! + #echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini + echo + echo "Enabling Memcached for PHP <= 5.4" + # Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1, 7.2 and nightly! + echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini + fi + phpenv rehash + echo + + - | + echo "Versions information" # Check PHP - php -i + echo "PHP version" + php -i | head - # Check PHP CodeSniffer installation + echo "PHPCS version" which phpcs - phpcs --version - phpcs -i + phpcs --version | head - + phpcs -i | head - # Check PHPUnit installation + echo "PHPUnit version" which phpunit - phpunit --version - # Check MySQL - mysql --version - mysql -e "SELECT VERSION();" + phpunit --version | head - + # Check Apache version + echo "Apache version" + apache2 -v | head - + # Check MariaDb + echo "MariaDb version" + mysql --version | head - + mysql -e "SELECT VERSION();" | head - echo - fi -- | - echo "Setting up database" - 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 "Setting up database" + 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 -- | - export CONF_FILE=htdocs/conf/conf.php - echo "Setting up Dolibarr $CONF_FILE" - echo ' $CONF_FILE - echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE - echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE - echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE - echo '$'dolibarr_main_db_host=\'127.0.0.1\'';' >> $CONF_FILE - echo '$'dolibarr_main_db_name=\'travis\'';' >> $CONF_FILE - echo '$'dolibarr_main_db_user=\'travis\'';' >> $CONF_FILE - if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then - echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE - fi - if [ "$DB" = 'postgresql' ]; then - echo '$'dolibarr_main_db_type=\'pgsql\'';' >> $CONF_FILE - fi - # TODO: SQLite - echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE - cat $CONF_FILE - echo + - | + export CONF_FILE=htdocs/conf/conf.php + echo "Setting up Dolibarr $CONF_FILE" + echo ' $CONF_FILE + echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE + echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE + echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE + echo '$'dolibarr_main_db_host=\'127.0.0.1\'';' >> $CONF_FILE + echo '$'dolibarr_main_db_name=\'travis\'';' >> $CONF_FILE + echo '$'dolibarr_main_db_user=\'travis\'';' >> $CONF_FILE + if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then + echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE + fi + if [ "$DB" = 'postgresql' ]; then + echo '$'dolibarr_main_db_type=\'pgsql\'';' >> $CONF_FILE + fi + # TODO: SQLite + echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE + cat $CONF_FILE + echo -- | - echo "Create documents directory and set permissions" - # and admin/temp subdirectory needed for unit tests - mkdir -p documents/admin/temp - echo "first line" > documents/dolibarr.log - echo + - | + echo "Create documents directory and set permissions" + # and admin/temp subdirectory needed for unit tests + mkdir -p documents/admin/temp + echo "first line" > documents/dolibarr.log + echo -- | - echo "Setting up Apache + FPM" + + - echo "Setting up Apache + FPM" + - sudo apt-get update + - sudo apt-get install apache2 libapache2-mod-fastcgi # enable php-fpm - cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf - if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then - # Copy the included pool - cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf - fi - if [ "$DEBUG" = true ]; then - cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf - fi - sudo a2enmod rewrite actions fastcgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini - if [ "$DEBUG" = true ]; then - cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini - fi - ~/.phpenv/versions/$PHP_VERSION_NAME/sbin/php-fpm - # configure apache virtual hosts - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/default - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/apache2/sites-available/default - if [ "$DEBUG" = true ]; then - sudo cat /etc/apache2/sites-available/default - fi - sudo service apache2 restart - echo + - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf + - | + if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then + # Copy the included pool + sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf + fi + - sudo a2enmod rewrite actions fastcgi alias + - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars + - sudo chown -R travis:travis /var/lib/apache2/fastcgi + - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm + # configure apache virtual hosts for precise + #- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default + #- sudo cat /etc/apache2/sites-available/default + # configure apache virtual hosts for trusty + - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf + - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf + - sudo cat /etc/apache2/sites-available/000-default.conf + - sudo service apache2 restart + + script: - | - echo "Checking webserver availability" + echo "Checking webserver availability by a wget -O - http://127.0.0.1" # Ensure we catch errors set -e - wget http://127.0.0.1 - if [ "$DEBUG" = true ]; then - cat index.html - fi + # The wget should return a page with line ' + wget -O - http://127.0.0.1 > test.html + head test.html set +e echo @@ -338,7 +344,6 @@ script: - | echo "Unit testing" - phpunit --version # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. set -e phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php diff --git a/build/travis-ci/apache.conf b/build/travis-ci/apache.conf index 5ba713924f2..a4965c40d68 100644 --- a/build/travis-ci/apache.conf +++ b/build/travis-ci/apache.conf @@ -1,11 +1,10 @@ DocumentRoot %TRAVIS_BUILD_DIR%/htdocs - + Options FollowSymLinks MultiViews ExecCGI AllowOverride All - Order deny,allow - Allow from all + Require all granted # Wire up Apache to use Travis CI's php-fpm. @@ -14,5 +13,9 @@ Action php5-fcgi /php5-fcgi Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization + + + Require all granted + diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index e5485b280ae..5e2337fd67e 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -138,9 +138,7 @@ - - 0 - + @@ -156,8 +154,8 @@ - - + + diff --git a/dev/tools/github_authors_peryear.sh b/dev/tools/github_authors_peryear.sh index 99b28d4d417..1f3a7fea5f6 100755 --- a/dev/tools/github_authors_peryear.sh +++ b/dev/tools/github_authors_peryear.sh @@ -1,7 +1,13 @@ #!/bin/sh -FROM=2016-01-01 -TO=2016-12-31 +if [ "x$1" = "x" ]; then + echo "Usage: $0 YEAR" + exit +fi + + +FROM=$1-01-01 +TO=$1-12-31 echo "git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l" git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l diff --git a/dev/tools/github_commits_perversion.sh b/dev/tools/github_commits_perversion.sh index 40ddafee617..bf76e68bc43 100755 --- a/dev/tools/github_commits_perversion.sh +++ b/dev/tools/github_commits_perversion.sh @@ -1,10 +1,11 @@ #/bin/bash -Releases=("3.8" "3.9" "4.0" "5.0", "develop") -Dates=("2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-07-01") +Releases=("3.8" "3.9" "4.0" "5.0" "6.0" " 7.0" "develop") +Dates=("2013-01-01", "2014-01-01", "2015-01-01", "2016-07-01", "2017-02-01", "2017-07-01", "2018-02-01", "2050-01-01") let "counter = 1" for i in "${Releases[@]}" do + echo "=== $counter git shortlog -s -n --after=${Dates[counter-1]} --before=${Dates[counter]}" git shortlog -s -n --after=${Dates[counter-1]} --before=${Dates[counter]} echo -n "Total $i: " git log --pretty=oneline --after=${Dates[counter-1]} --before=${Dates[counter]} | wc -l diff --git a/dev/tools/test/testtcpdf.php b/dev/tools/test/testtcpdf.php index ad67bce8af9..e14dae9c2a3 100755 --- a/dev/tools/test/testtcpdf.php +++ b/dev/tools/test/testtcpdf.php @@ -101,7 +101,7 @@ $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks -$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); +$pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); diff --git a/dev/tools/test/testutf.php b/dev/tools/test/testutf.php index cb83f431b93..c626a92a57d 100644 --- a/dev/tools/test/testutf.php +++ b/dev/tools/test/testutf.php @@ -76,7 +76,7 @@ $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks -$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); +$pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM); //set image scale factor //$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 7d73202eb79..690e9fad1f1 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -28,12 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); -$langs->load("salaries"); +$langs->loadLangs(array("compta","bills","admin","accountancy","salaries")); $mesg = ''; $action = GETPOST('action','aZ09'); @@ -193,6 +188,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql .= $db->plimit($limit + 1, $offset); @@ -225,9 +225,11 @@ if ($resql) print ''; print ''; - $htmlbuttonadd = '' . $langs->trans("Addanaccount") . ''; + $newcardbutton = '' . $langs->trans("Addanaccount"); + $newcardbutton.= ''; + $newcardbutton.= ''; - print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd, '', $limit); + print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); // Box to select active chart of account print $langs->trans("Selectchartofaccounts") . " : "; diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 9728a9524ea..f8a31b239bb 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel @@ -45,7 +45,7 @@ $langs->loadLangs(array("errors","admin","companies","resource","holiday","compt $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); -$id=GETPOST('id','int'); +$id=31; $rowid=GETPOST('rowid','alpha'); $code=GETPOST('code','alpha'); @@ -58,8 +58,8 @@ $listoffset=GETPOST('listoffset'); $listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; $active = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); +$sortfield = GETPOST("sortfield",'aZ09comma'); +$sortorder = GETPOST("sortorder",'aZ09comma'); $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; @@ -84,59 +84,48 @@ $hookmanager->initHooks(array('admin')); $tabname=array(); $tabname[31]= MAIN_DB_PREFIX."accounting_system"; -$tabname[32]= MAIN_DB_PREFIX."c_accounting_category"; // Dictionary labels $tablib=array(); $tablib[31]= "Pcg_version"; -$tablib[32]= "DictionaryAccountancyCategory"; // Requests to extract data $tabsql=array(); $tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.fk_country as country_id, c.code as country_code, c.label as country, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_country=c.rowid and c.active=1"; -$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"; // Criteria to sort dictionaries $tabsqlsort=array(); $tabsqlsort[31]="pcg_version ASC"; -$tabsqlsort[32]="position ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); $tabfield[31]= "pcg_version,label,country_id,country"; -$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); $tabfieldvalue[31]= "pcg_version,label,country"; -$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); $tabfieldinsert[31]= "pcg_version,label,fk_country"; -$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on // "nameoffield" if id field is not "rowid" or has not autoincrement on $tabrowid=array(); $tabrowid[31]= ""; -$tabrowid[32]= ""; // Condition to show dictionary in setup page $tabcond=array(); $tabcond[31]= ! empty($conf->accounting->enabled); -$tabcond[32]= ! empty($conf->accounting->enabled); // List of help for fields $tabhelp=array(); $tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode")); -$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode")); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); $tabfieldcheck[31] = array(); -$tabfieldcheck[32] = array(); // Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact") @@ -484,7 +473,7 @@ print "
\n"; // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.urlencode($page).'&':'').'sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'&rowid='.urlencode($rowid).'&code='.urlencode($code).'&id='.urlencode($id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } //var_dump($elementList); @@ -503,24 +492,9 @@ if ($id) $sql.= " c.rowid = ".$search_country_id; } - if ($sortfield) - { - // If sort order is "country", we use country_code instead - if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); - } - else { - $sql.=" ORDER BY "; - } - $sql.=$tabsqlsort[$id]; + // If sort order is "country", we use country_code instead + if ($sortfield == 'country') $sortfield='country_code'; + $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($listlimit+1,$offset); //print $sql; @@ -643,25 +617,13 @@ if ($id) $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; - if ($id == 3) unset($fieldlist[2]); - if (empty($reshook)) { - if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates' && $action == 'edit') - { - fieldListAccountModel($fieldlist,$obj,$tabname[$id],'hide'); - } - else - { - fieldListAccountModel($fieldlist,$obj,$tabname[$id],'add'); - } + fieldListAccountModel($fieldlist,$obj,$tabname[$id],'add'); } print ''; - if ($tabname[$id] != MAIN_DB_PREFIX.'c_email_templates' || $action != 'edit') - { - print ''; - } + print ''; print ''; print ""; @@ -683,7 +645,6 @@ if ($id) { $num = $db->num_rows($resql); $i = 0; - $var=true; $param = '&id='.$id; if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; @@ -880,7 +841,7 @@ if ($id) $valuetoshow=price($valuetoshow); } else if ($fieldlist[$field]=='libelle_facture') { - $langs->load("bills"); + $langs->loadLangs(array("bills")); $key=$langs->trans("PaymentCondition".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); $valuetoshow=nl2br($valuetoshow); @@ -890,7 +851,7 @@ if ($id) $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') { - $langs->load("propal"); + $langs->loadLangs(array("propal")); $key=$langs->trans("AvailabilityType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -915,17 +876,17 @@ if ($id) $valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') { - $langs->load('agenda'); + $langs->loadLangs(array("agenda")); $key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') { - $langs->load("bills"); + $langs->loadLangs(array("bills")); $key=$langs->trans("PaymentConditionShort".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') { - $langs->load("bills"); + $langs->loadLangs(array("bills")); $key=$langs->trans("PaymentType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -934,12 +895,12 @@ if ($id) $valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') { - $langs->load("orders"); + $langs->loadLangs(array("orders")); $key=$langs->trans($obj->code); $valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]}; } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') { - $langs->load("sendings"); + $langs->loadLangs(array("sendings")); $key=$langs->trans("SendingMethod".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -950,7 +911,7 @@ if ($id) } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') { - $langs->load('trips'); + $langs->loadLangs(array("trips")); $key = $langs->trans(strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); } @@ -961,11 +922,11 @@ if ($id) $valuetoshow = $langs->getCurrencySymbol($obj->code,1); } else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); + $langs->loadLangs(array("products")); $valuetoshow=$langs->trans($obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); + $langs->loadLangs(array("products")); $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); } else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format')) @@ -1062,7 +1023,6 @@ function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='') global $form; global $region_id; global $elementList,$sourceList; - global $bc; $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); @@ -1162,16 +1122,11 @@ function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='') } elseif (in_array($fieldlist[$field], array('content'))) { - if ($tabname == MAIN_DB_PREFIX.'c_email_templates') - { - print ''; // To create an artificial CR for the current tr we are on - } - else print ''; + print ''; if ($context != 'hide') { //print ''; $okforextended=true; - if ($tabname == MAIN_DB_PREFIX.'c_email_templates' && empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended=false; $doleditor = new DolEditor($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_5, '90%'); print $doleditor->Create(1); } diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 61166f88d07..669283077d9 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -31,9 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $error = 0; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $mesg = ''; $action = GETPOST('action','aZ09'); diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 69d09ae301b..34a857d65d4 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -29,8 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $error = 0; -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $mesg = ''; $id = GETPOST('id', 'int'); @@ -94,7 +93,7 @@ $formaccounting = new FormAccounting($db); llxheader('', $langs->trans('AccountingCategory')); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; print load_fiche_titre($langs->trans('AccountingCategory'), $linkback); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index fb7561dda94..681030a179f 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -54,8 +54,8 @@ $listoffset=GETPOST('listoffset'); $listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; $active = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); +$sortfield = GETPOST("sortfield",'aZ09comma'); +$sortorder = GETPOST("sortorder",'aZ09comma'); $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; @@ -178,7 +178,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } if (! is_numeric(GETPOST('position','alpha'))) { - $langs->load("errors"); + $langs->loadLangs(array("errors")); $ok=0; setEventMessages($langs->transnoentities('ErrorFieldMustBeANumeric', $langs->transnoentities("Position")), null, 'errors'); } @@ -300,7 +300,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } - $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; dol_syslog("delete", LOG_DEBUG); $result = $db->query($sql); @@ -324,10 +324,10 @@ if ($action == $acts[0]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code = '".$this->db->escape($code)."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code = '".$db->escape($code)."'"; } $result = $db->query($sql); @@ -344,10 +344,10 @@ if ($action == $acts[1]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code = '".$this->db->escape($code)."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code = '".$db->escape($code)."'"; } $result = $db->query($sql); @@ -364,10 +364,10 @@ if ($action == 'activate_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code = '".$this->db->escape($code)."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code = '".$db->escape($code)."'"; } $result = $db->query($sql); @@ -384,10 +384,10 @@ if ($action == 'disable_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code = '".$this->db->escape($code)."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code = '".$db->escape($code)."'"; } $result = $db->query($sql); @@ -437,24 +437,9 @@ if ($id) $sql.= " (a.fk_country = ".$search_country_id." OR a.fk_country = 0)"; } - if ($sortfield) - { - // If sort order is "country", we use country_code instead - if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); - } - else { - $sql.=" ORDER BY "; - } - $sql.=$tabsqlsort[$id]; + // If sort order is "country", we use country_code instead + if ($sortfield == 'country') $sortfield='country_code'; + $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($listlimit+1,$offset); //print $sql; @@ -471,7 +456,6 @@ if ($id) if ($tabname[$id]) { $alabelisused=0; - $var=false; $fieldlist=explode(',',$tabfield[$id]); @@ -565,7 +549,6 @@ if ($id) { $num = $db->num_rows($resql); $i = 0; - $var=true; $param = '&id='.$id; if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; @@ -735,7 +718,7 @@ if ($id) $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') { - $langs->load("propal"); + $langs->loadLangs(array("propal")); $key=$langs->trans("AvailabilityType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -793,7 +776,7 @@ if ($id) print ''; if (empty($obj->formula)) { - print ''; + print ''; print $langs->trans("ListOfAccounts"); print ''; } diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index c4b31c0f169..9d254338526 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -34,12 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); -$langs->load("salaries"); -$langs->load("loan"); +$langs->loadLangs(array("compta","bills","admin","accountancy","salaries","loan")); // Security check if (empty($user->rights->accounting->chartofaccount)) diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index dbe2a3b0c1c..6845491d003 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -28,15 +28,11 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","admin","accountancy")); // Security access if (empty($user->rights->accounting->chartofaccount)) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 147c140bdd1..3910e1148b4 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -39,8 +39,7 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield="f.rowid"; // Set here default search field if (! $sortorder) $sortorder="ASC"; -$langs->load("admin"); -$langs->load("compta"); +$langs->loadLangs(array("admin","compta")); // Security check if ($user->societe_id > 0) @@ -95,6 +94,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 78c6510469b..db323881bdc 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -26,8 +26,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php'; -$langs->load("admin"); -$langs->load("compta"); +$langs->loadLangs(array("admin","compta")); // Security check if ($user->societe_id > 0) diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index baadbdc0828..f8f0bd5668e 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -26,8 +26,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php'; -$langs->load("admin"); -$langs->load("compta"); +$langs->loadLangs(array("admin","compta")); // Security check if ($user->societe_id > 0) diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 93d41b3cbc6..6e235bc183e 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -24,16 +24,12 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("main"); -$langs->load("accountancy"); +// Load traductions files requiredby by page +$langs->loadLangs(array("compta","bills","accountancy")); // Security check if (! $user->admin) @@ -141,7 +137,6 @@ if ($result) { $form = new Form($db); $formaccounting = new FormAccounting($db); - $var = true; while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); print ''; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 44c816530dd..64857fbfbb4 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -32,10 +32,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","admin","accountancy")); // Security access if (empty($user->rights->accounting->chartofaccount)) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index a7811a2d606..925dcc0dc4e 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -30,13 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -$langs->load("admin"); -$langs->load("compta"); -$langs->load("accountancy"); +$langs->loadLangs(array("admin","compta","accountancy")); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); -$id=GETPOST('id','int'); +$id=35; $rowid=GETPOST('rowid','alpha'); $code=GETPOST('code','alpha'); @@ -401,24 +399,9 @@ if ($id) $sql=$tabsql[$id]; $sql.= " WHERE a.entity = ".$conf->entity; - if ($sortfield) - { - // If sort order is "country", we use country_code instead - if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); - } - else { - $sql.=" ORDER BY "; - } - $sql.=$tabsqlsort[$id]; + // If sort order is "country", we use country_code instead + if ($sortfield == 'country') $sortfield='country_code'; + $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($listlimit+1,$offset); $fieldlist=explode(',',$tabfield[$id]); @@ -434,7 +417,6 @@ if ($id) if ($tabname[$id]) { $alabelisused=0; - $var=false; $fieldlist=explode(',',$tabfield[$id]); @@ -514,7 +496,6 @@ if ($id) { $num = $db->num_rows($resql); $i = 0; - $var=true; $param = '&id='.$id; if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; @@ -629,7 +610,7 @@ if ($id) $valuetoshow=$langs->trans('All'); } else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { - $langs->load("accountancy"); + $langs->loadLangs(array("accountancy")); $key=$langs->trans("AccountingJournalType".strtoupper($obj->nature)); $valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($obj->nature)?$key:$obj->{$fieldlist[$field]}); } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index f6552d3d1e1..eb4d331f228 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -26,7 +26,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; @@ -35,12 +34,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; -// Langs -$langs->load("companies"); -$langs->load("compta"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("products"); +// Load traductions files requiredby by page +$langs->loadLangs(array("companies","compta","accountancy","products")); // Security check if (empty($conf->accounting->enabled)) { @@ -261,7 +256,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } + $sql .= $db->plimit($limit + 1, $offset); dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG); @@ -360,7 +361,6 @@ if ($result) $product_static = new Product($db); - $var = true; $i=0; while ($i < min($num,$limit)) { diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index fda67985883..d8a59a5ba43 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -1,7 +1,7 @@ - * Copyright (C) 2016 Florian Henry - * Copyright (C) 2016-2017 Alexandre Spangaro +/* Copyright (C) 2016 Olivier Geffroy + * Copyright (C) 2016 Florian Henry + * Copyright (C) 2016-2018 Alexandre Spangaro * * 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 @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; // Langs -$langs->load("accountancy"); +$langs->loadLangs(array("accountancy")); $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); @@ -152,7 +152,6 @@ if ($action == 'export_csv') { print $object->get_compte_desc($line->numero_compte) . $sep; print price($line->debit) . $sep; print price($line->credit) . $sep; - print price($line->debit) . $sep; print price($line->credit - $line->debit) . $sep; print "\n"; } @@ -187,7 +186,7 @@ else { print ''; print ''; - $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; + $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $result, 'title_accountancy', 0, $button); $moreforfilter = ''; @@ -253,8 +252,8 @@ else { print ''; // Permet d'afficher le compte comptable - if ($root_account_description != $displayed_account) { - + if (empty($displayed_account) || $root_account_description != $displayed_account) + { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price($sous_total_credit - $sous_total_debit) . ''; @@ -262,9 +261,9 @@ else { print ''; } - // Affiche le compte comptable en d�but de ligne + // Affiche le compte comptable en debut de ligne print ""; - print '' . $root_account_description . ''; + print '' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . ''; print ''; $displayed_account = $root_account_description; diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 1d746b4d4df..a433e19a09d 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -26,16 +26,11 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -// Langs -$langs->load("main"); -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("accountancy"); +// Load traductions files requiredby by page +$langs->loadLangs(array("bills","compta","accountancy","other")); // Filter $year = GETPOST("year",'int'); @@ -75,8 +70,6 @@ if ($result) { $y = $year_current; -$var = true; - print ''; print ''; @@ -108,7 +101,7 @@ if ($resql) { $row = $db->fetch_row($resql); - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 885b090fe0c..f0cc48a4878 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -617,7 +617,7 @@ if ($action == 'create') } print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -694,7 +694,7 @@ if ($action == 'create') } else { - print ''; + print ''; } print '   '; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 9a7ebf9716e..26a4cacf2c9 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -32,8 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("accountancy"); +$langs->loadLangs(array("accountancy")); $action = GETPOST('action', 'alpha'); $search_mvt_num = GETPOST('search_mvt_num', 'int'); @@ -272,6 +271,7 @@ if (! empty($search_credit)) { $param .= '&search_credit=' . urlencode($search_credit); } + if ($action == 'delbookkeeping') { $import_key = GETPOST('importkey', 'alpha'); @@ -437,10 +437,12 @@ else $button.= $langs->trans("ExportList"); $button.= ''; -$groupby = ' ' . $langs->trans("GroupByAccountAccounting") . ''; -$addbutton = '' . $langs->trans("NewAccountingMvt") . ''; +$groupby = ' ' . $langs->trans("GroupByAccountAccounting") . ''; +$newcardbutton = '' . $langs->trans("NewAccountingMvt"); +$newcardbutton.= ''; +$newcardbutton.= ''; -print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby.$addbutton, '', $limit); +print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby.$newcardbutton, '', $limit); $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 04708fe7726..499865233db 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -1,8 +1,8 @@ - * Copyright (C) 2013-2016 Olivier Geffroy - * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2017 Alexandre Spangaro +/* Copyright (C) 2016 Neil Orley + * Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2013-2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,15 +26,14 @@ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("accountancy"); +$langs->loadLangs(array("accountancy")); $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); @@ -44,17 +43,21 @@ $search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int' $search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); $search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); - - $search_accountancy_code = GETPOST("search_accountancy_code"); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); if ($search_accountancy_code_start == - 1) { $search_accountancy_code_start = ''; } +$search_accountancy_code_end = GETPOST('search_accountancy_code_end', 'alpha'); +if ($search_accountancy_code_end == - 1) { + $search_accountancy_code_end = ''; +} $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); $search_label_operation = GETPOST('search_label_operation', 'alpha'); $search_direction = GETPOST('search_direction', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'alpha'); +$search_debit = GETPOST('search_debit', 'alpha'); +$search_credit = GETPOST('search_credit', 'alpha'); // Load variable for pagination $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); @@ -96,63 +99,17 @@ if (empty($search_date_start) && empty($search_date_end)) { $object = new BookKeeping($db); - -$options = ''; -$filter = array (); - -if (! empty($search_date_start)) { - $filter['t.doc_date>='] = $search_date_start; - $options .= '&search_date_startmonth=' . GETPOST('search_date_startmonth', 'int') . '&search_date_startday=' . GETPOST('search_date_startday', 'int') . '&search_date_startyear=' . GETPOST('search_date_startyear', 'int'); -} -if (! empty($search_date_end)) { - $filter['t.doc_date<='] = $search_date_end; - $options .= '&search_date_endmonth=' . GETPOST('search_date_endmonth', 'int') . '&search_date_endday=' . GETPOST('search_date_endday', 'int') . '&search_date_endyear=' . GETPOST('search_date_endyear', 'int'); -} -if (! empty($search_doc_date)) { - $filter['t.doc_date'] = $search_doc_date; - $options .= '&doc_datemonth=' . GETPOST('doc_datemonth', 'int') . '&doc_dateday=' . GETPOST('doc_dateday', 'int') . '&doc_dateyear=' . GETPOST('doc_dateyear', 'int'); -} - -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 -{ - if (! empty($search_accountancy_code_start)) { - $filter['t.numero_compte'] = $search_accountancy_code_start; - $options .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); - } - if (! empty($search_label_account)) { - $filter['t.label_compte'] = $search_label_account; - $options .= '&search_label_compte=' . urlencode($search_label_account); - } - if (! empty($search_doc_ref)) { - $filter['t.doc_ref'] = $search_doc_ref; - $options .= '&search_doc_ref=' . urlencode($search_doc_ref); - } - if (! empty($search_label_operation)) { - $filter['t.label_operation'] = $search_label_operation; - $options .= '&search_label_operation=' . urlencode($search_label_operation); - } - if (! empty($search_direction)) { - $filter['t.sens'] = $search_direction; - $options .= '&search_direction=' . urlencode($search_direction); - } - if (! empty($search_ledger_code)) { - $filter['t.code_journal'] = $search_ledger_code; - $options .= '&search_ledger_code=' . urlencode($search_ledger_code); - } -} - - /* * Action */ - 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 { $search_doc_date = ''; $search_accountancy_code = ''; $search_accountancy_code_start = ''; - $search_label_account = ''; - $search_doc_ref = ''; + $search_accountancy_code_end = ''; + $search_label_account = ''; + $search_doc_ref = ''; $search_label_operation = ''; $search_direction = ''; $search_ledger_code = ''; @@ -164,8 +121,64 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_date_endyear=''; $search_date_endmonth=''; $search_date_endday=''; + $search_debit = ''; + $search_credit = ''; } +// Must be after the remove filter action, before the export. +$param = ''; +$filter = array (); + +if (! empty($search_date_start)) { + $filter['t.doc_date>='] = $search_date_start; + $param .= '&search_date_startmonth=' . GETPOST('search_date_startmonth', 'int') . '&search_date_startday=' . GETPOST('search_date_startday', 'int') . '&search_date_startyear=' . GETPOST('search_date_startyear', 'int'); +} +if (! empty($search_date_end)) { + $filter['t.doc_date<='] = $search_date_end; + $param .= '&search_date_endmonth=' . GETPOST('search_date_endmonth', 'int') . '&search_date_endday=' . GETPOST('search_date_endday', 'int') . '&search_date_endyear=' . GETPOST('search_date_endyear', 'int'); +} +if (! empty($search_doc_date)) { + $filter['t.doc_date'] = $search_doc_date; + $param .= '&doc_datemonth=' . GETPOST('doc_datemonth', 'int') . '&doc_dateday=' . GETPOST('doc_dateday', 'int') . '&doc_dateyear=' . GETPOST('doc_dateyear', 'int'); +} +if (! empty($search_accountancy_code_start)) { + $filter['t.numero_compte>='] = $search_accountancy_code_start; + $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); +} +if (! empty($search_accountancy_code_end)) { + $filter['t.numero_compte<='] = $search_accountancy_code_end; + $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); +} +if (! empty($search_label_account)) { + $filter['t.label_compte'] = $search_label_account; + $param .= '&search_label_compte=' . urlencode($search_label_account); +} +if (! empty($search_doc_ref)) { + $filter['t.doc_ref'] = $search_doc_ref; + $param .= '&search_doc_ref=' . urlencode($search_doc_ref); +} +if (! empty($search_label_operation)) { + $filter['t.label_operation'] = $search_label_operation; + $param .= '&search_label_operation=' . urlencode($search_label_operation); +} +if (! empty($search_direction)) { + $filter['t.sens'] = $search_direction; + $param .= '&search_direction=' . urlencode($search_direction); +} +if (! empty($search_ledger_code)) { + $filter['t.code_journal'] = $search_ledger_code; + $param .= '&search_ledger_code=' . urlencode($search_ledger_code); +} +if (! empty($search_debit)) { + $filter['t.debit'] = $search_debit; + $param .= '&search_debit=' . urlencode($search_debit); +} +if (! empty($search_credit)) { + $filter['t.credit'] = $search_credit; + $param .= '&search_credit=' . urlencode($search_credit); +} + + if ($action == 'delmouvconfirm') { $mvt_num = GETPOST('mvt_num', 'int'); @@ -189,7 +202,7 @@ $formaccounting = new FormAccounting($db); $formother = new FormOther($db); $form = new Form($db); -$title_page = $langs->trans("Bookkeeping") . ' ' . strtolower($langs->trans("By")) . ' ' . $langs->trans("AccountAccounting"); +$title_page = $langs->trans("Bookkeeping") . ' ' . strtolower($langs->trans("By")) . ' ' . strtolower($langs->trans("AccountAccounting")); llxHeader('', $title_page); @@ -239,28 +252,37 @@ if ($action == 'delbookkeepingyear') { } -$param=$options; - print '
'; -$viewflat = ' ' . $langs->trans("ViewFlatList") . ''; -$addbutton = '' . $langs->trans("NewAccountingMvt") . ''; +$viewflat = ' ' . $langs->trans("ViewFlatList") . ''; +$newcardbutton = '' . $langs->trans("NewAccountingMvt"); +$newcardbutton.= ''; +$newcardbutton.= ''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); -print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $viewflat.$addbutton, '', $limit); +print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $viewflat.$newcardbutton, '', $limit); // Reverse sort order if ( preg_match('/^asc/i', $sortorder) ) - $sortorder = "asc"; + $sortorder = "asc"; else - $sortorder = "desc"; + $sortorder = "desc"; print '
' . $langs->trans("Label") . '' . $langs->trans("JanuaryMin") . '' . $langs->trans("FebruaryMin") . '' . $langs->trans("MarchMin") . '' . $langs->trans("AprilMin") . '' . $langs->trans("MayMin") . '' . $langs->trans("JuneMin") . '' . $langs->trans("JulyMin") . '' . $langs->trans("AugustMin") . '' . $langs->trans("SeptemberMin") . '' . $langs->trans("OctoberMin") . '' . $langs->trans("NovemberMin") . '' . $langs->trans("DecemberMin") . 'Total
' . length_accountg($row[0]) . '
' . length_accountg($row[0]) . '' . price($row[1]) . '' . price($row[2]) . '' . price($row[3]) . ''; @@ -654,7 +654,7 @@ if ($action == 'create') if ($total_debit != $total_credit) { - setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings'); + setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings'); } if ($action == "" || $action == 'add') { @@ -675,7 +675,7 @@ if ($action == 'create') } print '
'; print ''; -print ''; +print ''; print ''; print ''; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; print ''; print ''; print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $options, 'align="right"', $sortfield, $sortorder); -print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $options, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre("Piece", $_SERVER['PHP_SELF'], "t.doc_ref", "", $options, "", $sortfield, $sortorder); +print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre("Piece", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label"); -print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder); -print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder); -print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder); +print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; print ''; @@ -308,34 +330,34 @@ while ($i < min($num, $limit)) $total_debit += $line->debit; $total_credit += $line->credit; - $accountg = length_accountg($line->numero_compte); + $accountg = length_accountg($line->numero_compte); //if (empty($accountg)) $accountg = '-'; // Is it a break ? - if ($accountg != $displayed_account_number || ! isset($displayed_account_number)) { + if ($accountg != $displayed_account_number || ! isset($displayed_account_number)) { - // Affiche un Sous-Total par compte comptable - if (isset($displayed_account_number)) { - print ''; - print "\n"; - print "\n"; - print ''; - } + // Affiche un Sous-Total par compte comptable + if (isset($displayed_account_number)) { + print ''; + print "\n"; + print "\n"; + print ''; + } - // Show the break account - $colspan = 9; - print ""; - print ''; - print ''; + // Show the break account + $colspan = 9; + print ""; + print ''; + print ''; - $displayed_account_number = $accountg; - //if (empty($displayed_account_number)) $displayed_account_number='-'; - $sous_total_debit = 0; - $sous_total_credit = 0; - } + $displayed_account_number = $accountg; + //if (empty($displayed_account_number)) $displayed_account_number='-'; + $sous_total_debit = 0; + $sous_total_credit = 0; + } print ''; print ''; @@ -344,22 +366,27 @@ while ($i < min($num, $limit)) // TODO Add a link according to doc_type and fk_doc print ''; + print ''; - // Affiche un lien vers la facture client/fournisseur - $doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref); - print strlen(length_accounta($line->subledger_account)) == 0 ? '' : ''; + // Affiche un lien vers la facture client/fournisseur + $doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref); + print strlen(length_accounta($line->subledger_account)) == 0 ? '' : ''; print ''; print ''; - print ''; + + $accountingjournal = new AccountingJournal($db); + $result = $accountingjournal->fetch('',$line->code_journal); + $journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0,0,0,'',0) : $line->code_journal); + print ''; + print ''; print "\n"; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php index 550ea1d933a..67d89bcda90 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php @@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; +$langs->loadLangs(array("compta")); + $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -141,7 +143,6 @@ if ($object->check_codeclient() != 0) print ''; print ''; -$langs->load('compta'); print ''; print ''; print ''; -$langs->load('compta'); print ''; print ''; @@ -169,14 +165,12 @@ if ($result) $num = $db->num_rows($result); if ($num > 0) - { - $var = true; + { $i = 0; - while ($i < $num ) + while ($i < $num ) { $obj = $db->fetch_object($result); - print ''; print ''; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index f9fad78a1f0..a85e5e4c01e 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -32,7 +32,7 @@ $result=restrictedArea($user,'mailing'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; @@ -104,7 +104,13 @@ if ($result) $title=$langs->trans("ListOfEMailings"); if ($filteremail) $title.=' ('.$langs->trans("SentTo",$filteremail).')'; - $newcardbutton=''.$langs->trans('NewMailing').''; + $newcardbutton=''; + if ($user->rights->mailing->creer) + { + $newcardbutton=''.$langs->trans('NewMailing'); + $newcardbutton.= ''; + $newcardbutton.= ''; + } $i = 0; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 8be7fa249b8..004b32a83fc 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1745,11 +1745,12 @@ if ($action == 'create') { //Form to close proposal (signed or not) $formquestion = array( - array('type' => 'select','name' => 'statut','label' => $langs->trans("CloseAs"),'values' => array(2=>$object->labelstatut [2],3=>$object->labelstatut [3])), - array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"),'value' => '') // Field to complete private note (not replace) + array('type' => 'select','name' => 'statut','label' => $langs->trans("CloseAs"),'values' => array(2=>$object->LibStatut(Propal::STATUS_SIGNED), 3=>$object->LibStatut(Propal::STATUS_NOTSIGNED))), + array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"),'value' => '') // Field to complete private note (not replace) ); - if (! empty($conf->notification->enabled)) { + if (! empty($conf->notification->enabled)) + { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); $formquestion = array_merge($formquestion, array( diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 63b26373f60..d153489dcc8 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -176,7 +176,7 @@ class Proposals extends DolibarrApi * @param array $request_data Request data * @return int ID of proposal */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401, "Insuffisant rights"); @@ -241,7 +241,7 @@ class Proposals extends DolibarrApi * * @return int */ - function postLine($id, $request_data = NULL) + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); @@ -307,7 +307,7 @@ class Proposals extends DolibarrApi * * @return object */ - function putLine($id, $lineid, $request_data = NULL) + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); @@ -410,7 +410,7 @@ class Proposals extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 68abd9f9a3f..b6e9d1411c5 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -142,9 +142,9 @@ class Propal extends CommonObject public $cond_reglement_code; public $mode_reglement_code; - public $remise; - public $remise_percent; - public $remise_absolue; + public $remise = 0; + public $remise_percent = 0; + public $remise_absolue = 0; public $fk_address; public $address_type; public $address; @@ -198,6 +198,7 @@ class Propal extends CommonObject */ const STATUS_BILLED = 4; // Todo rename into STATUS_CLOSE ? + /** * Constructor * @@ -210,26 +211,13 @@ class Propal extends CommonObject global $conf,$langs; $this->db = $db; + $this->socid = $socid; $this->id = $propalid; + $this->products = array(); - $this->remise = 0; - $this->remise_percent = 0; - $this->remise_absolue = 0; $this->duree_validite=$conf->global->PROPALE_VALIDITY_DURATION; - - $langs->load("propal"); - $this->labelstatut[0]=(! empty($conf->global->PROPAL_STATUS_DRAFT_LABEL) ? $conf->global->PROPAL_STATUS_DRAFT_LABEL : $langs->trans("PropalStatusDraft")); - $this->labelstatut[1]=(! empty($conf->global->PROPAL_STATUS_VALIDATED_LABEL) ? $conf->global->PROPAL_STATUS_VALIDATED_LABEL : $langs->trans("PropalStatusValidated")); - $this->labelstatut[2]=(! empty($conf->global->PROPAL_STATUS_SIGNED_LABEL) ? $conf->global->PROPAL_STATUS_SIGNED_LABEL : $langs->trans("PropalStatusSigned")); - $this->labelstatut[3]=(! empty($conf->global->PROPAL_STATUS_NOTSIGNED_LABEL) ? $conf->global->PROPAL_STATUS_NOTSIGNED_LABEL : $langs->trans("PropalStatusNotSigned")); - $this->labelstatut[4]=(! empty($conf->global->PROPAL_STATUS_BILLED_LABEL) ? $conf->global->PROPAL_STATUS_BILLED_LABEL : $langs->trans("PropalStatusBilled")); - $this->labelstatut_short[0]=(! empty($conf->global->PROPAL_STATUS_DRAFTSHORT_LABEL) ? $conf->global->PROPAL_STATUS_DRAFTSHORT_LABEL : $langs->trans("PropalStatusDraftShort")); - $this->labelstatut_short[1]=(! empty($conf->global->PROPAL_STATUS_VALIDATEDSHORT_LABEL) ? $conf->global->PROPAL_STATUS_VALIDATEDSHORT_LABEL : $langs->trans("Opened")); - $this->labelstatut_short[2]=(! empty($conf->global->PROPAL_STATUS_SIGNEDSHORT_LABEL) ? $conf->global->PROPAL_STATUS_SIGNEDSHORT_LABEL : $langs->trans("PropalStatusSignedShort")); - $this->labelstatut_short[3]=(! empty($conf->global->PROPAL_STATUS_NOTSIGNEDSHORT_LABEL) ? $conf->global->PROPAL_STATUS_NOTSIGNEDSHORT_LABEL : $langs->trans("PropalStatusNotSignedShort")); - $this->labelstatut_short[4]=(! empty($conf->global->PROPAL_STATUS_BILLEDSHORT_LABEL) ? $conf->global->PROPAL_STATUS_BILLEDSHORT_LABEL : $langs->trans("PropalStatusBilledShort")); } @@ -1653,7 +1641,7 @@ class Propal extends CommonObject $this->db->free($result); - return 1; + return $num; } else { @@ -3091,10 +3079,24 @@ class Propal extends CommonObject * @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 */ - function LibStatut($statut,$mode=1) + function LibStatut($statut,$mode=1) { - global $langs; - $langs->load("propal"); + // Init/load array of translation of status + if (empty($this->labelstatut) || empty($this->labelstatut_short)) + { + global $langs; + $langs->load("propal"); + $this->labelstatut[0]=(! empty($conf->global->PROPAL_STATUS_DRAFT_LABEL) ? $conf->global->PROPAL_STATUS_DRAFT_LABEL : $langs->trans("PropalStatusDraft")); + $this->labelstatut[1]=(! empty($conf->global->PROPAL_STATUS_VALIDATED_LABEL) ? $conf->global->PROPAL_STATUS_VALIDATED_LABEL : $langs->trans("PropalStatusValidated")); + $this->labelstatut[2]=(! empty($conf->global->PROPAL_STATUS_SIGNED_LABEL) ? $conf->global->PROPAL_STATUS_SIGNED_LABEL : $langs->trans("PropalStatusSigned")); + $this->labelstatut[3]=(! empty($conf->global->PROPAL_STATUS_NOTSIGNED_LABEL) ? $conf->global->PROPAL_STATUS_NOTSIGNED_LABEL : $langs->trans("PropalStatusNotSigned")); + $this->labelstatut[4]=(! empty($conf->global->PROPAL_STATUS_BILLED_LABEL) ? $conf->global->PROPAL_STATUS_BILLED_LABEL : $langs->trans("PropalStatusBilled")); + $this->labelstatut_short[0]=(! empty($conf->global->PROPAL_STATUS_DRAFTSHORT_LABEL) ? $conf->global->PROPAL_STATUS_DRAFTSHORT_LABEL : $langs->trans("PropalStatusDraftShort")); + $this->labelstatut_short[1]=(! empty($conf->global->PROPAL_STATUS_VALIDATEDSHORT_LABEL) ? $conf->global->PROPAL_STATUS_VALIDATEDSHORT_LABEL : $langs->trans("Opened")); + $this->labelstatut_short[2]=(! empty($conf->global->PROPAL_STATUS_SIGNEDSHORT_LABEL) ? $conf->global->PROPAL_STATUS_SIGNEDSHORT_LABEL : $langs->trans("PropalStatusSignedShort")); + $this->labelstatut_short[3]=(! empty($conf->global->PROPAL_STATUS_NOTSIGNEDSHORT_LABEL) ? $conf->global->PROPAL_STATUS_NOTSIGNEDSHORT_LABEL : $langs->trans("PropalStatusNotSignedShort")); + $this->labelstatut_short[4]=(! empty($conf->global->PROPAL_STATUS_BILLEDSHORT_LABEL) ? $conf->global->PROPAL_STATUS_BILLEDSHORT_LABEL : $langs->trans("PropalStatusBilledShort")); + } $statuttrans=''; if ($statut==self::STATUS_DRAFT) $statuttrans='statut0'; @@ -3814,6 +3816,8 @@ class PropaleLigne extends CommonObjectLine $this->multicurrency_total_tva = $objp->multicurrency_total_tva; $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $this->fetch_optionals(); + $this->db->free($result); return 1; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 3259654ebcc..84710999183 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -85,7 +85,7 @@ $sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alp $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -335,6 +335,12 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -397,7 +403,9 @@ if ($resql) $newcardbutton=''; if ($user->rights->propal->creer) { - $newcardbutton=''.$langs->trans('NewPropal').''; + $newcardbutton=''.$langs->trans('NewPropal'); + $newcardbutton.= ''; + $newcardbutton.= ''; } // Lignes des champs de filtre @@ -479,25 +487,25 @@ if ($resql) if (! empty($arrayfields['p.ref']['checked'])) { print ''; } if (! empty($arrayfields['p.ref_client']['checked'])) { print ''; } if (! empty($arrayfields['pr.ref']['checked'])) { print ''; } if (! empty($arrayfields['s.nom']['checked'])) { print ''; } if (! empty($arrayfields['s.town']['checked'])) print ''; @@ -521,15 +529,16 @@ if ($resql) { print ''; } // Date if (! empty($arrayfields['p.date']['checked'])) { - print ''; @@ -543,28 +552,28 @@ if ($resql) { // Amount print ''; } if (! empty($arrayfields['p.total_vat']['checked'])) { // Amount print ''; } if (! empty($arrayfields['p.total_ttc']['checked'])) { // Amount print ''; } if (! empty($arrayfields['u.login']['checked'])) { // Author print ''; } // Extra fields diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 273862f68bf..50ec740ea4a 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -329,7 +329,7 @@ print '
'; // Show graphs -print '
' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . ''; +print '
'; +print $langs->trans('From').' '; +print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, 'maxwidth200'); +print '
'; +print '
'; +print $langs->trans('to').' '; +print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, 'maxwidth200'); +print '
'; +print '
'; print $langs->trans('From') . ': '; @@ -271,8 +293,8 @@ print $form->select_date($search_date_end, 'search_date_end', 0, 0, 1); print '  '; $searchpicto=$form->showFilterAndCheckAddButtons(0); @@ -281,14 +303,14 @@ print '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).'  
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).'  
'; - if (! empty($line->numero_compte) && $line->numero_compte != '-1') print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte); - else print ''.$langs->trans("Unknown").''; - print '
'; + if (! empty($line->numero_compte) && $line->numero_compte != '-1') print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte); + else print ''.$langs->trans("Unknown").''; + print '
 '; - //if ($line->doc_type == 'supplier_invoice') - //if ($line->doc_type == 'customer_invoice') + //if ($line->doc_type == 'supplier_invoice') + //if ($line->doc_type == 'customer_invoice') print $line->doc_ref; - print '' . $line->label_operation . '' . $line->label_operation . '
(' . length_accounta($line->subledger_account) . ')
' . $line->label_operation . '' . $line->label_operation . '
(' . length_accounta($line->subledger_account) . ')
' . ($line->debit ? price($line->debit) :''). '' . ($line->credit ? price($line->credit) : '') . '' . $line->code_journal . '' . $journaltoshow . ''; print '' . img_edit() . ' '; - print '' . img_delete() . ''; + print '' . img_delete() . ''; print '
'; print $form->editfieldkey("CustomerAccountancyCode", 'customeraccountancycode', $object->code_compta, $object, $user->rights->societe->creer); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php index 35bdcfa23fe..96317a3a740 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php @@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; +$langs->loadLangs(array("compta")); + $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -157,7 +159,6 @@ if ($object->check_codefournisseur() != 0) print '
'; print $form->editfieldkey("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer); diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 0a538f0a6ae..27254ef31d1 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -360,9 +360,11 @@ class AccountancyCategory // extends CommonObject * @return int <0 if KO, 0 if not found, >0 if OK */ public function display($id) { + global $conf; $sql = "SELECT t.rowid, t.account_number, t.label"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t"; $sql .= " WHERE t.fk_accounting_category = " . $id; + $sql .= " AND t.entity = " . $conf->entity; $this->lines_display = array(); @@ -400,13 +402,14 @@ class AccountancyCategory // extends CommonObject $sql .= " WHERE t.numero_compte NOT IN ("; $sql .= " SELECT t.account_number"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t"; - $sql .= " WHERE t.fk_accounting_category = " . $id . ")"; + $sql .= " WHERE t.fk_accounting_category = " . $id . " AND t.entity = " . $conf->entity.")"; $sql .= " AND t.numero_compte IN ("; $sql .= " SELECT DISTINCT aa.account_number"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; - $sql .= " AND aa.active = 1)"; + $sql .= " AND aa.active = 1"; + $sql .= " AND aa.entity = = " . $conf->entity . ")"; $sql .= " GROUP BY t.numero_compte, t.label_operation, t.doc_ref"; $sql .= " ORDER BY t.numero_compte"; @@ -448,6 +451,7 @@ class AccountancyCategory // extends CommonObject $sql .= " WHERE (aa.fk_accounting_category != ".$id." OR aa.fk_accounting_category IS NULL)"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " AND aa.active = 1"; + $sql .= " AND aa.entity = " . $conf->entity; $sql .= " GROUP BY aa.account_number, aa.label"; $sql .= " ORDER BY aa.account_number, aa.label"; @@ -492,6 +496,7 @@ class AccountancyCategory // extends CommonObject $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " AND aa.active = 1"; + $sql .= " AND aa.entity = " . $conf->entity; $this->db->begin(); @@ -581,7 +586,7 @@ class AccountancyCategory // extends CommonObject */ public function getCatsCpts() { - global $mysoc; + global $mysoc,$conf; $sql = ""; @@ -595,8 +600,10 @@ class AccountancyCategory // extends CommonObject $sql .= " WHERE t.fk_accounting_category IN ( SELECT c.rowid "; $sql .= " FROM " . MAIN_DB_PREFIX . "c_accounting_category as c"; $sql .= " WHERE c.active = 1"; + $sql .= " AND c.entity = " . $conf->entity; $sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)"; $sql .= " AND cat.rowid = t.fk_accounting_category"; + $sql .= " AND t.entity = " . $conf->entity; $sql .= " ORDER BY cat.position ASC"; $resql = $this->db->query($sql); @@ -685,7 +692,7 @@ class AccountancyCategory // extends CommonObject */ public function getCats($categorytype=-1) { - global $db, $langs, $user, $mysoc; + global $db, $langs, $user, $mysoc, $conf; if (empty($mysoc->country_id)) { dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined'); @@ -695,6 +702,7 @@ class AccountancyCategory // extends CommonObject $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_accounting_category as c"; $sql .= " WHERE c.active = 1 "; + $sql .= " AND c.entity = " . $conf->entity; if ($categorytype >= 0) $sql.=" AND c.category_type = 1"; $sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)"; $sql .= " ORDER BY c.position ASC"; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 0b0d42b0075..d1870fabc38 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -566,7 +566,7 @@ class AccountingAccount extends CommonObject function LibStatut($statut,$mode=0) { global $langs; - $langs->load('users'); + $langs->loadLangs(array("users")); if ($mode == 0) { diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 2e48fc8a54a..454de6d7b84 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -256,7 +256,7 @@ class AccountingJournal extends CommonObject { global $langs; - $langs->load("accountancy"); + $langs->loadLangs(array("accountancy")); if ($mode == 0) { diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index a703e025c76..f7fed2e2b5b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -170,7 +170,7 @@ class BookKeeping extends CommonObject // Check parameters if (empty($this->numero_compte) || $this->numero_compte == '-1' || $this->numero_compte == 'NotDefined') { - $langs->load("errors"); + $langs->loadLangs(array("errors")); if (in_array($this->doc_type, array('bank', 'expense_report'))) { $this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForBankLine', $this->fk_docdet, $this->doc_type); @@ -246,9 +246,6 @@ class BookKeeping extends CommonObject } $now = dol_now(); - if (empty($this->date_create)) { - $this->date_create = $now; - } $sql = "INSERT INTO " . MAIN_DB_PREFIX . $this->table_element . " ("; $sql .= "doc_date"; @@ -291,7 +288,7 @@ class BookKeeping extends CommonObject $sql .= "," . $this->montant; $sql .= ",'" . $this->db->escape($this->sens) . "'"; $sql .= ",'" . $this->db->escape($this->fk_user_author) . "'"; - $sql .= ",'" . $this->db->idate($this->date_create). "'"; + $sql .= ",'" . $this->db->idate($now). "'"; $sql .= ",'" . $this->db->escape($this->code_journal) . "'"; $sql .= ",'" . $this->db->escape($this->journal_label) . "'"; $sql .= "," . $this->db->escape($this->piece_num); @@ -496,9 +493,6 @@ class BookKeeping extends CommonObject $this->credit = price2num($this->credit, 'MT'); $now = dol_now(); - if (empty($this->date_create)) { - $this->date_create = $now; - } // Check parameters // Put here code to add control on parameters values @@ -545,7 +539,7 @@ class BookKeeping extends CommonObject $sql .= ' ' . (! isset($this->montant) ? 'NULL' : $this->montant ). ','; $sql .= ' ' . (! isset($this->sens) ? 'NULL' : "'" . $this->db->escape($this->sens) . "'") . ','; $sql .= ' ' . $user->id . ','; - $sql .= ' ' . "'" . $this->db->idate($this->date_create) . "',"; + $sql .= ' ' . "'" . $this->db->idate($now) . "',"; $sql .= ' ' . (empty($this->code_journal) ? 'NULL' : "'" . $this->db->escape($this->code_journal) . "'") . ','; $sql .= ' ' . (empty($this->journal_label) ? 'NULL' : "'" . $this->db->escape($this->journal_label) . "'") . ','; $sql .= ' ' . (empty($this->piece_num) ? 'NULL' : $this->db->escape($this->piece_num)).','; diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 92d8f7b1c37..d0e5adc97fd 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -24,13 +24,10 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index aedaeda0e5b..8b88d8f396b 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -32,11 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; // Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","other","main","accountancy")); // Security check if (empty($conf->accounting->enabled)) { @@ -129,6 +125,7 @@ llxHeader('', $langs->trans("CustomersVentilation")); $textprevyear = '' . img_previous() . ''; $textnextyear = ' ' . img_next() . ''; + print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy'); // Clean database @@ -160,8 +157,8 @@ $y = $year_current; $buttonbind = '' . $langs->trans("ValidateHistory") . ''; - -print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); +print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); +//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; print ''; @@ -236,7 +233,8 @@ print ''; print '
'; -print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); +print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); +//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); print '
'; print '
'; @@ -315,7 +313,8 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print '
'; - print_fiche_titre($langs->trans("OtherInfo"), '', ''); + print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); + //print_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; print '
'; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index e696b4774d1..7bc929a7e6b 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -27,7 +27,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; @@ -35,12 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("bills"); -$langs->load("compta"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +$langs->loadLangs(array("bills","compta","accountancy","productbatch")); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); @@ -116,10 +110,10 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); } - $db->begin(); - if (! $error) { + $db->begin(); + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l"; $sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0'); $sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')'; @@ -173,20 +167,24 @@ print ''; -} -*/ llxFooter(); $db->close(); diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 790445f7032..5c17fd32eb0 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -1,6 +1,6 @@ - * Copyright (C) 2017 Regis Houssin +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2017-2018 Regis Houssin * * 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 @@ -212,9 +212,9 @@ print "
\n"; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($optioncss != '') $param.='&optioncss='.$optioncss; -if (defaulturl) $param.='&defaulturl='.urlencode(defaulturl); -if (defaultkey) $param.='&defaultkey='.urlencode(defaultkey); -if (defaultvalue) $param.='&defaultvalue='.urlencode(defaultvalue); +if ($defaulturl) $param.='&defaulturl='.urlencode($defaulturl); +if ($defaultkey) $param.='&defaultkey='.urlencode($defaultkey); +if ($defaultvalue) $param.='&defaultvalue='.urlencode($defaultvalue); print 'entity) && $debug)?'?debug=1':'').'" method="POST">'; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 37f66427225..4cf423b317f 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -144,7 +144,7 @@ if ($action == 'update') $plus=''; if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE'; // Update values - for($i=0;$i<4;$i++) { + for($i=0; $i<4; $i++) { if(isset($_POST['MAIN_METEO'.$plus.'_LEVEL'.$i])) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'),'chaine',0,'',$conf->entity); } @@ -172,7 +172,6 @@ if ($action == 'edit') print ''; print ''; print ''; - $var=true; print '
'; print ''; @@ -215,7 +214,6 @@ else print '
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
'; print ''; - $var=true; foreach($modules as $module => $delays) { @@ -241,7 +239,6 @@ else print '
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
'; print ''; - $var=false; print ''; print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d8d2382a59f..74e4dd6bd4e 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -953,14 +953,14 @@ if (empty($id)) print "
\n"; -$param = '&id='.$id; -if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; +$param = '&id='.urlencode($id); +if ($search_country_id > 0) $param.= '&search_country_id='.urlencode($search_country_id); if ($search_code != '') $param.= '&search_code='.urlencode($search_country_id); if ($entity != '') $param.= '&entity=' . (int) $entity; $paramwithsearch = $param; -if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; -if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; -if (GETPOST('from')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); +if ($sortorder) $paramwithsearch.= '&sortorder='.urlencode($sortorder); +if ($sortfield) $paramwithsearch.= '&sortfield='.urlencode($sortfield); +if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from','alpha')); // Confirmation de la suppression de la ligne @@ -987,10 +987,10 @@ if ($id) { // If sort order is "country", we use country_code instead if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; + $sql.= " ORDER BY ".$db->escape($sortfield); if ($sortorder) { - $sql.=" ".strtoupper($sortorder); + $sql.=" ".strtoupper($db->escape($sortorder)); } $sql.=", "; // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index 10653df9dc0..de3ca683519 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -118,9 +118,9 @@ class PrestaShopWebservice public function executeRequest($url, $curl_params = array()) { $defaultParams = array( - CURLOPT_HEADER => TRUE, - CURLOPT_RETURNTRANSFER => TRUE, - CURLINFO_HEADER_OUT => TRUE, + CURLOPT_HEADER => true, + CURLOPT_RETURNTRANSFER => true, + CURLINFO_HEADER_OUT => true, CURLOPT_HTTPAUTH => CURLAUTH_BASIC, CURLOPT_USERPWD => $this->key.':', CURLOPT_HTTPHEADER => array( 'Expect:' ) diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index dd9e748de02..cf1992dce5f 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -33,7 +33,7 @@ if (! $user->admin) accessforbidden(); /* * Action */ -if (preg_match('/set_(.*)/',$action,$reg)) +if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) @@ -47,7 +47,7 @@ if (preg_match('/set_(.*)/',$action,$reg)) } } -if (preg_match('/del_(.*)/',$action,$reg)) +if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) @@ -80,7 +80,6 @@ print ''; print ''."\n"; print ''; -$var=true; $form = new Form($db); // Mail required for members diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index b2d9bd97980..6f4dce93e8c 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -31,9 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("users"); -$langs->load("admin"); -$langs->load("other"); +// Load traductions files requiredby by page +$langs->loadLangs(array("users","admin","other")); $action=GETPOST('action','aZ09'); @@ -42,7 +41,6 @@ $securityevent=new Events($db); $eventstolog=$securityevent->eventstolog; - /* * Actions */ @@ -88,8 +86,6 @@ $head=security_prepare_head(); dol_fiche_head($head, 'audit', $langs->trans("Security"), -1); - -$var=true; print "
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").'' . yn($conf->global->MAIN_DISABLE_METEO) . '
 '.$langs->trans("Value").'
"; print ""; print ""; @@ -98,8 +94,7 @@ print "\n"; foreach ($eventstolog as $key => $arr) { if ($arr['id']) - { - + { print ''; print ''; print '\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/expensereport/doc"); @@ -376,7 +373,6 @@ foreach ($dirmodels as $reldir) if (file_exists($dir.'/'.$file)) { - $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); @@ -480,7 +476,6 @@ print ''; print ''; print ''; print "\n"; -$var=true; $substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2); $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); @@ -488,7 +483,6 @@ $htmltext = ''.$langs->trans("AvailableVariables").':
'; foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; $htmltext.='
'; -$var=! $var; print ''; + echo ''; // Label echo ''; @@ -175,7 +172,6 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) echo ''; echo ''; - $var=!$var; } } diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index bf615676f81..ef915e196a2 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -30,11 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_rule.class.php'; -$langs->load('admin'); -$langs->load('other'); -$langs->load('trips'); -$langs->load('errors'); -$langs->load('dict'); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin","other","trips","errors","dict")); if (!$user->admin) accessforbidden(); @@ -176,8 +173,7 @@ if ($action != 'edit') echo ''; echo ''; - $var=true; - echo ''; + echo ''; echo ''; echo ''; echo ''; -$var=true; foreach ($rules as $rule) { - echo ''; + echo ''; echo ''; - echo ''; echo ''; - $var=!$var; } diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 4a184aa95a0..a1d542203cf 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -250,8 +250,6 @@ if ($resql) $rssparser=new RssParser($db); $result = $rssparser->parser($conf->global->$keyrssurl, 5, 300, $conf->externalrss->dir_temp); - $var=true; - print "
"; print ""; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 9ffe45dec40..4fab390a4cc 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -284,8 +284,6 @@ foreach ($dirmodels as $reldir) $handle = opendir($dir); if (is_resource($handle)) { - $var=true; - while (($file = readdir($handle))!==false) { if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) @@ -316,7 +314,6 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var = !$var; print '\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) @@ -507,7 +503,6 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - $var = !$var; print '"; print ''; - // Hide any PDF informations - - print ''; - //Desc print ''; if (is_array($resCached)) { - $var = ! $var; print ''; print ""; print ''; print ""; - $var = ! $var; + print ''; print ""; print ''; @@ -301,17 +291,16 @@ if (is_array($resCached) || is_array($resRemoved)) { } if (is_array($resRemoved)) { - $var = ! $var; print ''; print ""; print ''; print ""; - $var = ! $var; + print ''; print ""; print ''; print ""; - $var = ! $var; + print ''; print ""; print ''; diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 01ab314df73..f3d2057395f 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -41,7 +41,7 @@ $page = GETPOST("page",'int'); if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="date"; if ($page < 0) { $page = 0; } -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page; if (! $user->admin) accessforbidden(); @@ -280,7 +280,7 @@ function backup_tables($outputfile, $tables='*') //cycle through $handle = fopen($outputfile, 'w+'); - if (fwrite($handle, '') === FALSE) + if (fwrite($handle, '') === false) { $langs->load("errors"); dol_syslog("Failed to open file ".$outputfile,LOG_ERR); diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index ac520ce22b3..48d3ef57fd5 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -184,6 +184,11 @@ $nbtotalofrecords = ''; { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } }*/ $sql.= $db->plimit($conf->liste_limit+1, $offset); diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 76f7debf3e7..70b0987732b 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -137,12 +137,8 @@ if ($savehandler == 'files') print_liste_field_titre(''); print "\n"; - $var=True; - foreach ($listofsessions as $key => $sessionentry) { - - print ''; // Login diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 58ca4e0eded..ca14869cb2e 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -65,10 +65,8 @@ print getTitleFieldOfList($langs->trans("Active"), 0, $_SERVER["PHP_SELF"], 'act print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; print ''; -$var=True; foreach ($triggers as $trigger) { - print ''; print ''; print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index ee5faefeaee..a7b1c5b9373 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -86,7 +86,7 @@ elseif ($action == 'setdoc') } $res = true; } -elseif (preg_match('/set_(.*)/',$action,$reg)) +elseif (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) @@ -100,7 +100,7 @@ elseif (preg_match('/set_(.*)/',$action,$reg)) } } -elseif (preg_match('/del_(.*)/',$action,$reg)) +elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 5a1cf94e59f..75497e9d19d 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -83,7 +83,7 @@ elseif ($action == 'setdoc') } $res = true; } -elseif (preg_match('/set_(.*)/',$action,$reg)) +elseif (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) @@ -97,7 +97,7 @@ elseif (preg_match('/set_(.*)/',$action,$reg)) } } -elseif (preg_match('/del_(.*)/',$action,$reg)) +elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index e3854c4eb11..73063c2b036 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -436,24 +436,7 @@ if ($id) { // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$id]; - - if ($sortfield) - { - // If sort order is "country", we use country_code instead - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); - } - else { - $sql.=" ORDER BY "; - } - $sql.=$tabsqlsort[$id]; + $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($limit+1, $offset); //print $sql; diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 22c763100d4..ef2b4c8bb6d 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -170,7 +170,7 @@ class Setup extends DolibarrApi // and then apply the filter if there is one. $this->translateLabel($country, $lang); - if (empty($filter) || stripos($country->label, $filter) !== FALSE) { + if (empty($filter) || stripos($country->label, $filter) !== false) { $list[] = $this->_cleanObjectDatas($country); } } @@ -385,7 +385,7 @@ class Setup extends DolibarrApi * @param string $sortorder Sort order * @param string $type Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...) * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'SO-%')" - * @return List of events types + * @return List of extra fields * * @url GET extrafields * @@ -584,7 +584,7 @@ class Setup extends DolibarrApi * Do a test of integrity for files and setup. * * @param string $target Can be 'local' or 'default' or Url of the signatures file to use for the test. Must be reachable by the tested Dolibarr. - * @return Result of file and setup integrity check + * @return Result of file and setup integrity check * * @url GET checkintegrity * diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 353b945cfda..e66a19c981a 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -24,12 +24,7 @@ * \file htdocs/api/index.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'); // Do not check anti CSRF attack test -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data 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 if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php diff --git a/htdocs/assets/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php similarity index 95% rename from htdocs/assets/admin/assets_extrafields.php rename to htdocs/asset/admin/assets_extrafields.php index 85c596b6e37..52c1f042836 100644 --- a/htdocs/assets/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -17,8 +17,8 @@ */ /** - * \file htdocs/assets/admin/assets_extrafields.php - * \ingroup assets + * \file htdocs/asset/admin/asset_extrafields.php + * \ingroup asset * \brief Page to setup extra fields of assets */ @@ -65,7 +65,7 @@ print load_fiche_titre($langs->trans("AssetsSetup"),$linkback,'title_setup'); $head = AssetsAdminPrepareHead(); -dol_fiche_head($head, 'attributes', $langs->trans("Assets"), 0, 'generic'); +dol_fiche_head($head, 'attributes', $langs->trans("Assets"), -1, 'generic'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/assets/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php similarity index 97% rename from htdocs/assets/admin/assets_type_extrafields.php rename to htdocs/asset/admin/assets_type_extrafields.php index 8d136ed1278..261c7de99b7 100644 --- a/htdocs/assets/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -18,8 +18,8 @@ /** /** - * \file htdocs/assets/admin/assets_type_extrafields.php - * \ingroup assets + * \file htdocs/asset/admin/assets_type_extrafields.php + * \ingroup asset * \brief Page to setup extra fields type of assets */ require '../../main.inc.php'; @@ -66,7 +66,7 @@ print load_fiche_titre($langs->trans("AssetsSetup"),$linkback,'title_setup'); $head = AssetsAdminPrepareHead(); -dol_fiche_head($head, 'attributes_type', $langs->trans("Assets"), 0, 'generic'); +dol_fiche_head($head, 'attributes_type', $langs->trans("Assets"), -1, 'generic'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/assets/admin/setup.php b/htdocs/asset/admin/setup.php similarity index 96% rename from htdocs/assets/admin/setup.php rename to htdocs/asset/admin/setup.php index 19de7b3b752..8708396fb7f 100644 --- a/htdocs/assets/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -60,10 +60,7 @@ print load_fiche_titre($langs->trans("AssetsSetup"),$linkback,'title_setup'); $head = AssetsAdminPrepareHead(); -dol_fiche_head($head, 'settings', $langs->trans("Assets"), 0, 'generic'); - -// Setup page goes here -echo $langs->trans("AssetsSetupPage"); +dol_fiche_head($head, 'settings', $langs->trans("Assets"), -1, 'generic'); if ($action == 'edit') diff --git a/htdocs/assets/card.php b/htdocs/asset/card.php similarity index 85% rename from htdocs/assets/card.php rename to htdocs/asset/card.php index 4424ca0cf93..a76bf3d069e 100644 --- a/htdocs/assets/card.php +++ b/htdocs/asset/card.php @@ -18,18 +18,18 @@ /** * \file card.php - * \ingroup assets - * \brief Page to create/edit/view assets + * \ingroup asset + * \brief Page to create/edit/view asset */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); // Load traductions files requiredby by page -$langs->loadLangs(array("assets")); +$langs->loadLangs(array("asset")); // Get parameters $id = GETPOST('id', 'int'); @@ -39,12 +39,12 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object=new Assets($db); +$object=new Asset($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetscard')); // Note that conf->hooks_modules contains array +$diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('assets'); +$extralabels = $extrafields->fetch_name_optionals_label('asset'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); // Initialize array of search criterias @@ -60,7 +60,7 @@ if (empty($action) && empty($id) && empty($ref)) $action='view'; // 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, 'assets', $id); +//$result = restrictedArea($user, 'asset', $id); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); @@ -84,9 +84,9 @@ if (empty($reshook)) { $error=0; - $permissiontoadd = $user->rights->assets->create; - $permissiontodelete = $user->rights->assets->delete; - $backurlforlist = dol_buildpath('/assets/list.php',1); + $permissiontoadd = $user->rights->asset->create; + $permissiontodelete = $user->rights->asset->delete; + $backurlforlist = dol_buildpath('/asset/list.php',1); // Actions cancel, add, update or delete include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -97,7 +97,7 @@ if (empty($reshook)) // Actions to send emails $trigger_name='MYOBJECT_SENTBYMAIL'; $autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; - $trackid='assets'.$object->id; + $trackid='asset'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -241,13 +241,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; /* // Ref bis - $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->assets->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->assets->creer, 'string', '', null, null, '', 1); + $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->asset->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->asset->creer, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); */ @@ -289,7 +289,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Send print '' . $langs->trans('SendMail') . ''."\n"; - if ($user->rights->assets->write) + if ($user->rights->asset->write) { print ''.$langs->trans("Modify").''."\n"; } @@ -298,7 +298,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans('Modify').''."\n"; } - if ($user->rights->assets->delete) + if ($user->rights->asset->delete) { print ''.$langs->trans('Delete').''."\n"; } @@ -324,15 +324,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Documents /*$objref = dol_sanitizeFileName($object->ref); $relativepath = $comref . '/' . $comref . '.pdf'; - $filedir = $conf->assets->dir_output . '/' . $objref; + $filedir = $conf->asset->dir_output . '/' . $objref; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; - $genallowed = $user->rights->assets->read; // If you can read, you can build the PDF to read content - $delallowed = $user->rights->assets->create; // If you can create/edit, you can remove a file on card - print $formfile->showdocuments('assets', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + $genallowed = $user->rights->asset->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->asset->create; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('asset', $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('assets')); + $linktoelem = $form->showLinkToObjectBlock($object, null, array('asset')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); @@ -340,14 +340,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlright = ''; + $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, 'assets', $socid, 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, 'asset', $socid, 1, '', $MAXEVENT, '', $morehtmlright); print '
'; } diff --git a/htdocs/assets/class/asset.class.php b/htdocs/asset/class/asset.class.php similarity index 95% rename from htdocs/assets/class/asset.class.php rename to htdocs/asset/class/asset.class.php index efacac10822..86da8ae5379 100644 --- a/htdocs/assets/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -17,9 +17,9 @@ */ /** - * \file assets/class/assets.class.php - * \ingroup assets - * \brief This file is a CRUD class file for assets (Create/Read/Update/Delete) + * \file asset/class/asset.class.php + * \ingroup asset + * \brief This file is a CRUD class file for asset (Create/Read/Update/Delete) */ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; @@ -27,30 +27,30 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** - * Class for Assets + * Class for Asset */ -class Assets extends CommonObject +class Asset extends CommonObject { /** * @var string ID to identify managed object */ - public $element = 'assets'; + public $element = 'asset'; /** * @var string Name of table without prefix where object is stored */ - public $table_element = 'assets'; + public $table_element = 'asset'; /** - * @var int Does assets support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + * @var int Does module 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 assets support extrafields ? 0=No, 1=Yes + * @var int Does asset support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; /** - * @var string String with name of icon for assets. Must be the part after the 'object_' into object_assets.png + * @var string String with name of icon for asset. Must be the part after the 'object_' into object_asset.png */ - public $picto = 'assets'; + public $picto = 'asset'; /** @@ -111,21 +111,21 @@ class Assets extends CommonObject /** * @var int Name of subtable line */ - //public $table_element_line = 'assetsdet'; + //public $table_element_line = 'assetdet'; /** * @var int Field with ID of parent key if this field has a parent */ - //public $fk_element = 'fk_assets'; + //public $fk_element = 'fk_asset'; /** * @var int Name of subtable class that manage subtable lines */ - //public $class_element_line = 'Assetsline'; + //public $class_element_line = 'Assetline'; /** * @var array Array of child tables (child tables to delete before deleting a record) */ - //protected $childtables=array('assetsdet'); + //protected $childtables=array('assetdet'); /** - * @var AssetsLine[] Array of subtable lines + * @var AssetLine[] Array of subtable lines */ //public $lines = array(); diff --git a/htdocs/assets/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php similarity index 97% rename from htdocs/assets/class/asset_type.class.php rename to htdocs/asset/class/asset_type.class.php index d4d12916e9a..9fbcca64d8b 100644 --- a/htdocs/assets/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -16,8 +16,8 @@ */ /** - * \file htdocs/assets/class/asset_type.class.php - * \ingroup assets + * \file htdocs/asset/class/asset_type.class.php + * \ingroup asset * \brief File of class to manage asset types */ @@ -375,7 +375,7 @@ class AssetType extends CommonObject $result=''; $label=$langs->trans("ShowTypeCard",$this->label); - $linkstart = ''; + $linkstart = ''; $linkend=''; $result .= $linkstart; diff --git a/htdocs/assets/document.php b/htdocs/asset/document.php similarity index 83% rename from htdocs/assets/document.php rename to htdocs/asset/document.php index 490fb8f36a4..fbd2fe6cdb8 100644 --- a/htdocs/assets/document.php +++ b/htdocs/asset/document.php @@ -18,13 +18,13 @@ /** * \file document.php - * \ingroup assets + * \ingroup asset * \brief Tab for documents linked to Assets */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; 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'; @@ -42,7 +42,7 @@ $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, 'assets', $id); +//$result = restrictedArea($user, 'asset', $id); // Get parameters $sortfield = GETPOST("sortfield",'alpha'); @@ -56,12 +56,12 @@ if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; // Initialize technical objects -$object=new Assets($db); +$object=new Asset($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetsdocument')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('assetdocument')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('assets'); +$extralabels = $extrafields->fetch_name_optionals_label('asset'); // 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 @@ -110,7 +110,7 @@ if ($object->id) // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -131,15 +131,15 @@ if ($object->id) dol_fiche_end(); - $modulepart = 'assets'; - //$permission = $user->rights->assets->create; + $modulepart = 'asset'; + //$permission = $user->rights->asset->create; $permission = 1; - //$permtoedit = $user->rights->assets->create; + //$permtoedit = $user->rights->asset->create; $permtoedit = 1; $param = '&id=' . $object->id; - //$relativepathwithnofile='assets/' . dol_sanitizeFileName($object->id).'/'; - $relativepathwithnofile='assets/' . dol_sanitizeFileName($object->ref).'/'; + //$relativepathwithnofile='asset/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile='asset/' . dol_sanitizeFileName($object->ref).'/'; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } diff --git a/htdocs/assets/info.php b/htdocs/asset/info.php similarity index 88% rename from htdocs/assets/info.php rename to htdocs/asset/info.php index 9017a9e6845..c953a09c83b 100644 --- a/htdocs/assets/info.php +++ b/htdocs/asset/info.php @@ -17,16 +17,16 @@ /** * \file info.php - * \ingroup assets + * \ingroup asset * \brief Page to show an asset information */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; -$langs->loadLangs(array("assets")); +$langs->loadLangs(array("asset")); $id = GETPOST('id','int'); $ref=GETPOST('ref','alpha'); @@ -34,9 +34,9 @@ $action=GETPOST('action','alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'assets', $id, ''); +$result = restrictedArea($user, 'asset', $id, ''); -$object = new Assets($db); +$object = new Asset($db); $object->fetch($id); /* diff --git a/htdocs/assets/list.php b/htdocs/asset/list.php similarity index 88% rename from htdocs/assets/list.php rename to htdocs/asset/list.php index c8ac1f869f1..d9860dc32a3 100644 --- a/htdocs/assets/list.php +++ b/htdocs/asset/list.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,31 +19,16 @@ /** * \file list.php - * \ingroup assets - * \brief List page for assets + * \ingroup asset + * \brief List page for asset */ -//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('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test done when option MAIN_SECURITY_CSRF_WITH_TOKEN is on. -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//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 -//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) - - // Load Dolibarr environment require '../main.inc.php'; 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 DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; // Load traductions files requiredby by page $langs->loadLangs(array("assets")); @@ -70,12 +56,12 @@ $pageprev = $page - 1; $pagenext = $page + 1; // Initialize technical objects -$object=new Assets($db); +$object=new Asset($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetslist')); // Note that conf->hooks_modules contains array +$diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('assets'); +$extralabels = $extrafields->fetch_name_optionals_label('asset'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); // Default sort order (if not yet defined by previous GETPOST) @@ -89,7 +75,7 @@ if ($user->societe_id > 0) //$socid = $user->societe_id; accessforbidden(); } -//$result = restrictedArea($user, 'assets', $id,''); +//$result = restrictedArea($user, 'asset', $id,''); // Initialize array of search criterias $search_all=trim(GETPOST("search_all",'alpha')); @@ -161,11 +147,11 @@ if (empty($reshook)) } // Mass actions - $objectclass='Assets'; - $objectlabel='Assets'; - $permtoread = $user->rights->assets->read; - $permtodelete = $user->rights->assets->delete; - $uploaddir = $conf->assets->dir_output; + $objectclass='Asset'; + $objectlabel='Asset'; + $permtoread = $user->rights->asset->read; + $permtodelete = $user->rights->asset->delete; + $uploaddir = $conf->asset->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -181,7 +167,7 @@ $form=new Form($db); $now=dol_now(); -//$help_url="EN:Module_Assets|FR:Module_Assets_FR|ES:Módulo_Assets"; +//$help_url="EN:Module_Asset|FR:Module_Asset_FR|ES:Módulo_Asset"; $help_url=''; $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Assets")); @@ -239,6 +225,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -300,7 +291,7 @@ $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); -if ($user->rights->assets->delete) $arrayofmassactions['predelete']=$langs->trans("Delete"); +if ($user->rights->asset->delete) $arrayofmassactions['predelete']=$langs->trans("Delete"); if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); @@ -318,8 +309,8 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort // Add code for pre mass action (confirmation or email presend form) $topicmail="SendAssetsRef"; -$modelmail="assets"; -$objecttmp=new Assets($db); +$modelmail="asset"; +$objecttmp=new Asset($db); $trackid='xxxx'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; @@ -394,7 +385,7 @@ foreach($object->fields as $key => $val) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters=array('arrayfields'=>$arrayfields); +$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; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; @@ -524,10 +515,10 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb $urlsource.=str_replace('&','&',$param); $filedir=$diroutputmassaction; - $genallowed=$user->rights->assets->read; - $delallowed=$user->rights->assets->create; + $genallowed=$user->rights->asset->read; + $delallowed=$user->rights->asset->create; - print $formfile->showdocuments('massfilesarea_assets','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); + print $formfile->showdocuments('massfilesarea_asset','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); } else { diff --git a/htdocs/assets/note.php b/htdocs/asset/note.php similarity index 82% rename from htdocs/assets/note.php rename to htdocs/asset/note.php index b0db48e2abe..9ed9053dc5c 100644 --- a/htdocs/assets/note.php +++ b/htdocs/asset/note.php @@ -18,16 +18,16 @@ /** * \file note.php - * \ingroup assets - * \brief Card with notes on Assets + * \ingroup asset + * \brief Card with notes on Asset */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; // Load traductions files requiredby by page -$langs->loadLangs(array("assets","companies")); +$langs->loadLangs(array("asset","companies")); // Get parameters $id = GETPOST('id', 'int'); @@ -37,24 +37,24 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object=new Assets($db); +$object=new Asset($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetsnote')); // Note that conf->hooks_modules contains array +$diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('assetnote')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('assets'); +$extralabels = $extrafields->fetch_name_optionals_label('asset'); // 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, 'assets', $id); +//$result = restrictedArea($user, 'asset', $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->assets->multidir_output[$object->entity] . "/" . $object->id; +if ($id > 0 || ! empty($ref)) $upload_dir = $conf->asset->multidir_output[$object->entity] . "/" . $object->id; $permissionnote=1; -//$permissionnote=$user->rights->assets->creer; // Used by the include of actions_setnotes.inc.php +//$permissionnote=$user->rights->asset->creer; // Used by the include of actions_setnotes.inc.php /* @@ -84,7 +84,7 @@ if ($id > 0 || ! empty($ref)) // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; /* @@ -98,7 +98,7 @@ if ($id > 0 || ! empty($ref)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->assets->creer) + if ($user->rights->asset->creer) { if ($action != 'classify') //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; diff --git a/htdocs/assets/type.php b/htdocs/asset/type.php similarity index 95% rename from htdocs/assets/type.php rename to htdocs/asset/type.php index f9e725acafa..d26175d168f 100644 --- a/htdocs/assets/type.php +++ b/htdocs/asset/type.php @@ -16,15 +16,15 @@ */ /** - * \file htdocs/assets/type.php - * \ingroup assets + * \file htdocs/asset/type.php + * \ingroup asset * \brief Asset's type setup */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/asset.class.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/asset_type.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("assets"); @@ -51,7 +51,7 @@ $label=GETPOST("label","alpha"); $comment=GETPOST("comment"); // Security check -$result=restrictedArea($user,'assets',$rowid,'asset_type'); +$result=restrictedArea($user,'asset',$rowid,'asset_type'); $object = new AssetType($db); @@ -86,7 +86,7 @@ if ($cancel) { } } -if ($action == 'add' && $user->rights->assets->write) +if ($action == 'add' && $user->rights->asset->write) { $object->label = trim($label); $object->accountancy_code_asset = trim($accountancy_code_asset); @@ -135,7 +135,7 @@ if ($action == 'add' && $user->rights->assets->write) } } -if ($action == 'update' && $user->rights->assets->write) +if ($action == 'update' && $user->rights->asset->write) { $object->fetch($rowid); @@ -166,7 +166,7 @@ if ($action == 'update' && $user->rights->assets->write) exit; } -if ($action == 'confirm_delete' && $user->rights->assets->write) +if ($action == 'confirm_delete' && $user->rights->asset->write) { $object->fetch($rowid); $res=$object->delete(); @@ -255,7 +255,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') print '
'; print ''; print ''; - if ($user->rights->adherent->configurer) + if ($user->rights->asset->configurer) print ''; else print ''; @@ -281,7 +281,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') /* ************************************************************************** */ if ($action == 'create') { - $object = new AdherentType($db); + $object = new AssetType($db); print load_fiche_titre($langs->trans("NewMemberType")); @@ -344,7 +344,7 @@ if ($rowid > 0) { if ($action != 'edit') { - $object = new AdherentType($db); + $object = new AssetType($db); $object->fetch($rowid); $object->fetch_optionals(); @@ -360,7 +360,7 @@ if ($rowid > 0) dol_fiche_head($head, 'card', $langs->trans("MemberType"), -1, 'group'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'rowid', $linkback); @@ -398,7 +398,7 @@ if ($rowid > 0) print '
'; // Edit - if ($user->rights->adherent->configurer) + if ($user->rights->asset->configurer) { print ''; } @@ -407,7 +407,7 @@ if ($rowid > 0) print ''; // Delete - if ($user->rights->adherent->configurer) + if ($user->rights->asset->configurer) { print ''; } @@ -464,6 +464,9 @@ if ($rowid > 0) { $sql.=" AND datefin < '".$db->idate($now)."'"; } + + $sql.= " ".$db->order($sortfield,$sortorder); + // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -471,9 +474,13 @@ if ($rowid > 0) $resql = $db->query($sql); if ($resql) $nbtotalofrecords = $db->num_rows($result); else dol_print_error($db); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } - // Add order and limit - $sql.= " ".$db->order($sortfield,$sortorder); + $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); $resql = $db->query($sql); @@ -568,7 +575,7 @@ if ($rowid > 0) $datefin=$db->jdate($objp->datefin); - $adh=new Adherent($db); + $adh=new Asset($db); $adh->lastname=$objp->lastname; $adh->firstname=$objp->firstname; @@ -636,12 +643,12 @@ if ($rowid > 0) // Actions print '
\n"; - $var=True; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; // Id diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 769a69a23fa..a0e992e9da9 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -292,7 +292,7 @@ class Facturation else if ( $aId == 'RESET' ) { - $this->id = NULL; + $this->id = null; } else @@ -318,7 +318,7 @@ class Facturation } else if ( $aRef == 'RESET' ) { - $this->ref = NULL; + $this->ref = null; } else { @@ -342,7 +342,7 @@ class Facturation else if ( $aQte == 'RESET' ) { - $this->qte = NULL; + $this->qte = null; } else { @@ -366,7 +366,7 @@ class Facturation } else if ( $aStock == 'RESET' ) { - $this->stock = NULL; + $this->stock = null; } else { @@ -390,7 +390,7 @@ class Facturation } else if ($aRemisePercent == 'RESET') { - $this->remise_percent = NULL; + $this->remise_percent = null; } else { @@ -414,7 +414,7 @@ class Facturation } else if ( $aMontantRemise == 'RESET' ) { - $this->montant_remise = NULL; + $this->montant_remise = null; } else { @@ -439,7 +439,7 @@ class Facturation } else if ( $aPrix == 'RESET' ) { - $this->prix = NULL; + $this->prix = null; } else { @@ -463,7 +463,7 @@ class Facturation } else if ( $aTva == 'RESET' ) { - $this->tva = NULL; + $this->tva = null; } else { @@ -487,7 +487,7 @@ class Facturation } else if ( $aNumFacture == 'RESET' ) { - $this->num_facture = NULL; + $this->num_facture = null; } else { @@ -511,7 +511,7 @@ class Facturation } else if ( $aModeReglement == 'RESET' ) { - $this->mode_reglement = NULL; + $this->mode_reglement = null; } else { @@ -536,7 +536,7 @@ class Facturation } else if ( $aMontantEncaisse == 'RESET' ) { - $this->montant_encaisse = NULL; + $this->montant_encaisse = null; } else { @@ -560,7 +560,7 @@ class Facturation return $this->montant_rendu; } else if ( $aMontantRendu == 'RESET' ) { - $this->montant_rendu = NULL; + $this->montant_rendu = null; } else { @@ -584,7 +584,7 @@ class Facturation } else if ( $aPaiementLe == 'RESET' ) { - $this->paiement_le = NULL; + $this->paiement_le = null; } else { @@ -607,7 +607,7 @@ class Facturation } else if ( $aTotalHt == 'RESET' ) { - $this->prix_total_ht = NULL; + $this->prix_total_ht = null; } else { @@ -630,7 +630,7 @@ class Facturation } else if ( $aMontantTva == 'RESET' ) { - $this->montant_tva = NULL; + $this->montant_tva = null; } else { @@ -654,7 +654,7 @@ class Facturation } else if ( $aTotalTtc == 'RESET' ) { - $this->prix_total_ttc = NULL; + $this->prix_total_ttc = null; } else { diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index 72fbd509535..e1a1dcc6bc8 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -24,16 +24,12 @@ */ -//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 (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // Change this following line to use the correct relative path (../, ../../, etc) require '../main.inc.php'; diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index c1564e1b892..518d8903edd 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -38,7 +38,7 @@ $action=GETPOST('action','aZ09'); * Actions */ -if (preg_match('/set_(.*)/',$action,$reg)) +if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) @@ -52,7 +52,7 @@ if (preg_match('/set_(.*)/',$action,$reg)) } } -if (preg_match('/del_(.*)/',$action,$reg)) +if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index 46332f9f979..c559d760f0f 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -172,7 +172,7 @@ class Categories extends DolibarrApi * @param array $request_data Request data * @return int ID of category */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->categorie->creer) { throw new RestException(401); @@ -197,7 +197,7 @@ class Categories extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->categorie->creer) { throw new RestException(401); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 71240d63d8f..5fa8d267830 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -895,24 +895,22 @@ class Categorie extends CommonObject $sql.= ' AND s.rowid = sub.fk_categorie'; $sql.= ' AND sub.'.$subcol_name.' = '.$id; + $sql.= $this->db->order($sortfield, $sortorder); + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $this->db->query($sql); $nbtotalofrecords = $this->db->num_rows($result); - } - - $sql.= $this->db->order($sortfield, $sortorder); - if ($limit) { - if ($page < 0) + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 { $page = 0; + $offset = 0; } - $offset = $limit * $page; - - $sql.= $this->db->plimit($limit + 1, $offset); } + $sql.= $this->db->plimit($limit + 1, $offset); + $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index b507d9c72b9..f5d9c7db762 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -187,7 +187,7 @@ class AgendaEvents extends DolibarrApi * @param array $request_data Request data * @return int ID of Agenda Event */ - function post($request_data = NULL) + function post($request_data = null) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) { throw new RestException(401, "Insuffisant rights to create your Agenda Event"); @@ -226,7 +226,7 @@ class AgendaEvents extends DolibarrApi * @return int */ /* - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) { throw new RestException(401, "Insuffisant rights to create your Agenda Event"); } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9fae2dd47a9..d967d94e9e1 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2014 Cedric GROSS @@ -44,7 +44,7 @@ if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MA if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=$conf->global->AGENDA_EXT_NB; -$filter = GETPOST("filter",'',3); +$filter = GETPOST("filter",'alpha',3); $filtert = GETPOST("filtert","int",3); $usergroup = GETPOST("usergroup","int",3); $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; @@ -59,7 +59,7 @@ $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 -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="a.datec"; @@ -85,8 +85,8 @@ $month=GETPOST("month","int")?GETPOST("month","int"):date("m"); $week=GETPOST("week","int")?GETPOST("week","int"):date("W"); $day=GETPOST("day","int")?GETPOST("day","int"):0; $pid=GETPOST("projectid","int",3); -$status=GETPOST("status"); -$type=GETPOST("type"); +$status=GETPOST("status",'aZ09'); // status may be 0, 50, 100, 'todo' +$type=GETPOST("type",'az09'); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('actioncode','array')) @@ -102,7 +102,10 @@ if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->glob if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW); - +if ($action == 'default') +{ + $action = ((! empty($conf->global->AGENDA_DEFAULT_VIEW) && $conf->global->AGENDA_DEFAULT_VIEW!='show_list') ? $conf->global->AGENDA_DEFAULT_VIEW : 'show_month'); +} if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') { $action='show_month'; $day=''; } // View by month @@ -126,7 +129,7 @@ $hookmanager->initHooks(array('agenda')); * Actions */ -if (GETPOST("viewlist") || $action == 'show_list') +if (GETPOST("viewlist",'alpha') || $action == 'show_list') { $param=''; if (is_array($_POST)) @@ -142,7 +145,7 @@ if (GETPOST("viewlist") || $action == 'show_list') exit; } -if (GETPOST("viewperuser") || $action == 'show_peruser') +if (GETPOST("viewperuser",'alpha') || $action == 'show_peruser') { $param=''; if (is_array($_POST)) @@ -677,7 +680,7 @@ if ($showbirthday) $sql = 'SELECT sp.rowid, sp.lastname, sp.firstname, sp.birthday'; $sql.= ' FROM '.MAIN_DB_PREFIX.'socpeople as sp'; $sql.= ' WHERE (priv=0 OR (priv=1 AND fk_user_creat='.$user->id.'))'; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; + $sql.= " AND sp.entity IN (".getEntity('socpeople').")"; if ($action == 'show_day') { $sql.= ' AND MONTH(birthday) = '.$month; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 9221c7d2ede..cca1f59bf8e 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -25,12 +25,15 @@ * \brief Page to list actions */ +if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->loadLangs(array("users","companies","agenda","commercial")); @@ -64,7 +67,7 @@ $dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth','int'), GETPOST('dateendday' if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW); -$filter = GETPOST("filter",'',3); +$filter = GETPOST("filter",'alpha',3); $filtert = GETPOST("filtert","int",3); $usergroup = GETPOST("usergroup","int",3); $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; @@ -318,6 +321,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1, $offset); @@ -397,6 +405,7 @@ if ($resql) $s = $hookmanager->resPrint; } + $newcardbutton=''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { $tmpforcreatebutton=dol_getdate(dol_now(), true); @@ -405,12 +414,12 @@ if ($resql) //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; - $link = ''; - $link.= $langs->trans("AddAction"); - $link.= ''; + $newcardbutton = ''.$langs->trans("AddAction"); + $newcardbutton.= ''; + $newcardbutton.= ''; } - print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$link, '', $limit); + print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit); $moreforfilter=''; diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 2d72fa4c3f8..93cbae527f1 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -38,7 +38,7 @@ $action=GETPOST('action','alpha'); $month=GETPOST('month'); $year=GETPOST('year'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -93,6 +93,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1,$offset); diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 5c160bfab16..fe2e3027dcf 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -34,7 +34,7 @@ $page=GETPOST('page', 'int'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="p.name"; if ($page < 0) { $page = 0; } -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; $type=GETPOST('type', 'alpha'); @@ -78,7 +78,7 @@ if (! $user->rights->societe->client->voir && ! $socid) $sql .= " ".MAIN_DB_PREF $sql.= " ".MAIN_DB_PREFIX."socpeople as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql.= " WHERE s.fk_stcomm = st.id"; -$sql.= " AND p.entity IN (".getEntity('societe').")"; +$sql.= " AND p.entity IN (".getEntity('socpeople').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($type == "c") $sql.= " AND s.client IN (1, 3)"; if ($type == "p") $sql.= " AND s.client IN (2, 3)"; @@ -144,14 +144,11 @@ if ($resql) print ''; print "\n"; - $var=True; $i = 0; while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - - print ''; print ''; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 255bb036c93..eab813653d6 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -228,7 +228,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_statut = 0"; $sql.= " AND p.fk_soc = s.rowid"; - $sql.= " AND p.entity IN (".getEntity('propal').")"; + $sql.= " AND p.entity IN (".getEntity('supplier_proposal').")"; 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; @@ -349,7 +349,12 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1,'customer',16); print ''; - print ''; + if(! empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) { + print ''; + } + else { + print ''; + } $i++; $total += $obj->total_ttc; } @@ -432,7 +437,12 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1,'supplier',16); print ''; - print ''; + if(! empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) { + print ''; + } + else { + print ''; + } $i++; $total += $obj->total_ttc; } @@ -744,7 +754,12 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print ''; print ''."\n"; - print ''; + if(! empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) { + print ''; + } + else { + print ''; + } print ''."\n"; print ''."\n"; $i++; @@ -843,7 +858,12 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) print ''; print ''."\n"; - print ''; + if(! empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) { + print ''; + } + else { + print ''; + } print ''."\n"; print ''."\n"; $i++; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 48949881659..676c9c3e98e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -425,7 +425,13 @@ if ($object->fetch($id) >= 0) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } + //$nbtotalofrecords=$object->nbemail; // nbemail is a denormalized field storing nb of targets $sql .= $db->plimit($limit+1, $offset); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 52eacf6c115..4175c4e4446 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -52,7 +52,6 @@ print '
'; //if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo //{ // Recherche emails - $var=false; print ''; print ''; print '
".$langs->trans("LogEvents")."
'.$arr['id'].''; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 28ced963f87..6d164b25282 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * * 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 @@ -233,8 +233,6 @@ foreach ($dirmodels as $reldir) $handle = opendir($dir); if (is_resource($handle)) { - $var=true; - while (($file = readdir($handle))!==false) { if (substr($file, 0, 18) == 'mod_expensereport_' && substr($file, dol_strlen($file)-3, 3) == 'php') @@ -351,7 +349,6 @@ print "
'.$langs->trans("Parameter").'
'; print $form->textwithpicto($langs->trans("FreeLegalTextOnExpenseReports"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; $variablename='EXPENSEREPORT_FREE_TEXT'; diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index adf18433caa..bb68ea2182e 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -30,11 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php'; -$langs->load('admin'); -$langs->load('other'); -$langs->load('trips'); -$langs->load('errors'); -$langs->load('dict'); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin","trips","errors","other","dict")); if (!$user->admin) accessforbidden(); @@ -129,7 +126,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) if ($Tab['active'] == 0) continue; $tranche=1; - $var = true; + foreach ($Tab['ranges'] as $k => $range) { if (isset($Tab['ranges'][$k+1])) $label = $langs->trans('expenseReportRangeFromTo', $range->range_ik, ($Tab['ranges'][$k+1]->range_ik-1)); @@ -137,7 +134,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) if ($range->range_active == 0) $label = $form->textwithpicto($label, $langs->trans('expenseReportRangeDisabled'), 1, 'help', '', 0, 3); - echo '
['.$langs->trans('RangeNum', $tranche++).'] - '.$label.'
 
'; echo '
'.$form->selectarray('apply_to', $tab_apply, '', 0).'
'; echo '
'.$form->select_dolusers('', 'fk_user').'
'; @@ -220,10 +216,9 @@ echo '
'.$langs->trans('ExpenseReportRestrictive').' 
'; if ($action == 'edit' && $object->id == $rule->id) @@ -260,7 +255,6 @@ foreach ($rules as $rule) echo ''; if ($action == 'edit' && $object->id == $rule->id) { @@ -335,7 +329,6 @@ foreach ($rules as $rule) echo '
'; echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file))); print "\n"; @@ -470,7 +467,6 @@ print "
'; print (empty($module->name)?$name:$module->name); print "\n"; @@ -598,7 +593,6 @@ print ''; print ''; print ''; -$var=True; print ''; print ''; print ''; print ''; print "\n"; -$var=true; // Force date validation -$var=! $var; print ''; print ''; print ''; @@ -717,7 +708,6 @@ $htmltext = ''.$langs->trans("AvailableVariables").':
'; foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; $htmltext.='
'; -$var=! $var; print ''; print ''; print ''; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 70b79acb931..53a2f8bf2da 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -139,8 +139,6 @@ $linkback=''; -$var=true; - if (empty($conf->use_javascript_ajax)) { setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors'); @@ -158,7 +156,6 @@ else { // Si condition non remplie, on ne propose pas l'option if (! $conditions[$const]) continue; - print ''; print ''; diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index bf588ca90ae..59ce46921a7 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -30,8 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("errors"); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin","errors")); $action = GETPOST('action','aZ09'); @@ -94,7 +94,6 @@ else } // Mode -$var=true; print ''; print ''; print ''; @@ -105,7 +104,6 @@ print ''; print "\n"; - print ''; print ''; print "\n"; // Type - print ''; // Version - print ''; // Serveur primaire - print ''; // Serveur secondaire - print ''; // Port - print ''; // DNserver - print ''; // Utiliser TLS - print ''; print "\n"; // DNAdmin - print ''; // Pass - print ''; } - - print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); - - print '
'; @@ -662,7 +656,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE clos = 0"; $sql.= " AND courant = 1"; $sql.= " AND entity IN (".getEntity('bank_account').")"; -$var=True; + $resql=$db->query($sql); if ($resql) { @@ -670,7 +664,6 @@ if ($resql) $i = 0; while ($i < $num) { - $row = $db->fetch_row($resql); print ''.$langs->trans("Value").' 
'.img_object("",$picto[$const]).''.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("PathToGeoIPMaxmindCountryDataFile").''; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 23cc0600705..ed687288a0a 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -108,10 +108,18 @@ if ($action == 'update') if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_VERMENU_BACK1', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val,'chaine',0,'',$conf->entity); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())))); + if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val,'chaine',0,'',$conf->entity); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val,'chaine',0,'',$conf->entity); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLE'),array())))); + if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val,'chaine',0,'',$conf->entity); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val,'chaine',0,'',$conf->entity); @@ -126,17 +134,13 @@ if ($action == 'update') if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR2', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val,'chaine',0,'',$conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())))); - if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val,'chaine',0,'',$conf->entity); - - if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) - else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val,'chaine',0,'',$conf->entity); + if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) + else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); @@ -543,6 +547,8 @@ else // Show print '
'; // Login page + print '
'; + print ''; print ''; @@ -573,6 +579,7 @@ else // Show print ''; print '
'.$langs->trans("LoginPage").'
'."\n"; + print '
'; print '
'; print ''.$langs->trans("Modify").''; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 5655c0c2714..141273a8f8c 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -102,7 +102,6 @@ if (! function_exists("ldap_connect")) } -$var=true; $form=new Form($db); @@ -180,7 +179,6 @@ print '
'.$langs->trans("Example").'
'.$langs->trans("Type").''; $arraylist=array(); $arraylist['activedirectory']='Active Directory'; @@ -190,7 +188,6 @@ print $form->selectarray('type',$arraylist,$conf->global->LDAP_SERVER_TYPE); print ' 
'.$langs->trans("Version").''; $arraylist=array(); $arraylist['3']='Version 3'; @@ -199,21 +196,18 @@ print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION',$arraylist,$conf->global- print ''.$langs->trans("LDAPServerProtocolVersion").'
'; print $langs->trans("LDAPPrimaryServer").''; print ''; print ''.$langs->trans("LDAPServerExample").'
'; print $langs->trans("LDAPSecondaryServer").''; print ''; print ''.$langs->trans("LDAPServerExample").'
'.$langs->trans("LDAPServerPort").''; if (! empty($conf->global->LDAP_SERVER_PORT)) { @@ -226,13 +220,11 @@ else print ''.$langs->trans("LDAPServerPortExample").'
'.$langs->trans("LDAPServerDn").''; print ''; print ''.$langs->trans("LDAPServerDnExample").'
'.$langs->trans("LDAPServerUseTLS").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); @@ -245,13 +237,11 @@ print ''.$langs->trans("ForANonAnonymousAccess").'
'.$langs->trans("LDAPAdminDn").''; print ''; print ''.$langs->trans("LDAPAdminDnExample").'
'.$langs->trans("LDAPPassword").''; if (! empty($conf->global->LDAP_ADMIN_PASS)) { diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 07910185956..a16f147586a 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -32,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -$langs->load("admin"); -$langs->load("errors"); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin","errors")); if (!$user->admin) accessforbidden(); @@ -117,15 +117,12 @@ print ''; print ''; print ''; -$var=true; print ''; print ''; print "\n"; - // DN Pour les contacts - print ''; @@ -133,7 +130,6 @@ print ''; print ''; // List of object class used to define attributes in structure - print ''; @@ -143,7 +139,6 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeContacts").'
'.$langs->trans("LDAPContactDn").''; print ''; print ''.$langs->trans("LDAPContactDnExample").' 
'.$langs->trans("LDAPContactObjectClassList").''; print ''; print ''.$langs->trans("LDAPContactObjectClassListExample").'
'; print '
'; print ''; -$var=true; print ''; print ''; @@ -152,7 +147,6 @@ print ''; print "\n"; // Common name - print ''; @@ -160,7 +154,6 @@ print ''; @@ -168,7 +161,6 @@ print ''; @@ -176,7 +168,6 @@ print ''; @@ -184,7 +175,6 @@ print ''; @@ -192,7 +182,6 @@ print ''; @@ -200,7 +189,6 @@ print ''; @@ -208,7 +196,6 @@ print ''; @@ -216,7 +203,6 @@ print ''; @@ -224,7 +210,6 @@ print ''; @@ -232,7 +217,6 @@ print ''; @@ -240,7 +224,6 @@ print ''; @@ -248,7 +231,6 @@ print ''; @@ -256,7 +238,6 @@ print ''; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 5a4e36b7792..a1d69c7216b 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; -$langs->load("admin"); -$langs->load("errors"); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin","errors")); if (!$user->admin) accessforbidden(); @@ -109,14 +109,12 @@ print ''; $form=new Form($db); print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").''.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").''.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").''.$langs->trans("LDAPFieldCompany").''; print ''; print ''.$langs->trans("LDAPFieldCompanyExample").''.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").''.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").''.$langs->trans("LDAPFieldHomePhone").''; print ''; print ''.$langs->trans("LDAPFieldHomePhoneExample").''.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").''.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").''.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").''.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").''.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").''.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").''.$langs->trans("LDAPFieldCountry").''; print ''; print ' 
'; -$var=true; print ''; print ''; print "\n"; // DN pour les groupes - print ''; @@ -124,7 +122,6 @@ print ''; print ''; // List of object class used to define attributes in structure - print ''; @@ -134,7 +131,6 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeGroups").'
'.$langs->trans("LDAPGroupDn").''; print ''; print ''.$langs->trans("LDAPGroupDnExample").' 
'.$langs->trans("LDAPGroupObjectClassList").''; print ''; print ''.$langs->trans("LDAPGroupObjectClassListExample").'
'; print '
'; print ''; -$var=true; print ''; print ''; @@ -145,7 +141,6 @@ print "\n"; // Filtre // Common name - print ''; @@ -162,7 +157,6 @@ print ''; */ // Description - print ''; @@ -170,7 +164,6 @@ print ''; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index a6385c9690c..d363d8811e4 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -133,17 +133,13 @@ dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1); print $langs->trans("LDAPDescMembers").'
'; print '
'; - print '
'.$langs->trans("LDAPDolibarrMapping").'
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldCommonNameExample").'
'.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").''.$langs->trans("LDAPFieldGroupMembers").''; print ''; print ''.$langs->trans("LDAPFieldGroupMembersExample").'
'; -$var=true; - print ''; print ''; print "\n"; // DN Pour les adherents - print ''; @@ -151,7 +147,6 @@ print ''; print ''; // List of object class used to define attributes in structure - print ''; @@ -159,7 +154,6 @@ print ''; print ''; // Filter, used to filter search - print ''; @@ -169,7 +163,6 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeMembers").'
'.$langs->trans("LDAPMemberDn").''; print ''; print ''.$langs->trans("LDAPMemberDnExample").' 
'.$langs->trans("LDAPMemberObjectClassList").''; print ''; print ''.$langs->trans("LDAPMemberObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; print ''; print ''.$langs->trans("LDAPFilterConnectionExample").'
'; print '
'; print ''; -$var=true; print ''; print ''; @@ -180,7 +173,6 @@ print "\n"; // Filtre // Common name - print ''; @@ -188,7 +180,6 @@ print ''; @@ -196,7 +187,6 @@ print ''; @@ -204,7 +194,6 @@ print ''; print ''; // Login unix - print ''; @@ -212,7 +201,6 @@ print ''; @@ -220,7 +208,6 @@ print ''; @@ -228,7 +215,6 @@ print ''; print ''; // Password crypted - print ''; @@ -236,7 +222,6 @@ print ''; print ''; // Mail - print ''; @@ -244,7 +229,6 @@ print ''; @@ -260,7 +244,6 @@ print ''; print ''; // Mobile - print ''; @@ -268,7 +251,6 @@ print ''; print ''; // Skype - print ''; @@ -276,7 +258,6 @@ print ''; print ''; // Fax - print ''; @@ -284,7 +265,6 @@ print ''; print ''; // Company - print ''; @@ -292,7 +272,6 @@ print ''; print ''; // Address - print ''; @@ -300,7 +279,6 @@ print ''; print ''; // ZIP - print ''; @@ -308,7 +286,6 @@ print ''; print ''; // TOWN - print ''; @@ -316,7 +293,6 @@ print ''; print ''; // COUNTRY - print ''; @@ -324,7 +300,6 @@ print ''; print ''; // Description - print ''; @@ -332,7 +307,6 @@ print ''; print ''; // Public Note - print ''; @@ -348,7 +322,6 @@ print ''; print ''; // Status - print ''; @@ -364,7 +337,6 @@ print ''; print ''; // First subscription amount - print ''; @@ -372,7 +344,6 @@ print ''; print ''; // Last subscription date - print ''; @@ -380,7 +351,6 @@ print ''; print ''; // Last subscription amount - print ''; @@ -388,7 +358,6 @@ print ''; print ''; // End last subscriptions - print ''; diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 2c08ec9fae8..b5f278a8968 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -108,14 +108,12 @@ print ''; $form=new Form($db); print '
'.$langs->trans("LDAPDolibarrMapping").'
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").''.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").''.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").' 
'.$langs->trans("LDAPFieldLoginUnix").''; print ''; print ''.$langs->trans("LDAPFieldLoginExample").''.$langs->trans("LDAPFieldLoginSamba").''; print ''; print ''.$langs->trans("LDAPFieldLoginSambaExample").''.$langs->trans("LDAPFieldPasswordNotCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").' 
'.$langs->trans("LDAPFieldPasswordCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").' 
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").''.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").' 
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").' 
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").' 
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").' 
'.$langs->trans("LDAPFieldCompany").''; print ''; print ''.$langs->trans("LDAPFieldCompanyExample").' 
'.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").' 
'.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").' 
'.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").' 
'.$langs->trans("LDAPFieldCountry").''; print ''; print '  
'.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").' 
'.$langs->trans("LDAPFieldNotePublic").''; print ''; print ''.$langs->trans("LDAPFieldNotePublicExample").' 
'.$langs->trans("LDAPFieldStatus").''; print ''; print '  
'.$langs->trans("LDAPFieldFirstSubscriptionAmount").''; print ''; print '  
'.$langs->trans("LDAPFieldLastSubscriptionDate").''; print ''; print '  
'.$langs->trans("LDAPFieldLastSubscriptionAmount").''; print ''; print '  
'.$langs->trans("LDAPFieldEndLastSubscription").''; print ''; print ' 
'; -$var=true; print ''; print ''; print "\n"; // DN pour les types de membres - print ''; @@ -123,7 +121,6 @@ print ''; print ''; // List of object class used to define attributes in structure - print ''; @@ -133,7 +130,6 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeMembersTypes").'
'.$langs->trans("LDAPMemberTypeDn").''; print ''; print ''.$langs->trans("LDAPMemberTypepDnExample").' 
'.$langs->trans("LDAPMemberTypeObjectClassList").''; print ''; print ''.$langs->trans("LDAPMemberTypeObjectClassListExample").'
'; print '
'; print ''; -$var=true; print ''; print ''; @@ -144,7 +140,6 @@ print "\n"; // Filtre // Common name - print ''; @@ -152,7 +147,6 @@ print ''; @@ -160,7 +154,6 @@ print ''; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index a2e40abfed2..1181d2860fb 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -124,17 +124,13 @@ print $langs->trans("LDAPDescUsers").'
'; print '
'; - - print '
'.$langs->trans("LDAPDolibarrMapping").'
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldCommonNameExample").''.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").''.$langs->trans("LDAPFieldGroupMembers").''; print ''; print ''.$langs->trans("LDAPFieldGroupMembersExample").'
'; -$var=true; print ''; print ''; print "\n"; // DN Pour les utilisateurs - print ''; @@ -142,7 +138,6 @@ print ''; print ''; // List of object class used to define attributes in structure - print ''; @@ -150,7 +145,6 @@ print ''; print ''; // Filter, used to filter search - print ''; @@ -160,7 +154,6 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeUsers").'
'.$langs->trans("LDAPUserDn").''; print ''; print ''.$langs->trans("LDAPUserDnExample").' 
'.$langs->trans("LDAPUserObjectClassList").''; print ''; print ''.$langs->trans("LDAPUserObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; print ''; print ''.$langs->trans("LDAPFilterConnectionExample").'
'; print '
'; print ''; -$var=true; print ''; print ''; @@ -169,7 +162,6 @@ print ''; print "\n"; // Common name - print ''; @@ -177,7 +169,6 @@ print ''; @@ -185,7 +176,6 @@ print ''; @@ -193,7 +183,6 @@ print ''; @@ -201,7 +190,6 @@ print ''; @@ -209,7 +197,6 @@ print ''; @@ -217,7 +204,6 @@ print ''; print ''; // Password crypted - print ''; @@ -225,7 +211,6 @@ print ''; print ''; // Mail - print ''; @@ -233,7 +218,6 @@ print ''; @@ -241,7 +225,6 @@ print ''; @@ -249,7 +232,6 @@ print ''; @@ -257,7 +239,6 @@ print ''; @@ -265,7 +246,6 @@ print ''; @@ -273,7 +253,6 @@ print ''; print ''; // Address - print ''; @@ -281,7 +260,6 @@ print ''; print ''; // ZIP - print ''; @@ -289,7 +267,6 @@ print ''; print ''; // TOWN - print ''; @@ -297,7 +274,6 @@ print ''; print ''; // COUNTRY - print ''; @@ -305,7 +281,6 @@ print ''; print ''; // Title - print ''; @@ -313,7 +288,6 @@ print ''; print ''; // Note - print ''; @@ -321,7 +295,6 @@ print ''; print ''; // Sid - print ''; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 69d1d8a8cea..5f0288525a0 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -1,5 +1,6 @@ + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,21 +22,6 @@ * \brief Page to adminsiter email sender profiles */ -//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('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test done when option MAIN_SECURITY_CSRF_WITH_TOKEN is on. -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//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 -//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) - - require '../main.inc.php'; require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; @@ -244,6 +230,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -387,7 +378,7 @@ foreach($object->fields as $key => $val) include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters=array('arrayfields'=>$arrayfields); +$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; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 89f3700c4f7..4e731021199 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -169,9 +169,6 @@ if ($conf->adherent->enabled) $elementList['member']=$langs->trans('Mai if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract'); if ($conf->projet->enabled) $elementList['project']=$langs->trans('MailToProject'); $elementList['user']=$langs->trans('MailToUser'); -$elementList['all'] =$langs->trans('VisibleEverywhere'); -$elementList['none']=$langs->trans('VisibleNowhere'); - $parameters=array('elementList'=>$elementList); $reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks @@ -181,6 +178,12 @@ if ($reshook == 0) { } } +// Add all and none after the sort +$elementList['all'] ='-- '.$langs->trans("All").' -- ('.$langs->trans('VisibleEverywhere').')'; +$elementList['none']='-- '.$langs->trans("None").' -- ('.$langs->trans('VisibleNowhere').')'; + +asort($elementList); + $id = 25; @@ -210,7 +213,7 @@ if (empty($reshook)) } // Actions add or modify an entry into a dictionary - if (GETPOST('actionadd') || GETPOST('actionmodify')) + if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) { $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); $listfieldinsert=explode(',',$tabfieldinsert[$id]); @@ -226,7 +229,7 @@ if (empty($reshook)) if ($value == 'content') continue; if ($value == 'content_lines') continue; - if (GETPOST('actionmodify') && $value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; + if (GETPOST('actionmodify','alpha') && $value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; if ((! isset($_POST[$value]) || $_POST[$value]=='' || $_POST[$value]=='-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position') { @@ -268,8 +271,8 @@ if (empty($reshook)) if ($value == 'fk_user' && ! ($_POST[$keycode] > 0)) $_POST[$keycode]=''; if ($value == 'private' && ! is_numeric($_POST[$keycode])) $_POST[$keycode]='0'; if ($value == 'position' && ! is_numeric($_POST[$keycode])) $_POST[$keycode]='1'; - if ($_POST[$keycode] == '' && $keycode != 'langcode') $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work - elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="null"; + if ($_POST[$keycode] == '' && $keycode != 'langcode') $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work + elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work else $sql.="'".$db->escape($_POST[$keycode])."'"; $i++; } @@ -315,12 +318,16 @@ if (empty($reshook)) if ($field == 'entity') $_POST[$keycode] = $conf->entity; if ($i) $sql.=","; $sql.= $field."="; - if ($_POST[$keycode] == '' || ($keycode == 'langcode' && empty($_POST[$keycode]))) $sql.="null"; // For vat, we want/accept code = '' + +// print $keycode.' - '.$_POST[$keycode].'
'; + if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work + elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work + elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1 else $sql.="'".$db->escape($_POST[$keycode])."'"; $i++; } $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; - +//print $sql;exit; dol_syslog("actionmodify", LOG_DEBUG); //print $sql; $resql = $db->query($sql); @@ -430,24 +437,9 @@ if ($search_type_template != '' && $search_type_template != '-1') $sql.=natural_ if ($search_lang) $sql.=natural_search('lang', $search_lang); if ($search_fk_user != '' && $search_fk_user != '-1') $sql.=natural_search('fk_user', $search_fk_user, 2); if ($search_topic) $sql.=natural_search('topic', $search_topic); -if ($sortfield) -{ - // If sort order is "country", we use country_code instead - if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); -} -else { - $sql.=" ORDER BY "; -} -$sql.=$tabsqlsort[$id]; +// If sort order is "country", we use country_code instead +if ($sortfield == 'country') $sortfield='country_code'; +$sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($listlimit+1,$offset); //print $sql; @@ -726,10 +718,10 @@ if ($resql) { $obj = $db->fetch_object($resql); - print '
'; - if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { + print ''; + $tmpaction='edit'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook=$hookmanager->executeHooks('editEmailTemplateFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks @@ -787,10 +779,23 @@ if ($resql) print ''; } } + + print "\n"; } else { - $tmpaction = 'view'; + $keyforobj='type_template'; + if (! in_array($obj->$keyforobj, array_keys($elementList))) + { + $i++; + continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled) + } + // TODO Test on 'enabled' + + + print ''; + + $tmpaction = 'view'; $parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook=$hookmanager->executeHooks('viewEmailTemplateFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks @@ -876,7 +881,6 @@ if ($resql) } print ''; - /* $fieldsforcontent = array('content'); if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) @@ -904,8 +908,9 @@ if ($resql) } }*/ + + print "\n"; } - print "\n"; $i++; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 5e0b6fac6f6..7ffaa9a110a 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -30,11 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $action=GETPOST('action','aZ09'); $cancel=GETPOST('cancel','alpha'); -$langs->load("companies"); -$langs->load("products"); -$langs->load("admin"); -$langs->load("users"); -$langs->load("other"); +$langs->loadLangs(array("companies","products","admin","users","other")); // Security check if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index dd90774a05b..8d44421186d 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -17,21 +17,11 @@ */ /** - * \file htdocs/admin/modules.php + * \file htdocs/admin/modulehelp.php * \brief Page to activate/disable all modules */ -//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'); // Do not check anti CSRF attack test -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//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 -//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) require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 25feceda0d1..467ffffeb41 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -48,10 +48,11 @@ $action = GETPOST('action', 'alpha'); */ -if (preg_match('/set_(.*)/',$action,$reg)) +if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; - if (dolibarr_set_const($db, $code, GETPOST($code), 'chaine', 0, '', $conf->entity) > 0) + $value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1); + if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) { header("Location: ".$_SERVER["PHP_SELF"]); exit; @@ -62,7 +63,7 @@ if (preg_match('/set_(.*)/',$action,$reg)) } } -if (preg_match('/del_(.*)/',$action,$reg)) +if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, 0) > 0) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 5f57ac99efc..f71bc87fc2d 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -128,8 +128,6 @@ print ''; print ''; print ''; -$var=true; - print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").''.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").''; // Firstname - print '
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").''.$langs->trans("LDAPFieldLoginUnix").''; print ''; print ''.$langs->trans("LDAPFieldLoginExample").''; // Login samba - print '
'.$langs->trans("LDAPFieldLoginSamba").''; print ''; print ''.$langs->trans("LDAPFieldLoginSambaExample").''.$langs->trans("LDAPFieldPasswordNotCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").' 
'.$langs->trans("LDAPFieldPasswordCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").' 
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").''; // Phone - print '
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").''; // Mobile - print '
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").''.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").''; // Fax - print '
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").''; // Company - print '
'.$langs->trans("LDAPFieldCompany").''; print ''; print ''.$langs->trans("LDAPFieldCompanyExample").' 
'.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").' 
'.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").' 
'.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").' 
'.$langs->trans("LDAPFieldCountry").''; print ''; print '  
'.$langs->trans("LDAPFieldTitle").''; print ''; print ''.$langs->trans("LDAPFieldTitleExample").' 
'.$langs->trans("Note").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").' 
'.$langs->trans("LDAPFieldSid").''; print ''; print ''.$langs->trans("LDAPFieldSidExample").'
'; print ''; print ''; @@ -168,7 +166,6 @@ $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); print ''; print '\n"; $notificationtrigger=new InterfaceNotification($db); $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); -$var=true; foreach($listofnotifiedevents as $notifiedevent) { diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 2f1ae179948..e0c2d776d7a 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -133,7 +133,7 @@ if ($action == 'edit') // Edit // Misc options - print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'
'; + print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'',''); print '
'; print '
'.$langs->trans("Parameter").'
'; -$var=true; $i=0; foreach($listofnotifiedevents as $notifiedevent) { @@ -212,7 +209,6 @@ print "
'; @@ -168,7 +168,7 @@ if ($action == 'edit') // Edit // Addresses - print load_fiche_titre($langs->trans("PDFAddressForging"),'','').'
'; + print load_fiche_titre($langs->trans("PDFAddressForging"),'',''); print '
'; print '
'; @@ -255,14 +255,15 @@ if ($action == 'edit') // Edit print '
'; print ''; + print '
'; + // Localtaxes + $locales =''; + $text=''; if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) { - $locales =''; - $text=''; - if ($mysoc->useLocalTax(1)) { $locales = $langs->transcountry("LT1",$mysoc->country_code); @@ -279,31 +280,39 @@ if ($action == 'edit') // Edit $text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1); $text.= '
'; - print ''; - print $text; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print '
'; - } + $title = $langs->trans("PDFRulesForSalesTax"); + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) + { + $title.=' - '.$langs->trans("PDFLocaltax",$locales); + } + + print load_fiche_titre($title,'',''); + + print ''; + print ''; + + // Hide any information on Sale tax / VAT + + print ''; + + // Locataxes + print $text; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("HideAnyVATInformationOnPDF").''; + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1); + print '
'; + print '
'; + + // Other - print load_fiche_titre($langs->trans("Other"),'','').'
'; + print load_fiche_titre($langs->trans("Other"),'',''); print '
'; print ''; print ''; - // Hide any PDF informations - - print ''; - //Desc print ''; } - print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("HideAnyVATInformationOnPDF").''; - print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1); - print '
'.$langs->trans("HideDescOnPDF").''; @@ -491,11 +500,10 @@ else // Show print '
'; // Localtaxes + $locales =''; + $text=''; if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) { - $locales =''; - $text=''; - if ($mysoc->useLocalTax(1)) { $locales = $langs->transcountry("LT1",$mysoc->country_code); @@ -513,16 +521,27 @@ else // Show $text.= '
'; - print ''; - print $text; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print '
'; - } + // Sales TAX / VAT information + $title=$langs->trans("PDFRulesForSalesTax",$locales); + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) $title.=' - '.$langs->trans("PDFLocaltax",$locales); + + print load_fiche_titre($title,'',''); + + print ''; + print ''; + + print ''; + + print $text; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("HideAnyVATInformationOnPDF").''; + print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1); + print '
'; + print '
'; + + // Other print load_fiche_titre($langs->trans("Other"),'',''); @@ -558,12 +577,6 @@ else // Show print "
'.$langs->trans("HideAnyVATInformationOnPDF").''; - print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1); - print '
'.$langs->trans("HideDescOnPDF").''; @@ -601,7 +614,7 @@ else // Show */ print '
'; - print load_fiche_titre($langs->trans("Library")); + print load_fiche_titre($langs->trans("Library"), '', ''); print '
'; print ''."\n"; @@ -644,7 +657,6 @@ else // Show print ' ('.@constant('TCPDI_PATH').')'; $i++; } - print ''; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 602b80c3855..21f34f2a770 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -$langs->load("admin"); -$langs->load("withdrawals"); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin","withdrawals")); // Security check if (!$user->admin) accessforbidden(); @@ -417,7 +417,6 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) if ($resql) { $num = $db->num_rows($resql); - $var = true; $i = 0; while ($i < $num) { diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 9627164f534..38cd2d12c1b 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -127,7 +127,7 @@ if ($action == 'activate_encryptdbpassconf') if ($result > 0) { sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait. - + // database value not required //dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1"); header("Location: security.php"); @@ -135,7 +135,7 @@ if ($action == 'activate_encryptdbpassconf') } else { - setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings'); + setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings'); } } else if ($action == 'disable_encryptdbpassconf') @@ -144,7 +144,7 @@ else if ($action == 'disable_encryptdbpassconf') if ($result > 0) { sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait. - + // database value not required //dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity); header("Location: security.php"); @@ -233,6 +233,7 @@ if (is_resource($handle)) } closedir($handle); } +asort($arrayhandler); print '
'; print ''; @@ -299,42 +300,42 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){ 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 '
'.$langs->trans("PasswordPatternDesc").'
' . $langs->trans("MinLength")."
' . $langs->trans("NbMajMin")."
' . $langs->trans("NbNumMin")."
' . $langs->trans("NbSpeMin")."
' . $langs->trans("NbIteConsecutive")."
' . $langs->trans("NoAmbiCaracAutoGeneration")." '.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'
'; print '
'; diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 1053658b191..7ce087ead6f 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -51,41 +51,17 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) dol_add_file_process($upload_dir, 0, 0, 'userfile'); } -if (preg_match('/set_(.*)/',$action,$reg)) +if ($action == 'updateform') { - $code=$reg[1]; - $value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1); - if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) - { - Header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } -} + $antivircommand = GETPOST('MAIN_ANTIVIRUS_COMMAND','none'); // Use GETPOST none because we must accept ". Example c:\Progra~1\ClamWin\bin\clamscan.exe + $antivirparam = GETPOST('MAIN_ANTIVIRUS_PARAM','none'); // Use GETPOST none because we must accept ". Example --database="C:\Program Files (x86)\ClamWin\lib" + $antivircommand = dol_string_nospecial($antivircommand, '', array("|", ";", "<", ">", "&")); // Sanitize command + $antivirparam = dol_string_nospecial($antivirparam, '', array("|", ";", "<", ">", "&")); // Sanitize params -else if (preg_match('/del_(.*)/',$action,$reg)) -{ - $code=$reg[1]; - if (dolibarr_del_const($db, $code, $conf->entity) > 0) - { - Header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } -} - -else if ($action == 'updateform') -{ $res3=dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',GETPOST('MAIN_UPLOAD_DOC','alpha'),'chaine',0,'',$conf->entity); $res4=dolibarr_set_const($db, "MAIN_UMASK", GETPOST('MAIN_UMASK','alpha'),'chaine',0,'',$conf->entity); - $res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", trim(GETPOST('MAIN_ANTIVIRUS_COMMAND','none')),'chaine',0,'',$conf->entity); // Use GETPOST none because we must accept " - $res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", trim(GETPOST('MAIN_ANTIVIRUS_PARAM','none')),'chaine',0,'',$conf->entity); // Use GETPOST none because we must accept " + $res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", trim($antivircommand),'chaine',0,'',$conf->entity); + $res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", trim($antivirparam),'chaine',0,'',$conf->entity); if ($res3 && $res4 && $res5 && $res6) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } @@ -95,10 +71,10 @@ else if ($action == 'updateform') else if ($action == 'delete') { $langs->load("other"); - $file = $conf->admin->dir_temp . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). + $file = $conf->admin->dir_temp . '/' . GETPOST('urlfile','alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $ret=dol_delete_file($file); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile','alpha')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile','alpha')), null, 'errors'); Header('Location: '.$_SERVER["PHP_SELF"]); exit; } diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index e5c66d9e24b..60d0888ed91 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -43,10 +43,10 @@ $action=GETPOST('action','alpha'); * Actions */ -if (preg_match('/set_(.*)/',$action,$reg)) +if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; - $value=(GETPOST($code) ? GETPOST($code) : 1); + $value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1); if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) { Header("Location: ".$_SERVER["PHP_SELF"]); @@ -58,7 +58,7 @@ if (preg_match('/set_(.*)/',$action,$reg)) } } -else if (preg_match('/del_(.*)/',$action,$reg)) +else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index e434f669f45..bd2e07ef97d 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -31,8 +31,8 @@ global $conf; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin","other")); $error=0; $action = GETPOST('action','aZ09'); @@ -50,7 +50,6 @@ foreach ($dirsyslogs as $reldir) { $handle = opendir($newdir); if (is_resource($handle)) { - $var = true; while (($file = readdir($handle)) !== false) { if (substr($file, 0, 11) == 'mod_syslog_' && substr($file, dol_strlen($file) - 3, 3) == 'php') { diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index eee003b0872..82e8481c2dd 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -140,7 +140,7 @@ $configfilelib=array( 'Limit nb of email sent by page', 'Strict mode is on/off' ); -$var=true; + print ''; print ''; print ''; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index d6e05ed2e72..cef493c95f8 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -66,7 +66,6 @@ else if ($resql) { $num = $db->num_rows($resql); - $var=True; $i=0; while ($i < $num) { @@ -109,7 +108,7 @@ else //$sql = "DESCRIBE ".$table; $sql = "SHOW FULL COLUMNS IN ".$db->escape($table); - + $resql = $db->query($sql); if ($resql) { @@ -129,7 +128,7 @@ else print ""; - + print ''; print ''; $i++; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 6fd623bf1bb..76202c2df2b 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -86,8 +86,8 @@ if (empty($xmlremote)) $xmlremote = 'https://www.dolibarr.org/files/stable/signa // Test if remote test is ok -$enableremotecheck = True; -if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False; +$enableremotecheck = true; +if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=false; $enableremotecheck = true; print ''; diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 55584df6445..1e757b72f63 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -50,7 +50,7 @@ llxHeader(); print load_fiche_titre($langs->trans("PerfDolibarr"),'','title_setup'); -print $langs->trans("YouMayFindPerfAdviceHere",'http://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' ('.$langs->trans("Reload").')
'; +print $langs->trans("YouMayFindPerfAdviceHere",'https://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' ('.$langs->trans("Reload").')
'; // Recupere la version de PHP $phpversion=version_php(); diff --git a/htdocs/admin/ticketsup.php b/htdocs/admin/ticketsup.php index 7a3ddf7826b..9b0cc0e2684 100644 --- a/htdocs/admin/ticketsup.php +++ b/htdocs/admin/ticketsup.php @@ -71,7 +71,7 @@ if ($action == 'updateMask') { if (!empty($notification_email)) { $res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, '', $conf->entity); } else { - $res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_FROM', '000000', 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_FROM', '', 'chaine', 0, '', $conf->entity); } if (!$res > 0) { $error++; @@ -82,7 +82,7 @@ if ($action == 'updateMask') { if (!empty($notification_email_to)) { $res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_TO', $notification_email_to, 'chaine', 0, '', $conf->entity); } else { - $res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_TO', '000000', 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_TO', '', 'chaine', 0, '', $conf->entity); } if (!$res > 0) { $error++; @@ -184,16 +184,22 @@ if ($action == 'setvarother') { $error++; } - $param_show_module_logo = GETPOST('TICKETS_SHOW_MODULE_LOGO', 'alpha'); - $res = dolibarr_set_const($db, 'TICKETS_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity); - if (!$res > 0) { - $error++; + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + $param_show_module_logo = GETPOST('TICKETS_SHOW_MODULE_LOGO', 'alpha'); + $res = dolibarr_set_const($db, 'TICKETS_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + } } - $param_notification_also_main_addressemail = GETPOST('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); - $res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); - if (!$res > 0) { - $error++; + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + $param_notification_also_main_addressemail = GETPOST('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); + $res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + } } $param_limit_view = GETPOST('TICKETS_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha'); @@ -263,7 +269,6 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { - $var = true; while (($file = readdir($handle)) !== false) { if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) { @@ -284,8 +289,7 @@ foreach ($dirmodels as $reldir) { } if ($module->isEnabled()) { - $var = !$var; - print ''; @@ -380,20 +384,23 @@ print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'h print ''; print ''; -// Show logo for module -print ''; -print ''; -print ''; -print ''; +/*if ($conf->global->MAIN_FEATURES_LEVEL >= 2) +{ + // Show logo for module + print ''; + print ''; + print ''; + print ''; +}*/ // Show logo for company print ''; @@ -446,19 +453,22 @@ print ''; print ''; // Also send to main email address -print ''; -print ''; + print ''; + print ''; + print ''; } -print ''; -print ''; -print ''; // Limiter la vue des tickets à ceux assignés à l'utilisateur print ''; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 7b2c8805f55..1c985e23090 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2012 Regis Houssin +/* Copyright (C) 2006-2018 Laurent Destailleur + * Copyright (C) 2006-2018 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,8 +36,8 @@ $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="date"; -if ($page < 0) { $page = 0; } -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +if (empty($page) || $page == -1) { $page = 0; } +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page; if (! $user->admin) diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index 68d56bd2ded..d3253c02514 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -116,8 +116,7 @@ function revcompare($x, $y) */ function create_script_table($list) { - global $sortby,$bc,$langs; - $var=true; + global $sortby,$langs; if (GETPOT('order') == "asc" || GETPOST('order') =="desc") { $order = GETPOST('order'); @@ -173,7 +172,6 @@ function create_script_table($list) } foreach($list as $script) { - $var = ! $var; print ''; print ''; print ''; @@ -194,8 +192,7 @@ function create_script_table($list) */ function create_key_table($list) { - global $bc,$langs; - $var=true; + global $langs; print '
'.$langs->trans("Label").''.$langs->trans("Parameter").'".(isset($link[$row[0]][0])?$link[$row[0]][0]:'')."."; print (isset($link[$row[0]][1])?$link[$row[0]][1]:'')."
' . $module->name . "\n"; + print '
' . $module->name . "\n"; print $module->info(); print '
' . $langs->trans("TicketsShowModuleLogo") . ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKETS_SHOW_MODULE_LOGO'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKETS_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKETS_SHOW_MODULE_LOGO); -} -print ''; -print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help'); -print '
' . $langs->trans("TicketsShowModuleLogo") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKETS_SHOW_MODULE_LOGO'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKETS_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKETS_SHOW_MODULE_LOGO); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help'); + print '
' . $langs->trans("TicketsShowCompanyLogo") . '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS); +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) +{ + print '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help'); + print '
'; -print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help'); -print '
' . $langs->trans("TicketsLimitViewAssignedOnly") . '
'.dol_trunc($script['file'],80,'left').''.dol_print_date($script['mtime'],'dayhour').'
'; print ''; @@ -206,7 +203,6 @@ function create_key_table($list) print ''; foreach($list as $key) { - $var = !$var; print ''; print ''; print ''; @@ -229,54 +225,49 @@ function create_key_table($list) $form=new Form($db); print load_fiche_titre('Dolibarr eAccelerator '.$info['version'].' control panel','','title_setup'); -$var=true; - print '
'; - print '
'.dol_trunc($key['name'],80,'left').''.dol_print_date($key['created'],'dayhour').'
'; print ''; print ''; print ''; -$var = !$var; + print ''; print ''; print ''; print ''; -$var = !$var; + print ''; print ''; print ''; print ''; -$var = !$var; + print ''; print ''; print ''; print ''; -$var = ! $var; + print ''; print ''; print ''; print ''; -$var = ! $var; + print ''; print ''; print ''; print ''; -$var = ! $var; + print ''; print ''; print ''; print ''; -$var = ! $var; + print ''; print ''; print ''; print ''; print '
Information
Caching enabled'.($info['cache']?'yes':'no').'
Optimizer enabled'.$info['optimizer']?'yes':'no'.'
Memory usage'.number_format(100 * $info['memoryAllocated']/$info['memorySize'], 2).'%('.number_format($info['memoryAllocated'] / (1024*1024), 2).'MB / '.number_format($info['memorySize']/(1024*1024), 2).'MB)
Free memory in reserved cache'.number_format($info['memoryAvailable']/(1024*1024), 2).'MB
Cached scripts'.$info['cachedScripts'].'
Removed scripts'.$info['removedScripts'].'
Cached keys'.(isset($info['cachedKeys'])?$info['cachedKeys']:'').'
'; -$var=true; - $resCached = @eaccelerator_cached_scripts(); // If success return an array $resRemoved = @eaccelerator_removed_scripts(); @@ -288,12 +279,11 @@ if (is_array($resCached) || is_array($resRemoved)) { print '
Actions
Caching
Optimizer
Clear cache
Clean cache
Purge cache
'.$trigger['picto'].''.$trigger['file'].''.dol_escape_htmltag($objp->label).''.yn($objp->subscription).''.yn($objp->vote).'rowid.'">'.img_edit().' '; - if ($user->rights->adherent->creer) + if ($user->rights->asset->creer) { print ''.img_edit().''; } print ' '; - if ($user->rights->adherent->supprimer) + if ($user->rights->asset->supprimer) { print ''.img_picto($langs->trans("Resiliate"),'disable.png').''; } @@ -675,7 +682,7 @@ if ($rowid > 0) if ($action == 'edit') { - $object = new AdherentType($db); + $object = new AssetType($db); $object->fetch($rowid); $object->fetch_optionals(); diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 69a9a96f032..8cd5ff979a0 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -28,8 +28,6 @@ * write = system,call,log,verbose,command,agent,user */ -//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'); diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 5e684b4091d..806a88325fb 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -212,7 +212,8 @@ if ($conf->societe->enabled) { $nbno=$nbtotal=0; - print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','object_company'); + print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','title_companies'); + print '
'."\n"; $sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''"; $resql=$db->query($sql); @@ -253,7 +254,7 @@ if ($conf->product->enabled || $conf->product->service) $nbno=$nbtotal=0; - print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','object_product'); + print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','title_products'); print '
'."\n"; $sql ="SELECT count(rowid) as nb, fk_product_type, datec"; diff --git a/htdocs/blockedlog/ajax/authority.php b/htdocs/blockedlog/ajax/authority.php index 929fd8401d5..7bde15aa879 100644 --- a/htdocs/blockedlog/ajax/authority.php +++ b/htdocs/blockedlog/ajax/authority.php @@ -27,10 +27,8 @@ // Directory to scan (full path) is inside POST['dir']. if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); $res=require '../../master.inc.php'; diff --git a/htdocs/blockedlog/ajax/block-add.php b/htdocs/blockedlog/ajax/block-add.php index 24fd71f0514..873b904e7a2 100644 --- a/htdocs/blockedlog/ajax/block-add.php +++ b/htdocs/blockedlog/ajax/block-add.php @@ -27,10 +27,8 @@ // Directory to scan (full path) is inside POST['dir']. if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); $res=require '../../main.inc.php'; diff --git a/htdocs/blockedlog/ajax/block-info.php b/htdocs/blockedlog/ajax/block-info.php index d4d4eef4e07..7a4ebebb2cf 100644 --- a/htdocs/blockedlog/ajax/block-info.php +++ b/htdocs/blockedlog/ajax/block-info.php @@ -27,10 +27,8 @@ // Directory to scan (full path) is inside POST['dir']. if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); require '../../main.inc.php'; diff --git a/htdocs/blockedlog/ajax/check_signature.php b/htdocs/blockedlog/ajax/check_signature.php index 4b50474b4a9..199f9051e07 100644 --- a/htdocs/blockedlog/ajax/check_signature.php +++ b/htdocs/blockedlog/ajax/check_signature.php @@ -27,10 +27,8 @@ // Directory to scan (full path) is inside POST['dir']. if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); require '../../main.inc.php'; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index b1262b7a554..fa46f683e50 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -81,7 +81,13 @@ $userstatic=new User($db); llxHeader('', $langs->trans("ListOfBookmarks")); -$newcardbutton=''.$langs->trans('NewBookmark').''; +$newcardbutton=''; +if ($user->rights->bookmark->creer) +{ + $newcardbutton=''.$langs->trans('NewBookmark'); + $newcardbutton.= ''; + $newcardbutton.= ''; +} print_barre_liste($langs->trans("ListOfBookmarks"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', -1, '', 'title_generic.png', 0, $newcardbutton); @@ -119,12 +125,10 @@ if ($resql) print_liste_field_titre(''); print "
'.img_object($langs->trans("ShowContact"),"contact"); print ' '.$obj->name.''.price($obj->total_ttc).'
'.price($obj->total_ht).'
'.price($obj->total_ttc).'
'.price($obj->total_ttc).'
'.price($obj->total_ht).'
'.price($obj->total_ttc).'
'; print dol_print_date($db->jdate($obj->dp),'day').''.price($obj->total_ttc).''.price($obj->total_ht).''.price($obj->total_ttc).''.$propalstatic->LibStatut($obj->fk_statut,3).'
'; print dol_print_date($db->jdate($obj->dp),'day').''.price($obj->total_ttc).''.price($obj->total_ht).''.price($obj->total_ttc).''.$orderstatic->LibStatut($obj->fk_statut,$obj->billed,3).'
'; @@ -62,7 +61,7 @@ print '
'; print '
'; print ''; - + print "
'; print $langs->trans("Other").':

\n"; //} @@ -74,7 +73,6 @@ print '
'.$langs->trans("TargetsStatistic $dir=DOL_DOCUMENT_ROOT."/core/modules/mailings"; $handle=opendir($dir); -$var=True; if (is_resource($handle)) { while (($file = readdir($handle))!==false) @@ -106,8 +104,6 @@ if (is_resource($handle)) // Si le module mailing est qualifi� if ($qualified) { - $var = !$var; - foreach ($mailmodule->getSqlArrayForStats() as $sql) { print '
'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); + print ajax_combobox('search_type_thirdparty'); print ''; + print ''; //print $langs->trans('Month').': '; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; //print ' '.$langs->trans('Year').': '; $formother->select_year($search_year,'search_year',1, 20, 5); print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
'; break; } - if (! is_array($coll_listbuy) && $coll_listbuy == -2) + if (! is_array($x_paye) && $coll_listbuy == -2) { print ''; break; @@ -227,46 +387,121 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu print ''; - print ''; + print ''; - $x_coll = 0; - foreach($coll_listsell as $vatrate=>$val) + $x_coll_sum = 0; + foreach (array_keys($x_coll) as $rate) { - $x_coll+=$val['vat']; - } - $subtotalcoll = $subtotalcoll + $x_coll; - print ""; + $subtot_coll_total_ht = 0; + $subtot_coll_vat = 0; - $x_paye = 0; - foreach($coll_listbuy as $vatrate=>$val) + foreach ($x_both[$rate]['coll']['detail'] as $index => $fields) + { + // Payment + $ratiopaymentinvoice=1; + if ($modetax != 1) + { + // Define type + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (!empty($fields['ddate_start'])) { + $type=1; + } + if (!empty($fields['ddate_end'])) { + $type=1; + } + + if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') + || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) + { + //print $langs->trans("NA"); + } else { + if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { + $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); + } + } + } + //var_dump('type='.$type.' '.$fields['totalht'].' '.$ratiopaymentinvoice); + $temp_ht=$fields['totalht']*$ratiopaymentinvoice; + $temp_vat=$fields['vat']*$ratiopaymentinvoice; + $subtot_coll_total_ht += $temp_ht; + $subtot_coll_vat += $temp_vat; + $x_coll_sum += $temp_vat; + } + } + print ""; + + $x_paye_sum = 0; + foreach (array_keys($x_paye) as $rate) { - $x_paye+=$val['vat']; - } - $subtotalpaye = $subtotalpaye + $x_paye; - print ""; + $subtot_paye_total_ht = 0; + $subtot_paye_vat = 0; - $diff = $x_coll - $x_paye; + foreach ($x_both[$rate]['paye']['detail'] as $index => $fields) + { + // Payment + $ratiopaymentinvoice=1; + if ($modetax != 1) + { + // Define type + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (!empty($fields['ddate_start'])) { + $type=1; + } + if (!empty($fields['ddate_end'])) { + $type=1; + } + + if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') + || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) + { + //print $langs->trans("NA"); + } else { + if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { + $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); + } + } + } + //var_dump('type='.$type.' '.$fields['totalht'].' '.$ratiopaymentinvoice); + $temp_ht=$fields['totalht']*$ratiopaymentinvoice; + $temp_vat=$fields['vat']*$ratiopaymentinvoice; + $subtot_paye_total_ht += $temp_ht; + $subtot_paye_vat += $temp_vat; + $x_paye_sum += $temp_vat; + } + } + print ""; + + $subtotalcoll = $subtotalcoll + $x_coll_sum; + $subtotalpaye = $subtotalpaye + $x_paye_sum; + + $diff = $x_coll_sum - $x_paye_sum; $total = $total + $diff; - $subtotal = $subtotal + $diff; + $subtotal = price2num($subtotal + $diff, 'MT'); - print "\n"; + print "\n"; print "\n"; print "\n"; - $i++; + $i++; $m++; if ($i > 2) { print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; $i = 0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; } } -print ''; +print ''; print "\n"; print ''; @@ -276,32 +511,44 @@ print '
'; +print ''; } if (! empty($arrayfields['c.date_delivery']['checked'])) { - print ''; } diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index b1baf7332a1..27d177cfbd3 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -354,7 +354,7 @@ print '
'; // Show graphs -print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index cbd505a41b8..c0e494a1684 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -179,7 +179,7 @@ class Orders extends DolibarrApi * @param array $request_data Request data * @return int ID of order */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401, "Insuffisant rights"); @@ -245,7 +245,7 @@ class Orders extends DolibarrApi * * @return int */ - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); } @@ -308,7 +308,7 @@ class Orders extends DolibarrApi * * @return object */ - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); } @@ -402,7 +402,7 @@ class Orders extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if (! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 0c63da5d4c2..a38cc3a442d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -823,7 +823,7 @@ class Commande extends CommonOrder $line = $this->lines[$i]; // Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array - //if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object. + //if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object. if (! is_object($line)) $line = (object) $line; // Reset fk_parent_line for no child products and special product diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 205efc3ad91..2d97b06238b 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -102,6 +102,12 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1, $offset); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 8048d5a618f..872d6f02bfa 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -342,6 +342,12 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1,$offset); @@ -422,7 +428,9 @@ if ($resql) $newcardbutton=''; if ($contextpage == 'orderlist' && $user->rights->commande->creer) { - $newcardbutton=''.$langs->trans('NewOrder').''; + $newcardbutton=''.$langs->trans('NewOrder'); + $newcardbutton.= ''; + $newcardbutton.= ''; } // Lines of title fields @@ -604,17 +612,17 @@ if ($resql) // Date order if (! empty($arrayfields['c.date_commande']['checked'])) { - print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($search_orderyear?$search_orderyear:-1,'search_orderyear',1, 20, 5); print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($search_deliveryyear?$search_deliveryyear:-1,'search_deliveryyear',1, 20, 5); print '
'; print ''; print ''; print ''; print ''; print ''; if (! empty($conf->banque->enabled)) { @@ -252,7 +258,7 @@ if ($resql) print ''; } print ''; print ''; // Ref print ''; print ''; - $var=True; - while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 04ec746d7f6..765e0cf4fa8 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -129,8 +129,6 @@ if ($resql) print ''; print ''; - $var = True; - $users = array(); while ($i < min($num,$limit)) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 64811c7604a..d446e64fe9b 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -170,6 +170,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1,$offset); diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 82431e3bdd2..2fbaaf7fbcb 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -169,6 +169,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 271ce4da7fe..64e1991064d 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -71,7 +71,6 @@ print '
'; $thirdpartystatic=new Societe($db); $invoicestatic=new Facture($db); $bprev = new BonPrelevement($db); -$var=true; print '
'; +print ''; } print ''; print ''; if (GETPOST('action','aZ09') == 'edit' && GETPOST("categid")== $objp->rowid) @@ -136,7 +135,7 @@ if ($result) */ if ($action != 'edit') { - + print ''; print ''; print ''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index c773ef242ad..7228214e51c 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -395,9 +395,10 @@ class Account extends CommonObject * @param string $emetteur Name of cheque writer * @param string $banque Bank of cheque writer * @param string $accountancycode When we record a free bank entry, we must provide accounting account if accountancy module is on. + * @param int $datev Date value * @return int Rowid of added entry, <0 if KO */ - function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur='',$banque='', $accountancycode='') + function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur='',$banque='', $accountancycode='', $datev=null) { // Deprecatîon warning if (is_numeric($oper)) { @@ -447,7 +448,7 @@ class Account extends CommonObject $this->db->begin(); - $datev = $date; + if (is_null($datev) || empty($datev)) $datev = $date; $accline = new AccountLine($this->db); $accline->datec = $now; diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index e3c2a5b94a9..9fc8f5028bb 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -5,6 +5,7 @@ use Stripe\BankAccount; * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -230,7 +231,9 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->banque->configurer) { - $newcardbutton.=''.$langs->trans("NewFinancialAccount").''; + $newcardbutton.=''.$langs->trans("NewFinancialAccount"); + $newcardbutton.= ''; + $newcardbutton.= ''; } @@ -389,7 +392,7 @@ if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titr // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters=array('arrayfields'=>$arrayfields); +$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['b.datec']['checked'])) print_liste_field_titre($arrayfields['b.datec']['label'],$_SERVER["PHP_SELF"],"b.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 6a6557c5aef..5e9f98be02d 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -72,7 +72,7 @@ if ($user->rights->banque->consolidate && $action == 'dvprev' && ! empty($dvid)) } -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -395,7 +395,6 @@ if (empty($numref)) $result = $db->query($sql); if ($result) { - $var=True; $numrows = $db->num_rows($result); $i = 0; @@ -572,7 +571,6 @@ else $result = $db->query($sql); if ($result) { - $var=False; $numrows = $db->num_rows($result); $i = 0; diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php index aa47d714bd9..f92090a0259 100644 --- a/htdocs/compta/bank/various_payment/index.php +++ b/htdocs/compta/bank/various_payment/index.php @@ -38,7 +38,7 @@ $result = restrictedArea($user, 'banque', '', '', ''); $optioncss = GETPOST('optioncss','alpha'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $search_ref = GETPOST('search_ref','int'); $search_user = GETPOST('search_user','alpha'); $search_label = GETPOST('search_label','alpha'); @@ -153,7 +153,13 @@ if ($result) if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - $newcardbutton=''.$langs->trans('MenuNewVariousPayment').''; + $newcardbutton=''; + if ($user->rights->banque->modifier) + { + $newcardbutton=''.$langs->trans('MenuNewVariousPayment'); + $newcardbutton.= ''; + $newcardbutton.= ''; + } print '
'; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 321fad5baf6..7a11a709128 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -48,7 +48,7 @@ if (! $year && $mode != 'sconly') { $year=date("Y", time()); } $search_account = GETPOST('search_account','int'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 2cd3823bacd..64c5442299f 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -45,7 +45,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="d.dated"; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; /* diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 807ddfee700..fad8d93b244 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -46,7 +46,7 @@ $search_company=GETPOST('search_company','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 36bc107d672..d503d5e4c07 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -294,7 +294,7 @@ print '
'; // Show graphs -print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/compta/ajaxpayment.php b/htdocs/compta/ajaxpayment.php index 27a167bc576..01fe12e50f4 100644 --- a/htdocs/compta/ajaxpayment.php +++ b/htdocs/compta/ajaxpayment.php @@ -20,16 +20,11 @@ * \brief File to return Ajax response on payment breakdown process */ -//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) require '../main.inc.php'; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index c583e9180ff..3179a6486e9 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1,12 +1,13 @@ - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012 Vinícius Nogueira * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +92,7 @@ $num_releve=GETPOST("num_releve","alpha"); $cat=GETPOST("cat"); if (empty($dateop)) $dateop=-1; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -427,9 +428,9 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->banque->consolidate) { $newparam = $param; $newparam = preg_replace('/search_conciliated=\d+/i','',$newparam); - $buttonreconcile = ''.$langs->trans("Conciliate").''; + $buttonreconcile = ''.$langs->trans("Conciliate").''; } else { - $buttonreconcile = ''.$langs->trans("Conciliate").''; + $buttonreconcile = ''.$langs->trans("Conciliate").''; } } } @@ -722,7 +723,7 @@ if ($resql) // Title $bankcateg=new BankCateg($db); - $addbutton = ''; + $newcardbutton = ''; if ($action != 'addline' && $action != 'reconcile') { if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) @@ -730,27 +731,37 @@ if ($resql) if (! empty($conf->global->BANK_USE_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments { if ($user->rights->banque->modifier) { - $addbutton = ''.$langs->trans("AddBankRecord").''; + $newcardbutton = ''.$langs->trans("AddBankRecord"); + $newcardbutton.= ''; + $newcardbutton.= ''; } else { - $addbutton = ''.$langs->trans("AddBankRecord").''; + $newcardbutton = ''.$langs->trans("AddBankRecord"); + $newcardbutton.= ''; + $newcardbutton.= ''; } } else // If direct entries is not done using miscellaneous payments { if ($user->rights->banque->modifier) { - $addbutton = ''.$langs->trans("AddBankRecord").''; + $newcardbutton = ''.$langs->trans("AddBankRecord"); + $newcardbutton.= ''; + $newcardbutton.= ''; } else { - $addbutton = ''.$langs->trans("AddBankRecord").''; + $newcardbutton = ''.$langs->trans("AddBankRecord"); + $newcardbutton.= ''; + $newcardbutton.= ''; } } } else { - $addbutton = ''.$langs->trans("AddBankRecord").''; + $newcardbutton = ''.$langs->trans("AddBankRecord"); + $newcardbutton.= ''; + $newcardbutton.= ''; } } - $morehtml='
'; + $morehtml='
'; $morehtml.= ' "; // ' Page '; $morehtml.=''; $morehtml.='/'.$nbtotalofpages.' '; @@ -761,7 +772,7 @@ if ($resql) $morehtml.=$buttonreconcile; } - $morehtml.=$addbutton; + $morehtml.=$newcardbutton; $picto='title_bank'; if ($id > 0 || ! empty($ref)) $picto=''; @@ -901,7 +912,7 @@ if ($resql) if (! empty($arrayfields['b.conciliated']['checked'])) { print '
'; - print $form->selectyesno('search_conciliated', $search_conciliated, 1, False, 1); + print $form->selectyesno('search_conciliated', $search_conciliated, 1, false, 1); print ''; @@ -931,7 +942,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters=array('arrayfields'=>$arrayfields); + $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 83e1f15ef36..fb514120d57 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -101,11 +101,10 @@ if ($result) $num = $db->num_rows($result); $i = 0; $total = 0; - $var=True; while ($i < $num) { $objp = $db->fetch_object($result); - + print '
'.$objp->rowid.'
 
'; print ''; print ""; + print ""; print ''; print ""; print "\n"; @@ -79,7 +82,8 @@ if ($result) $localtax_static->ref=$obj->rowid; print "\n"; print "\n"; - print '\n"; + print '\n"; + print '\n"; $total = $total + $obj->amount; print ""; @@ -87,8 +91,8 @@ if ($result) $i++; } - print ''; - print ""; + print ''; + print ''; print "
'; +print ''; - // Date when + // Date when (next invoice generation) print ''; print ''; diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 0a2b9f72d60..3e077e8a749 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -83,7 +83,7 @@ $search_frequency=GETPOST('search_frequency','alpha'); $search_unit_frequency=GETPOST('search_unit_frequency','alpha'); $search_status=GETPOST('search_status','int'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -273,14 +273,20 @@ else if ($search_year_date_when > 0) $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when,12,false))."'"; } +$sql.= $db->order($sortfield, $sortorder); + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } -$sql.= $db->order($sortfield, $sortorder); $sql.= $db->plimit($limit+1,$offset); $resql = $db->query($sql); @@ -598,13 +604,20 @@ if ($resql) // Date next generation if (! empty($arrayfields['f.date_when']['checked'])) { - print ''; - if (! $i) $totalarray['nbfield']++; + print ''; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['f.datec']['checked'])) { @@ -631,7 +644,11 @@ if ($resql) print ''; break; } - if (! is_array($coll_listbuy) && $coll_listbuy == -2) + if (! is_array($x_paye) && $coll_listbuy == -2) { print ''; break; @@ -240,76 +420,121 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu print ''; - print ''; - - if ($CalcLT==0) { - $x_coll = 0; - foreach($coll_listsell as $vatrate=>$val) { - $x_coll+=$val[$localTaxType==1?'localtax1':'localtax2']; - } - $subtotalcoll = $subtotalcoll + $x_coll; - print ""; + print ''; - $x_paye = 0; - foreach($coll_listbuy as $vatrate=>$val) { - $x_paye+=$val[$localTaxType==1?'localtax1':'localtax2']; - } - $subtotalpaye = $subtotalpaye + $x_paye; - print ""; - } elseif($CalcLT==1) { - $x_paye = 0; - foreach($coll_listbuy as $vatrate=>$val) { - $x_paye+=$val[$localTaxType==1?'localtax1':'localtax2']; + $x_coll_sum = 0; + foreach (array_keys($x_coll) as $rate) + { + $subtot_coll_total_ht = 0; + $subtot_coll_vat = 0; + + foreach ($x_both[$rate]['coll']['detail'] as $index => $fields) + { + // Payment + $ratiopaymentinvoice=1; + if ($modetax != 1) + { + // Define type + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (!empty($fields['ddate_start'])) { + $type=1; + } + if (!empty($fields['ddate_end'])) { + $type=1; + } + + if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') + || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) + { + //print $langs->trans("NA"); + } else { + if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { + $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); + } + } + } + //var_dump('type='.$type.' '.$fields['totalht'].' '.$ratiopaymentinvoice); + $temp_ht=$fields['totalht']*$ratiopaymentinvoice; + $temp_vat=$fields['localtax'.$localTaxType]*$ratiopaymentinvoice; + $subtot_coll_total_ht += $temp_ht; + $subtot_coll_vat += $temp_vat; + $x_coll_sum += $temp_vat; } - $subtotalpaye = $subtotalpaye + $x_paye; - print ""; - } elseif($CalcLT==2) { - $x_coll = 0; - foreach($coll_listsell as $vatrate=>$val) { - $x_coll+=$val[$localTaxType==1?'localtax1':'localtax2']; + } + print ""; + + $x_paye_sum = 0; + foreach (array_keys($x_paye) as $rate) + { + $subtot_paye_total_ht = 0; + $subtot_paye_vat = 0; + + foreach ($x_both[$rate]['paye']['detail'] as $index => $fields) + { + // Payment + $ratiopaymentinvoice=1; + if ($modetax != 1) + { + // Define type + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (!empty($fields['ddate_start'])) { + $type=1; + } + if (!empty($fields['ddate_end'])) { + $type=1; + } + + if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') + || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) + { + //print $langs->trans("NA"); + } else { + if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { + $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); + } + } + } + //var_dump('type='.$type.' '.$fields['totalht'].' '.$ratiopaymentinvoice); + $temp_ht=$fields['totalht']*$ratiopaymentinvoice; + $temp_vat=$fields['localtax'.$localTaxType]*$ratiopaymentinvoice; + $subtot_paye_total_ht += $temp_ht; + $subtot_paye_vat += $temp_vat; + $x_paye_sum += $temp_vat; } - $subtotalcoll = $subtotalcoll + $x_coll; - print ""; - } + print ""; - if($CalcLT==0) { - $diff= $x_coll - $x_paye; - } elseif($CalcLT==1) { - $diff= $x_paye; - } elseif($CalcLT==2) { - $diff= $x_coll; - } + $subtotalcoll = $subtotalcoll + $x_coll_sum; + $subtotalpaye = $subtotalpaye + $x_paye_sum; + $diff = $x_coll_sum - $x_paye_sum; $total = $total + $diff; - $subtotal = $subtotal + $diff; + $subtotal = price2num($subtotal + $diff, 'MT'); - print "\n"; + print "\n"; print "\n"; print "\n"; - $i++; + $i++; $m++; if ($i > 2) { - print ''; - print ''; - if($CalcLT==0) { - print ''; - print ''; - print ''; - } elseif($CalcLT==1) { - print ''; - print ''; - } elseif($CalcLT==2) { - print ''; - print ''; - } - print ''; - $i = 0; - $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $i = 0; + $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; } } -print ''; +print ''; print "\n"; print ''; @@ -318,27 +543,39 @@ print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ec14ec3da14..dbce9c2e76d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -983,15 +983,13 @@ if (empty($reshook)) // Add link between credit note and origin if(! empty($object->fk_facture_source)) { $facture_source->fetch($object->fk_facture_source); - } - $facture_source->fetchObjectLinked(); + $facture_source->fetchObjectLinked(); - if(! empty($facture_source->linkedObjectsIds)) { - $linkedObjectIds = $facture_source->linkedObjectsIds; - $sourcetype = key($linkedObjectIds); - $fk_origin = current($facture_source->linkedObjectsIds[$sourcetype]); - - $object->add_object_linked($sourcetype, $fk_origin); + if(! empty($facture_source->linkedObjectsIds)) { + foreach($facture_source->linkedObjectsIds as $sourcetype => $TIds) { + $object->add_object_linked($sourcetype, current($TIds)); + } + } } } } diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index a114829d43c..8547be8cb2c 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -196,7 +196,7 @@ class Invoices extends DolibarrApi * @param array $request_data Request datas * @return int ID of invoice */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401, "Insuffisant rights"); @@ -313,7 +313,7 @@ class Invoices extends DolibarrApi * @throws 401 * @throws 404 */ - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); } @@ -414,7 +414,7 @@ class Invoices extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -499,7 +499,7 @@ class Invoices extends DolibarrApi * @throws 404 * @throws 400 */ - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); } @@ -562,6 +562,59 @@ class Invoices extends DolibarrApi return $updateRes; } + /** + * Adds a contact to an invoice + * + * @param int $id Order ID + * @param int $fk_socpeople Id of thirdparty contact (if source = 'external') or id of user (if souce = 'internal') to link + * @param string $type_contact Type of contact (code). Must a code found into table llx_c_type_contact. For example: BILLING + * @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) + * @param int $notrigger Disable all triggers + * + * @url POST {id}/contacts + * + * @return array + * + * @throws 200 + * @throws 304 + * @throws 401 + * @throws 404 + * @throws 500 + * + */ + function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger=0) + { + if(! DolibarrApiAccess::$user->rights->facture->creer) { + throw new RestException(401); + } + $result = $this->invoice->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Invoice not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $result = $this->invoice->add_contact($fk_socpeople,$type_contact,$source,$notrigger); + if ($result < 0) { + throw new RestException(500, 'Error : '.$this->invoice->error); + } + + $result = $this->invoice->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Invoice not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + return $this->_cleanObjectDatas($this->invoice); + } + + + /** * Sets an invoice as draft * @@ -899,14 +952,13 @@ class Invoices extends DolibarrApi return $result; } - /** - * Add payment line to a specific invoice - * - * The model schema is defined by the PaymentData class. + + /** + * Add payment line to a specific invoice with the remain to pay as amount. * * @param int $id Id of invoice - * @param string $datepaye {@from body} Payment date {@type timestamp} - * @param int $paiementid {@from body} Payment mode Id {@min 1} + * @param string $datepaye {@from body} Payment date {@type timestamp} + * @param int $paiementid {@from body} Payment mode Id {@min 1} * @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no} * @param int $accountid {@from body} Account Id {@min 1} * @param string $num_paiement {@from body} Payment number (optional) @@ -922,63 +974,194 @@ class Invoices extends DolibarrApi * @throws 404 */ function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='') { + global $conf; + + require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; + + if(! DolibarrApiAccess::$user->rights->facture->creer) { + throw new RestException(403); + } + if(empty($id)) { + throw new RestException(400, 'Invoice ID is mandatory'); + } + + if( ! DolibarrApi::_checkAccessToResource('facture',$id)) { + throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + if (! empty($conf->banque->enabled)) { + if(empty($accountid)) { + throw new RestException(400, 'Account ID is mandatory'); + } + } + + if(empty($paiementid)) { + throw new RestException(400, 'Paiement ID or Paiement Code is mandatory'); + } + + + $result = $this->invoice->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Invoice not found'); + } + + // Calculate amount to pay + $totalpaye = $this->invoice->getSommePaiement(); + $totalcreditnotes = $this->invoice->getSumCreditNotesUsed(); + $totaldeposits = $this->invoice->getSumDepositsUsed(); + $resteapayer = price2num($this->invoice->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + + $this->db->begin(); + + $amounts = array(); + $multicurrency_amounts = array(); + + // Clean parameters amount if payment is for a credit note + if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) { + $resteapayer = price2num($resteapayer,'MT'); + $amounts[$id] = -$resteapayer; + // Multicurrency + $newvalue = price2num($this->invoice->multicurrency_total_ttc,'MT'); + $multicurrency_amounts[$id] = -$newvalue; + } else { + $resteapayer = price2num($resteapayer,'MT'); + $amounts[$id] = $resteapayer; + // Multicurrency + $newvalue = price2num($this->invoice->multicurrency_total_ttc,'MT'); + $multicurrency_amounts[$id] = $newvalue; + } + + + // Creation of payment line + $paiement = new Paiement($this->db); + $paiement->datepaye = $datepaye; + $paiement->amounts = $amounts; // Array with all payments dispatching with invoice id + $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching + $paiement->paiementid = $paiementid; + $paiement->paiementcode = dol_getIdFromCode($this->db,$paiementid,'c_paiement','id','code',1); + $paiement->num_paiement = $num_paiement; + $paiement->note = $comment; + + $paiement_id = $paiement->create(DolibarrApiAccess::$user, ($closepaidinvoices=='yes'?1:0)); // This include closing invoices + if ($paiement_id < 0) + { + $this->db->rollback(); + throw new RestException(400, 'Payment error : '.$paiement->error); + } + + if (! empty($conf->banque->enabled)) { + $label='(CustomerInvoicePayment)'; + + if($paiement->paiementcode == 'CHQ' && empty($chqemetteur)) { + throw new RestException(400, 'Emetteur is mandatory when payment code is '.$paiement->paiementcode); + } + if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) $label='(CustomerInvoicePaymentBack)'; // Refund of a credit note + $result=$paiement->addPaymentToBank(DolibarrApiAccess::$user,'payment',$label,$accountid,$chqemetteur,$chqbank); + if ($result < 0) + { + $this->db->rollback(); + throw new RestException(400, 'Add payment to bank error : '.$paiement->error); + } + } + + $this->db->commit(); + + return $paiement_id; + } + + /** + * Add a payment to pay partially or completely one or several invoices. + * Warning: Take care that all invoices are owned by the same customer. + * Example of value for parameter arrayofamounts: {"1": "99.99", "2": "10"} + * + * @param string $arrayofamounts {@from body} Array with id of invoices with amount to pay for each invoice + * @param string $datepaye {@from body} Payment date {@type timestamp} + * @param int $paiementid {@from body} Payment mode Id {@min 1} + * @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no} + * @param int $accountid {@from body} Account Id {@min 1} + * @param string $num_paiement {@from body} Payment number (optional) + * @param string $comment {@from body} Note (optional) + * @param string $chqemetteur {@from body} Payment issuer (mandatory if paiementcode = 'CHQ') + * @param string $chqbank {@from body} Issuer bank name (optional) + * + * @url POST /paymentsdistributed + * + * @return int Payment ID + * @throws 400 + * @throws 401 + * @throws 403 + * @throws 404 + */ + function addPaymentDistributed($arrayofamounts, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='') + { global $conf; require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; if(! DolibarrApiAccess::$user->rights->facture->creer) { - throw new RestException(401); + throw new RestException(403); } - if(empty($id)) { - throw new RestException(400, 'Invoice ID is mandatory'); - } - - if( ! DolibarrApi::_checkAccessToResource('facture',$id)) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + foreach($arrayofamounts as $id => $amount) { + if(empty($id)) { + throw new RestException(400, 'Invoice ID is mandatory. Fill the invoice id and amount into arrayofamounts parameter. For example: {"1": "99.99", "2": "10"}'); + } + if( ! DolibarrApi::_checkAccessToResource('facture',$id)) { + throw new RestException(403, 'Access not allowed on invoice ID '.$id.' for login '.DolibarrApiAccess::$user->login); + } } if (! empty($conf->banque->enabled)) { - if(empty($accountid)) { - throw new RestException(400, 'Account ID is mandatory'); - } + if(empty($accountid)) { + throw new RestException(400, 'Account ID is mandatory'); + } } - if(empty($paiementid)) { - throw new RestException(400, 'Paiement ID or Paiement Code is mandatory'); + throw new RestException(400, 'Paiement ID or Paiement Code is mandatory'); } - - $result = $this->invoice->fetch($id); - if( ! $result ) { - throw new RestException(404, 'Invoice not found'); - } - - // Calculate amount to pay - $totalpaye = $this->invoice->getSommePaiement(); - $totalcreditnotes = $this->invoice->getSumCreditNotesUsed(); - $totaldeposits = $this->invoice->getSumDepositsUsed(); - $resteapayer = price2num($this->invoice->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); - $this->db->begin(); $amounts = array(); $multicurrency_amounts = array(); - // Clean parameters amount if payment is for a credit note - if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) { - $resteapayer = price2num($resteapayer,'MT'); - $amounts[$id] = -$resteapayer; - // Multicurrency - $newvalue = price2num($this->invoice->multicurrency_total_ttc,'MT'); - $multicurrency_amounts[$id] = -$newvalue; - } else { - $resteapayer = price2num($resteapayer,'MT'); - $amounts[$id] = $resteapayer; - // Multicurrency - $newvalue = price2num($this->invoice->multicurrency_total_ttc,'MT'); - $multicurrency_amounts[$id] = $newvalue; - } + // Loop on each invoice to pay + foreach($arrayofamounts as $id => $amount) + { + $result = $this->invoice->fetch($id); + if( ! $result ) { + $this->db->rollback(); + throw new RestException(404, 'Invoice ID '.$id.' not found'); + } + // Calculate amount to pay + $totalpaye = $this->invoice->getSommePaiement(); + $totalcreditnotes = $this->invoice->getSumCreditNotesUsed(); + $totaldeposits = $this->invoice->getSumDepositsUsed(); + $resteapayer = price2num($this->invoice->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + if ($amount != 'remain') + { + if ($amount > $resteapayer) + { + $this->db->rollback(); + throw new RestException(400, 'Payment amount on invoice ID '.$id.' ('.$amount.') is higher than remain to pay ('.$resteapayer.')'); + } + $resteapayer = $amount; + } + // Clean parameters amount if payment is for a credit note + if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) { + $resteapayer = price2num($resteapayer,'MT'); + $amounts[$id] = -$resteapayer; + // Multicurrency + $newvalue = price2num($this->invoice->multicurrency_total_ttc,'MT'); + $multicurrency_amounts[$id] = -$newvalue; + } else { + $resteapayer = price2num($resteapayer,'MT'); + $amounts[$id] = $resteapayer; + // Multicurrency + $newvalue = price2num($this->invoice->multicurrency_total_ttc,'MT'); + $multicurrency_amounts[$id] = $newvalue; + } + } // Creation of payment line $paiement = new Paiement($this->db); @@ -989,17 +1172,14 @@ class Invoices extends DolibarrApi $paiement->paiementcode = dol_getIdFromCode($this->db,$paiementid,'c_paiement','id','code',1); $paiement->num_paiement = $num_paiement; $paiement->note = $comment; - $paiement_id = $paiement->create(DolibarrApiAccess::$user, ($closepaidinvoices=='yes'?1:0)); // This include closing invoices if ($paiement_id < 0) { $this->db->rollback(); throw new RestException(400, 'Payment error : '.$paiement->error); } - if (! empty($conf->banque->enabled)) { $label='(CustomerInvoicePayment)'; - if($paiement->paiementcode == 'CHQ' && empty($chqemetteur)) { throw new RestException(400, 'Emetteur is mandatory when payment code is '.$paiement->paiementcode); } @@ -1011,7 +1191,9 @@ class Invoices extends DolibarrApi throw new RestException(400, 'Add payment to bank error : '.$paiement->error); } } + $this->db->commit(); + return $paiement_id; } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index aebce8e4b07..e52658d38e8 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -108,7 +108,7 @@ class FactureRec extends CommonInvoice if (empty($this->frequency)) { $this->frequency=0; - $this->date_when=NULL; + $this->date_when=null; } @@ -475,7 +475,6 @@ class FactureRec extends CommonInvoice $line->id = $objp->rowid; $line->rowid = $objp->rowid; - $line->label = $objp->custom_label; // Label line $line->desc = $objp->description; // Description line $line->description = $objp->description; // Description line $line->product_type = $objp->product_type; // Type of line @@ -488,6 +487,8 @@ class FactureRec extends CommonInvoice $line->qty = $objp->qty; $line->subprice = $objp->subprice; + $line->label = $objp->custom_label; // @deprecated + $line->vat_src_code = $objp->vat_src_code; $line->tva_tx = $objp->tva_tx; $line->localtax1_tx = $objp->localtax1_tx; @@ -992,6 +993,7 @@ class FactureRec extends CommonInvoice $sql.= " AND (date_when IS NULL OR date_when <= '".$db->idate($today)."')"; $sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)'; $sql.= ' AND suspended = 0'; + $sql.= ' AND entity = '.$conf->entity; // MUST STAY = $conf->entity here $sql.= $db->order('entity', 'ASC'); //print $sql;exit; @@ -1006,7 +1008,7 @@ class FactureRec extends CommonInvoice $saventity = $conf->entity; - while ($i < $num) // Loop on each template invoice + while ($i < $num) // Loop on each template invoice. If $num = 0, test is false at first pass. { $line = $db->fetch_object($resql); @@ -1015,49 +1017,59 @@ class FactureRec extends CommonInvoice $facturerec = new FactureRec($db); $facturerec->fetch($line->rowid); - // Set entity context - $conf->entity = $facturerec->entity; + if ($facturerec->id > 0) + { + // Set entity context + $conf->entity = $facturerec->entity; - dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity); + dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity); - $error=0; + $error=0; - $facture = new Facture($db); - $facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice - $facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice + $facture = new Facture($db); + $facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice + $facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice - $facture->type = self::TYPE_STANDARD; - $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->type = self::TYPE_STANDARD; + $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; - $invoiceidgenerated = $facture->create($user); - if ($invoiceidgenerated <= 0) - { - $this->errors = $facture->errors; - $this->error = $facture->error; - $error++; - } - if (! $error && $facturerec->auto_validate) - { - $result = $facture->validate($user); - if ($result <= 0) - { - $this->errors = $facture->errors; - $this->error = $facture->error; - $error++; - } - } - if (! $error && $facturerec->generate_pdf) - { - $result = $facture->generateDocument($facturerec->modelpdf, $langs); - if ($result <= 0) - { - $this->errors = $facture->errors; - $this->error = $facture->error; - $error++; - } - } + $invoiceidgenerated = $facture->create($user); + if ($invoiceidgenerated <= 0) + { + $this->errors = $facture->errors; + $this->error = $facture->error; + $error++; + } + if (! $error && $facturerec->auto_validate) + { + $result = $facture->validate($user); + if ($result <= 0) + { + $this->errors = $facture->errors; + $this->error = $facture->error; + $error++; + } + } + if (! $error && $facturerec->generate_pdf) + { + $result = $facture->generateDocument($facturerec->modelpdf, $langs); + if ($result <= 0) + { + $this->errors = $facture->errors; + $this->error = $facture->error; + $error++; + } + } + } + else + { + $error++; + $this->error="Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n"; + $this->errors[]="Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity; + dol_syslog("createRecurringInvoices Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity); + } if (! $error && $invoiceidgenerated >= 0) { @@ -1503,7 +1515,7 @@ class FactureRec extends CommonInvoice } /** - * Update the auto validate invoice + * Update the auto validate flag of invoice * * @param int $validate 0 to create in draft, 1 to create and validate invoice * @return int <0 if KO, >0 if OK diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 343bbbe6414..84461ab0493 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -613,7 +613,7 @@ class Facture extends CommonInvoice $line = $this->lines[$i]; // Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array - //if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object. + //if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object. if (! is_object($line)) $line = (object) $line; if ($result >= 0) @@ -1984,6 +1984,7 @@ class Facture extends CommonInvoice $this->db->begin(); dol_syslog(get_class($this)."::set_paid rowid=".$this->id, LOG_DEBUG); + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; $sql.= ' fk_statut='.self::STATUS_CLOSED; if (! $close_code) $sql.= ', paye=1'; @@ -1991,7 +1992,6 @@ class Facture extends CommonInvoice if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::set_paid", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -2363,7 +2363,7 @@ class Facture extends CommonInvoice if (!empty($conf->global->INVOICE_USE_SITUATION)) { - $final = True; + $final = true; $nboflines = count($this->lines); while (($i < $nboflines) && $final) { $final = ($this->lines[$i]->situation_percent == 100); @@ -2565,6 +2565,7 @@ class Facture extends CommonInvoice // Deprecation warning if ($label) { dol_syslog(__METHOD__ . ": using line label is deprecated", LOG_WARNING); + //var_dump(debug_backtrace(false));exit; } global $mysoc, $conf, $langs; @@ -2730,14 +2731,15 @@ class Facture extends CommonInvoice // Mise a jour informations denormalisees au niveau de la facture meme $result=$this->update_price(1,'auto',0,$mysoc); // The addline method is designed to add line from user input so total calculation with update_price must be done using 'auto' mode. + if ($result > 0) { $this->db->commit(); - return $this->line->rowid; + return $this->line->id; } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); $this->db->rollback(); return -1; } @@ -4482,11 +4484,11 @@ class FactureLigne extends CommonInvoiceLine $resql=$this->db->query($sql); if ($resql) { - $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet'); + $this->id=$this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet'); + $this->rowid=$this->id; // For backward compatibility if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; $result=$this->insertExtraFields(); if ($result < 0) { @@ -4558,12 +4560,12 @@ class FactureLigne extends CommonInvoiceLine } $this->db->commit(); - return $this->rowid; + return $this->id; } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); $this->db->rollback(); return -2; } diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 33132620662..1fc7fa1fb96 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -69,7 +69,7 @@ $projectid = GETPOST('projectid','int'); $year_date_when=GETPOST('year_date_when'); $month_date_when=GETPOST('month_date_when'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -1497,7 +1497,7 @@ else } print '
'; if ($action == 'date_when' || $object->frequency > 0) { @@ -1513,7 +1513,14 @@ else print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); } //var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour')); - if ($action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late")); + if (! $object->isMaxNbGenReached()) + { + if ($action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late")); + } + else + { + print img_info($langs->trans("MaxNumberOfGenerationReached")); + } print '
'; - print '
'; - print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'':'') : ''.$langs->trans('NA').''); - if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late")); - print '
'; - print '
'; + print '
'; + print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'':'') : ''.$langs->trans('NA').''); + if (! $invoicerectmp->isMaxNbGenReached()) + { + if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late")); + } + else + { + print img_info($langs->trans("MaxNumberOfGenerationReached")); + } + print '
'; + print '
'; if ($user->rights->facture->creer && empty($invoicerectmp->suspended)) { - if (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) + if ($invoicerectmp->isMaxNbGenReached()) + { + print $langs->trans("MaxNumberOfGenerationReached"); + } + elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) { print ''; print $langs->trans("CreateBill").''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8845d0bc8d7..61383941c10 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -103,7 +103,7 @@ if ($option == 'late') { } $filtre = GETPOST('filtre','alpha'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -515,6 +515,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1,$offset); @@ -535,8 +540,8 @@ if ($resql) } $param='&socid='.$socid; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($sall) $param.='&sall='.urlencode($sall); if ($search_day) $param.='&search_day='.urlencode($search_day); if ($search_month) $param.='&search_month='.urlencode($search_month); @@ -592,7 +597,9 @@ if ($resql) $newcardbutton=''; if($user->rights->facture->creer) { - $newcardbutton=''.$langs->trans('NewBill').''; + $newcardbutton=''.$langs->trans('NewBill'); + $newcardbutton.= ''; + $newcardbutton.= ''; } $i = 0; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index d85255fbf4e..2f2692055e9 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -331,7 +331,7 @@ print '
'; // Show graphs -print '"; print "\n"; - $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell'); + $coll_list = tax_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell'); $action = "tvaclient"; $object = &$coll_list; @@ -247,7 +248,7 @@ if($calc ==0 || $calc == 1){ $company_static=new Societe($db); - $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy'); + $coll_list = tax_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy'); $parameters["direction"] = 'buy'; $parameters["type"] = 'localtax'.$local; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 39d8a1dfa6a..4e825469b14 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin")); @@ -44,13 +45,12 @@ if (empty($year)) } $date_start=dol_mktime(0,0,0,GETPOST("date_startmonth"),GETPOST("date_startday"),GETPOST("date_startyear")); $date_end=dol_mktime(23,59,59,GETPOST("date_endmonth"),GETPOST("date_endday"),GETPOST("date_endyear")); -// Quarter if (empty($date_start) || empty($date_end)) // We define date_start and date_end { - $q=GETPOST("q"); + $q=GETPOST("q","int"); if (empty($q)) { - if (GETPOST("month")) { $date_start=dol_get_first_day($year_start,GETPOST("month"),false); $date_end=dol_get_last_day($year_start,GETPOST("month"),false); } + if (GETPOST("month","int")) { $date_start=dol_get_first_day($year_start,GETPOST("month","int"),false); $date_end=dol_get_last_day($year_start,GETPOST("month","int"),false); } else { $date_start=dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START,false); @@ -81,10 +81,10 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); /** * print function * - * @param DoliDB $db Database handler - * @param string $sql SQL Request - * @param string $date Date - * @return void + * @param DoliDB $db Database handler + * @param string $sql SQL Request + * @param string $date Date + * @return void */ function pt ($db, $sql, $date) { @@ -96,25 +96,78 @@ function pt ($db, $sql, $date) $i = 0; $total = 0; print '
'; +print ''; - print ''; @@ -218,47 +221,48 @@ if ($action == 'create') } -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - +// View mode if ($id) { $h = 0; - $head[$h][0] = DOL_URL_ROOT.'/compta/localtax/card.php?id='.$vatpayment->id; + $head[$h][0] = DOL_URL_ROOT.'/compta/localtax/card.php?id='.$object->id; $head[$h][1] = $langs->trans('Card'); $head[$h][2] = 'card'; $h++; - dol_fiche_head($head, 'card', $langs->trans("VATPayment"), 0, 'payment'); + dol_fiche_head($head, 'card', $langs->transcountry("LT".$object->ltt, $mysoc->country_code), -1, 'payment'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); + + print '
'; + print '
'; print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index ad409145478..438427fa491 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -25,6 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; $langs->load("compta"); $langs->load("banks"); @@ -38,11 +39,11 @@ if (empty($refund)) $refund=0; $lttype=GETPOST('localTaxType', 'int'); // Security check -$socid = isset($_GET["socid"])?$_GET["socid"]:''; +$socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); -$localtax = new Localtax($db); +$object = new Localtax($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('localtaxvatcard','globalcard')); @@ -52,8 +53,8 @@ $hookmanager->initHooks(array('localtaxvatcard','globalcard')); * Actions */ -//add payment of localtax -if($_POST["cancel"] == $langs->trans("Cancel")){ +if ($_POST["cancel"] == $langs->trans("Cancel") && ! $id) +{ header("Location: list.php?localTaxType=".$lttype); exit; } @@ -66,15 +67,15 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]); $datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]); - $localtax->accountid=GETPOST("accountid"); - $localtax->paymenttype=GETPOST("paiementtype"); - $localtax->datev=$datev; - $localtax->datep=$datep; - $localtax->amount=price2num(GETPOST("amount")); - $localtax->label=GETPOST("label"); - $localtax->ltt=$lttype; + $object->accountid=GETPOST("accountid"); + $object->paymenttype=GETPOST("paiementtype"); + $object->datev=$datev; + $object->datep=$datep; + $object->amount=price2num(GETPOST("amount")); + $object->label=GETPOST("label"); + $object->ltt=$lttype; - $ret=$localtax->addPayment($user); + $ret=$object->addPayment($user); if ($ret > 0) { $db->commit(); @@ -84,7 +85,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) else { $db->rollback(); - setEventMessages($localtax->error, $localtax->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $_GET["action"]="create"; } } @@ -92,39 +93,39 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) //delete payment of localtax if ($action == 'delete') { - $result=$localtax->fetch($id); + $result=$object->fetch($id); - if ($localtax->rappro == 0) + if ($object->rappro == 0) { $db->begin(); - $ret=$localtax->delete($user); + $ret=$object->delete($user); if ($ret > 0) { - if ($localtax->fk_bank) + if ($object->fk_bank) { $accountline=new AccountLine($db); - $result=$accountline->fetch($localtax->fk_bank); + $result=$accountline->fetch($object->fk_bank); if ($result > 0) $result=$accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) } if ($result >= 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT.'/compta/localtax/list.php?localTaxType='.$localtax->ltt); + header("Location: ".DOL_URL_ROOT.'/compta/localtax/list.php?localTaxType='.$object->ltt); exit; } else { - $localtax->error=$accountline->error; + $object->error=$accountline->error; $db->rollback(); - setEventMessages($localtax->error, $localtax->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else { $db->rollback(); - setEventMessages($localtax->error, $localtax->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else @@ -136,17 +137,12 @@ if ($action == 'delete') /* -* View -*/ - -llxHeader(); - -$form = new Form($db); + * View + */ if ($id) { - $vatpayment = new Localtax($db); - $result = $vatpayment->fetch($id); + $result = $object->fetch($id); if ($result <= 0) { dol_print_error($db); @@ -154,6 +150,13 @@ if ($id) } } +$form = new Form($db); + +$title=$langs->trans("LT".$object->ltt) . " - " . $langs->trans("Card"); +$help_url=''; +llxHeader("",$title,$helpurl); + + if ($action == 'create') { @@ -173,7 +176,7 @@ if ($action == 'create') print $form->select_date($datep,"datep",'','','','add',1,1); print '
'.$langs->trans("DateValue").''; + print '
'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; print $form->select_date($datev,"datev",'','','','add',1,1); print '
'; print ""; - print ''; print ""; print ''; - print ''; - print ''; + print ''; if (! empty($conf->banque->enabled)) { - if ($vatpayment->fk_account > 0) + if ($object->fk_account > 0) { $bankline=new AccountLine($db); - $bankline->fetch($vatpayment->fk_bank); + $bankline->fetch($object->fk_bank); print ''; print ''; @@ -271,22 +275,28 @@ if ($id) // Other attributes $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$vatpayment,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'.$langs->trans("Ref").''; - print $vatpayment->ref; + print ''.$langs->trans("Ref").''; + print $object->ref; print '
'.$langs->trans("DatePayment").''; - print dol_print_date($vatpayment->datep,'day'); + print dol_print_date($object->datep,'day'); print '
'.$langs->trans("DateValue").''; - print dol_print_date($vatpayment->datev,'day'); + print '
'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; + print dol_print_date($object->datev,'day'); print '
'.$langs->trans("Amount").''.price($vatpayment->amount).'
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans('BankTransactionLine').'
'; - dol_fiche_end(); + print ''; + + dol_fiche_end(); /* - * Boutons d'actions - */ + * Action buttons + */ print "
\n"; - if ($vatpayment->rappro == 0) - print ''.$langs->trans("Delete").''; + if ($object->rappro == 0) + { + print ''.$langs->trans("Delete").''; + } else + { print ''.$langs->trans("Delete").''; + } print "
"; } diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 79a88d11c4d..a75de537724 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -29,7 +29,11 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Localtax extends CommonObject { - var $ltt; + public $element='localtax'; //!< Id that identify managed objects + public $table_element='localtax'; //!< Name of table without prefix where object is stored + public $picto='payment'; + + var $ltt; var $tms; var $datep; var $datev; @@ -607,4 +611,29 @@ class Localtax extends CommonObject return $result; } + /** + * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Libelle + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->statut,$mode); + } + + /** + * Renvoi le libelle d'un statut donne + * + * @param int $status Statut + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Libelle du statut + */ + function LibStatut($status,$mode=0) + { + global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage + + return ''; + } + } diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 3dc3e2777c2..3c8a2a9aef6 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -26,6 +26,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin")); @@ -163,7 +164,7 @@ if($calc ==0 || $calc == 2) print "
".$vatcust."
'; + print ''; - print ''; - print ''; - print ''."\n"; + print ''; + print ''; + print ''; print "\n"; + $amountclaimed = 0; + $amountpaid = 0; + $previousmode = ''; while ($i < $num) { $obj = $db->fetch_object($result); - print ''; - print '\n"; - $total = $total + $obj->mm; + if ($obj->mode == 'claimed' && ! empty($previousmode)) + { + print ''; + print '\n"; + print '\n"; + print '\n"; + print "\n"; - print '\n"; - print "\n"; + $amountclaimed = 0; + $amountpaid = 0; + } + + if ($obj->mode == 'claimed') + { + $amountclaimed = $obj->mm; + $totalclaimed = $totalclaimed + $amountclaimed; + } + if ($obj->mode == 'paid') + { + $amountpaid = $obj->mm; + $totalpaid = $totalpaid + $amountpaied; + } + + if ($obj->mode == 'paid') + { + print ''; + print '\n"; + print '\n"; + print '\n"; + print "\n"; + $amountclaimed = 0; + $amountpaid = 0; + $previousmode = ''; + } + else + { + $previousmode = $obj->mode; + } $i++; } - print '"; + + if ($obj->mode == 'claimed' && ! empty($previousmode)) + { + print ''; + print '\n"; + print '\n"; + print '\n"; + print "\n"; + + $amountclaimed = 0; + $amountpaid = 0; + } + + print ''; + print ''; + print ''; + print ''; + print ""; print "
'.$date.''.$langs->trans("Amount").' '.$date.''.$langs->trans("ClaimedForThisPeriod").''.$langs->trans("PaidDuringThisPeriod").'
'.$obj->dm."
'.$obj->dm."'.price($amountclaimed)."'.price($amountpaid)."
'.price($obj->mm)." 
'.$obj->dm."'.price($amountclaimed)."'.price($amountpaid)."
'.$langs->trans("Total")." :".price($total)." 
'.$obj->dm."'.price($amountclaimed)."'.price($amountpaid)."
'.$langs->trans("Total").''.price($totalclaimed).''.price($totalpaid).'
"; $db->free($result); @@ -149,11 +202,12 @@ if($localTaxType==1) { $CalcLT= $conf->global->MAIN_INFO_LOCALTAX_CALC2; } -$description = ''; +$fsearch.=' '; +$description = $fsearch; // Show report header $name = $langs->trans("ReportByMonth"); -$description = $langs->trans($LT); +$description .= $langs->trans($LT); $calcmode = $langs->trans("LTReportBuildWithOptionDefinedInModule").' '; $calcmode.= '('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')
'; @@ -173,6 +227,7 @@ llxHeader('', $name); report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); //report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode); + print '
'; print '
'; @@ -207,16 +262,141 @@ $total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; $i=0; $mcursor=0; while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop { - $m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12); + //$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12); if ($m == 13) $y++; if ($m > 12) $m -= 12; $mcursor++; - $coll_listsell = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'sell', $m); - $coll_listbuy = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'buy', $m); + // Get array with details of each line + $x_coll = tax_by_rate(($localTaxType==1?'localtax1':'localtax2'), $db, $y, 0, 0, 0, $modetax, 'sell', $m); + $x_paye = tax_by_rate(($localTaxType==1?'localtax1':'localtax2'), $db, $y, 0, 0, 0, $modetax, 'buy', $m); + + $x_both = array(); + //now, from these two arrays, get another array with one rate per line + foreach(array_keys($x_coll) as $my_coll_rate) + { + $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht']; + $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat']; + $x_both[$my_coll_rate]['coll']['localtax1'] = $x_coll[$my_coll_rate]['localtax1']; + $x_both[$my_coll_rate]['coll']['localtax2'] = $x_coll[$my_coll_rate]['localtax2']; + $x_both[$my_coll_rate]['paye']['totalht'] = 0; + $x_both[$my_coll_rate]['paye']['vat'] = 0; + $x_both[$my_coll_rate]['paye']['localtax1'] = 0; + $x_both[$my_coll_rate]['paye']['localtax2'] = 0; + $x_both[$my_coll_rate]['coll']['links'] = ''; + $x_both[$my_coll_rate]['coll']['detail'] = array(); + foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy) { + //$invoice_customer->id=$x_coll[$my_coll_rate]['facid'][$id]; + //$invoice_customer->ref=$x_coll[$my_coll_rate]['facnum'][$id]; + //$invoice_customer->type=$x_coll[$my_coll_rate]['type'][$id]; + //$company_static->fetch($x_coll[$my_coll_rate]['company_id'][$id]); + $x_both[$my_coll_rate]['coll']['detail'][] = array( + 'id' =>$x_coll[$my_coll_rate]['facid'][$id], + 'descr' =>$x_coll[$my_coll_rate]['descr'][$id], + 'pid' =>$x_coll[$my_coll_rate]['pid'][$id], + 'pref' =>$x_coll[$my_coll_rate]['pref'][$id], + 'ptype' =>$x_coll[$my_coll_rate]['ptype'][$id], + 'payment_id'=>$x_coll[$my_coll_rate]['payment_id'][$id], + 'payment_amount'=>$x_coll[$my_coll_rate]['payment_amount'][$id], + 'ftotal_ttc'=>$x_coll[$my_coll_rate]['ftotal_ttc'][$id], + 'dtotal_ttc'=>$x_coll[$my_coll_rate]['dtotal_ttc'][$id], + 'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id], + 'datef' =>$x_coll[$my_coll_rate]['datef'][$id], + 'datep' =>$x_coll[$my_coll_rate]['datep'][$id], + //'company_link'=>$company_static->getNomUrl(1,'',20), + 'ddate_start'=>$x_coll[$my_coll_rate]['ddate_start'][$id], + 'ddate_end' =>$x_coll[$my_coll_rate]['ddate_end'][$id], + + 'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id], + 'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id], + 'localtax1' =>$x_coll[$my_coll_rate]['localtax1_list'][$id], + 'localtax2' =>$x_coll[$my_coll_rate]['localtax2_list'][$id], + //'link' =>$invoice_customer->getNomUrl(1,'',12) + ); + } + } + + // tva paid + foreach (array_keys($x_paye) as $my_paye_rate) { + $x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht']; + $x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat']; + $x_both[$my_paye_rate]['paye']['localtax1'] = $x_paye[$my_paye_rate]['localtax1']; + $x_both[$my_paye_rate]['paye']['localtax2'] = $x_paye[$my_paye_rate]['localtax2']; + if (!isset($x_both[$my_paye_rate]['coll']['totalht'])) { + $x_both[$my_paye_rate]['coll']['totalht'] = 0; + $x_both[$my_paye_rate]['coll']['vat'] = 0; + $x_both[$my_paye_rate]['coll']['localtax1'] = 0; + $x_both[$my_paye_rate]['coll']['localtax2'] = 0; + } + $x_both[$my_paye_rate]['paye']['links'] = ''; + $x_both[$my_paye_rate]['paye']['detail'] = array(); + + foreach ($x_paye[$my_paye_rate]['facid'] as $id=>$dummy) + { + // ExpenseReport + if ($x_paye[$my_paye_rate]['ptype'][$id] == 'ExpenseReportPayment') + { + //$expensereport->id=$x_paye[$my_paye_rate]['facid'][$id]; + //$expensereport->ref=$x_paye[$my_paye_rate]['facnum'][$id]; + //$expensereport->type=$x_paye[$my_paye_rate]['type'][$id]; + + $x_both[$my_paye_rate]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_rate]['facid'][$id], + 'descr' =>$x_paye[$my_paye_rate]['descr'][$id], + 'pid' =>$x_paye[$my_paye_rate]['pid'][$id], + 'pref' =>$x_paye[$my_paye_rate]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id], + 'payment_id' =>$x_paye[$my_paye_rate]['payment_id'][$id], + 'payment_amount' =>$x_paye[$my_paye_rate]['payment_amount'][$id], + 'ftotal_ttc' =>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]), + 'dtotal_ttc' =>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id], + 'ddate_start' =>$x_paye[$my_paye_rate]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], + + 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], + 'localtax1' =>$x_paye[$my_paye_rate]['localtax1_list'][$id], + 'localtax2' =>$x_paye[$my_paye_rate]['localtax2_list'][$id], + //'link' =>$expensereport->getNomUrl(1) + ); + } + else + { + //$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; + //$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; + //$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; + //$company_static->fetch($x_paye[$my_paye_rate]['company_id'][$id]); + $x_both[$my_paye_rate]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_rate]['facid'][$id], + 'descr' =>$x_paye[$my_paye_rate]['descr'][$id], + 'pid' =>$x_paye[$my_paye_rate]['pid'][$id], + 'pref' =>$x_paye[$my_paye_rate]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id], + 'payment_id'=>$x_paye[$my_paye_rate]['payment_id'][$id], + 'payment_amount'=>$x_paye[$my_paye_rate]['payment_amount'][$id], + 'ftotal_ttc'=>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]), + 'dtotal_ttc'=>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id], + 'datef' =>$x_paye[$my_paye_rate]['datef'][$id], + 'datep' =>$x_paye[$my_paye_rate]['datep'][$id], + //'company_link'=>$company_static->getNomUrl(1,'',20), + 'ddate_start'=>$x_paye[$my_paye_rate]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], + + 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], + 'localtax1' =>$x_paye[$my_paye_rate]['localtax1_list'][$id], + 'localtax2' =>$x_paye[$my_paye_rate]['localtax2_list'][$id], + //'link' =>$invoice_supplier->getNomUrl(1,'',12) + ); + } + } + } + //now we have an array (x_both) indexed by rates for coll and paye $action = "tva"; - $object = array(&$coll_listsell, &$coll_listbuy); + $object = array(&$x_coll, &$x_paye, &$x_both); $parameters["mode"] = $modetax; $parameters["year"] = $y; $parameters["month"] = $m; @@ -226,13 +406,13 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if (! is_array($coll_listbuy) && $coll_listbuy == -1) + if (! is_array($x_coll) && $coll_listbuy == -1) { $langs->load("errors"); print '
'.$langs->trans("ErrorNoAccountancyModuleLoaded").'
'.$langs->trans("FeatureNotYetAvailable").'
'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'".price($x_coll)."'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'".price($x_paye)."".price($x_paye)."".price(price2num($x_coll_sum,'MT'))."".price($x_coll)."".price(price2num($x_paye_sum,'MT'))."".price($diff)."".price(price2num($diff,'MT'))." 
'.$langs->trans("SubTotal").':'.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotal).''.price($subtotalpaye).''.price($subtotal).''.price($subtotalcoll).''.price($subtotal).' 
'.$langs->trans("SubTotal").':'.price(price2num($subtotalcoll,'MT')).''.price(price2num($subtotalpaye,'MT')).''.price(price2num($subtotal,'MT')).' 
'.$langs->trans("TotalToPay").':'.price($total).'
'.$langs->trans("TotalToPay").':'.price(price2num($total, 'MT')).' 
'; print '
'; -print load_fiche_titre($langs->transcountry($LTPaid,$mysoc->country_code), '', ''); + /* * Payed */ -$sql = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm"; +print load_fiche_titre($langs->transcountry($LTPaid,$mysoc->country_code), '', ''); + +$sql=''; + +$sql.= "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm, 'claimed' as mode"; $sql.= " FROM ".MAIN_DB_PREFIX."localtax as f"; $sql.= " WHERE f.entity = ".$conf->entity; -$sql.= " AND f.datev >= '".$db->idate($date_start)."'"; -$sql.= " AND f.datev <= '".$db->idate($date_end)."'"; +$sql.= " AND (f.datev >= '".$db->idate($date_start)."' AND f.datev <= '".$db->idate($date_end)."')"; $sql.= " AND localtaxtype=".$localTaxType; $sql.= " GROUP BY dm"; -$sql.= " ORDER BY dm ASC"; -pt($db, $sql,$langs->trans("Year")." $y"); +$sql.= " UNION "; + +$sql.= "SELECT SUM(amount) as mm, date_format(f.datep,'%Y-%m') as dm, 'paid' as mode"; +$sql.= " FROM ".MAIN_DB_PREFIX."localtax as f"; +$sql.= " WHERE f.entity = ".$conf->entity; +$sql.= " AND (f.datep >= '".$db->idate($date_start)."' AND f.datep <= '".$db->idate($date_end)."')"; +$sql.= " AND localtaxtype=".$localTaxType; +$sql.= " GROUP BY dm"; + +$sql.= " ORDER BY dm ASC, mode ASC"; +//print $sql; + +pt($db, $sql, $langs->trans("Month")); -print '
'; print '
'; - llxFooter(); $db->close(); diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index 50bc87d4d27..6668e3d61db 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -44,15 +44,17 @@ $localtax_static = new Localtax($db); $newcardbutton=''; if ($user->rights->tax->charges->creer) { - $newcardbutton=''.$langs->trans('NewVATPayment').''; + $newcardbutton=''.$langs->trans('NewVATPayment'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments",$mysoc->country_code), $newcardbutton); -$sql = "SELECT rowid, amount, label, f.datev as dm"; +$sql = "SELECT rowid, amount, label, f.datev, f.datep"; $sql.= " FROM ".MAIN_DB_PREFIX."localtax as f "; $sql.= " WHERE f.entity = ".$conf->entity." AND localtaxtype=".$db->escape($ltt); -$sql.= " ORDER BY dm DESC"; +$sql.= " ORDER BY datev DESC"; $result = $db->query($sql); if ($result) @@ -65,6 +67,7 @@ if ($result) print '
'.$langs->trans("Ref").'".$langs->trans("Label")."".$langs->trans("PeriodEndDate")."'.$langs->trans("DatePayment").'".$langs->trans("PayedByThisPayment")."
".$localtax_static->getNomUrl(1)."".dol_trunc($obj->label,40)."'.dol_print_date($db->jdate($obj->dm),'day')."'.dol_print_date($db->jdate($obj->datev),'day')."'.dol_print_date($db->jdate($obj->datep),'day')."".price($obj->amount)."
'.$langs->trans("Total").'".price($total)."
'.$langs->trans("Total").''.price($total).'
"; $db->free($result); diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index db316a1d6dc..8d7843b5cea 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -22,8 +22,7 @@ /** * \file htdocs/compta/tva/quadri_detail.php * \ingroup tax - * \brief Trimestrial page - detailed version - * TODO Deal with recurrent invoices as well + * \brief Local tax by rate */ global $mysoc; @@ -31,18 +30,21 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; +require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php'; $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin")); $local=GETPOST('localTaxType', 'int'); // Date range -$year=GETPOST("year"); +$year=GETPOST("year","int"); if (empty($year)) { $year_current = strftime("%Y",dol_now()); @@ -51,16 +53,15 @@ if (empty($year)) $year_current = $year; $year_start = $year; } - -$date_start = dol_mktime( 0, 0, 0, GETPOST( "date_startmonth" ), GETPOST( "date_startday" ), GETPOST( "date_startyear" ) ); -$date_end = dol_mktime( 23, 59, 59, GETPOST( "date_endmonth" ), GETPOST( "date_endday" ), GETPOST( "date_endyear" ) ); +$date_start=dol_mktime(0,0,0,GETPOST("date_startmonth"),GETPOST("date_startday"),GETPOST("date_startyear")); +$date_end=dol_mktime(23,59,59,GETPOST("date_endmonth"),GETPOST("date_endday"),GETPOST("date_endyear")); // Quarter if (empty($date_start) || empty($date_end)) // We define date_start and date_end { - $q=GETPOST("q"); + $q=GETPOST("q","int"); if (empty($q)) { - if (GETPOST("month")) { $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); $date_end=dol_get_last_day($year_start,GETPOST("month"),false); } + if (GETPOST("month","int")) { $date_start=dol_get_first_day($year_start,GETPOST("month","int"),false); $date_end=dol_get_last_day($year_start,GETPOST("month","int"),false); } else { $date_start=dol_get_first_day($year_start,empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START,false); @@ -83,7 +84,9 @@ if (empty($min)) $min = 0; // Define modetax (0 or 1) // 0=normal, 1=option vat for services is on debit, 2=option on payments for products -$modetax = $conf->global->TAX_MODE; +//$modetax = $conf->global->TAX_MODE; +$calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local; +$modetax=$conf->global->$calc; if (GETPOSTISSET("modetax")) $modetax=GETPOST("modetax",'int'); if (empty($modetax)) $modetax=0; @@ -92,121 +95,123 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); -/** + + +/* * View */ + +$form=new Form($db); +$company_static=new Societe($db); +$invoice_customer=new Facture($db); +$invoice_supplier=new FactureFournisseur($db); +$expensereport=new ExpenseReport($db); +$product_static=new Product($db); +$payment_static=new Paiement($db); +$paymentfourn_static=new PaiementFourn($db); +$paymentexpensereport_static=new PaymentExpenseReport($db); + $morequerystring=''; $listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday'); -foreach($listofparams as $param) +foreach ($listofparams as $param) { if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); } -llxHeader('','','','',0,0,'','',$morequerystring); - -$form=new Form($db); - -$company_static=new Societe($db); -$invoice_customer=new Facture($db); -$invoice_supplier=new FactureFournisseur($db); -$product_static=new Product($db); -$payment_static=new Paiement($db); -$paymentfourn_static=new PaiementFourn($db); +llxHeader('',$langs->trans("LocalTaxReport"),'','',0,0,'','',$morequerystring); $fsearch.=' '; $fsearch.=' '; $fsearch.=' '; $name=$langs->transcountry($local==1?"LT1ReportByQuarters":"LT2ReportByQuarters", $mysoc->country_code); -$calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local; - -if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice for goods and services -{ - $calcmode=$calc==0?$langs->trans("CalcModeLT".$local):$langs->trans("CalcModeLT".$local."Rec"); - $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')'; - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - $prevyear=$year_start; $prevquarter=$q; - if ($prevquarter > 1) $prevquarter--; - else { $prevquarter=4; $prevyear--; } - $nextyear=$year_start; $nextquarter=$q; - if ($nextquarter < 4) $nextquarter++; - else { $nextquarter=1; $nextyear++; } - - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); - else $description.='
'.$langs->trans("DepositsAreIncluded"); - $description.=$fsearch; - $builddate=dol_now(); - - $elementcust=$langs->trans("CustomersInvoices"); - $productcust=$langs->trans("ProductOrService"); - $amountcust=$langs->trans("AmountHT"); - $vatcust=$langs->trans("VATReceived"); - if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')'; - $elementsup=$langs->trans("SuppliersInvoices"); - $productsup=$langs->trans("ProductOrService"); - $amountsup=$langs->trans("AmountHT"); - $vatsup=$langs->trans("VATPaid"); - if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; +$calcmode=''; +if ($modetax == 0) $calcmode=$langs->trans('OptionVATDefault'); +if ($modetax == 1) $calcmode=$langs->trans('OptionVATDebitOption'); +if ($modetax == 2) $calcmode=$langs->trans('OptionPaymentForProductAndServices'); +$calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; +// Set period +$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); +$prevyear=$year_start; $prevquarter=$q; +if ($prevquarter > 1) { + $prevquarter--; +} else { + $prevquarter=4; $prevyear--; } -if ($conf->global->$calc==2) // Invoice for goods, payment for services -{ - $calcmode=$calc==0?$langs->trans("CalcModeLT".$local):$langs->trans("CalcModeLT".$local."Rec"); - $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')'; - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - $prevyear=$year_start; $prevquarter=$q; - if ($prevquarter > 1) $prevquarter--; - else { $prevquarter=4; $prevyear--; } - $nextyear=$year_start; $nextquarter=$q; - if ($nextquarter < 4) $nextquarter++; - else { $nextquarter=1; $nextyear++; } - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded"); - else $description.=' '.$langs->trans("DepositsAreIncluded"); - $description.=$fsearch; - $builddate=dol_now(); - - $elementcust=$langs->trans("CustomersInvoices"); - $productcust=$langs->trans("ProductOrService"); - $amountcust=$langs->trans("AmountHT"); - $vatcust=$langs->trans("VATReceived"); - if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')'; - $elementsup=$langs->trans("SuppliersInvoices"); - $productsup=$langs->trans("ProductOrService"); - $amountsup=$langs->trans("AmountHT"); - $vatsup=$langs->trans("VATPaid"); - if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; +$nextyear=$year_start; $nextquarter=$q; +if ($nextquarter < 4) { + $nextquarter++; +} else { + $nextquarter=1; $nextyear++; } +$description.=$fsearch; +$builddate=dol_now(); + +/*if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') $description.=$langs->trans("RulesVATDueProducts"); +if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') $description.=$langs->trans("RulesVATInProducts"); +if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') $description.='
'.$langs->trans("RulesVATDueServices"); +if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') $description.='
'.$langs->trans("RulesVATInServices"); +if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description.='
'.$langs->trans("DepositsAreNotIncluded"); +} +*/ +if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
'.$langs->trans("ThisIsAnEstimatedValue"); + +// Customers invoices +$elementcust=$langs->trans("CustomersInvoices"); +$productcust=$langs->trans("ProductOrService"); +$amountcust=$langs->trans("AmountHT"); +$vatcust=$langs->trans("VATReceived"); +$namecust=$langs->trans("Name"); +if ($mysoc->tva_assuj) { + $vatcust.=' ('.$langs->trans("ToPay").')'; +} + +// Suppliers invoices +$elementsup=$langs->trans("SuppliersInvoices"); +$productsup=$productcust; +$amountsup=$amountcust; +$vatsup=$langs->trans("VATPaid"); +$namesup=$namecust; +if ($mysoc->tva_assuj) { + $vatsup.=' ('.$langs->trans("ToGetBack").')'; +} + + report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); if($local==1){ $vatcust=$langs->transcountry("LocalTax1", $mysoc->country_code); $vatsup=$langs->transcountry("LocalTax1", $mysoc->country_code); + $vatexpensereport=$langs->transcountry("LocalTax1", $mysoc->country_code); }else{ $vatcust=$langs->transcountry("LocalTax2", $mysoc->country_code); $vatsup=$langs->transcountry("LocalTax2", $mysoc->country_code); + $vatexpensereport=$langs->transcountry("LocalTax2", $mysoc->country_code); } // VAT Received and paid +echo ''; $y = $year_current; $total = 0; $i=0; +$columns = 5; // Load arrays of datas -$x_coll = tax_by_date('localtax' . $local, $db, 0, 0, $date_start, $date_end, $modetax, 'sell'); -$x_paye = tax_by_date('localtax' . $local, $db, 0, 0, $date_start, $date_end, $modetax, 'buy'); - -echo '
'; +$x_coll = tax_by_rate('localtax' . $local, $db, 0, 0, $date_start, $date_end, $modetax, 'sell'); +$x_paye = tax_by_rate('localtax' . $local, $db, 0, 0, $date_start, $date_end, $modetax, 'buy'); if (! is_array($x_coll) || ! is_array($x_paye)) { $langs->load("errors"); if ($x_coll == -1) - print ''; + print ''; else if ($x_coll == -2) - print ''; + print ''; else - print ''; + print ''; } else { @@ -226,6 +231,7 @@ else $invoice_customer->id=$x_coll[$my_coll_rate]['facid'][$id]; $invoice_customer->ref=$x_coll[$my_coll_rate]['facnum'][$id]; $invoice_customer->type=$x_coll[$my_coll_rate]['type'][$id]; + $company_static->fetch($x_coll[$my_coll_rate]['company_id'][$id]); $x_both[$my_coll_rate]['coll']['detail'][] = array( 'id' =>$x_coll[$my_coll_rate]['facid'][$id], 'descr' =>$x_coll[$my_coll_rate]['descr'][$id], @@ -237,20 +243,24 @@ else 'ftotal_ttc'=>$x_coll[$my_coll_rate]['ftotal_ttc'][$id], 'dtotal_ttc'=>$x_coll[$my_coll_rate]['dtotal_ttc'][$id], 'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id], + 'datef' =>$x_coll[$my_coll_rate]['datef'][$id], + 'datep' =>$x_coll[$my_coll_rate]['datep'][$id], + 'company_link'=>$company_static->getNomUrl(1,'',20), 'ddate_start'=>$x_coll[$my_coll_rate]['ddate_start'][$id], 'ddate_end' =>$x_coll[$my_coll_rate]['ddate_end'][$id], 'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id], 'localtax1'=> $x_coll[$my_coll_rate]['localtax1_list'][$id], 'localtax2'=> $x_coll[$my_coll_rate]['localtax2_list'][$id], 'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id], - 'link' =>$invoice_customer->getNomUrl(1,'',12)); + 'link' =>$invoice_customer->getNomUrl(1,'',12) + ); } } // tva paid - foreach(array_keys($x_paye) as $my_paye_rate){ + foreach(array_keys($x_paye) as $my_paye_rate) { $x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht']; $x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat']; - if(!isset($x_both[$my_paye_rate]['coll']['totalht'])){ + if(!isset($x_both[$my_paye_rate]['coll']['totalht'])) { $x_both[$my_paye_rate]['coll']['totalht'] = 0; $x_both[$my_paye_rate]['coll']['vat'] = 0; } @@ -273,35 +283,39 @@ else 'ftotal_ttc'=>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]), 'dtotal_ttc'=>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]), 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id], + 'datef' =>$x_paye[$my_paye_rate]['datef'][$id], + 'datep' =>$x_paye[$my_paye_rate]['datep'][$id], + 'company_link'=>$company_static->getNomUrl(1,'',20), 'ddate_start'=>$x_paye[$my_paye_rate]['ddate_start'][$id], 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]), 'localtax1'=> $x_paye[$my_paye_rate]['localtax1_list'][$id], 'localtax2'=> $x_paye[$my_paye_rate]['localtax2_list'][$id], 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], - 'link' =>$invoice_supplier->getNomUrl(1,'',12)); + 'link' =>$invoice_supplier->getNomUrl(1,'',12) + ); } } //now we have an array (x_both) indexed by rates for coll and paye + //print table headers for this quadri - incomes first + $x_coll_sum = 0; $x_coll_ht = 0; $x_paye_sum = 0; $x_paye_ht = 0; - $span=3; - if ($modetax == 0) $span+=2; + $span=$columns; + if ($modetax != 1) $span+=2; - if($conf->global->$calc ==0 || $conf->global->$calc == 2){ + //if ($modetax == 0 || $modetax == 2) + //{ // Customers invoices print ''; print ''; print ''; - if ($modetax == 0) - { - print ''; - print ''; - } + if ($modetax != 2) print ''; + if ($modetax != 1) print ''; print ''; print ''; print ''; @@ -317,8 +331,6 @@ else if (is_array($x_both[$rate]['coll']['detail'])) { // VAT Rate - $var=true; - if($rate!=0){ print ""; print ''; @@ -326,116 +338,116 @@ else } foreach($x_both[$rate]['coll']['detail'] as $index => $fields) { - if(($local==1 && $fields['localtax1']!=0) || ($local==2 && $fields['localtax2']!=0)){ - // Define type - $type=($fields['dtype']?$fields['dtype']:$fields['ptype']); - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. - if (! empty($fields['ddate_start'])) $type=1; - if (! empty($fields['ddate_end'])) $type=1; - - - print ''; - - // Ref - print ''; - - // Description - print ''; - // Total HT - if ($modetax == 0) - { - print ''; + + // Ref + print ''; + + // Description + print ''; - } - // Payment - $ratiopaymentinvoice=1; - if ($modetax == 0) - { - if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); + // Total HT + if ($modetax != 2) + { + print ''; + } + + // Payment + $ratiopaymentinvoice=1; + if ($modetax != 1) + { + if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); + print ''; + } + + // Total collected print ''; + + // Localtax + print ''; + print ''; + + $subtot_coll_total_ht += $temp_ht; + $subtot_coll_vat += $temp_vat; + $x_coll_sum += $temp_vat; } - - // Total collected - print ''; - - // Localtax - print ''; - print ''; - - $subtot_coll_total_ht += $temp_ht; - $subtot_coll_vat += $temp_vat; - $x_coll_sum += $temp_vat; } } - } - if($rate!=0){ - // Total customers for this vat rate - print ''; - print ''; - print ''; - if ($modetax == 0) - { - print ''; - print ''; - } - print ''; - print ''; - print ''; - } + + // Total customers for this vat rate + print ''; + print ''; + print ''; + if ($modetax != 1) + { + print ''; + print ''; + } + print ''; + print ''; + print ''; } if (count($x_coll) == 0) // Show a total ine if nothing shown @@ -457,15 +469,15 @@ else print ''; print '
'.$langs->trans("ErrorNoAccountancyModuleLoaded").'
'.$langs->trans("ErrorNoAccountancyModuleLoaded").'
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("Error").'
'.$langs->trans("Error").'
'.$elementcust.''.$productcust.''.$amountcust.''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'.$amountcust.''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'.$langs->trans("BI").''.$vatcust.'
'.$langs->trans("Rate").': '.vatrate($rate).'%
'.$fields['link'].''; - if ($fields['pid']) + if(($local==1 && $fields['localtax1']!=0) || ($local==2 && $fields['localtax2']!=0)) { - $product_static->id=$fields['pid']; - $product_static->ref=$fields['pref']; - $product_static->type=$fields['ptype']; - print $product_static->getNomUrl(1); - if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); - } - else - { - if ($type) $text = img_object($langs->trans('Service'),'service'); - else $text = img_object($langs->trans('Product'),'product'); - if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) - { - if ($reg[1]=='DEPOSIT') $fields['descr']=$langs->transnoentitiesnoconv('Deposit'); - elseif ($reg[1]=='CREDIT_NOTE') $fields['descr']=$langs->transnoentitiesnoconv('CreditNote'); - else $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); - } - print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); + // Define type + $type=($fields['dtype']?$fields['dtype']:$fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (! empty($fields['ddate_start'])) $type=1; + if (! empty($fields['ddate_end'])) $type=1; - // Show range - print_date_range($fields['ddate_start'],$fields['ddate_end']); - } - print ''; - print price($fields['totalht']); - if (price2num($fields['ftotal_ttc'])) + print '
'.$fields['link'].''; + if ($fields['pid']) { - $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']); + $product_static->id=$fields['pid']; + $product_static->ref=$fields['pref']; + $product_static->type=$fields['ptype']; + print $product_static->getNomUrl(1); + if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); + } + else + { + if ($type) $text = img_object($langs->trans('Service'),'service'); + else $text = img_object($langs->trans('Product'),'product'); + if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) + { + if ($reg[1]=='DEPOSIT') $fields['descr']=$langs->transnoentitiesnoconv('Deposit'); + elseif ($reg[1]=='CREDIT_NOTE') $fields['descr']=$langs->transnoentitiesnoconv('CreditNote'); + else $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); + } + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); + + // Show range + print_date_range($fields['ddate_start'],$fields['ddate_end']); } print ''; + print price($fields['totalht']); + if (price2num($fields['ftotal_ttc'])) + { + $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']); + } + print ''; + if ($fields['payment_amount'] && $fields['ftotal_ttc']) + { + $payment_static->id=$fields['payment_id']; + print $payment_static->getNomUrl(2); + } + if ($type == 0) + { + print $langs->trans("NotUsedForGoods"); + } + else { + print price($fields['payment_amount']); + if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice*100,2).'%)'; + } + print ''; - if ($fields['payment_amount'] && $fields['ftotal_ttc']) - { - $payment_static->id=$fields['payment_id']; - print $payment_static->getNomUrl(2); - } - if ($type == 0) - { - print $langs->trans("NotUsedForGoods"); - } - else { - print price($fields['payment_amount']); - if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice*100,2).'%)'; - } + $temp_ht=$fields['totalht']; + if ($type == 1) $temp_ht=$fields['totalht']*$ratiopaymentinvoice; + print price(price2num($temp_ht,'MT')); print ''; + $temp_vat= $local==1?$fields['localtax1']:$fields['localtax2']; + print price(price2num($temp_vat,'MT')); + //print price($fields['vat']); + print '
'; - $temp_ht=$fields['totalht']; - if ($type == 1) $temp_ht=$fields['totalht']*$ratiopaymentinvoice; - print price(price2num($temp_ht,'MT')); - print ''; - $temp_vat= $local==1?$fields['localtax1']:$fields['localtax2']; - print price(price2num($temp_vat,'MT')); - //print price($fields['vat']); - print '
'.$langs->trans("Total").':  '.price(price2num($subtot_coll_total_ht,'MT')).''.price(price2num($subtot_coll_vat,'MT')).'
'.$langs->trans("Total").':  '.price(price2num($subtot_coll_total_ht,'MT')).''.price(price2num($subtot_coll_vat,'MT')).'
 
'; $diff=$x_coll_sum; - } + //} - if($conf->global->$calc ==0 || $conf->global->$calc == 1){ + //if($conf->global->$calc ==0 || $conf->global->$calc == 1){ echo ''; //print table headers for this quadri - expenses now print ''; print ''; print ''; - if ($modetax == 0) + if ($modetax != 1) { print ''; print ''; @@ -479,9 +491,8 @@ else $subtot_paye_total_ht = 0; $subtot_paye_vat = 0; - if(is_array($x_both[$rate]['paye']['detail'])) + if (is_array($x_both[$rate]['paye']['detail'])) { - $var=true; if($rate!=0){ print ""; print ''; @@ -489,149 +500,144 @@ else } foreach($x_both[$rate]['paye']['detail'] as $index=>$fields) { - if(($local==1 && $fields['localtax1']!=0) || ($local==2 && $fields['localtax2']!=0)){ - // Define type - $type=($fields['dtype']?$fields['dtype']:$fields['ptype']); - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. - if (! empty($fields['ddate_start'])) $type=1; - if (! empty($fields['ddate_end'])) $type=1; - - - print ''; - - // Ref - print ''; - - // Description - print ''; - // Total HT - if ($modetax == 0) - { - print ''; + + // Ref + print ''; + + // Description + print ''; - } - - // Payment - $ratiopaymentinvoice=1; - if ($modetax == 0) - { - if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); - print ''; + + // Total HT + if ($modetax != 2) + { + print ''; + } + + // Payment + $ratiopaymentinvoice=1; + if ($modetax != 1) + { + print ''; + } + + // VAT paid + print ''; + + // Localtax + print ''; + print ''; + + $subtot_paye_total_ht += $temp_ht; + $subtot_paye_vat += $temp_vat; + $x_paye_sum += $temp_vat; } - - // VAT paid - print ''; - - // Localtax - print ''; - print ''; - - $subtot_paye_total_ht += $temp_ht; - $subtot_paye_vat += $temp_vat; - $x_paye_sum += $temp_vat; } } - } - if($rate!=0){ - // Total suppliers for this vat rate - print ''; - print ''; - print ''; - if ($modetax == 0) - { - print ''; - print ''; - } - print ''; - print ''; - print ''; - } + + // Total suppliers for this vat rate + print ''; + print ''; + print ''; + if ($modetax != 1) + { + print ''; + print ''; + } + print ''; + print ''; + print ''; } - if (count($x_paye) == 0) // Show a total ine if nothing shown - { - print ''; - print ''; - print ''; - if ($modetax == 0) - { - print ''; - print ''; - } - print ''; - print ''; - print ''; + if (count($x_paye) == 0) { // Show a total line if nothing shown + print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''; } print '
'.$elementsup.''.$productsup.''.$amountsup.''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')
'.$langs->trans("Rate").': '.vatrate($rate).'%
'.$fields['link'].''; - if ($fields['pid']) + if(($local==1 && $fields['localtax1']!=0) || ($local==2 && $fields['localtax2']!=0)) { - $product_static->id=$fields['pid']; - $product_static->ref=$fields['pref']; - $product_static->type=$fields['ptype']; - print $product_static->getNomUrl(1); - if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); - } - else - { - if ($type) $text = img_object($langs->trans('Service'),'service'); - else $text = img_object($langs->trans('Product'),'product'); - print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); + // Define type + $type=($fields['dtype']?$fields['dtype']:$fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (! empty($fields['ddate_start'])) $type=1; + if (! empty($fields['ddate_end'])) $type=1; - // Show range - print_date_range($fields['ddate_start'],$fields['ddate_end']); - } - print ''; - print price($fields['totalht']); - if (price2num($fields['ftotal_ttc'])) + print '
'.$fields['link'].''; + if ($fields['pid']) { - //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; - $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']); - //print ' ('.round($ratiolineinvoice*100,2).'%)'; - } - print ''; - if ($fields['payment_amount'] && $fields['ftotal_ttc']) - { - $paymentfourn_static->id=$fields['payment_id']; - print $paymentfourn_static->getNomUrl(2); - } - if ($type == 0) - { - print $langs->trans("NotUsedForGoods"); + $product_static->id=$fields['pid']; + $product_static->ref=$fields['pref']; + $product_static->type=$fields['ptype']; + print $product_static->getNomUrl(1); + if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); } else { - print price($fields['payment_amount']); - if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice*100,2).'%)'; + if ($type) $text = img_object($langs->trans('Service'),'service'); + else $text = img_object($langs->trans('Product'),'product'); + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); + + // Show range + print_date_range($fields['ddate_start'],$fields['ddate_end']); } print ''; + print price($fields['totalht']); + if (price2num($fields['ftotal_ttc'])) + { + //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; + $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']); + //print ' ('.round($ratiolineinvoice*100,2).'%)'; + } + print ''; + if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); + if ($fields['payment_amount'] && $fields['ftotal_ttc']) + { + $paymentfourn_static->id=$fields['payment_id']; + print $paymentfourn_static->getNomUrl(2); + } + if ($type == 0) + { + print $langs->trans("NA"); + } + else + { + print price(price2num($fields['payment_amount'],'MT')); + if (isset($fields['payment_amount'])) { + print ' ('.round($ratiopaymentinvoice*100,2).'%)'; + } + } + print ''; + $temp_ht=$fields['totalht']*$ratiopaymentinvoice; + print price(price2num($temp_ht,'MT'),1); + print ''; + $temp_vat=($local==1?$fields['localtax1']:$fields['localtax2'])*$ratiopaymentinvoice;; + print price(price2num($temp_vat,'MT'),1); + //print price($fields['vat']); + print '
'; - $temp_ht=$fields['totalht']; - if ($type == 1) $temp_ht=$fields['totalht']*$ratiopaymentinvoice; - print price(price2num($temp_ht,'MT')); - print ''; - $temp_vat= $local==1?$fields['localtax1']:$fields['localtax2']; - print price(price2num($temp_vat,'MT')); - //print price($fields['vat']); - print '
 '.$langs->trans("Total").':  '.price(price2num($subtot_paye_total_ht,'MT')).''.price(price2num($subtot_paye_vat,'MT')).'
 '.$langs->trans("Total").':  '.price(price2num($subtot_paye_total_ht,'MT')).''.price(price2num($subtot_paye_vat,'MT')).'
 '.$langs->trans("Total").':  '.price(price2num(0,'MT')).''.price(price2num(0,'MT')).'
 '.$langs->trans("Total").':  '.price(price2num(0,'MT')).''.price(price2num(0,'MT')).'
'; - $diff=$x_paye_sum; - } + //} - if($conf->global->$calc ==0){$diff=$x_coll_sum - $x_paye_sum;} - echo ''; - // Total to pay - print '

'; - print '
'; - //$diff = $local==1?$x_coll_sum:$x_paye_sum; - print ''; - print ''; - print '\n"; - print "\n"; - - echo '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."
'; + // Total to pay + print '

'; + print ''; + $diff = $x_coll_sum - $x_paye_sum; + print ''; + print ''; + print '\n"; + print "\n"; $i++; } +print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."
'; llxFooter(); $db->close(); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 77d9cd0a93d..8b6956a3942 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -819,7 +819,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if (! GETPOST('action','aZ09')) { if ($page == -1) $page = 0 ; - $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; + $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; if (! $sortorder) $sortorder='DESC'; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 8a165ebe811..8489e82ae33 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -54,7 +54,7 @@ $page=GETPOST('page', 'int'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="b.dateo,b.rowid"; if (empty($page) || $page == -1) { $page = 0; } -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; $dir=$conf->bank->dir_output.'/checkdeposits/'; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 532d2e4c9b8..b9e8cac609a 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -43,7 +43,7 @@ $search_ref = GETPOST('search_ref','alpha'); $search_account = GETPOST('search_account','int'); $search_amount = GETPOST('search_amount','alpha'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -117,6 +117,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -134,7 +139,9 @@ if ($resql) $newcardbutton=''; if ($user->rights->banque->cheque) { - $newcardbutton = ''.$langs->trans('NewCheckDeposit').''; + $newcardbutton = ''.$langs->trans('NewCheckDeposit'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 6ca9f29c16e..017593316a7 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -6,6 +6,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +60,7 @@ $search_amount=GETPOST("search_amount",'alpha'); // alpha because we must be $search_company=GETPOST("search_company",'alpha'); $search_payment_num=GETPOST('search_payment_num','alpha'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -191,6 +192,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -229,21 +235,21 @@ if ($resql) // Lines for filters fields print '
'; - print ''; + print ''; print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($year?$year:-1,'year',1, 20, 5); print ''; - print ''; + print ''; print ''; $form->select_types_paiements($search_paymenttype,'search_paymenttype','',2,1,1); print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); @@ -278,7 +284,7 @@ if ($resql) print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder); //print_liste_field_titre("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder); - $parameters=array(); + $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index 7e16b525233..031a0ff354a 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -38,7 +38,7 @@ if ($user->societe_id > 0) } -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); @@ -85,6 +85,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1,$offset); @@ -94,7 +99,6 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - $var=True; print_barre_liste($langs->trans("ReceivedCustomersPaymentsToValid"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num); diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index ea9bc5af42a..8e76a219c3d 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -245,13 +245,10 @@ if ($resql) if ($num > 0) { - $var=True; - while ($i < $num) { $objp = $db->fetch_object($resql); - print '
'; diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 31dfbd5b610..02c6e7b08f0 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -37,7 +37,7 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement','','','bons'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); @@ -87,6 +87,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1,$offset); @@ -101,7 +106,13 @@ if ($result) $selectedfields=''; - $newcardbutton = ''.$langs->trans('NewStandingOrder').''; + $newcardbutton=''; + if ($user->rights->prelevement->bons->creer) + { + $newcardbutton = ''.$langs->trans('NewStandingOrder'); + $newcardbutton.= ''; + $newcardbutton.= ''; + } // Lines of title fields print ''; diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index ed0977ebabf..a6d739f1f0c 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -322,6 +322,11 @@ if ($id > 0 || $ref) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 57cf518db16..245b25be3b6 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -99,14 +99,6 @@ class BonPrelevement extends CommonObject $this->methodes_trans[0] = "Internet"; $this->_fetched = 0; - - - $langs->load("withdrawals"); - $this->labelstatut[0]=$langs->trans("StatusWaiting"); - $this->labelstatut[1]=$langs->trans("StatusTrans"); - $this->labelstatut[2]=$langs->trans("StatusCredited"); - - return 1; } /** @@ -1310,14 +1302,14 @@ class BonPrelevement extends CommonObject */ // SEPA Initialisation $CrLf = "\n"; - + $now = dol_now(); - + $dateTime_ECMA = dol_print_date($now, '%Y-%m-%dT%H:%M:%S'); $date_actu = $now; if (!empty($executiondate)) $date_actu=$executiondate; - + $dateTime_YMD = dol_print_date($date_actu, '%Y%m%d'); $dateTime_YMDHMS = dol_print_date($date_actu, '%Y%m%d%H%M%S'); $fileDebiteurSection = ''; @@ -1890,48 +1882,52 @@ class BonPrelevement extends CommonObject */ function LibStatut($statut,$mode=0) { - global $langs; + if (empty($this->labelstatut)) + { + global $langs; + $langs->load("withdrawals"); + $this->labelstatut[0]=$langs->trans("StatusWaiting"); + $this->labelstatut[1]=$langs->trans("StatusTrans"); + $this->labelstatut[2]=$langs->trans("StatusCredited"); + } if ($mode == 0) { - return $langs->trans($this->labelstatut[$statut]); + return $this->labelstatut[$statut]; } - if ($mode == 1) { - if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1').' '.$langs->trans($this->labelstatut[$statut]); - if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut3').' '.$langs->trans($this->labelstatut[$statut]); - if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6').' '.$langs->trans($this->labelstatut[$statut]); + return $this->labelstatut[$statut]; } if ($mode == 2) { - if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1'); - if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut3'); - if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6'); + if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut]; + if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut]; + if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut]; } if ($mode == 3) { - if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1'); - if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut3'); - if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6'); + if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1'); + if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3'); + if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6'); } if ($mode == 4) { - if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1').' '.$langs->trans($this->labelstatut[$statut]); - if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut3').' '.$langs->trans($this->labelstatut[$statut]); - if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6').' '.$langs->trans($this->labelstatut[$statut]); + if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut]; + if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut]; + if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut]; } if ($mode == 5) { - if ($statut==0) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut1'); - if ($statut==1) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut3'); - if ($statut==2) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut6'); + if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1'); + if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3'); + if ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6'); } if ($mode == 6) { - if ($statut==0) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut1'); - if ($statut==1) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut3'); - if ($statut==2) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut6'); + if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1'); + if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3'); + if ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6'); } } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index c94a786917f..c1d87a4c1b5 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -298,8 +298,6 @@ if ($result) print ''.$langs->trans("Date").''.$langs->trans("Amount").'
'; print ''; @@ -117,7 +116,6 @@ if ($resql) print ''; if ($num) { - $var = True; while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); @@ -184,7 +182,6 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - $var=True; print"\n\n"; print '
'.$langs->trans("Statistics").'
'.$langs->trans("InvoiceWaitingWithdraw").' ('.$num.')
'; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index ff6fe4e109c..10634670f5f 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -40,7 +40,7 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement','','','bons'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); @@ -111,6 +111,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1,$offset); diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index e8b00fc869b..c4131dc365b 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -90,7 +90,7 @@ $tmps=dol_getdate($date_start); $year_start = $tmps['year']; $tmpe=dol_getdate($date_end); $year_end = $tmpe['year']; -$nbofyear = ($year_end - $start_year) + 1; +$nbofyear = ($year_end - $year_start) + 1; //var_dump("year_start=".$year_start." year_end=".$year_end." nbofyear=".$nbofyear." date_start=".dol_print_date($date_start, 'dayhour')." date_end=".dol_print_date($date_end, 'dayhour')); diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 71cfe997fe0..3a3f34b85b4 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -388,7 +388,11 @@ class PaymentSalary extends CommonObject -abs($this->amount), $this->num_payment, '', - $user + $user, + '', + '', + '', + $this->datev ); // Update fk_bank into llx_paiement. diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index f9b9adf616c..a88ec8683a9 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -28,17 +28,14 @@ require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; -$langs->load("compta"); -$langs->load("salaries"); -$langs->load("bills"); -$langs->load("hrm"); +$langs->loadLangs(array("compta","salaries","bills","hrm")); // Security check $socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'salaries', '', '', ''); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $search_ref = GETPOST('search_ref','int'); $search_user = GETPOST('search_user','alpha'); $search_label = GETPOST('search_label','alpha'); @@ -52,8 +49,8 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortfield) $sortfield="s.datep"; -if (! $sortorder) $sortorder="DESC"; +if (! $sortfield) $sortfield="s.datep,s.rowid"; +if (! $sortorder) $sortorder="DESC,DESC"; $optioncss = GETPOST('optioncss','alpha'); $filtre=$_GET["filtre"]; @@ -150,9 +147,15 @@ if ($result) if ($typeid) $param.='&typeid='.$typeid; if ($optioncss != '') $param.='&optioncss='.$optioncss; - $newcardbutton=''.$langs->trans('NewSalaryPayment').''; + $newcardbutton=''; + if ($user->rights->salaries->payment->write) + { + $newcardbutton=''.$langs->trans('NewSalaryPayment'); + $newcardbutton.= ''; + $newcardbutton.= ''; + } - print ''; + print ''; if ($optioncss != '') print ''; print ''; print ''; @@ -202,7 +205,7 @@ if ($result) print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder); print_liste_field_titre("Employee",$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder); print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"s.datep,s.rowid","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); diff --git a/htdocs/compta/salaries/stats/index.php b/htdocs/compta/salaries/stats/index.php index 0ba0c29ea6f..dabe988909f 100644 --- a/htdocs/compta/salaries/stats/index.php +++ b/htdocs/compta/salaries/stats/index.php @@ -59,6 +59,7 @@ $year = GETPOST('year')>0?GETPOST('year'):$nowyear; $startyear=$year-1; $endyear=$year; + /* * View */ @@ -231,11 +232,11 @@ print ''; print '

'; print '
'; -print ''; +print ''; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print ''; $oldyear=0; @@ -269,7 +270,7 @@ print '
'; // Show graphs -print '
'.$langs->trans("Year").''.$langs->trans("Number").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").''.$langs->trans("Number").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").'
"; // Period end date - print ""; + print ""; print "'; + print ''; } if (! $total[$annee-1] && ! $total[$annee]) { @@ -551,7 +556,6 @@ print ''; if ($num) { - $var = True; $total_ttc_Rac = $totalam_Rac = $total_Rac = 0; while ($i < $num) { @@ -602,7 +606,6 @@ print ''; if ($num) { - $var = True; $total_pr = 0; while ($i < $num) { diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 2411858a924..240a4624d44 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -59,10 +59,18 @@ if ($_POST["cancel"] == $langs->trans("Cancel") && ! $id) exit; } +if ($action == 'setlib' && $user->rights->tax->charges->creer) +{ + $object->fetch($id); + $result = $object->setValueFrom('label', GETPOST('lib','alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); + if ($result < 0) + setEventMessages($object->error, $object->errors, 'errors'); +} + if ($action == 'setdatev' && $user->rights->tax->charges->creer) { $object->fetch($id); - $object->datev=dol_mktime(12,0,0,$_POST['datevmonth'],$_POST['datevday'],$_POST['datevyear']); + $object->datev=dol_mktime(12,0,0,GETPOST('datevmonth','int'),GETPOST('datevday','int'),GETPOST('datevyear','int')); $result=$object->update($user); if ($result < 0) dol_print_error($db,$object->error); @@ -172,7 +180,8 @@ if ($action == 'delete') } else { - setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors'); + $mesg='Error try do delete a line linked to a conciliated bank transaction'; + setEventMessages($mesg, null, 'errors'); } } @@ -180,11 +189,13 @@ if ($action == 'delete') /* * View */ + +$form = new Form($db); + $title=$langs->trans("VAT") . " - " . $langs->trans("Card"); $help_url=''; llxHeader("",$title,$helpurl); -$form = new Form($db); if ($id) { @@ -248,7 +259,7 @@ if ($action == 'create') print $form->select_date($datep,"datep",'','','','add',1,1); print ''; - print ''; @@ -261,7 +272,7 @@ if ($action == 'create') print ''; // Amount - print ''; + print ''; if (! empty($conf->banque->enabled)) { @@ -306,6 +317,13 @@ if ($id) dol_fiche_head($head, 'card', $langs->trans("VATPayment"), -1, 'payment'); + $morehtmlref='
'; + // Label of social contribution + $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); + // Project + $morehtmlref.='
'; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); @@ -316,18 +334,17 @@ if ($id) print '
'; +print ''; print ''; print ''; print ''; + // Date due + print ''; + print ''; + print ''; + print "\n"; + // Amount print ''; print ''; } - // Date due - print ''; - print ''; - print ''; - print "\n"; - print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index cdcabc5617b..d7bdd9c77e6 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -327,13 +327,23 @@ if ($action == 'create') // Date end period print '
'; - print $langs->trans("PeriodEndDate"); + print $form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")); print ''; print $form->select_date(! empty($dateperiod)?$dateperiod:'-1', 'period', 0, 0, 0, 'charge', 1); print '
'; + print $langs->trans("DateDue"); + print ''; + print $form->select_date(! empty($dateech)?$dateech:'-1', 'ech', 0, 0, 0, 'charge', 1); + print '
'; @@ -370,16 +380,6 @@ if ($action == 'create') print '
'; - print $langs->trans("DateDue"); - print ''; - print $form->select_date(! empty($dateech)?$dateech:'-1', 'ech', 0, 0, 0, 'charge', 1); - print '
'; dol_fiche_end(); @@ -496,7 +496,7 @@ if ($id > 0) print "
".$langs->trans("PeriodEndDate")."
".$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).""; if ($action == 'edit') { diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index fa4127c3af6..f16d18c8143 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -192,7 +192,7 @@ class ChargeSociales extends CommonObject $this->id=$this->db->last_insert_id(MAIN_DB_PREFIX."chargesociales"); //dol_syslog("ChargesSociales::create this->id=".$this->id); - $result=$this->call_trigger('PAYMENTSOCIALCONTRIBUTION_CREATE',$user); + $result=$this->call_trigger('SOCIALCONTRIBUTION_CREATE',$user); if ($result < 0) $error++; if(empty($error)) { diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 4cd0dfd2b59..ba9c671f755 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -164,6 +164,9 @@ class PaymentSocialContribution extends CommonObject } + $result = $this->call_trigger('PAYMENTSOCIALCONTRIBUTION_CREATE',$user); + if($result < 0) $error++; + if ($totalamount != 0 && ! $error) { $this->amount=$totalamount; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 3850ddfe5c5..d38ae348c90 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -42,7 +42,7 @@ $search_label = GETPOST('search_label','alpha'); $search_amount = GETPOST('search_amount','alpha'); $search_status = GETPOST('search_status','int'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -149,7 +149,9 @@ if ($resql) $newcardbutton=''; if($user->rights->tax->charges->creer) { - $newcardbutton=''.$langs->trans('MenuNewSocialContribution').''; + $newcardbutton=''.$langs->trans('MenuNewSocialContribution'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print '
'; diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 879e9b69ee7..6abb6013095 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -45,7 +45,7 @@ $year=GETPOST("year",'int'); $filtre=GETPOST("filtre",'alpha'); if (! $year && $mode != 'sconly') { $year=date("Y", time()); } -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index f367f8ee436..1c170eae96d 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -111,6 +111,13 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end // TODO We define q } +// $date_start and $date_end are defined. We force $year_start and $nbofyear +$tmps=dol_getdate($date_start); +$year_start = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $year_start) + 1; + $commonparams=array(); $commonparams['modecompta']=$modecompta; $commonparams['sortorder'] = $sortorder; @@ -154,9 +161,7 @@ $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByProductsAndServices") if ($modecompta=="CREANCES-DETTES") { $calcmode=$langs->trans("CalcModeDebt"); - $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $description=$langs->trans("RulesCADue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { @@ -168,15 +173,16 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=dol_now(); } else { $calcmode=$langs->trans("CalcModeEngagement"); - $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; - - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $description=$langs->trans("RulesCAIn"); $description.= $langs->trans("DepositsAreIncluded"); $builddate=dol_now(); } +$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); +if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) $periodlink=''.img_previous().' '.img_next().''; +else $periodlink = ''; report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 1fa48738e66..1d386df6c6f 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -99,6 +99,12 @@ else { // TODO We define q } +// $date_start and $date_end are defined. We force $year_start and $nbofyear +$tmps=dol_getdate($date_start); +$year_start = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $year_start) + 1; $commonparams=array(); $commonparams['modecompta']=$modecompta; @@ -139,9 +145,7 @@ $form=new Form($db); if ($modecompta=="CREANCES-DETTES") { $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); $calcmode=$langs->trans("CalcModeDebt"); - $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink="".img_previous()." ".img_next().""; + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $description=$langs->trans("RulesCADue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); @@ -150,14 +154,16 @@ if ($modecompta=="CREANCES-DETTES") { } else { $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); $calcmode=$langs->trans("CalcModeEngagement"); - $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink="".img_previous()." ".img_next().""; + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $description=$langs->trans("RulesCAIn"); $description.= $langs->trans("DepositsAreIncluded"); $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } +$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); +if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) $periodlink=''.img_previous().' '.img_next().''; +else $periodlink = ''; + $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index b7b37d0837c..ed36d677df9 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -120,6 +120,13 @@ else // TODO We define q } +// $date_start and $date_end are defined. We force $year_start and $nbofyear +$tmps=dol_getdate($date_start); +$year_start = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $year_start) + 1; + $commonparams=array(); $commonparams['modecompta']=$modecompta; $commonparams['sortorder'] = $sortorder; @@ -167,9 +174,7 @@ if ($modecompta=="CREANCES-DETTES") { $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); $calcmode=$langs->trans("CalcModeDebt"); - $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink=''.img_previous().' '.img_next().''; + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $description=$langs->trans("RulesCADue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); @@ -178,14 +183,15 @@ if ($modecompta=="CREANCES-DETTES") } else { $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); $calcmode=$langs->trans("CalcModeEngagement"); - $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; - $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink=''.img_previous().' '.img_next().''; + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $description=$langs->trans("RulesCAIn"); $description.= $langs->trans("DepositsAreIncluded"); $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } +$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); +if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) $periodlink=''.img_previous().' '.img_next().''; +else $periodlink = ''; report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 598de2ba490..ea2d6fa9c03 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -71,7 +71,6 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $month_end=$month_start-1; if ($month_end < 1) $month_end=12; - else $year_end++; } else $month_end=$month_start; $date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false); @@ -85,6 +84,12 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $userid=GETPOST('userid','int'); $socid = GETPOST('socid','int'); +$tmps=dol_getdate($date_start); +$year_start = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $year_start) + 1; + // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') $modecompta = $conf->global->ACCOUNTING_MODE; if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING'; @@ -114,7 +119,7 @@ if ($modecompta=="CREANCES-DETTES") $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - $periodlink=($year_start?"".img_previous()." ".img_next()."":""); + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCADue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); @@ -128,7 +133,7 @@ else if ($modecompta=="RECETTES-DEPENSES") $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - $periodlink=($year_start?"".img_previous()." ".img_next()."":""); + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCAIn"); $description.= $langs->trans("DepositsAreIncluded"); $builddate=dol_now(); @@ -141,7 +146,7 @@ else if ($modecompta=="BOOKKEEPING") $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - $periodlink=($year_start?"".img_previous()." ".img_next()."":""); + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCATotalSaleJournal"); $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); @@ -493,7 +498,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) } if (! $total[$annee-1] && $total[$annee]) { - print '
+zzzz'.$total[$annee-1].$langs->trans('Inf').'%+'.$langs->trans('Inf').'%
'.$langs->trans("DateValue").''; + print '
'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; print $form->select_date($datev,"datev",'','','','add',1,1); print '
'.$langs->trans("Label").'
'.$langs->trans("Amount").'
'.$langs->trans("Amount").'
'; // Label - print ''; + //print ''; print ""; - print ''; - print ''; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 80242103c51..af330910cdf 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Tva extends CommonObject { - //public $element='tva'; //!< Id that identify managed objects - //public $table_element='tva'; //!< Name of table without prefix where object is stored + public $element='tva'; //!< Id that identify managed objects + public $table_element='tva'; //!< Name of table without prefix where object is stored public $picto='payment'; var $tms; @@ -48,8 +48,6 @@ class Tva extends CommonObject var $fk_user_creat; var $fk_user_modif; - - /** * Constructor * @@ -58,8 +56,6 @@ class Tva extends CommonObject function __construct($db) { $this->db = $db; - $this->element = 'tva'; - $this->table_element = 'tva'; } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 71376a566e1..734f4880e48 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -30,7 +30,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; +require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php'; $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin")); @@ -84,10 +91,6 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') -$modecompta = $conf->global->ACCOUNTING_MODE; -if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta"); - /* @@ -96,13 +99,19 @@ if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta"); $form=new Form($db); $company_static=new Societe($db); +$invoice_customer=new Facture($db); +$invoice_supplier=new FactureFournisseur($db); +$expensereport=new ExpenseReport($db); +$product_static=new Product($db); +$payment_static=new Paiement($db); +$paymentfourn_static=new PaiementFourn($db); +$paymentexpensereport_static=new PaymentExpenseReport($db); $morequerystring=''; $listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday'); -foreach($listofparams as $param) { - if (GETPOST($param)!='') { - $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); - } +foreach ($listofparams as $param) +{ + if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); } $special_report = false; @@ -118,15 +127,28 @@ $fsearch.=' '; $fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; $fsearch.=' '; -$description=''; - // Show report header -$name=$langs->trans("VATReportByCustomers"); +$name=$langs->trans("VATReportByThirdParties"); $calcmode=''; if ($modetax == 0) $calcmode=$langs->trans('OptionVATDefault'); if ($modetax == 1) $calcmode=$langs->trans('OptionVATDebitOption'); if ($modetax == 2) $calcmode=$langs->trans('OptionPaymentForProductAndServices'); $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; +// Set period +$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); +$prevyear=$year_start; $prevquarter=$q; +if ($prevquarter > 1) { + $prevquarter--; +} else { + $prevquarter=4; $prevyear--; +} +$nextyear=$year_start; $nextquarter=$q; +if ($nextquarter < 4) { + $nextquarter++; +} else { + $nextquarter=1; $nextyear++; +} +$builddate=dol_now(); if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') $description.=$langs->trans("RulesVATDueProducts"); if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') $description.=$langs->trans("RulesVATInProducts"); @@ -137,23 +159,24 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { } if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
'.$langs->trans("ThisIsAnEstimatedValue"); -$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=($year_start?"".img_previous()."".img_next()."":""); $description.=$fsearch; -$description.='
' - . ' ' - . $langs->trans('SimpleReport') - . '' - . '
' - . ' ' - . $langs->trans('AddExtraReport') - . '' - . '
'; -$builddate=dol_now(); -//$exportlink=$langs->trans("NotYetAvailable"); +if (! empty($conf->global->TAX_REPORT_EXTRA_REPORT)) +{ + $description.='
' + . ' ' + . $langs->trans('SimpleReport') + . '' + . '
' + . ' ' + . $langs->trans('AddExtraReport') + . '' + . '
'; +} $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("Description"); +$namerate=$langs->trans("VATRate"); $amountcust=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) { $vatcust.=' ('.$langs->trans("ToPay").')'; @@ -172,152 +195,547 @@ $vatsup=$langs->trans("VATPaid"); // VAT Received -//print "
"; -//print load_fiche_titre($vatcust); - print "
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("DatePayment").''; + print ''.$langs->trans("DatePayment").''; print dol_print_date($object->datep,'day'); print '
'; - print $form->editfieldkey("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); + print $form->editfieldkey($form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")), 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); print ''; - print $form->editfieldval("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); + print $form->editfieldval("PeriodEndDate", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); //print dol_print_date($object->datev,'day'); print '
"; -print ""; -print '"; -print '"; -print ""; -print ""; -print ""; -print "\n"; -$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell'); +$y = $year_current; +$total = 0; +$i=0; +$columns = 5; -$action = "tvaclient"; -$object = &$coll_list; -$parameters["mode"] = $modetax; -$parameters["start"] = $date_start; -$parameters["end"] = $date_end; -$parameters["direction"] = 'sell'; -$parameters["type"] = 'vat'; +// Load arrays of datas +$x_coll = tax_by_thirdparty('vat', $db, 0, $date_start, $date_end, $modetax, 'sell'); +$x_paye = tax_by_thirdparty('vat', $db, 0, $date_start, $date_end, $modetax, 'buy'); -// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('externalbalance')); -$reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - -if (is_array($coll_list)) { - $var=true; - $total = 0; $totalamount = 0; - $i = 1; - foreach ($coll_list as $coll) { - if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - - $intra = str_replace($find,$replace,$coll->tva_intra); - if(empty($intra)) { - if($coll->assuj == '1') { - $intra = $langs->trans('Unknown'); - } else { - //$intra = $langs->trans('NotRegistered'); - $intra = ''; - } - } - print ''; - print '"; - $company_static->id=$coll->socid; - $company_static->name=$coll->name; - $company_static->client=1; - print ''; - $find = array(' ','.'); - $replace = array('',''); - print '"; - print ""; - print ""; - $totalamount = $totalamount + $coll->amount; - $total = $total + $coll->tva; - print "\n"; - $i++; - } - } - $x_coll_sum = $total; - - print ''; - print ''; - print ''; - print ''; -} else { +if (! is_array($x_coll) || ! is_array($x_paye)) +{ $langs->load("errors"); - if ($coll_list == -1) { - if ($modecompta == 'CREANCES-DETTES') - { - print ''; - } - else - { - print ''; - } - } else if ($coll_list == -2) { - print ''; + if ($x_coll == -1) { + print ''; + } else if ($x_coll == -2) { + print ''; } else { - print ''; + print ''; } -} - -//print '
'.$langs->trans("Num")."'.$langs->trans("Customer")."".$langs->trans("VATIntra")."".$langs->trans("AmountHTVATRealReceived")."".$vatcust."
'.$i."'.$company_static->getNomUrl(1,'customer').''.$intra."".price($coll->amount)."".price($coll->tva)."
'.$langs->trans("Total").':'.price($totalamount).''.price($total).'
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
' . $langs->trans("Error") . '
'; - - -// VAT Paid - -//print "
"; -//print load_fiche_titre($vatsup); - -//print ""; -print ""; -print '"; -print '"; -print ""; -print ""; -print ""; -print "\n"; - -$company_static=new Societe($db); - -$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy'); - -$parameters["direction"] = 'buy'; -$reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -if (is_array($coll_list)) { - $var=true; - $total = 0; $totalamount = 0; - $i = 1; - foreach ($coll_list as $coll) { - if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - - $intra = str_replace($find,$replace,$coll->tva_intra); - if (empty($intra)) { - if ($coll->assuj == '1') { - $intra = $langs->trans('Unknown'); - } else { - //$intra = $langs->trans('NotRegistered'); - $intra = ''; - } - } - print ''; - print '"; - $company_static->id=$coll->socid; - $company_static->name=$coll->name; - $company_static->fournisseur=1; - print ''; - $find = array(' ','.'); - $replace = array('',''); - print '"; - print ""; - print ""; - $totalamount = $totalamount + $coll->amount; - $total = $total + $coll->tva; - print "\n"; - $i++; +} else { + $x_both = array(); + //now, from these two arrays, get another array with one rate per line + foreach(array_keys($x_coll) as $my_coll_thirdpartyid) + { + $x_both[$my_coll_thirdpartyid]['coll']['totalht'] = $x_coll[$my_coll_thirdpartyid]['totalht']; + $x_both[$my_coll_thirdpartyid]['coll']['vat'] = $x_coll[$my_coll_thirdpartyid]['vat']; + $x_both[$my_coll_thirdpartyid]['paye']['totalht'] = 0; + $x_both[$my_coll_thirdpartyid]['paye']['vat'] = 0; + $x_both[$my_coll_thirdpartyid]['coll']['links'] = ''; + $x_both[$my_coll_thirdpartyid]['coll']['detail'] = array(); + foreach($x_coll[$my_coll_thirdpartyid]['facid'] as $id=>$dummy) { + $invoice_customer->id=$x_coll[$my_coll_thirdpartyid]['facid'][$id]; + $invoice_customer->ref=$x_coll[$my_coll_thirdpartyid]['facnum'][$id]; + $invoice_customer->type=$x_coll[$my_coll_thirdpartyid]['type'][$id]; + $company_static->fetch($x_coll[$my_coll_thirdpartyid]['company_id'][$id]); + $x_both[$my_coll_thirdpartyid]['coll']['detail'][] = array( + 'id' =>$x_coll[$my_coll_thirdpartyid]['facid'][$id], + 'descr' =>$x_coll[$my_coll_thirdpartyid]['descr'][$id], + 'pid' =>$x_coll[$my_coll_thirdpartyid]['pid'][$id], + 'pref' =>$x_coll[$my_coll_thirdpartyid]['pref'][$id], + 'ptype' =>$x_coll[$my_coll_thirdpartyid]['ptype'][$id], + 'payment_id'=>$x_coll[$my_coll_thirdpartyid]['payment_id'][$id], + 'payment_amount'=>$x_coll[$my_coll_thirdpartyid]['payment_amount'][$id], + 'ftotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['ftotal_ttc'][$id], + 'dtotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['dtotal_ttc'][$id], + 'dtype' =>$x_coll[$my_coll_thirdpartyid]['dtype'][$id], + 'drate' =>$x_coll[$my_coll_thirdpartyid]['drate'][$id], + 'datef' =>$x_coll[$my_coll_thirdpartyid]['datef'][$id], + 'datep' =>$x_coll[$my_coll_thirdpartyid]['datep'][$id], + 'company_link'=>$company_static->getNomUrl(1,'',20), + 'ddate_start'=>$x_coll[$my_coll_thirdpartyid]['ddate_start'][$id], + 'ddate_end' =>$x_coll[$my_coll_thirdpartyid]['ddate_end'][$id], + 'totalht' =>$x_coll[$my_coll_thirdpartyid]['totalht_list'][$id], + 'vat' =>$x_coll[$my_coll_thirdpartyid]['vat_list'][$id], + 'link' =>$invoice_customer->getNomUrl(1,'',12) + ); } } - $x_paye_sum = $total; + // tva paid + foreach (array_keys($x_paye) as $my_paye_thirdpartyid) { + $x_both[$my_paye_thirdpartyid]['paye']['totalht'] = $x_paye[$my_paye_thirdpartyid]['totalht']; + $x_both[$my_paye_thirdpartyid]['paye']['vat'] = $x_paye[$my_paye_thirdpartyid]['vat']; + if (!isset($x_both[$my_paye_thirdpartyid]['coll']['totalht'])) { + $x_both[$my_paye_thirdpartyid]['coll']['totalht'] = 0; + $x_both[$my_paye_thirdpartyid]['coll']['vat'] = 0; + } + $x_both[$my_paye_thirdpartyid]['paye']['links'] = ''; + $x_both[$my_paye_thirdpartyid]['paye']['detail'] = array(); - print ''; - print ''; - print ''; + foreach ($x_paye[$my_paye_thirdpartyid]['facid'] as $id=>$dummy) + { + // ExpenseReport + if ($x_paye[$my_paye_thirdpartyid]['ptype'][$id] == 'ExpenseReportPayment') + { + $expensereport->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id]; + $expensereport->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id]; + $expensereport->type=$x_paye[$my_paye_thirdpartyid]['type'][$id]; + + $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id], + 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id], + 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id], + 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id], + 'payment_id' =>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id], + 'payment_amount' =>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id], + 'ftotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]), + 'dtotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id], + 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id], + 'ddate_start' =>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id], + 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id], + 'link' =>$expensereport->getNomUrl(1) + ); + } + else + { + $invoice_supplier->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id]; + $invoice_supplier->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id]; + $invoice_supplier->type=$x_paye[$my_paye_thirdpartyid]['type'][$id]; + $company_static->fetch($x_paye[$my_paye_thirdpartyid]['company_id'][$id]); + $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id], + 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id], + 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id], + 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id], + 'payment_id'=>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id], + 'payment_amount'=>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id], + 'ftotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]), + 'dtotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id], + 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id], + 'datef' =>$x_paye[$my_paye_thirdpartyid]['datef'][$id], + 'datep' =>$x_paye[$my_paye_thirdpartyid]['datep'][$id], + 'company_link'=>$company_static->getNomUrl(1,'',20), + 'ddate_start'=>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id], + 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id], + 'link' =>$invoice_supplier->getNomUrl(1,'',12) + ); + } + } + } + //now we have an array (x_both) indexed by rates for coll and paye + + + //print table headers for this quadri - incomes first + + $x_coll_sum = 0; + $x_coll_ht = 0; + $x_paye_sum = 0; + $x_paye_ht = 0; + + $span=$columns; + if ($modetax != 1) $span+=2; + + //print ''; + + // Customers invoices + print ''; + print ''; + print ''; + if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print ''; + else print ''; + print ''; + print ''; + if ($modetax != 1) + { + print ''; + print ''; + } + print ''; + print ''; print ''; + $action = "tvadetail"; + $parameters["mode"] = $modetax; + $parameters["start"] = $date_start; + $parameters["end"] = $date_end; + $parameters["type"] = 'vat'; + + $object = array(&$x_coll, &$x_paye, &$x_both); + // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + $hookmanager->initHooks(array('externalbalance')); + $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + foreach (array_keys($x_coll) as $thirdparty_id) { + $subtot_coll_total_ht = 0; + $subtot_coll_vat = 0; + + if (is_array($x_both[$thirdparty_id]['coll']['detail'])) + { + + // VAT Rate + print ""; + print ''; + print ''."\n"; + + foreach ($x_both[$thirdparty_id]['coll']['detail'] as $index => $fields) { + // Define type + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (!empty($fields['ddate_start'])) { + $type=1; + } + if (!empty($fields['ddate_end'])) { + $type=1; + } + + + print ''; + + // Ref + print ''; + + // Invoice date + print ''; + + // Payment date + if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print ''; + else print ''; + + // Rate + print ''; + + // Description + print ''; + + // Total HT + if ($modetax != 1) + { + print ''; + } + + // Payment + $ratiopaymentinvoice=1; + if ($modetax != 1) + { + print ''; + } + + // Total collected + print ''; + + // VAT + print ''; + print ''; + + $subtot_coll_total_ht += $temp_ht; + $subtot_coll_vat += $temp_vat; + $x_coll_sum += $temp_vat; + } + } + // Total customers for this vat rate + print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''; + } + + if (count($x_coll) == 0) // Show a total ine if nothing shown + { + print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''; + } + + // Blank line + print ''; + + // Print table headers for this quadri - expenses now + print ''; + print ''; + print ''; + if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print ''; + else print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''."\n"; + + foreach (array_keys($x_paye) as $thirdparty_id) + { + $subtot_paye_total_ht = 0; + $subtot_paye_vat = 0; + + if (is_array($x_both[$thirdparty_id]['paye']['detail'])) + { + print ""; + print ''; + print ''."\n"; + + foreach ($x_both[$thirdparty_id]['paye']['detail'] as $index=>$fields) { + // Define type + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (!empty($fields['ddate_start'])) { + $type=1; + } + if (!empty($fields['ddate_end'])) { + $type=1; + } + + + print ''; + + // Ref + print ''; + + // Invoice date + print ''; + + // Payment date + if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print ''; + else print ''; + + // Company name + print ''; + + // Description + print ''; + + // Total HT + if ($modetax != 1) + { + print ''; + } + + // Payment + $ratiopaymentinvoice=1; + if ($modetax != 1) + { + print ''; + } + + // VAT paid + print ''; + + // VAT + print ''; + print ''; + + $subtot_paye_total_ht += $temp_ht; + $subtot_paye_vat += $temp_vat; + $x_paye_sum += $temp_vat; + } + } + // Total suppliers for this vat rate + print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''; + } + + if (count($x_paye) == 0) { // Show a total line if nothing shown + print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''; + } + print '
'.$langs->trans("Num")."'.$langs->trans("Supplier")."".$langs->trans("VATIntra")."".$langs->trans("AmountHTVATRealPaid")."".$vatsup."
'.$i."'.$company_static->getNomUrl(1,'supplier').''.$intra."".price($coll->amount)."".price($coll->tva)."
'.$langs->trans("Total").':'.price($totalamount).''.price($total).'
'..')
'.$elementcust.''.$langs->trans("DateInvoice").''.$langs->trans("DatePayment").''.$namerate.''.$productcust.''.$amountcust.''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'.$langs->trans("AmountHTVATRealReceived").''.$vatcust.'
'; + if (is_numeric($thirdparty_id)) + { + $company_static->fetch($thirdparty_id); + print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1); + } + else + { + $tmpid = preg_replace('/userid_/','',$thirdparty_id); + $user_static->fetch($tmpid); + print $langs->trans("User").': '.$user_static->getNomUrl(1); + } + print '
'.$fields['link'].'' . dol_print_date($fields['datef'], 'day') . '' . dol_print_date($fields['datep'], 'day') . '' . $fields['drate'] . ''; + if ($fields['pid']) + { + $product_static->id=$fields['pid']; + $product_static->ref=$fields['pref']; + $product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered + print $product_static->getNomUrl(1); + if (dol_string_nohtmltag($fields['descr'])) { + print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),24); + } + } + else + { + if ($type) { + $text = img_object($langs->trans('Service'),'service'); + } else { + $text = img_object($langs->trans('Product'),'product'); + } + if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) { + if ($reg[1]=='DEPOSIT') { + $fields['descr']=$langs->transnoentitiesnoconv('Deposit'); + } elseif ($reg[1]=='CREDIT_NOTE') { + $fields['descr']=$langs->transnoentitiesnoconv('CreditNote'); + } else { + $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); + } + } + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),24); + + // Show range + print_date_range($fields['ddate_start'],$fields['ddate_end']); + } + print ''; + print price($fields['totalht']); + if (price2num($fields['ftotal_ttc'])) + { + //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; + $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']); + //print ' ('.round($ratiolineinvoice*100,2).'%)'; + } + print ''; + //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc']; + if ($fields['payment_amount'] && $fields['ftotal_ttc']) + { + $payment_static->id=$fields['payment_id']; + print $payment_static->getNomUrl(2); + } + if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') + || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) + { + print $langs->trans("NA"); + } else { + if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { + $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); + } + print price(price2num($fields['payment_amount'],'MT')); + if (isset($fields['payment_amount'])) { + print ' ('.round($ratiopaymentinvoice*100,2).'%)'; + } + } + print ''; + $temp_ht=$fields['totalht']*$ratiopaymentinvoice; + print price(price2num($temp_ht,'MT'),1); + print ''; + $temp_vat=$fields['vat']*$ratiopaymentinvoice; + print price(price2num($temp_vat,'MT'),1); + //print price($fields['vat']); + print '
'.$langs->trans("Total").':  '.price(price2num($subtot_coll_total_ht,'MT')).''.price(price2num($subtot_coll_vat,'MT')).'
'.$langs->trans("Total").':  '.price(price2num(0,'MT')).''.price(price2num(0,'MT')).'
 
'.$elementsup.''.$langs->trans("DateInvoice").''.$langs->trans("DatePayment").''.$namesup.''.$productsup.''.$amountsup.''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'.$langs->trans("AmountHTVATRealPaid").''.$vatsup.'
'; + if (is_numeric($thirdparty_id)) + { + $company_static->fetch($thirdparty_id); + print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1); + } + else + { + $tmpid = preg_replace('/userid_/','',$thirdparty_id); + $user_static->fetch($tmpid); + print $langs->trans("User").': '.$user_static->getNomUrl(1); + } + print '
'.$fields['link'].'' . dol_print_date($fields['datef'], 'day') . '' . dol_print_date($fields['datep'], 'day') . '' . $fields['company_link'] . ''; + if ($fields['pid']) + { + $product_static->id=$fields['pid']; + $product_static->ref=$fields['pref']; + $product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered + print $product_static->getNomUrl(1); + if (dol_string_nohtmltag($fields['descr'])) { + print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),24); + } + } + else + { + if ($type) { + $text = img_object($langs->trans('Service'),'service'); + } else { + $text = img_object($langs->trans('Product'),'product'); + } + if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) { + if ($reg[1]=='DEPOSIT') { + $fields['descr']=$langs->transnoentitiesnoconv('Deposit'); + } elseif ($reg[1]=='CREDIT_NOTE') { + $fields['descr']=$langs->transnoentitiesnoconv('CreditNote'); + } else { + $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); + } + } + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),24); + + // Show range + print_date_range($fields['ddate_start'],$fields['ddate_end']); + } + print ''; + print price($fields['totalht']); + if (price2num($fields['ftotal_ttc'])) + { + //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; + $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']); + //print ' ('.round($ratiolineinvoice*100,2).'%)'; + } + print ''; + if ($fields['payment_amount'] && $fields['ftotal_ttc']) + { + $paymentfourn_static->id=$fields['payment_id']; + print $paymentfourn_static->getNomUrl(2); + } + + if (($type == 0 && $conf->global->TAX_MODE_BUY_PRODUCT == 'invoice') + || ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice')) + { + print $langs->trans("NA"); + } + else + { + if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { + $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); + } + print price(price2num($fields['payment_amount'],'MT')); + if (isset($fields['payment_amount'])) { + print ' ('.round($ratiopaymentinvoice*100,2).'%)'; + } + } + print ''; + $temp_ht=$fields['totalht']*$ratiopaymentinvoice; + print price(price2num($temp_ht,'MT'),1); + print ''; + $temp_vat=$fields['vat']*$ratiopaymentinvoice; + print price(price2num($temp_vat,'MT'),1); + //print price($fields['vat']); + print '
'.$langs->trans("Total").':  '.price(price2num($subtot_paye_total_ht,'MT')).''.price(price2num($subtot_paye_vat,'MT')).'
'.$langs->trans("Total").':  '.price(price2num(0,'MT')).''.price(price2num(0,'MT')).'
'; // Total to pay @@ -325,198 +743,15 @@ if (is_array($coll_list)) { print ''; $diff = $x_coll_sum - $x_paye_sum; print ''; - print ''; + print ''; print '\n"; print "\n"; -} else { - $langs->load("errors"); - if ($coll_list == -1) { - if ($modecompta == 'CREANCES-DETTES') - { - print ''; - } - else - { - print ''; - } - } else if ($coll_list == -2) { - print ''; - } else { - print ''; - } + $i++; } print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
'; -if ($special_report) { - // Get country 2-letters code - global $mysoc; - $country_id = $mysoc->country_id; - $country = new Ccountry($db); - $country->fetch($country_id); - - // Print listing of other-country customers as additional report - // This matches tax requirements to list all same-country customers (only) - print '

'.$langs->trans('OtherCountriesCustomersReport').'

'; - print $langs->trans('BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry'); - $coll_list = vat_by_thirdparty($db, 0, $date_start, $date_end, $modetax, 'sell'); - - print ""; - print ""; - print '"; - print '"; - print ""; - print ""; - print ""; - print "\n"; - - if (is_array($coll_list)) { - $var = true; - $total = 0; - $totalamount = 0; - $i = 1; - foreach ($coll_list as $coll) { - if (substr($coll->tva_intra, 0, 2) == $country->code) { - // Only use different-country VAT codes - continue; - } - if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - $var = !$var; - $intra = str_replace($find, $replace, $coll->tva_intra); - if (empty($intra)) { - if ($coll->assuj == '1') { - $intra = $langs->trans('Unknown'); - } else { - //$intra = $langs->trans('NotRegistered'); - $intra = ''; - } - } - print ""; - print '"; - $company_static->id = $coll->socid; - $company_static->name = $coll->name; - $company_static->client = 1; - print ''; - $find = array(' ', '.'); - $replace = array('', ''); - print '"; - print ""; - print ""; - $totalamount = $totalamount + $coll->amount; - $total = $total + $coll->tva; - print "\n"; - $i++; - } - } - $x_coll_sum = $total; - - print ''; - print ''; - print ''; - print ''; - } else { - $langs->load("errors"); - if ($coll_list == -1) { - if ($modecompta == 'CREANCES-DETTES') - { - print ''; - } - else - { - print ''; - } - } else { - if ($coll_list == -2) { - print ''; - } else { - print ''; - } - } - } - print '
' . $langs->trans("Num") . "' . $langs->trans("Customer") . "" . $langs->trans("VATIntra") . "" . $langs->trans("AmountHTVATRealReceived") . "" . $vatcust . "
' . $i . "' . $company_static->getNomUrl(1, - 'customer') . '' . $intra . "" . price($coll->amount) . "" . price($coll->tva) . "
' . $langs->trans("Total") . ':' . price($totalamount) . '' . price($total) . '
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
'; - - // Print listing of same-country customers as additional report - // This matches tax requirements to list all same-country customers (only) - print '

'.$langs->trans('SameCountryCustomersWithVAT').'

'; - print $langs->trans('BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry'); - $coll_list = vat_by_thirdparty($db, 0, $date_start, $date_end, $modetax, 'sell'); - - print ""; - print ""; - print '"; - print '"; - print ""; - print ""; - print ""; - print "\n"; - - if (is_array($coll_list)) { - $var = true; - $total = 0; - $totalamount = 0; - $i = 1; - foreach ($coll_list as $coll) { - if (substr($coll->tva_intra, 0, 2) != $country->code) { - // Only use same-country VAT codes - continue; - } - if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - $var = !$var; - $intra = str_replace($find, $replace, $coll->tva_intra); - if (empty($intra)) { - if ($coll->assuj == '1') { - $intra = $langs->trans('Unknown'); - } else { - //$intra = $langs->trans('NotRegistered'); - $intra = ''; - } - } - print ""; - print '"; - $company_static->id = $coll->socid; - $company_static->name = $coll->name; - $company_static->client = 1; - print ''; - $find = array(' ', '.'); - $replace = array('', ''); - print '"; - print ""; - print ""; - $totalamount = $totalamount + $coll->amount; - $total = $total + $coll->tva; - print "\n"; - $i++; - } - } - $x_coll_sum = $total; - - print ''; - print ''; - print ''; - print ''; - } else { - $langs->load("errors"); - if ($coll_list == -1) { - if ($modecompta == 'CREANCES-DETTES') - { - print ''; - } - else - { - print ''; - } - } else { - if ($coll_list == -2) { - print ''; - } else { - print ''; - } - } - } - print '
' . $langs->trans("Num") . "' . $langs->trans("Customer") . "" . $langs->trans("VATIntra") . "" . $langs->trans("AmountHTVATRealReceived") . "" . $vatcust . "
' . $i . "' . $company_static->getNomUrl(1, 'customer') . '' . $intra . "" . price($coll->amount) . "" . price($coll->tva) . "
' . $langs->trans("Total") . ':' . price($totalamount) . '' . price($total) . '
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
'; -} llxFooter(); diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 9ffc2202b8a..04d65dfadf5 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -84,7 +84,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; if ($action == 'setlib' && $user->rights->tax->charges->creer) { $object->fetch($id); - $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); + $result = $object->setValueFrom('label', GETPOST('lib','alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } @@ -111,23 +111,8 @@ if ($object->id) $morehtmlref='
'; // Label of social contribution - $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' : '; - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } + $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); $morehtmlref.='
'; $linkback = '' . $langs->trans("BackToList") . ''; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 1c9632fac61..3597ad27c92 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin")); @@ -44,13 +45,12 @@ if (empty($year)) } $date_start=dol_mktime(0,0,0,GETPOST("date_startmonth"),GETPOST("date_startday"),GETPOST("date_startyear")); $date_end=dol_mktime(23,59,59,GETPOST("date_endmonth"),GETPOST("date_endday"),GETPOST("date_endyear")); -// Quarter if (empty($date_start) || empty($date_end)) // We define date_start and date_end { - $q=GETPOST("q"); + $q=GETPOST("q","int"); if (empty($q)) { - if (GETPOST("month")) { $date_start=dol_get_first_day($year_start,GETPOST("month"),false); $date_end=dol_get_last_day($year_start,GETPOST("month"),false); } + if (GETPOST("month","int")) { $date_start=dol_get_first_day($year_start,GETPOST("month","int"),false); $date_end=dol_get_last_day($year_start,GETPOST("month","int"),false); } else { $date_start=dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START,false); @@ -81,10 +81,10 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); /** * print function * - * @param DoliDB $db Database handler - * @param string $sql SQL Request - * @param string $date Date - * @return void + * @param DoliDB $db Database handler + * @param string $sql SQL Request + * @param string $date Date + * @return void */ function pt ($db, $sql, $date) { @@ -96,25 +96,78 @@ function pt ($db, $sql, $date) $i = 0; $total = 0; print ''; + print ''; - print ''; - print ''; - print ''."\n"; + print ''; + print ''; + print ''; print "\n"; + $amountclaimed = 0; + $amountpaid = 0; + $previousmode = ''; while ($i < $num) { $obj = $db->fetch_object($result); - print ''; - print '\n"; - $total = $total + $obj->mm; + if ($obj->mode == 'claimed' && ! empty($previousmode)) + { + print ''; + print '\n"; + print '\n"; + print '\n"; + print "\n"; - print '\n"; - print "\n"; + $amountclaimed = 0; + $amountpaid = 0; + } + + if ($obj->mode == 'claimed') + { + $amountclaimed = $obj->mm; + $totalclaimed = $totalclaimed + $amountclaimed; + } + if ($obj->mode == 'paid') + { + $amountpaid = $obj->mm; + $totalpaid = $totalpaid + $amountpaied; + } + + if ($obj->mode == 'paid') + { + print ''; + print '\n"; + print '\n"; + print '\n"; + print "\n"; + $amountclaimed = 0; + $amountpaid = 0; + $previousmode = ''; + } + else + { + $previousmode = $obj->mode; + } $i++; } - print '"; + + if ($obj->mode == 'claimed' && ! empty($previousmode)) + { + print ''; + print '\n"; + print '\n"; + print '\n"; + print "\n"; + + $amountclaimed = 0; + $amountpaid = 0; + } + + print ''; + print ''; + print ''; + print ''; + print ""; print "
'.$date.''.$langs->trans("Amount").' '.$date.''.$langs->trans("ClaimedForThisPeriod").''.$langs->trans("PaidDuringThisPeriod").'
'.$obj->dm."
'.$obj->dm."'.price($amountclaimed)."'.price($amountpaid)."
'.price($obj->mm)." 
'.$obj->dm."'.price($amountclaimed)."'.price($amountpaid)."
'.$langs->trans("Total")." :".price($total)." 
'.$obj->dm."'.price($amountclaimed)."'.price($amountpaid)."
'.$langs->trans("Total").''.price($totalclaimed).''.price($totalpaid).'
"; $db->free($result); @@ -189,21 +242,128 @@ $m = $tmp['mon']; $tmp=dol_getdate($date_end); $yend = $tmp['year']; $mend = $tmp['mon']; - +//var_dump($m); $total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; $i=0; $mcursor=0; while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop { - $m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12); + //$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12); if ($m == 13) $y++; if ($m > 12) $m -= 12; $mcursor++; - $coll_listsell = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'sell', $m); - $coll_listbuy = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'buy', $m); + $x_coll = tax_by_rate('vat', $db, $y, 0, 0, 0, $modetax, 'sell', $m); + $x_paye = tax_by_rate('vat', $db, $y, 0, 0, 0, $modetax, 'buy', $m); + + $x_both = array(); + //now, from these two arrays, get another array with one rate per line + foreach(array_keys($x_coll) as $my_coll_rate) + { + $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht']; + $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat']; + $x_both[$my_coll_rate]['paye']['totalht'] = 0; + $x_both[$my_coll_rate]['paye']['vat'] = 0; + $x_both[$my_coll_rate]['coll']['links'] = ''; + $x_both[$my_coll_rate]['coll']['detail'] = array(); + foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy) { + //$invoice_customer->id=$x_coll[$my_coll_rate]['facid'][$id]; + //$invoice_customer->ref=$x_coll[$my_coll_rate]['facnum'][$id]; + //$invoice_customer->type=$x_coll[$my_coll_rate]['type'][$id]; + //$company_static->fetch($x_coll[$my_coll_rate]['company_id'][$id]); + $x_both[$my_coll_rate]['coll']['detail'][] = array( + 'id' =>$x_coll[$my_coll_rate]['facid'][$id], + 'descr' =>$x_coll[$my_coll_rate]['descr'][$id], + 'pid' =>$x_coll[$my_coll_rate]['pid'][$id], + 'pref' =>$x_coll[$my_coll_rate]['pref'][$id], + 'ptype' =>$x_coll[$my_coll_rate]['ptype'][$id], + 'payment_id'=>$x_coll[$my_coll_rate]['payment_id'][$id], + 'payment_amount'=>$x_coll[$my_coll_rate]['payment_amount'][$id], + 'ftotal_ttc'=>$x_coll[$my_coll_rate]['ftotal_ttc'][$id], + 'dtotal_ttc'=>$x_coll[$my_coll_rate]['dtotal_ttc'][$id], + 'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id], + 'datef' =>$x_coll[$my_coll_rate]['datef'][$id], + 'datep' =>$x_coll[$my_coll_rate]['datep'][$id], + //'company_link'=>$company_static->getNomUrl(1,'',20), + 'ddate_start'=>$x_coll[$my_coll_rate]['ddate_start'][$id], + 'ddate_end' =>$x_coll[$my_coll_rate]['ddate_end'][$id], + 'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id], + 'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id], + //'link' =>$invoice_customer->getNomUrl(1,'',12) + ); + } + } + + // tva paid + foreach (array_keys($x_paye) as $my_paye_rate) { + $x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht']; + $x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat']; + if (!isset($x_both[$my_paye_rate]['coll']['totalht'])) { + $x_both[$my_paye_rate]['coll']['totalht'] = 0; + $x_both[$my_paye_rate]['coll']['vat'] = 0; + } + $x_both[$my_paye_rate]['paye']['links'] = ''; + $x_both[$my_paye_rate]['paye']['detail'] = array(); + + foreach ($x_paye[$my_paye_rate]['facid'] as $id=>$dummy) + { + // ExpenseReport + if ($x_paye[$my_paye_rate]['ptype'][$id] == 'ExpenseReportPayment') + { + //$expensereport->id=$x_paye[$my_paye_rate]['facid'][$id]; + //$expensereport->ref=$x_paye[$my_paye_rate]['facnum'][$id]; + //$expensereport->type=$x_paye[$my_paye_rate]['type'][$id]; + + $x_both[$my_paye_rate]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_rate]['facid'][$id], + 'descr' =>$x_paye[$my_paye_rate]['descr'][$id], + 'pid' =>$x_paye[$my_paye_rate]['pid'][$id], + 'pref' =>$x_paye[$my_paye_rate]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id], + 'payment_id' =>$x_paye[$my_paye_rate]['payment_id'][$id], + 'payment_amount' =>$x_paye[$my_paye_rate]['payment_amount'][$id], + 'ftotal_ttc' =>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]), + 'dtotal_ttc' =>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id], + 'ddate_start' =>$x_paye[$my_paye_rate]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], + 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], + //'link' =>$expensereport->getNomUrl(1) + ); + } + else + { + //$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; + //$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; + //$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; + //$company_static->fetch($x_paye[$my_paye_rate]['company_id'][$id]); + $x_both[$my_paye_rate]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_rate]['facid'][$id], + 'descr' =>$x_paye[$my_paye_rate]['descr'][$id], + 'pid' =>$x_paye[$my_paye_rate]['pid'][$id], + 'pref' =>$x_paye[$my_paye_rate]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id], + 'payment_id'=>$x_paye[$my_paye_rate]['payment_id'][$id], + 'payment_amount'=>$x_paye[$my_paye_rate]['payment_amount'][$id], + 'ftotal_ttc'=>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]), + 'dtotal_ttc'=>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id], + 'datef' =>$x_paye[$my_paye_rate]['datef'][$id], + 'datep' =>$x_paye[$my_paye_rate]['datep'][$id], + //'company_link'=>$company_static->getNomUrl(1,'',20), + 'ddate_start'=>$x_paye[$my_paye_rate]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], + 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], + //'link' =>$invoice_supplier->getNomUrl(1,'',12) + ); + } + } + } + //now we have an array (x_both) indexed by rates for coll and paye $action = "tva"; - $object = array(&$coll_listsell, &$coll_listbuy); + $object = array(&$x_coll, &$x_paye, &$x_both); $parameters["mode"] = $modetax; $parameters["year"] = $y; $parameters["month"] = $m; @@ -213,13 +373,13 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if (! is_array($coll_listbuy) && $coll_listbuy == -1) + if (! is_array($x_coll) && $coll_listbuy == -1) { $langs->load("errors"); print '
'.$langs->trans("ErrorNoAccountancyModuleLoaded").'
'.$langs->trans("FeatureNotYetAvailable").'
'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'".price($x_coll)."".price(price2num($x_coll_sum,'MT'))."".price($x_paye)."".price(price2num($x_paye_sum,'MT'))."".price($diff)."".price(price2num($diff,'MT'))." 
'.$langs->trans("SubTotal").':'.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotal).''.price(price2num($subtotalcoll,'MT')).''.price(price2num($subtotalpaye,'MT')).''.price(price2num($subtotal,'MT')).' 
'.$langs->trans("TotalToPay").':'.price($total).'
'.$langs->trans("TotalToPay").':'.price(price2num($total, 'MT')).' 
'; print '
'; -print load_fiche_titre($langs->trans("VATPaid"), '', ''); /* * Payed */ -$sql = "SELECT SUM(amount) as mm, date_format(f.datep,'%Y-%m') as dm"; +print load_fiche_titre($langs->trans("VATPaid"), '', ''); + +$sql=''; + +$sql.= "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm, 'claimed' as mode"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as f"; $sql.= " WHERE f.entity = ".$conf->entity; -$sql.= " AND f.datep >= '".$db->idate($date_start)."'"; -$sql.= " AND f.datep <= '".$db->idate($date_end)."'"; -$sql.= " GROUP BY dm ORDER BY dm ASC"; +$sql.= " AND (f.datev >= '".$db->idate($date_start)."' AND f.datev <= '".$db->idate($date_end)."')"; +$sql.= " GROUP BY dm"; -pt($db, $sql,$langs->trans("Year")." $y"); +$sql.= " UNION "; +$sql.= "SELECT SUM(amount) as mm, date_format(f.datep,'%Y-%m') as dm, 'paid' as mode"; +$sql.= " FROM ".MAIN_DB_PREFIX."tva as f"; +$sql.= " WHERE f.entity = ".$conf->entity; +$sql.= " AND (f.datep >= '".$db->idate($date_start)."' AND f.datep <= '".$db->idate($date_end)."')"; +$sql.= " GROUP BY dm"; -print '
'; +$sql.= " ORDER BY dm ASC"; +//print $sql; + +pt($db, $sql, $langs->trans("Month")); if (! empty($conf->global->MAIN_FEATURES_LEVEL)) { - /* + print '
'; + + /* * Recap */ - print load_fiche_titre($langs->trans("VATRecap"), '', ''); // need to add translation + print load_fiche_titre($langs->trans("VATBalance"), '', ''); // need to add translation $sql1 = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y') as dm"; $sql1 .= " FROM " . MAIN_DB_PREFIX . "tva as f"; @@ -316,7 +563,7 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL)) print ''; print ""; - print ''; // need to add translation + print ''; print ''; print "\n"; @@ -327,7 +574,7 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $restopay = $total - $obj->mm; print ""; - print ''; // need to add translation + print ''; print ''; print "\n"; diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php index 6a3955403e7..24208aedf2a 100644 --- a/htdocs/compta/tva/info.php +++ b/htdocs/compta/tva/info.php @@ -37,10 +37,27 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +$object = new Tva($db); + + + +/* + * Actions + */ + +if ($action == 'setlib' && $user->rights->tax->charges->creer) +{ + $object->fetch($id); + $result = $object->setValueFrom('label', GETPOST('lib','alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); + if ($result < 0) + setEventMessages($object->error, $object->errors, 'errors'); +} + /* * View */ + $title=$langs->trans("VAT") . " - " . $langs->trans("Info"); $help_url=''; llxHeader("",$title,$helpurl); @@ -53,6 +70,12 @@ $head = vat_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("VATPayment"), -1, 'payment'); +$morehtmlref='
'; +// Label of social contribution +$morehtmlref.=$form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); +$morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); +$morehtmlref.='
'; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index e796ddacac7..efe436a3704 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -46,7 +46,7 @@ $search_account = GETPOST('search_account','int'); $month = GETPOST("month","int"); $year = GETPOST("year","int"); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -151,7 +151,9 @@ if ($result) $newcardbutton=''; if ($user->rights->tax->charges->creer) { - $newcardbutton=''.$langs->trans('NewVATPayment').''; + $newcardbutton=''.$langs->trans('NewVATPayment'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''; @@ -168,11 +170,11 @@ if ($result) print '
' . $langs->trans("VATDue") . '' . $langs->trans("VATDue") . '' . price(price2num($total, 'MT')) . '
' . $langs->trans("VATRestopay") . '' . $langs->trans("RemainToPay") . '' . price(price2num($restopay, 'MT')) . '
'; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; @@ -197,7 +199,7 @@ if ($result) print ''; print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder); print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre("DateValue",$_SERVER["PHP_SELF"],"t.datev","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"t.datev","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"t.datep","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); if (! empty($conf->banque->enabled)) print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); @@ -264,7 +266,7 @@ if ($result) $colspan=5; if (! empty($conf->banque->enabled)) $colspan++; print ''; - print ""; + print ''; print ""; print "
'; - print ''; + print ''; + print ''; $syear = $year; $formother->select_year($syear?$syear:-1,'year',1, 20, 5); print '
'.$langs->trans("Total").'".price($total)."'.price($total).' 
"; diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php deleted file mode 100644 index e572eb7e006..00000000000 --- a/htdocs/compta/tva/quadri.php +++ /dev/null @@ -1,319 +0,0 @@ - - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2008 Laurent Destailleur - * Copyright (C) 2006 Yannick Warnier - * Copyright (C) 2005-2009 Regis Houssin - * - * 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/compta/tva/quadri.php - * \ingroup tax - * \brief Trimestrial page - * TODO Deal with recurrent invoices as well - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; - -$langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin")); - -$year = GETPOST('year', 'int'); -if ($year == 0 ) -{ - $year_current = strftime("%Y",time()); - $year_start = $year_current; -} else { - $year_current = $year; - $year_start = $year; -} - -// Security check -$socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'tax', '', '', 'charges'); - - -/** - * Gets VAT to collect for the given month of the given year - * The function gets the VAT in split results, as the VAT declaration asks - * to report the amounts for different VAT rates as different lines. - * This function also accounts recurrent invoices. - * - * @param DoliDB $db Database handler - * @param int $y Year - * @param int $q Year quarter (1-4) - * @return array - */ -function tva_coll($db,$y,$q) -{ - global $conf; - - if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES") - { - // if vat paid on due invoices - $sql = "SELECT d.fk_facture as facid, f.facnumber as facnum, d.tva_tx as rate, d.total_ht as totalht, d.total_tva as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= ", ".MAIN_DB_PREFIX."facturedet as d" ; - $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; - $sql.= " AND f.rowid = d.fk_facture "; - $sql.= " AND date_format(f.datef,'%Y') = '".$y."'"; - $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3); - $sql.= " AND date_format(f.datef,'%m') <= ".($q*3).")"; - $sql.= " ORDER BY rate, facid"; - - } - else - { - // if vat paid on paiments - } - - $resql = $db->query($sql); - - if ($resql) - { - $list = array(); - $rate = -1; - while($assoc = $db->fetch_array($resql)) - { - if($assoc['rate'] != $rate){ //new rate - $list[$assoc['rate']]['totalht'] = $assoc['totalht']; - $list[$assoc['rate']]['vat'] = $assoc['amount']; - $list[$assoc['rate']]['facid'][] = $assoc['facid']; - $list[$assoc['rate']]['facnum'][] = $assoc['facnum']; - }else{ - $list[$assoc['rate']]['totalht'] += $assoc['totalht']; - $list[$assoc['rate']]['vat'] += $assoc['amount']; - if(!in_array($assoc['facid'],$list[$assoc['rate']]['facid'])){ - $list[$assoc['rate']]['facid'][] = $assoc['facid']; - $list[$assoc['rate']]['facnum'][] = $assoc['facnum']; - } - } - $rate = $assoc['rate']; - } - return $list; - } - else - { - dol_print_error($db); - } -} - - -/** - * Gets VAT to pay for the given month of the given year - * The function gets the VAT in split results, as the VAT declaration asks - * to report the amounts for different VAT rates as different lines - * - * @param DoliDB $db Database handler object - * @param int $y Year - * @param int $q Year quarter (1-4) - * @return array - */ -function tva_paye($db, $y,$q) -{ - global $conf; - - if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES") - { - // Si on paye la tva sur les factures dues (non brouillon) - $sql = "SELECT d.fk_facture_fourn as facid, f.ref_supplier as facnum, d.tva_tx as rate, d.total_ht as totalht, d.tva as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= ", ".MAIN_DB_PREFIX."facture_fourn_det as d" ; - $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND f.fk_statut = 1 "; - $sql.= " AND f.rowid = d.fk_facture_fourn "; - $sql.= " AND date_format(f.datef,'%Y') = '".$y."'"; - $sql.= " AND (round(date_format(f.datef,'%m')) > ".(($q-1)*3); - $sql.= " AND round(date_format(f.datef,'%m')) <= ".($q*3).")"; - $sql.= " ORDER BY rate, facid "; - } - else - { - // Si on paye la tva sur les payments - } - - $resql = $db->query($sql); - if ($resql) - { - $list = array(); - $rate = -1; - while($assoc = $db->fetch_array($resql)) - { - if($assoc['rate'] != $rate){ //new rate - $list[$assoc['rate']]['totalht'] = $assoc['totalht']; - $list[$assoc['rate']]['vat'] = $assoc['amount']; - $list[$assoc['rate']]['facid'][] = $assoc['facid']; - $list[$assoc['rate']]['facnum'][] = $assoc['facnum']; - }else{ - $list[$assoc['rate']]['totalht'] += $assoc['totalht']; - $list[$assoc['rate']]['vat'] += $assoc['amount']; - if(!in_array($assoc['facid'],$list[$assoc['rate']]['facid'])){ - $list[$assoc['rate']]['facid'][] = $assoc['facid']; - $list[$assoc['rate']]['facnum'][] = $assoc['facnum']; - } - } - $rate = $assoc['rate']; - } - return $list; - - } - else - { - dol_print_error($db); - } -} - - -/** - * View - */ - -llxHeader(); - -$textprevyear="".img_previous().""; -$textnextyear=" ".img_next().""; - -print load_fiche_titre($langs->trans("VAT"),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear"); - - -echo ''; -echo ''; - -echo ''; - -print "
'; -print load_fiche_titre($langs->trans("VATSummary")); -echo '
"; -print ""; -print ""; -print ""; -print ""; -print ""; -print ""; -print ""; -print ""; -print ""; -print "\n"; - -if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES") -{ - $y = $year_current; - - $total = 0; $subtotal = 0; - $i=0; - $subtot_coll_total = 0; - $subtot_coll_vat = 0; - $subtot_paye_total = 0; - $subtot_paye_vat = 0; - for ($q = 1 ; $q <= 4 ; $q++) { - print ""; - $var=true; - - $x_coll = tva_coll($db, $y, $q); - $x_paye = tva_paye($db, $y, $q); - $x_both = array(); - //now, from these two arrays, get another array with one rate per line - foreach(array_keys($x_coll) as $my_coll_rate){ - $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht']; - $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat']; - $x_both[$my_coll_rate]['paye']['totalht'] = 0; - $x_both[$my_coll_rate]['paye']['vat'] = 0; - $x_both[$my_coll_rate]['coll']['links'] = ''; - foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy){ - $x_both[$my_coll_rate]['coll']['links'] .= '..'.substr($x_coll[$my_coll_rate]['facnum'][$id],-2).' '; - } - } - foreach(array_keys($x_paye) as $my_paye_rate){ - $x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht']; - $x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat']; - if(!isset($x_both[$my_paye_rate]['coll']['totalht'])){ - $x_both[$my_paye_rate]['coll']['total_ht'] = 0; - $x_both[$my_paye_rate]['coll']['vat'] = 0; - } - $x_both[$my_paye_rate]['paye']['links'] = ''; - foreach($x_paye[$my_paye_rate]['facid'] as $id=>$dummy){ - $x_both[$my_paye_rate]['paye']['links'] .= '..'.substr($x_paye[$my_paye_rate]['facnum'][$id],-2).' '; - } - } - //now we have an array (x_both) indexed by rates for coll and paye - - $x_coll_sum = 0; - $x_coll_ht = 0; - $x_paye_sum = 0; - $x_paye_ht = 0; - foreach($x_both as $rate => $both){ - - print ''; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - $x_coll_sum += $both['coll']['vat']; - $x_paye_sum += $both['paye']['vat']; - $subtot_coll_total += $both['coll']['totalht']; - $subtot_coll_vat += $both['coll']['vat']; - $subtot_paye_total += $both['paye']['totalht']; - $subtot_paye_vat += $both['paye']['vat']; - } - - $diff = $x_coll_sum - $x_paye_sum; - $total = $total + $diff; - $subtotal = $subtotal + $diff; - - - print ''; - print ''; - print "\n"; - print "\n"; - - $i++; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - -} -else -{ - print ''; - print ''; -} - -print '
".$langs->trans("Year")." $year_current".$langs->trans("Income")."".$langs->trans("VATToPay")."".$langs->trans("Invoices")."".$langs->trans("Outcome")."".$langs->trans("VATToCollect")."".$langs->trans("Invoices")."".$langs->trans("TotalToPay")."
".$langs->trans("Quadri")." $q (".dol_print_date(dol_mktime(0,0,0,(($q-1)*3)+1,1,$y),"%b %Y").' - '.dol_print_date(dol_mktime(0,0,0,($q*3),1,$y),"%b %Y").")
$rate%".price($both['coll']['totalht'])."".price($both['coll']['vat'])."".$both['coll']['links']."".price($both['paye']['totalht'])."".price($both['paye']['vat'])."".$both['paye']['links']."
".price($diff)."
'.$langs->trans("Total").':'.price($subtot_coll_total).''.price($subtot_coll_vat).''.price($subtot_paye_total).''.price($subtot_paye_vat).''.price($total).''; - print '
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("FeatureIsSupportedInInOutModeOnly").'
'; -echo ''; -echo ''; - -llxFooter(); -$db->close(); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 713cab1dc13..0866bafad0c 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -22,7 +22,7 @@ /** * \file htdocs/compta/tva/quadri_detail.php * \ingroup tax - * \brief Trimestrial page - detailed version + * \brief VAT by rate */ require '../../main.inc.php'; @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; @@ -55,10 +56,10 @@ $date_end=dol_mktime(23,59,59,GETPOST("date_endmonth"),GETPOST("date_endday"),GE // Quarter if (empty($date_start) || empty($date_end)) // We define date_start and date_end { - $q=GETPOST("q"); + $q=GETPOST("q","int"); if (empty($q)) { - if (GETPOST("month")) { $date_start=dol_get_first_day($year_start,GETPOST("month"),false); $date_end=dol_get_last_day($year_start,GETPOST("month"),false); } + if (GETPOST("month","int")) { $date_start=dol_get_first_day($year_start,GETPOST("month","int"),false); $date_end=dol_get_last_day($year_start,GETPOST("month","int"),false); } else { $date_start=dol_get_first_day($year_start,empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START,false); @@ -96,6 +97,16 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); * View */ +$form=new Form($db); +$company_static=new Societe($db); +$invoice_customer=new Facture($db); +$invoice_supplier=new FactureFournisseur($db); +$expensereport=new ExpenseReport($db); +$product_static=new Product($db); +$payment_static=new Paiement($db); +$paymentfourn_static=new PaiementFourn($db); +$paymentexpensereport_static=new PaymentExpenseReport($db); + $morequerystring=''; $listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday'); foreach ($listofparams as $param) @@ -105,16 +116,6 @@ foreach ($listofparams as $param) llxHeader('',$langs->trans("VATReport"),'','',0,0,'','',$morequerystring); -$form=new Form($db); - -$company_static=new Societe($db); -$invoice_customer=new Facture($db); -$invoice_supplier=new FactureFournisseur($db); -$expensereport=new ExpenseReport($db); -$product_static=new Product($db); -$payment_static=new Paiement($db); -$paymentfourn_static=new PaiementFourn($db); -$paymentexpensereport_static=new PaymentExpenseReport($db); //print load_fiche_titre($langs->trans("VAT"),""); @@ -126,7 +127,7 @@ $fsearch.=' '; // Show report header -$name=$langs->trans("VATReportByPeriods"); +$name=$langs->trans("VATReportByRates"); $calcmode=''; if ($modetax == 0) $calcmode=$langs->trans('OptionVATDefault'); if ($modetax == 1) $calcmode=$langs->trans('OptionVATDebitOption'); @@ -185,6 +186,7 @@ $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); $vatexpensereport=$langs->trans("VATPaid"); + // VAT Received and paid print ''; @@ -194,8 +196,8 @@ $i=0; $columns = 5; // Load arrays of datas -$x_coll = tax_by_date('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'sell'); -$x_paye = tax_by_date('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'buy'); +$x_coll = tax_by_rate('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'sell'); +$x_paye = tax_by_rate('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'buy'); if (! is_array($x_coll) || ! is_array($x_paye)) { @@ -362,14 +364,14 @@ if (! is_array($x_coll) || ! is_array($x_paye)) if (is_array($x_both[$rate]['coll']['detail'])) { // VAT Rate - $var=true; print ""; print ''; print ''."\n"; foreach ($x_both[$rate]['coll']['detail'] as $index => $fields) { // Define type - $type=($fields['dtype']?$fields['dtype']:$fields['ptype']); + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); // Try to enhance type detection using date_start and date_end for free lines where type // was not saved. if (!empty($fields['ddate_start'])) { @@ -401,10 +403,10 @@ if (! is_array($x_coll) || ! is_array($x_paye)) { $product_static->id=$fields['pid']; $product_static->ref=$fields['pref']; - $product_static->type=$fields['ptype']; + $product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered print $product_static->getNomUrl(1); if (dol_string_nohtmltag($fields['descr'])) { - print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); + print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),24); } } else @@ -423,7 +425,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); } } - print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),24); // Show range print_date_range($fields['ddate_start'],$fields['ddate_end']); @@ -503,7 +505,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) print ''; } - if (count($x_coll) == 0) // Show a total ine if nothing shown + if (count($x_coll) == 0) // Show a total line if nothing shown { print ''; print ''; @@ -543,14 +545,14 @@ if (! is_array($x_coll) || ! is_array($x_paye)) if (is_array($x_both[$rate]['paye']['detail'])) { - $var=true; print ""; print ''; print ''."\n"; foreach ($x_both[$rate]['paye']['detail'] as $index=>$fields) { // Define type - $type=($fields['dtype']?$fields['dtype']:$fields['ptype']); + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); // Try to enhance type detection using date_start and date_end for free lines where type // was not saved. if (!empty($fields['ddate_start'])) { @@ -582,10 +584,10 @@ if (! is_array($x_coll) || ! is_array($x_paye)) { $product_static->id=$fields['pid']; $product_static->ref=$fields['pref']; - $product_static->type=$fields['ptype']; + $product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered print $product_static->getNomUrl(1); if (dol_string_nohtmltag($fields['descr'])) { - print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); + print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),24); } } else @@ -595,7 +597,16 @@ if (! is_array($x_coll) || ! is_array($x_paye)) } else { $text = img_object($langs->trans('Product'),'product'); } - print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); + if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) { + if ($reg[1]=='DEPOSIT') { + $fields['descr']=$langs->transnoentitiesnoconv('Deposit'); + } elseif ($reg[1]=='CREDIT_NOTE') { + $fields['descr']=$langs->transnoentitiesnoconv('CreditNote'); + } else { + $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); + } + } + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),24); // Show range print_date_range($fields['ddate_start'],$fields['ddate_end']); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e63cfa3da99..5053e07212f 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -687,7 +687,10 @@ class Contact extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; if ($id) $sql.= " WHERE c.rowid = ". $id; - elseif ($ref_ext) $sql .= " WHERE c.ref_ext = '".$this->db->escape($ref_ext)."'"; + elseif ($ref_ext) { + $sql .= " WHERE c.entity IN (".getEntity($this->element).")"; + $sql .= " AND c.ref_ext = '".$this->db->escape($ref_ext)."'"; + } $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 5c101401dac..8719c77f1b4 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -7,7 +7,8 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 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 @@ -259,7 +260,7 @@ if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_conta if (! empty($search_categ_thirdparty)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ if (! empty($search_categ_supplier)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs2 ON s.rowid = cs2.fk_soc"; // We need this table joined to the select in order to filter by categ if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; -$sql.= ' WHERE p.entity IN ('.getEntity('societe').')'; +$sql.= ' WHERE p.entity IN ('.getEntity('socpeople').')'; if (!$user->rights->societe->client->voir && !$socid) //restriction { $sql .= " AND (sc.fk_user = " .$user->id." OR p.fk_soc IS NULL)"; @@ -303,6 +304,7 @@ if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $sea if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax); if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype); if (strlen($search_email)) $sql.= natural_search('p.email', $search_email); +if (strlen($search_zip)) $sql.= natural_search("p.zip",$search_zip); if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status); if ($search_import_key) $sql.= natural_search("p.import_key",$search_import_key); if ($type == "o") // filtre sur type @@ -347,6 +349,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -415,7 +422,9 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->societe->contact->creer) { - $newcardbutton=''.$langs->trans('NewContactAddress').''; + $newcardbutton=''.$langs->trans('NewContactAddress'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''; diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 3fb55acc2ca..a33d020d74d 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013-2018 Philippe Grand * * 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 @@ -31,9 +31,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load("contracts"); +// Load traductions files requiredby by page +$langs->loadLangs(array("companies","admin","contracts")); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 17beae4be46..d474da18a85 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -46,12 +46,7 @@ if (! empty($conf->projet->enabled)) { } require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; -$langs->load("contracts"); -$langs->load("orders"); -$langs->load("companies"); -$langs->load("bills"); -$langs->load("products"); -$langs->load('compta'); +$langs->loadLangs(array("contracts","orders","companies","bills","products",'compta')); $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); @@ -1554,6 +1549,7 @@ else print ''; // Area with common detail of line + print '
'; print '
'.$langs->trans("Rate").': '.vatrate($rate).'%
'.$langs->trans("Rate").': '.vatrate($rate).'%
'; $sql = "SELECT cd.rowid, cd.statut, cd.label as label_det, cd.fk_product, cd.product_type, cd.description, cd.price_ht, cd.qty,"; @@ -1592,7 +1588,7 @@ else if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) { - print ''; + print ''; // Label if ($objp->fk_product > 0) { @@ -1688,7 +1684,7 @@ else $colspan = 7; } - print ''; + print ''; print '"; + print ''; print ''; print ''; - + $colspan=6; if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) $colspan++; if($conf->global->PRODUCT_USE_UNITS) $colspan++; // Ligne dates prevues - print ""; + print ''; print ''; + print ''; print ''; print "\n"; } print "
'; // Date planned @@ -1725,14 +1721,14 @@ else if (is_array($extralabelslines) && count($extralabelslines)>0) { $line = new ContratLigne($db); $line->fetch_optionals($objp->rowid); - print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bcnd[$var], 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); + print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); } } // Ligne en mode update else { // Ligne carac - print "
'; if ($objp->fk_product) { @@ -1781,13 +1777,13 @@ else print '
'; print '
'; print $langs->trans("DateStartPlanned").' '; $form->select_date($db->jdate($objp->date_debut),"date_start_update",$usehm,$usehm,($db->jdate($objp->date_debut)>0?0:1),"update"); @@ -1799,7 +1795,7 @@ else if (is_array($extralabelslines) && count($extralabelslines)>0) { $line = new ContratLigne($db); $line->fetch_optionals($objp->rowid); - print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); + print $line->showOptionals($extrafieldsline, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); } } @@ -1812,12 +1808,13 @@ else if ($object->statut > 0) { - print '

"; + print '
'; print "\n"; @@ -1889,7 +1886,7 @@ else { print ''; - print ''; + print ''; print ''; print ''; print "\n"; - print ''; + print ''; print ''; + print ''; print ''; @@ -1984,7 +1981,7 @@ else print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; } // Extra fields @@ -577,7 +584,7 @@ if (! empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_t // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters=array('arrayfields'=>$arrayfields); +$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index f78ed639804..0fc475c19fb 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -204,6 +205,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk $sql.= " cd.date_ouverture_prevue,"; $sql.= " cd.date_ouverture,"; $sql.= " cd.date_fin_validite,"; +$sql.= " cd.date_cloture,"; $sql.= " cd.qty,"; $sql.= " cd.total_ht,"; $sql.= " cd.total_tva,"; @@ -255,6 +257,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql .= $db->plimit($limit + 1, $offset); @@ -382,7 +389,7 @@ if (! empty($arrayfields['cd.date_cloture']['checked'])) print_liste_field_titre // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters=array('arrayfields'=>$arrayfields); +$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['cd.datec']['checked'])) print_liste_field_titre($arrayfields['cd.datec']['label'],$_SERVER["PHP_SELF"],"cd.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); @@ -525,7 +532,9 @@ print "\n"; $contractstatic=new Contrat($db); $productstatic=new Product($db); -$var=True; $i=0; +$var=true; +$i=0; +$totalarray=array(); while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); @@ -542,6 +551,7 @@ while ($i < min($num,$limit)) print ''; + if (! $i) $totalarray['nbfield']++; } // Service if (! empty($arrayfields['p.description']['checked'])) @@ -563,6 +573,7 @@ while ($i < min($num,$limit)) if ($obj->type == 1) print img_object($obj->description,'service').' '.dol_trunc($obj->description,24); } print ''; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['cd.qty']['checked'])) @@ -570,30 +581,45 @@ while ($i < min($num,$limit)) print ''; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['cd.total_ht']['checked'])) { - print ''; - } + $totalarray['totalht'] += $obj->total_ht; + if (! $i) { + $totalarray['displaytotalline']++; + $totalarray['nbfield']++; + $totalarray['totalhtfield']=$totalarray['nbfield']; + } + } if (! empty($arrayfields['cd.total_tva']['checked'])) { - print ''; - } + $totalarray['totalvat'] += $obj->total_tva; + if (! $i) { + $totalarray['nbfield']++; + $totalarray['totalvatfield']=$totalarray['nbfield']; + $totalarray['displaytotalline']++; + } + } if (! empty($arrayfields['cd.tva_tx']['checked'])) { - print ''; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['cd.subprice']['checked'])) { - print ''; + if (! $i) $totalarray['nbfield']++; } @@ -606,26 +632,29 @@ while ($i < min($num,$limit)) $companystatic->client=1; print $companystatic->getNomUrl(1,'customer',28); print ''; + if (! $i) $totalarray['nbfield']++; } // Start date if (! empty($arrayfields['cd.date_ouverture_prevue']['checked'])) { print ''; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['cd.date_ouverture']['checked'])) { - print ''; + print ''; + if (! $i) $totalarray['nbfield']++; } // End date if (! empty($arrayfields['cd.date_fin_validite']['checked'])) { - print ''; + if (! $i) $totalarray['nbfield']++; } + // Close date (real end date) if (! empty($arrayfields['cd.date_cloture']['checked'])) { - print ''; + print ''; + if (! $i) $totalarray['nbfield']++; } // Extra fields @@ -675,6 +707,7 @@ while ($i < min($num,$limit)) print $staticcontratligne->LibStatut($obj->statut,5,($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now)?1:0); } print ''; + if (! $i) $totalarray['nbfield']++; } // Action column print '\n"; $i++; } + +// Show total line +if (isset($totalarray['displaytotalline'])) { + print ''; + $i=0; + while ($i < $totalarray['nbfield']) { + $i++; + if ($i == 1) { + if ($num < $limit && empty($offset)) print ''; + else print ''; + } + elseif ($totalarray['totalhtfield'] == $i) print ''; + elseif ($totalarray['totalvatfield'] == $i) print ''; + elseif ($totalarray['totalttcfield'] == $i) print ''; + else print ''; + } + print ''; +} + $db->free($resql); $parameters=array('sql' => $sql); diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index ff723866b74..394680f4d8e 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -63,7 +63,7 @@ if ($action == 'add' && ! empty($permissiontoadd)) if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field $object->$key=$value; - if ($val['notnull'] > 0 && $object->$key == '') + if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { $error++; setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors'); @@ -76,7 +76,7 @@ if ($action == 'add' && ! empty($permissiontoadd)) if ($result > 0) { // Creation OK - $urltogo=$backtopage?$backtopage:$backurlforlist; + $urltogo=$backtopage?str_replace('__ID__', $result, $backtopage):$backurlforlist; header("Location: ".$urltogo); exit; } @@ -118,7 +118,7 @@ if ($action == 'update' && ! empty($permissiontoadd)) if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field $object->$key=$value; - if ($val['notnull'] > 0 && $object->$key == '') + if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { $error++; setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors'); diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index f1ab9305a4d..18a236056b9 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -23,8 +23,8 @@ // $mysoc must be defined // $id must be defined -// $paramname must be defined -// $mode must be defined (used to know the automatic BCC to add) +// $paramname may be defined +// $autocopy may be defined (used to know the automatic BCC to add) // $trigger_name must be set (can be '') // $actiontypecode can be set // $object and $uobject may be defined @@ -347,9 +347,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO if (!$folder) $folder = "Sent"; // Default Sent folder $mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password); - if (FALSE === $mailboxconfig->mbox) + if (false === $mailboxconfig->mbox) { - $info = FALSE; + $info = false; $err = $langs->trans('Error3_Imap_Connection_Error'); setEventMessages($err,$mailboxconfig->element, null, 'errors'); } diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index eadce1dc74c..03ff1491e49 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -31,13 +31,13 @@ if ($action == 'update' && is_array($arrayofparameters)) { $db->begin(); - $ok=True; + $ok=true; foreach($arrayofparameters as $key => $val) { $result=dolibarr_set_const($db,$key,GETPOST($key, 'alpha'),'chaine',0,'',$conf->entity); if ($result < 0) { - $ok=False; + $ok=false; break; } } diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index 612f38bb05b..f6bd5b5214a 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -26,8 +26,6 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; @@ -70,7 +68,7 @@ if ($boxorder && $zone != '' && $userid > 0) dol_syslog("AjaxBox boxorder=".$boxorder." zone=".$zone." userid=".$userid, LOG_DEBUG); $result=InfoBox::saveboxorder($db,$zone,$boxorder,$userid); - if ($result > 0) + if ($result > 0) { $langs->load("boxes"); if (! GETPOST('closing')) diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index f79753260d7..9e9f8a0d799 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -26,7 +26,6 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; diff --git a/htdocs/core/ajax/contacts.php b/htdocs/core/ajax/contacts.php index 1c7c7a56e4b..b03b9f128cf 100644 --- a/htdocs/core/ajax/contacts.php +++ b/htdocs/core/ajax/contacts.php @@ -23,10 +23,7 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require '../../main.inc.php'; diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php index f8a636e52a5..908c1ef9f11 100644 --- a/htdocs/core/ajax/extraparams.php +++ b/htdocs/core/ajax/extraparams.php @@ -25,7 +25,6 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); include '../../main.inc.php'; diff --git a/htdocs/core/ajax/fileupload.php b/htdocs/core/ajax/fileupload.php index 6eb4d5836b8..9405aa26cf1 100644 --- a/htdocs/core/ajax/fileupload.php +++ b/htdocs/core/ajax/fileupload.php @@ -21,16 +21,10 @@ * \brief File to return Ajax response on file upload */ -//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) require '../../main.inc.php'; diff --git a/htdocs/core/ajax/getaccountcurrency.php b/htdocs/core/ajax/getaccountcurrency.php index 40e52672c0e..2289d8e1c0f 100644 --- a/htdocs/core/ajax/getaccountcurrency.php +++ b/htdocs/core/ajax/getaccountcurrency.php @@ -22,10 +22,7 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require '../../main.inc.php'; diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php index 7e9e541c768..099f66ba3de 100644 --- a/htdocs/core/ajax/loadinplace.php +++ b/htdocs/core/ajax/loadinplace.php @@ -22,10 +22,8 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php index d4a101fb497..577f659b2cc 100644 --- a/htdocs/core/ajax/price.php +++ b/htdocs/core/ajax/price.php @@ -22,10 +22,8 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require('../../main.inc.php'); diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 4fe31ee7ae8..98f18df8a68 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -28,7 +28,6 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index 61c2dca675b..7070d1a8799 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -22,10 +22,8 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; diff --git a/htdocs/core/ajax/security.php b/htdocs/core/ajax/security.php index cc7335618d0..fa1ce2103d4 100644 --- a/htdocs/core/ajax/security.php +++ b/htdocs/core/ajax/security.php @@ -27,7 +27,6 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); require '../../main.inc.php'; diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 1bc527ff555..57483848c4e 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -27,10 +27,9 @@ if (! isset($usedbyinclude) || empty($usedbyinclude)) { if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal - //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); - if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); - if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); - if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); + if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); + if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); + if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREDIRECTBYMAINTOLOGIN')) define('NOREDIRECTBYMAINTOLOGIN','1'); $res=@include '../../main.inc.php'; diff --git a/htdocs/core/ajax/vatrates.php b/htdocs/core/ajax/vatrates.php index ac9691bfa25..3826e521d06 100644 --- a/htdocs/core/ajax/vatrates.php +++ b/htdocs/core/ajax/vatrates.php @@ -22,10 +22,7 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require '../../main.inc.php'; diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 936d269f82a..a8dc7f1231d 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -85,7 +85,7 @@ class box_contacts extends ModeleBoxes $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; + $sql.= " WHERE sp.entity IN (".getEntity('socpeople').")"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND sp.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($user->societe_id) $sql.= " AND sp.fk_soc = ".$user->societe_id; $sql.= " ORDER BY sp.tms DESC"; diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index d665d70da56..abbdc7b7c71 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -222,13 +222,14 @@ class box_graph_invoices_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfBillsByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index efd7de41e5a..53d9ce08059 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -219,13 +219,14 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfBillsByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 699f2db902b..05a0ff498ec 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -218,13 +218,14 @@ class box_graph_orders_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfOrdersByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index f49f38c1228..e88ed46be72 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -217,13 +217,14 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfOrdersByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 69a09e8aad2..39a7a3984d2 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -338,6 +338,7 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; if (! empty($conf->facture->enabled) || ! empty($user->rights->facture->lire)) { @@ -355,7 +356,7 @@ class box_graph_product_distribution extends ModeleBoxes } $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.='
'; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 50e3cbe9bf8..bddf4a27e64 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -219,13 +219,14 @@ class box_graph_propales_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfProposalsByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfProposalsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 74f0ffc9d9d..61af58a4b8b 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -261,17 +261,17 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" { $sublink=''; if (! empty($head['sublink'])) $sublink.= ''; - if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); + if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="opacitymedium '.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); if (! empty($head['sublink'])) $sublink.= ''; $out.= '
'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline-1]->getLibStatut(4).''; if ($user->societe_id == 0) @@ -1916,7 +1913,7 @@ else print '
'; // Si pas encore active @@ -1972,7 +1969,7 @@ else } } - print '
'.$langs->trans("DateServiceActivate").''; print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active",1,0,1); print '
'.$langs->trans("Comment").''; print '   '; @@ -2029,7 +2026,7 @@ else $now=dol_now(); if ($dateactend > $now) $dateactend=$now; - print '
'; + print '
'; if ($objp->statut >= 4) { if ($objp->statut == 4) @@ -2042,7 +2039,7 @@ else print ''; print '
'.$langs->trans("Comment").''; print '   '; @@ -2082,8 +2079,6 @@ else // Form to add new line if ($action != 'editline') { - $var = true; - $forcetoshowtitlelines=1; // Add free products/services @@ -2136,7 +2131,7 @@ else else print ''; } - if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) + if (! empty($conf->facture->enabled) && $object->statut > 0) { $langs->load("bills"); if ($user->rights->facture->creer) print ''; @@ -2205,7 +2200,6 @@ else $genallowed = $user->rights->contrat->lire; $delallowed = $user->rights->contrat->creer; - $var = true; print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 689b0465fd4..1bb17eb4352 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -182,7 +182,7 @@ class Contracts extends DolibarrApi * @param array $request_data Request data * @return int ID of contrat */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401, "Insuffisant rights"); @@ -247,7 +247,7 @@ class Contracts extends DolibarrApi * * @return int */ - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } @@ -300,7 +300,7 @@ class Contracts extends DolibarrApi * * @return object */ - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } @@ -359,7 +359,7 @@ class Contracts extends DolibarrApi * * @return object */ - function activateLine($id, $lineid, $datestart, $dateend = NULL, $comment = NULL) { + function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } @@ -396,7 +396,7 @@ class Contracts extends DolibarrApi * * @return object */ - function unactivateLine($id, $lineid, $datestart, $comment = NULL) { + function unactivateLine($id, $lineid, $datestart, $comment = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } @@ -470,7 +470,7 @@ class Contracts extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 215dc185ac4..8e6f6af33ce 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -237,7 +237,13 @@ class Contrat extends CommonObject */ function active_line($user, $line_id, $date, $date_end='', $comment='') { - return $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment); + $result = $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment); + if ($result < 0) + { + $this->error = $this->lines[$this->lines_id_index_mapper[$line_id]]->error; + $this->errors = $this->lines[$this->lines_id_index_mapper[$line_id]]->errors; + } + return $result; } @@ -252,7 +258,13 @@ class Contrat extends CommonObject */ function close_line($user, $line_id, $date_end, $comment='') { - return $this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); + $result=$this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); + if ($result < 0) + { + $this->error = $this->lines[$this->lines_id_index_mapper[$line_id]]->error; + $this->errors = $this->lines[$this->lines_id_index_mapper[$line_id]]->errors; + } + return $result; } @@ -767,17 +779,7 @@ class Contrat extends CommonObject $line->fk_user_cloture = $objp->fk_user_cloture; $line->fk_unit = $objp->fk_unit; - $line->ref = $objp->product_ref; // deprecated - if (empty($objp->fk_product)) - { - $line->label = ''; // deprecated - $line->libelle = $objp->description; // deprecated - } - else - { - $line->label = $objp->product_label; // deprecated - $line->libelle = $objp->product_label; // deprecated - } + $line->ref = $objp->product_ref; // deprecated $line->product_ref = $objp->product_ref; // Ref product $line->product_desc = $objp->product_desc; // Description product $line->product_label = $objp->product_label; // Label product @@ -2459,12 +2461,15 @@ class ContratLigne extends CommonObjectLine var $fk_contrat; var $fk_product; var $statut; // 0 inactive, 4 active, 5 closed - var $type; // 0 for product, 1 for service + var $type; // 0 for product, 1 for service + /** + * @var string + * @deprecated + */ var $label; /** * @var string - * @deprecated Use $label instead - * @see label + * @deprecated */ public $libelle; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index b1755b7f7ec..61d62896cf1 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2016-2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -301,6 +301,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1, $offset); @@ -372,7 +377,9 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->contrat->creer) { - $newcardbutton=''.$langs->trans('NewContractSubscription').''; + $newcardbutton=''.$langs->trans('NewContractSubscription'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print '
'; @@ -512,11 +519,11 @@ if (! empty($arrayfields['c.date_contrat']['checked'])) // Date contract print '
'; //print $langs->trans('Month').': '; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; //print ' '.$langs->trans('Year').': '; $syear = $year; - print $formother->selectyear($syear,'year',1, 20, 5, 0, 0, '', 'widthauto'); + print $formother->selectyear($syear,'year',1, 20, 5); print '
'; print $contractstatic->getNomUrl(1,16); print ''; print $obj->qty; print ''; + print ''; print price($obj->total_ht); print ''; + print ''; print price($obj->total_tva); print ''; + print ''; print price2num($obj->tva_tx).'%'; print ''; + print ''; print price($obj->subprice); print ''; - print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' '); + print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue), 'dayhour'):' '); if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)) && $obj->statut == 0) print ' '.img_picto($langs->trans("Late"),"warning"); else print '    '; print ''.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').''.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture), 'dayhour'):' ').''.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' '); + print ''.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite), 'dayhour'):' '); if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) { $warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24; @@ -634,10 +663,13 @@ while ($i < min($num,$limit)) } else print '    '; print ''.dol_print_date($db->jdate($obj->date_cloture)).''.dol_print_date($db->jdate($obj->date_cloture), 'dayhour').''; @@ -690,6 +723,25 @@ while ($i < min($num,$limit)) print "
'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).'
'; $out.=$sublink; // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object - $out.= img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone cursormove"'); - $out.= img_picto($langs->trans("CloseBox",$this->box_id),'close_title','class="boxclose cursorpointer" rel="x:y" id="imgclose'.$this->box_id.'"'); + $out.= img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="opacitymedium boxhandle hideonsmartphone cursormove"'); + $out.= img_picto($langs->trans("CloseBox",$this->box_id),'close_title','class="opacitymedium boxclose cursorpointer" rel="x:y" id="imgclose'.$this->box_id.'"'); $label=$head['text']; //if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; - if (! empty($head['graph'])) $label.=' '; + if (! empty($head['graph'])) $label.=' '; $out.= ''; $out.= '
'; } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 42a219cd3ff..3bccc54204f 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1155,7 +1155,7 @@ class CMailFile $out.= "Content-Disposition: attachment; filename=\"".$filename_list[$i]."\"".$this->eol; $out.= "Content-Type: " . $mimetype_list[$i] . "; name=\"".$filename_list[$i]."\"".$this->eol; $out.= "Content-Transfer-Encoding: base64".$this->eol; - $out.= "Content-Description: File Attachment".$this->eol; + $out.= "Content-Description: ".$filename_list[$i].$this->eol; $out.= $this->eol; $out.= $encoded; $out.= $this->eol; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d662fa98820..4c236324373 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel - * Copyright (C) 2011-2014 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012-2015 Raphaël Doursenaud * Copyright (C) 2012 Cedric Salvador @@ -13,7 +13,7 @@ * Copyright (C) 2016 Bahfir abbes * Copyright (C) 2017 ATM Consulting * Copyright (C) 2017 Nicolas ZABOURI - * Copyright (C) 2017 Rui Strecht + * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Frederic France * * This program is free software; you can redistribute it and/or modify @@ -448,7 +448,7 @@ abstract class CommonObject * * @param int $withcountry 1=Add country into address string * @param string $sep Separator to use to build string - * @param int $withregion 1=Add region into address string + * @param int $withregion 1=Add region into address string * @return string Full address string */ function getFullAddress($withcountry=0,$sep="\n",$withregion=0) @@ -599,7 +599,7 @@ abstract class CommonObject if (empty($this->last_main_doc)) { - return ''; // No known last doc + return ''; // No way to known which document name to use } include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; @@ -717,7 +717,7 @@ abstract class CommonObject } else { - // On recherche id type_contact + // We look for id type_contact $sql = "SELECT tc.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql.= " WHERE tc.element='".$this->db->escape($this->element)."'"; @@ -741,7 +741,7 @@ abstract class CommonObject $datecreate = dol_now(); - // Socpeople must have already been added by some a trigger, then we have to check it to avoid DB_ERROR_RECORD_ALREADY_EXISTS error + // Socpeople must have already been added by some trigger, then we have to check it to avoid DB_ERROR_RECORD_ALREADY_EXISTS error $TListeContacts=$this->liste_contact(-1, $source); $already_added=false; if(!empty($TListeContacts)) { @@ -757,7 +757,7 @@ abstract class CommonObject $this->db->begin(); - // Insertion dans la base + // Insert into database $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact"; $sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) "; $sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ; @@ -832,7 +832,7 @@ abstract class CommonObject */ function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0) { - // Insertion dans la base + // Insert into database $sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set"; $sql.= " statut = ".$statut; if ($type_contact_id) $sql.= ", fk_c_type_contact = '".$type_contact_id ."'"; @@ -1116,7 +1116,7 @@ abstract class CommonObject $sql.= " WHERE ec.element_id = ".$id; $sql.= " AND ec.fk_socpeople = c.rowid"; if ($source == 'internal') $sql.= " AND c.entity IN (0,".$conf->entity.")"; - if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('societe').")"; + if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('socpeople').")"; $sql.= " AND ec.fk_c_type_contact = tc.rowid"; $sql.= " AND tc.element = '".$element."'"; $sql.= " AND tc.source = '".$source."'"; @@ -3594,12 +3594,12 @@ abstract class CommonObject * @param Societe $buyer Object thirdparty who buy * @return void */ - function formAddObjectLine($dateSelector,$seller,$buyer) + function formAddObjectLine($dateSelector, $seller, $buyer) { global $conf,$user,$langs,$object,$hookmanager; global $form,$bcnd,$var; - //Line extrafield + // Line extrafield require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafieldsline = new ExtraFields($this->db); $extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line); @@ -3677,7 +3677,7 @@ abstract class CommonObject print ''.$langs->trans('PriceUHT').''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''; + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print ''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''; if ($inputalsopricewithtax) print ''.$langs->trans('PriceUTTC').''; @@ -3716,7 +3716,7 @@ abstract class CommonObject print ''.$langs->trans('TotalHTShort').''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''; + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print ''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''; if ($outputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; @@ -3923,23 +3923,26 @@ abstract class CommonObject $var = true; $i = 0; - foreach ($this->lines as $line) + if (! empty($this->lines)) { - if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) + foreach ($this->lines as $line) { - if (empty($line->fk_parent_line)) + if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) { - $parameters=array('line'=>$line,'var'=>$var,'i'=>$i); - $action=''; - $hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($line->fk_parent_line)) + { + $parameters=array('line'=>$line,'var'=>$var,'i'=>$i); + $action=''; + $hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + } + } + else + { + $this->printOriginLine($line, $var, $restrictlist); } - } - else - { - $this->printOriginLine($line, $var, $restrictlist); - } - $i++; + $i++; + } } } @@ -4384,6 +4387,9 @@ abstract class CommonObject $ecmfile->gen_or_uploaded = 'generated'; $ecmfile->description = ''; // indexed content $ecmfile->keyword = ''; // keyword content + $ecmfile->src_object_type = $this->table_element; + $ecmfile->src_object_id = $this->id; + $result = $ecmfile->create($user); if ($result < 0) { @@ -4560,6 +4566,8 @@ abstract class CommonObject return 0; } + $this->array_options=array(); + 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. @@ -4601,7 +4609,7 @@ abstract class CommonObject $sql.= " FROM ".MAIN_DB_PREFIX.$table_element."_extrafields"; $sql.= " WHERE fk_object = ".$rowid; - dol_syslog(get_class($this)."::fetch_optionals get extrafields data for ".$this->table_element, LOG_DEBUG); + //dol_syslog(get_class($this)."::fetch_optionals get extrafields data for ".$this->table_element, LOG_DEBUG); // Too verbose $resql=$this->db->query($sql); if ($resql) { @@ -5022,7 +5030,7 @@ abstract class CommonObject * @param array $val Array of properties for field to show * @param string $key Key of attribute * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) - * @param string $moreparam To add more parametes on html input tag + * @param string $moreparam To add more parameters on html input tag * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) * @param string|int $showsize Value for css to define size. May also be a numeric. @@ -5050,7 +5058,8 @@ abstract class CommonObject $type = 'varchar'; // convert varchar(xx) int varchar $size = $reg[1]; } - elseif (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) int varchar + elseif (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) into varchar + elseif (preg_match('/double/', $type)) $type = 'double'; // convert double(xx) into double if (is_array($val['arrayofkeyval'])) $type='select'; if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) $type='link'; @@ -5076,7 +5085,7 @@ abstract class CommonObject else return ''; } - // Use in priorit showsize from parameters, then $val['css'] then autodefine + // Use in priority showsize from parameters, then $val['css'] then autodefine if (empty($showsize) && ! empty($val['css'])) { $showsize = $val['css']; @@ -5124,7 +5133,6 @@ abstract class CommonObject } } //var_dump($showsize.' '.$size); - if (in_array($type,array('date','datetime'))) { $tmp=explode(',',$size); @@ -5547,6 +5555,41 @@ abstract class CommonObject // If prefix is 'search_', field is used as a filter, we use a common text field. $out=''; } + elseif ($type == 'array') + { + $newval = $val; + $newval['type'] = 'varchar(256)'; + + $out=''; + + $inputs = array(); + if(! empty($value)) { + foreach($value as $option) { + $out.= ' '; + $out.= $this->showInputField($newval, $keyprefix.$key.$keysuffix.'[]', $option, $moreparam, '', '', $showsize).'
'; + } + } + + $out.= ''; + + $newInput = ' '; + $newInput.= $this->showInputField($newval, $keyprefix.$key.$keysuffix.'[]', '', $moreparam, '', '', $showsize).'
'; + + if(! empty($conf->use_javascript_ajax)) { + $out.= ' + '; + } + } if (!empty($hidden)) { $out=''; } @@ -5670,11 +5713,19 @@ abstract class CommonObject elseif ($key == 'status' && method_exists($this, 'getLibStatut')) $value=$this->getLibStatut(3); elseif ($type == 'date') { - $value=dol_print_date($value,'day'); + if(! empty($value)) { + $value=dol_print_date($value,'day'); + } else { + $value=''; + } } elseif ($type == 'datetime') { - $value=dol_print_date($value,'dayhour'); + if(! empty($value)) { + $value=dol_print_date($value,'dayhour'); + } else { + $value=''; + } } elseif ($type == 'double') { @@ -5910,6 +5961,10 @@ abstract class CommonObject { $value=preg_replace('/./i','*',$value); } + elseif ($type == 'array') + { + $value = implode('
', $value); + } //print $type.'-'.$size; $out=$value; @@ -5988,9 +6043,9 @@ abstract class CommonObject } else { $value = $this->array_options["options_" . $key]; // No GET, no POST, no default value, so we take value of object. } + //var_dump($keyprefix.' - '.$key.' - '.$keysuffix.' - '.$keyprefix.'options_'.$key.$keysuffix.' - '.$this->array_options["options_".$key.$keysuffix].' - '.$getposttemp.' - '.$value); break; } - //var_dump($value); if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { @@ -6025,12 +6080,12 @@ abstract class CommonObject // Convert date into timestamp format (value in memory must be a timestamp) if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('date','datetime'))) { - $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]); + $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]); } // Convert float submited string into real php numeric (value in memory must be a php numeric) if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('price','double'))) { - $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix,'int',3)):$this->array_options['options_'.$key]; + $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)):$this->array_options['options_'.$key]; } $labeltoshow = $langs->trans($label); @@ -6589,7 +6644,7 @@ abstract class CommonObject { if(empty($this->{$field})) { - $queryarray[$field] = NULL; + $queryarray[$field] = null; } else { @@ -6598,7 +6653,14 @@ abstract class CommonObject } else if($this->isArray($info)) { - $queryarray[$field] = serialize($this->{$field}); + if(! empty($this->{$field})) { + if(! is_array($this->{$field})) { + $this->{$field} = array($this->{$field}); + } + $queryarray[$field] = serialize($this->{$field}); + } else { + $queryarray[$field] = null; + } } else if($this->isInt($info)) { @@ -6642,9 +6704,13 @@ abstract class CommonObject } elseif($this->isArray($info)) { - $this->{$field} = @unserialize($obj->{$field}); - // Hack for data not in UTF8 - if($this->{$field } === FALSE) @unserialize(utf8_decode($obj->{$field})); + if(! empty($obj->{$field})) { + $this->{$field} = @unserialize($obj->{$field}); + // Hack for data not in UTF8 + if($this->{$field } === false) @unserialize(utf8_decode($obj->{$field})); + } else { + $this->{$field} = array(); + } } elseif($this->isInt($info)) { @@ -6732,7 +6798,7 @@ abstract class CommonObject if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]=''; //var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1)); - if ($this->fields[$key]['notnull'] == 1 && ! isset($values[$key])) + if ($this->fields[$key]['notnull'] == 1 && ! isset($values[$key]) && is_null($val['default'])) { $error++; $this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 103b52f48f1..0ee73799bcb 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -97,7 +97,7 @@ class Conf // First level object // TODO Remove this part. $this->expedition_bon = new stdClass(); - $this->livraison_bon = new stdClass(); + $this->livraison_bon = new stdClass(); $this->fournisseur = new stdClass(); $this->product = new stdClass(); $this->service = new stdClass(); @@ -107,12 +107,12 @@ class Conf $this->propal = new stdClass(); $this->facture = new stdClass(); $this->contrat = new stdClass(); - $this->usergroup = new stdClass(); + $this->usergroup = new stdClass(); $this->adherent = new stdClass(); $this->bank = new stdClass(); $this->notification = new stdClass(); $this->mailing = new stdClass(); - $this->expensereport = new stdClass(); + $this->expensereport = new stdClass(); $this->productbatch = new stdClass(); } @@ -347,6 +347,9 @@ class Conf $this->fournisseur->facture=new stdClass(); $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; + $this->supplierproposal=new stdClass(); + $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; + $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; $this->fournisseur->payment=new stdClass(); $this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment"; $this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp"; @@ -362,6 +365,9 @@ class Conf $this->supplier_invoice->enabled=1; $this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture"; $this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp"; + $this->supplierproposal=new stdClass(); + $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; + $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; } } diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php deleted file mode 100644 index 1d28861a44e..00000000000 --- a/htdocs/core/class/cookie.class.php +++ /dev/null @@ -1,142 +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 . - */ - -/** - * \file htdocs/core/class/cookie.class.php - * \ingroup core - * \brief File of class to manage cookies - */ - - -/** - * Class to manage cookies. - * This class is used by external module multicompany but will be removed soon only and must not be used by - * - * @deprecated PHP already provide function to read/store a cookie. No need to use a dedicated class. Also storing sensitive information into cookie is forbidden, so encryption is useless. - * If a data is sensitive, it must be stored into database (if we need a long term retention) or into session. - */ -class DolCookie -{ - private $_myKey; - private $_iv; - - var $myCookie; - var $myValue; - var $myExpire; - var $myPath; - var $myDomain; - var $mySecure; - var $cookie; - - /** - * Constructor - * - * @param string $key Personnal key - * @deprecated - */ - function __construct($key = '') - { - $this->_myKey = hash('sha256', $key, TRUE); - $this->_iv = md5(md5($this->_myKey)); - $this->cookie = ""; - $this->myCookie = ""; - $this->myValue = ""; - } - - - /** - * Encrypt en create the cookie - * - * @return void - */ - private function _cryptCookie() - { - if (!empty($this->_myKey) && !empty($this->_iv)) - { - $valuecrypt = base64_encode($this->myValue); - $this->cookie = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->_myKey, $valuecrypt, MCRYPT_MODE_CBC, $this->_iv)); - } - else - { - $this->cookie = $this->myValue; - } - - setcookie($this->myCookie, $this->cookie, $this->myExpire, $this->myPath, $this->myDomain, $this->mySecure); - } - - /** - * Decrypt the cookie - * - * @return string - */ - private function _decryptCookie() - { - if (!empty($this->_myKey) && !empty($this->_iv)) - { - $this->cookie = $_COOKIE[$this->myCookie]; - $this->myValue = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->_myKey, base64_decode($this->cookie), MCRYPT_MODE_CBC, $this->_iv)); - - return(base64_decode($this->myValue)); - } - else - { - return($_COOKIE[$this->myCookie]); - } - } - - /** - * Set and create the cookie - * - * @param string $cookie Cookie name - * @param string $value Cookie value - * @param integer $expire Expiration - * @param string $path Path of cookie - * @param string $domain Domain name - * @param int $secure 0 or 1 - * @return void - */ - public function setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0) - { - $this->myCookie = $cookie; - $this->myValue = $value; - $this->myExpire = $expire; - $this->myPath = $path; - $this->myDomain = $domain; - $this->mySecure = $secure; - - //print 'key='.$this->myKey.' name='.$this->myCookie.' value='.$this->myValue.' expire='.$this->myExpire; - - $this->_cryptCookie(); - } - - /** - * Get the cookie - * - * @param string $cookie Cookie name - * @return string Decrypted value - */ - public function getCookie($cookie) - { - $this->myCookie = $cookie; - - $decryptValue = $this->_decryptCookie(); - - return $decryptValue; - } - -} - diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index aa500ab64df..860d89afea8 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -153,7 +153,7 @@ class DolEditor { global $conf,$langs; - $fullpage=False; + $fullpage=false; if (isset($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT)) { $disallowAnyContent=empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT); // Only predefined list of html tags are allowed or all diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index ba7a67be3cb..3ad22f87c03 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -674,7 +674,7 @@ class DolGraph $group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values $group->legend->setSpace(0); $group->legend->setPadding(2,2,2,2); - $group->legend->setPosition(NULL,0.1); + $group->legend->setPosition(null, 0.1); $group->legend->setBackgroundColor($colorsemitrans); if (is_array($this->bgcolorgrid)) $group->grid->setBackgroundColor($bgcolorgrid); @@ -734,7 +734,7 @@ class DolGraph $plot->barShadow->setSize($this->SetShading); $plot->barShadow->setPosition(SHADOW_RIGHT_TOP); $plot->barShadow->setColor(new Color(160, 160, 160, 50)); - $plot->barShadow->smooth(TRUE); + $plot->barShadow->smooth(true); //$plot->setSize(1, 0.96); //$plot->setCenter(0.5, 0.52); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c6dab1241f8..153efd5b8c9 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -729,7 +729,7 @@ class ExtraFields { global $conf; - if (empty($elementtype) ) return array(); + if (empty($elementtype)) return array(); if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -832,16 +832,17 @@ class ExtraFields * Return HTML string to put an input field into a page * Code very similar with showInputField of common object * - * @param string $key Key of attribute - * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) - * @param string $moreparam To add more parametes on html input tag - * @param string $keysuffix Prefix string to add after name and id of field (can be used to avoid duplicate names) - * @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names) - * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) - * @param int $objectid Current object id + * @param string $key Key of attribute + * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) + * @param string $moreparam To add more parametes on html input tag + * @param string $keysuffix Prefix string to add after name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names) + * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) + * @param int $objectid Current object id + * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data * @return string */ - function showInputField($key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss='', $objectid=0) + function showInputField($key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss='', $objectid=0, $extrafieldsobjectkey='') { global $conf,$langs,$form; @@ -855,18 +856,36 @@ class ExtraFields $keyprefix = $keyprefix.'options_'; // Because we work on extrafields - $label=$this->attribute_label[$key]; - $type =$this->attribute_type[$key]; - $size =$this->attribute_size[$key]; - $elementtype=$this->attribute_elementtype[$key]; // Seems not used - $default=$this->attribute_default[$key]; - $computed=$this->attribute_computed[$key]; - $unique=$this->attribute_unique[$key]; - $required=$this->attribute_required[$key]; - $param=$this->attribute_param[$key]; - $langfile=$this->attribute_langfile[$key]; - $list=$this->attribute_list[$key]; - $hidden=$this->attribute_hidden[$key]; + if (! empty($extrafieldsobjectkey)) + { + $label=$this->attributes[$extrafieldsobjectkey]['label'][$key]; + $type=$this->attributes[$extrafieldsobjectkey]['type'][$key]; + $size=$this->attributes[$extrafieldsobjectkey]['size'][$key]; + $default=$this->attributes[$extrafieldsobjectkey]['default'][$key]; + $computed=$this->attributes[$extrafieldsobjectkey]['computed'][$key]; + $unique=$this->attributes[$extrafieldsobjectkey]['unique'][$key]; + $required=$this->attributes[$extrafieldsobjectkey]['required'][$key]; + $param=$this->attributes[$extrafieldsobjectkey]['param'][$key]; + $perms=dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1); + $langfile=$this->attributes[$extrafieldsobjectkey]['langfile'][$key]; + $list=dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1); + $hidden=(empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) + } + else // Old usage + { + $label=$this->attribute_label[$key]; + $type =$this->attribute_type[$key]; + $size =$this->attribute_size[$key]; + $elementtype=$this->attribute_elementtype[$key]; // Seems not used + $default=$this->attribute_default[$key]; + $computed=$this->attribute_computed[$key]; + $unique=$this->attribute_unique[$key]; + $required=$this->attribute_required[$key]; + $param=$this->attribute_param[$key]; + $langfile=$this->attribute_langfile[$key]; + $list=$this->attribute_list[$key]; + $hidden=$this->attribute_hidden[$key]; + } if ($computed) { @@ -1008,7 +1027,10 @@ class ExtraFields $out.=''; } $out.=''; } @@ -1470,7 +1492,8 @@ class ExtraFields } elseif ($type == 'select') { - $value=$param['options'][$value]; + if ($langfile && $param['options'][$value]) $value=$langs->trans($param['options'][$value]); + else $value=$param['options'][$value]; } elseif ($type == 'sellist') { @@ -1823,13 +1846,14 @@ class ExtraFields } else if (in_array($key_type,array('price','double'))) { - $value_arr=GETPOST("options_".$key); + $value_arr=GETPOST("options_".$key, 'alpha'); $value_key=price2num($value_arr); } else { $value_key=GETPOST("options_".$key); } + $object->array_options["options_".$key]=$value_key; } diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 648f1295c25..c3a40599877 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -225,7 +225,7 @@ class FileUpload * getFileObject * * @param string $file_name Filename - * @return stdClass|NULL + * @return stdClass|null */ protected function getFileObject($file_name) { diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 8cc2c62bee7..5c1f1358784 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -80,28 +80,31 @@ class HookManager $this->contextarray=array_unique(array_merge($arraycontext,$this->contextarray)); // All contexts are concatenated - foreach($conf->modules_parts['hooks'] as $module => $hooks) + foreach($conf->modules_parts['hooks'] as $module => $hooks) // Loop on each module that brings hooks { - if ($conf->$module->enabled) + if (empty($conf->$module->enabled)) continue; + + //dol_syslog(get_class($this).'::initHooks module='.$module.' arraycontext='.join(',',$arraycontext)); + foreach($arraycontext as $context) { - foreach($arraycontext as $context) + if (is_array($hooks)) $arrayhooks=$hooks; // New system + else $arrayhooks=explode(':',$hooks); // Old system (for backward compatibility) + + if (in_array($context, $arrayhooks) || in_array('all', $arrayhooks)) // We instantiate action class only if initialized hook is handled by module { - if (is_array($hooks)) $arrayhooks=$hooks; // New system - else $arrayhooks=explode(':',$hooks); // Old system (for backward compatibility) - if (in_array($context,$arrayhooks) || in_array('all',$arrayhooks)) // We instantiate action class only if hook is required + // Include actions class overwriting hooks + if (! is_object($this->hooks[$context][$module])) // If set, class was already loaded { $path = '/'.$module.'/class/'; $actionfile = 'actions_'.$module.'.class.php'; - $pathroot = ''; - // Include actions class overwriting hooks - dol_syslog('Loading hook:' . $actionfile, LOG_INFO); + dol_syslog(get_class($this).'::initHooks Loading hook class for context '.$context.": ".$actionfile, LOG_INFO); $resaction=dol_include_once($path.$actionfile); if ($resaction) { - $controlclassname = 'Actions'.ucfirst($module); - $actionInstance = new $controlclassname($this->db); - $this->hooks[$context][$module] = $actionInstance; + $controlclassname = 'Actions'.ucfirst($module); + $actionInstance = new $controlclassname($this->db); + $this->hooks[$context][$module] = $actionInstance; } } } @@ -117,7 +120,7 @@ class HookManager * @param array $parameters Array of parameters * @param Object $object Object to use hooks on * @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) - * @return mixed For 'addreplace' hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller. + * @return mixed For 'addreplace' hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller. * For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller. * All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller. * $this->error or this->errors are also defined by class called by this function if error. @@ -181,7 +184,8 @@ class HookManager 'printObjectSubLine', 'sendMail', 'sendMailAfter', - 'showLinkToObjectBlock' + 'showLinkToObjectBlock', + 'setContentSecurityPolicy' ) )) $hooktype='addreplace'; @@ -213,20 +217,19 @@ class HookManager $this->resNbOfHooks++; - dol_syslog(get_class($this).'::executeHooks a qualified hook was found for method='.$method.' module='.$module." action=".$action." context=".$context); - $modulealreadyexecuted[$module]=$module; // Use the $currentcontext in method to avoid running twice // Clean class (an error may have been set from a previous call of another method for same module/hook) $actionclassinstance->error=0; $actionclassinstance->errors=array(); + dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", action=".$action." context=".$context, LOG_DEBUG); + // Add current context to avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; $parameters['currentcontext'] = $context; // Hooks that must return int (hooks with type 'addreplace') if ($hooktype == 'addreplace') { - dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG); $resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 32de5f2edfd..c02ada175fd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -642,16 +642,17 @@ class Form /** * Return combo list of activated countries, into language of user * - * @param string $selected Id or Code or Label of preselected country - * @param string $htmlname Name of html select object - * @param string $htmloption Options html on select object - * @param integer $maxlength Max length for labels (0=no limit) - * @param string $morecss More css class - * @param string $usecodeaskey 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key - * @param int $showempty Show empty choice - * @return string HTML string with select + * @param string $selected Id or Code or Label of preselected country + * @param string $htmlname Name of html select object + * @param string $htmloption Options html on select object + * @param integer $maxlength Max length for labels (0=no limit) + * @param string $morecss More css class + * @param string $usecodeaskey 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key + * @param int $showempty Show empty choice + * @param int $disablefavorites Disable favorites + * @return string HTML string with select */ - function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1) + function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0) { global $conf,$langs; @@ -692,13 +693,14 @@ class Form $i++; } - array_multisort($favorite, SORT_DESC, $label, SORT_ASC, $countryArray); + if (empty($disablefavorites)) array_multisort($favorite, SORT_DESC, $label, SORT_ASC, $countryArray); + else $countryArray = dol_sort_array($countryArray, 'label'); foreach ($countryArray as $row) { if (empty($showempty) && empty($row['rowid'])) continue; - if ($row['favorite'] && $row['code_iso']) $atleastonefavorite++; + if (empty($disablefavorites) && $row['favorite'] && $row['code_iso']) $atleastonefavorite++; if (empty($row['favorite']) && $atleastonefavorite) { $atleastonefavorite=0; @@ -1330,7 +1332,7 @@ class Form if ($showsoc > 0) $sql.= " , s.nom as company"; $sql.= " FROM ".MAIN_DB_PREFIX ."socpeople as sp"; if ($showsoc > 0) $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX ."societe as s ON s.rowid=sp.fk_soc"; - $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; + $sql.= " WHERE sp.entity IN (".getEntity('socpeople').")"; if ($socid > 0) $sql.= " AND sp.fk_soc=".$socid; if (! empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND sp.statut <> 0"; $sql.= " ORDER BY sp.lastname ASC"; @@ -3469,8 +3471,8 @@ class Form if ($selected) { require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; $bankstatic=new Account($this->db); - $bankstatic->fetch($selected); - print $bankstatic->getNomUrl(1); + $result = $bankstatic->fetch($selected); + if ($result) print $bankstatic->getNomUrl(1); } else { print " "; } @@ -4774,8 +4776,8 @@ class Form * * @param timestamp $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date (emptydate must be 0). * @param string $prefix Prefix for fields name - * @param int $h 1=Show also hours (-1 has same effect, but hour and minutes are prefilled with 23:59 if $set_time = -1) - * @param int $m 1=Show also minutes + * @param int $h 1 or 2=Show also hours (2=hours on a new line), -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show hour always empty + * @param int $m 1=Show also minutes, -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show minutes always empty * @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only * @param string $form_name Not used * @param int $d 1=Show days, month, years @@ -4848,6 +4850,8 @@ class Form $smin = !isset($conf->global->MAIN_DEFAULT_DATE_MIN) ? ($h == -1 ? '59' : '') : $conf->global->MAIN_DEFAULT_DATE_MIN; $ssec = !isset($conf->global->MAIN_DEFAULT_DATE_SEC) ? ($h == -1 ? '59' : '') : $conf->global->MAIN_DEFAULT_DATE_SEC; } + if ($h == 3) $shour = ''; + if ($m == 3) $smin = ''; // You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery' $usecalendar='combo'; @@ -5908,7 +5912,7 @@ class Form -
+
'; + } print ''; print ''; diff --git a/htdocs/dav/dav.class.php b/htdocs/dav/dav.class.php index 25f2ac8ccc7..9e5121112d0 100644 --- a/htdocs/dav/dav.class.php +++ b/htdocs/dav/dav.class.php @@ -244,7 +244,7 @@ class CdavLib * * @param int $calendarId Calendar id * @param int $bCalendarData Add calendar data - * @return array|string[][]|unknown[][]|NULL[][] + * @return array|string[][] */ public function getFullCalendarObjects($calendarId, $bCalendarData) { diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php index c8b71d1e3f5..cd19fc294ec 100644 --- a/htdocs/dav/fileserver.php +++ b/htdocs/dav/fileserver.php @@ -21,16 +21,12 @@ * \brief Server DAV */ -//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('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'); -define("NOLOGIN",1); // This means this output page does not require to be logged. -define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. +if (! defined('NOCSRFCHECK')) define("NOCSRFCHECK",1); // We accept to go on this page from external web site. require ("../main.inc.php"); require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; @@ -56,7 +52,9 @@ if(empty($conf->dav->enabled)) // settings $publicDir = $conf->dav->dir_output.'/public'; -$tmpDir = $conf->dav->dir_output.'/tmp'; +$privateDir = $conf->dav->dir_output.'/private'; +$tmpDir = $conf->dav->dir_temp; +//var_dump($tmpDir);exit; // Authentication callback function $authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $password) @@ -100,7 +98,8 @@ $nodes = array(); // Enable directories and features according to DAV setup // / Public docs -$nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/dav/public'); +if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) $nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/dav/public'); +$nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/dav/private'); // Principals Backend //$principalBackend = new \Sabre\DAVACL\PrincipalBackend\Dolibarr($user,$db); @@ -124,8 +123,14 @@ $baseUri = DOL_URL_ROOT.'/dav/fileserver.php/'; if (isset($baseUri)) $server->setBaseUri($baseUri); // Add authentication function -$server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend)); - +if ((empty($conf->global->DAV_ALLOW_PUBLIC_DIR) + || ! preg_match('/'.preg_quote(DOL_URL_ROOT.'/dav/fileserver.php/public','/').'/', $_SERVER["PHP_SELF"])) + && ! preg_match('/^sabreAction=asset&assetName=[a-zA-Z0-9%\-\/]+\.(png|css|woff|ico|ttf)$/', $_SERVER["QUERY_STRING"]) // URL for Sabre browser resources + ) +{ + //var_dump($_SERVER["QUERY_STRING"]);exit; + $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend)); +} // Support for LOCK and UNLOCK $lockBackend = new \Sabre\DAV\Locks\Backend\File($tmpDir . '/.locksdb'); $lockPlugin = new \Sabre\DAV\Locks\Plugin($lockBackend); diff --git a/htdocs/document.php b/htdocs/document.php index 50f4a61186d..725d079a9f6 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -32,31 +32,31 @@ //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language -//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 (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -//if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks + // For bittorent link, we don't need to load/check we are into a login session -if (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'bittorrent' && ! defined("NOLOGIN")) +if (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'bittorrent') { - define("NOLOGIN",1); - define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + if (! defined("NOLOGIN")) define("NOLOGIN",1); + if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + if (! defined("NOIPCHECK")) define("NOIPCHECK",1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } // For direct external download link, we don't need to load/check we are into a login session -if (isset($_GET["hashp"]) && ! defined("NOLOGIN")) +if (isset($_GET["hashp"])) { - define("NOLOGIN",1); - define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + if (! defined("NOLOGIN")) define("NOLOGIN",1); + if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + if (! defined("NOIPCHECK")) define("NOIPCHECK",1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } // Some value of modulepart can be used to get resources that are public so no login are required. -if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) +if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) { - define("NOLOGIN",1); - define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + if (! defined("NOLOGIN")) define("NOLOGIN",1); + if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + if (! defined("NOIPCHECK")) define("NOIPCHECK",1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } /** diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 4be83ffa30a..78e3a57f436 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -52,6 +52,10 @@ class Don extends CommonObject var $fk_typepayment; var $num_payment; var $date_valid; + var $modepaymentid = 0; + + var $labelstatut; + var $labelstatutshort; /** * @deprecated @@ -59,6 +63,7 @@ class Don extends CommonObject */ var $commentaire; + /** * Constructor * @@ -69,17 +74,6 @@ class Don extends CommonObject global $langs; $this->db = $db; - $this->modepaymentid = 0; - - $langs->load("donations"); - $this->labelstatut[-1]=$langs->trans("Canceled"); - $this->labelstatut[0]=$langs->trans("DonationStatusPromiseNotValidated"); - $this->labelstatut[1]=$langs->trans("DonationStatusPromiseValidated"); - $this->labelstatut[2]=$langs->trans("DonationStatusPaid"); - $this->labelstatutshort[-1]=$langs->trans("Canceled"); - $this->labelstatutshort[0]=$langs->trans("DonationStatusPromiseNotValidatedShort"); - $this->labelstatutshort[1]=$langs->trans("DonationStatusPromiseValidatedShort"); - $this->labelstatutshort[2]=$langs->trans("DonationStatusPaidShort"); } @@ -103,7 +97,19 @@ class Don extends CommonObject */ function LibStatut($statut,$mode=0) { - global $langs; + if (empty($this->labelstatut) || empty($this->labelstatushort)) + { + global $langs; + $langs->load("donations"); + $this->labelstatut[-1]=$langs->trans("Canceled"); + $this->labelstatut[0]=$langs->trans("DonationStatusPromiseNotValidated"); + $this->labelstatut[1]=$langs->trans("DonationStatusPromiseValidated"); + $this->labelstatut[2]=$langs->trans("DonationStatusPaid"); + $this->labelstatutshort[-1]=$langs->trans("Canceled"); + $this->labelstatutshort[0]=$langs->trans("DonationStatusPromiseNotValidatedShort"); + $this->labelstatutshort[1]=$langs->trans("DonationStatusPromiseValidatedShort"); + $this->labelstatutshort[2]=$langs->trans("DonationStatusPaidShort"); + } if ($mode == 0) { diff --git a/htdocs/don/index.php b/htdocs/don/index.php index b72e63f7797..d9bee39723c 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -150,7 +150,6 @@ print ''; $total=0; $totalnb=0; -$var=true; foreach ($listofstatus as $status) { @@ -200,10 +199,8 @@ if ($resql) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print ''; diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 4d7db533e12..334d1f219c2 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * @@ -34,7 +34,7 @@ $langs->load("donations"); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -113,12 +113,19 @@ if (trim($search_name) != '') if ($search_amount) $sql.= natural_search('d.amount', $search_amount, 1); $sql.= $db->order($sortfield,$sortorder); + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } + $sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); @@ -131,7 +138,13 @@ if ($resql) //if ($page > 0) $param.= '&page='.$page; if ($optioncss != '') $param.='&optioncss='.$optioncss; - $newcardbutton=''.$langs->trans('NewDonation').''; + $newcardbutton=''; + if ($user->rights->don->creer) + { + $newcardbutton=''.$langs->trans('NewDonation'); + $newcardbutton.= ''; + $newcardbutton.= ''; + } print ''."\n"; if ($optioncss != '') print ''; diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 68d29fe3dc1..e4a7ef5c5d4 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -226,13 +226,10 @@ if ($resql) if ($num > 0) { - $var=True; - while ($i < $num) { $objp = $db->fetch_object($resql); - print ''; // Ref print ''; diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index b8cd532d35a..cb574da939a 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -277,7 +277,7 @@ foreach ($data as $val) $oldyear--; print ''; print ''.$oldyear.''; - + print '0'; /*print '0'; print '0';*/ @@ -300,7 +300,7 @@ print '
'; // Show graphs -print '
'; +print ''; print ''; - + print ''; /*print ''; print '';*/ print ''; } - + print ''; print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/ecm/ajax/ecmdatabase.php b/htdocs/ecm/ajax/ecmdatabase.php index 6753a4299b0..666c6df9217 100644 --- a/htdocs/ecm/ajax/ecmdatabase.php +++ b/htdocs/ecm/ajax/ecmdatabase.php @@ -22,10 +22,8 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 698960974d5..f1c0b6b1448 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2018 Francis Appels * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify @@ -33,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; /** * Class to manage ECM files */ -class EcmFiles //extends CommonObject +class EcmFiles extends CommonObject { /** * @var string Id to identify managed objects @@ -65,6 +66,8 @@ class EcmFiles //extends CommonObject public $fk_user_c; public $fk_user_m; public $acl; + public $src_object_type; + public $src_object_id; /** */ @@ -142,6 +145,9 @@ class EcmFiles //extends CommonObject if (isset($this->acl)) { $this->acl = trim($this->acl); } + if (isset($this->src_object_type)) { + $this->src_object_type = trim($this->src_object_type); + } if (empty($this->date_c)) $this->date_c = dol_now(); if (empty($this->date_m)) $this->date_m = dol_now(); @@ -161,15 +167,27 @@ class EcmFiles //extends CommonObject $obj = $this->db->fetch_object($resql); $maxposition = (int) $obj->maxposition; } - else dol_print_error($this->db); + else + { + $this->errors[] = 'Error ' . $this->db->lasterror(); + return --$error; + } + $maxposition=$maxposition+1; + } + else + { + $maxposition=$this->position; } - $maxposition=$maxposition+1; // Check parameters if (empty($this->filename) || empty($this->filepath)) { $this->errors[] = 'Bad property filename or filepath'; - return -1; + return --$error; + } + if (! isset($this->entity)) + { + $this->entity = $conf->entity; } // Put here code to add control on parameters values @@ -192,12 +210,14 @@ class EcmFiles //extends CommonObject $sql.= 'date_m,'; $sql.= 'fk_user_c,'; $sql.= 'fk_user_m,'; - $sql.= 'acl'; + $sql.= 'acl,'; + $sql.= 'src_object_type,'; + $sql.= 'src_object_id'; $sql .= ') VALUES ('; $sql .= " '".$ref."', "; $sql .= ' '.(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").','; $sql .= ' '.(! isset($this->share)?'NULL':"'".$this->db->escape($this->share)."'").','; - $sql .= ' '.(! isset($this->entity)?$conf->entity:$this->entity).','; + $sql .= ' '.$this->entity.','; $sql .= ' '.(! isset($this->filename)?'NULL':"'".$this->db->escape($this->filename)."'").','; $sql .= ' '.(! isset($this->filepath)?'NULL':"'".$this->db->escape($this->filepath)."'").','; $sql .= ' '.(! isset($this->fullpath_orig)?'NULL':"'".$this->db->escape($this->fullpath_orig)."'").','; @@ -211,7 +231,9 @@ class EcmFiles //extends CommonObject $sql .= ' '.(! isset($this->date_m) || dol_strlen($this->date_m)==0?'NULL':"'".$this->db->idate($this->date_m)."'").','; $sql .= ' '.(! isset($this->fk_user_c)?$user->id:$this->fk_user_c).','; $sql .= ' '.(! isset($this->fk_user_m)?'NULL':$this->fk_user_m).','; - $sql .= ' '.(! isset($this->acl)?'NULL':"'".$this->db->escape($this->acl)."'"); + $sql .= ' '.(! isset($this->acl)?'NULL':"'".$this->db->escape($this->acl)."'").','; + $sql .= ' '.(! isset($this->src_object_type)?'NULL':"'".$this->db->escape($this->src_object_type)."'").','; + $sql .= ' '.(! isset($this->src_object_id)?'NULL':$this->src_object_id); $sql .= ')'; $this->db->begin(); @@ -227,14 +249,13 @@ class EcmFiles //extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); $this->position = $maxposition; - if (!$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action to call a trigger. - - //// Call triggers - //$result=$this->call_trigger('MYOBJECT_CREATE',$user); - //if ($result < 0) $error++; - //// End call triggers + // Triggers + if (! $notrigger) + { + // Call triggers + $result=$this->call_trigger(strtoupper(get_class($this)).'_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers } } @@ -253,14 +274,16 @@ class EcmFiles //extends CommonObject /** * Load object in memory from the database * - * @param int $id Id object - * @param string $ref Hash of file name (filename+filepath). Not always defined on some version. - * @param string $relativepath Relative path of file from document directory. Example: path/path2/file - * @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed. - * @param string $hashforshare Hash of file sharing. - * @return int <0 if KO, 0 if not found, >0 if OK + * @param int $id Id object + * @param string $ref Hash of file name (filename+filepath). Not always defined on some version. + * @param string $relativepath Relative path of file from document directory. Example: path/path2/file + * @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed. + * @param string $hashforshare Hash of file sharing. + * @param string $src_object_type src_object_type to search + * @param string $src_object_id src_object_id to search + * @return int <0 if KO, 0 if not found, >0 if OK */ - public function fetch($id, $ref = '', $relativepath = '', $hashoffile='', $hashforshare='') + public function fetch($id, $ref = '', $relativepath = '', $hashoffile='', $hashforshare='', $src_object_type='', $src_object_id=0) { dol_syslog(__METHOD__, LOG_DEBUG); @@ -283,7 +306,9 @@ class EcmFiles //extends CommonObject $sql .= " t.date_m,"; $sql .= " t.fk_user_c,"; $sql .= " t.fk_user_m,"; - $sql .= " t.acl"; + $sql .= " t.acl,"; + $sql .= " t.src_object_type,"; + $sql .= " t.src_object_id"; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; $sql.= ' WHERE 1 = 1'; /* Fetching this table depends on filepath+filename, it must not depends on entity @@ -301,8 +326,13 @@ class EcmFiles //extends CommonObject } elseif (! empty($hashforshare)) { $sql .= " AND t.share = '".$this->db->escape($hashforshare)."'"; - } else { - $sql .= ' AND t.rowid = ' . $id; + } + elseif ($src_object_type && $src_object_id) + { + $sql.= " AND t.src_object_type ='".$this->db->escape($src_object_type)."' AND t.src_object_id = ".$this->db->escape($src_object_id); + } + else { + $sql .= ' AND t.rowid = '.$this->db->escape($id); } // When we search on hash of content, we take the first one. Solve also hash conflict. $this->db->plimit(1); @@ -333,6 +363,8 @@ class EcmFiles //extends CommonObject $this->fk_user_c = $obj->fk_user_c; $this->fk_user_m = $obj->fk_user_m; $this->acl = $obj->acl; + $this->src_object_type = $obj->src_object_type; + $this->src_object_id = $obj->src_object_id; } // Retrieve all extrafields for invoice @@ -390,7 +422,9 @@ class EcmFiles //extends CommonObject $sql .= " t.date_m,"; $sql .= " t.fk_user_c,"; $sql .= " t.fk_user_m,"; - $sql .= " t.acl"; + $sql .= " t.acl,"; + $sql .= " t.src_object_type,"; + $sql .= " t.src_object_id"; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element. ' as t'; // Manage filter @@ -443,6 +477,9 @@ class EcmFiles //extends CommonObject $line->fk_user_c = $obj->fk_user_c; $line->fk_user_m = $obj->fk_user_m; $line->acl = $obj->acl; + $line->src_object_type = $obj->src_object_type; + $line->src_object_id = $obj->src_object_id; + $this->lines[] = $line; } $this->db->free($resql); @@ -465,6 +502,8 @@ class EcmFiles //extends CommonObject */ public function update(User $user, $notrigger = false) { + global $conf; + $error = 0; dol_syslog(__METHOD__, LOG_DEBUG); @@ -507,16 +546,15 @@ class EcmFiles //extends CommonObject if (isset($this->extraparams)) { $this->extraparams = trim($this->extraparams); } - if (isset($this->fk_user_c)) { - $this->fk_user_c = trim($this->fk_user_c); - } if (isset($this->fk_user_m)) { $this->fk_user_m = trim($this->fk_user_m); } if (isset($this->acl)) { $this->acl = trim($this->acl); } - + if (isset($this->src_object_type)) { + $this->src_object_type = trim($this->src_object_type); + } // Check parameters // Put here code to add a control on parameters values @@ -538,9 +576,10 @@ class EcmFiles //extends CommonObject $sql .= ' extraparams = '.(isset($this->extraparams)?"'".$this->db->escape($this->extraparams)."'":"null").','; $sql .= ' date_c = '.(! isset($this->date_c) || dol_strlen($this->date_c) != 0 ? "'".$this->db->idate($this->date_c)."'" : 'null').','; //$sql .= ' date_m = '.(! isset($this->date_m) || dol_strlen($this->date_m) != 0 ? "'".$this->db->idate($this->date_m)."'" : 'null').','; // Field automatically updated - $sql .= ' fk_user_c = '.(isset($this->fk_user_c)?$this->fk_user_c:"null").','; $sql .= ' fk_user_m = '.($this->fk_user_m > 0?$this->fk_user_m:$user->id).','; - $sql .= ' acl = '.(isset($this->acl)?"'".$this->db->escape($this->acl)."'":"null"); + $sql .= ' acl = '.(isset($this->acl)?"'".$this->db->escape($this->acl)."'":"null").','; + $sql .= ' src_object_id = '.($this->src_object_id > 0?$this->src_object_id:"null").','; + $sql .= ' src_object_type = '.(isset($this->src_object_type)?"'".$this->db->escape($this->src_object_type)."'":"null"); $sql .= ' WHERE rowid=' . $this->id; $this->db->begin(); @@ -552,14 +591,13 @@ class EcmFiles //extends CommonObject dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); } - if (!$error && !$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - //// Call triggers - //$result=$this->call_trigger('MYOBJECT_MODIFY',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - //// End call triggers + // Triggers + if (! $error && ! $notrigger) + { + // Call triggers + $result=$this->call_trigger(strtoupper(get_class($this)).'_MODIFY',$user); + if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail + // End call triggers } // Commit or rollback @@ -590,16 +628,13 @@ class EcmFiles //extends CommonObject $this->db->begin(); - if (!$error) { - if (!$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - //// Call triggers - //$result=$this->call_trigger('MYOBJECT_DELETE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - //// End call triggers - } + // Triggers + if (! $notrigger) + { + // Call triggers + $result=$this->call_trigger(strtoupper(get_class($this)).'_DELETE',$user); + if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail + // End call triggers } // If you need to delete child tables to, you can insert them here @@ -781,8 +816,9 @@ class EcmFiles //extends CommonObject $this->fk_user_c = $user->id; $this->fk_user_m = ''; $this->acl = ''; + $this->src_object_type = 'product'; + $this->src_object_id = 1; } - } @@ -804,4 +840,6 @@ class EcmfilesLine public $fk_user_c; public $fk_user_m; public $acl; + public $src_object_type; + public $src_object_id; } diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index 9857b90c84c..844a6c95305 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -181,7 +181,7 @@ class Shipments extends DolibarrApi * @param array $request_data Request data * @return int ID of shipment */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->expedition->creer) { throw new RestException(401, "Insuffisant rights"); @@ -250,7 +250,7 @@ class Shipments extends DolibarrApi * @return int */ /* - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expedition->creer) { throw new RestException(401); } @@ -312,7 +312,7 @@ class Shipments extends DolibarrApi * @return object */ /* - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expedition->creer) { throw new RestException(401); } @@ -407,7 +407,7 @@ class Shipments extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if (! DolibarrApiAccess::$user->rights->expedition->creer) { throw new RestException(401); } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 88050097d3f..a3d44d7072a 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2016-2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -233,14 +233,20 @@ $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; +$sql.= $db->order($sortfield,$sortorder); + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } -$sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1,$offset); //print $sql; @@ -268,7 +274,9 @@ if ($resql) $newcardbutton=''; if ($user->rights->expedition->creer) { - $newcardbutton=''.$langs->trans('NewSending').''; + $newcardbutton=''.$langs->trans('NewSending'); + $newcardbutton.= ''; + $newcardbutton.= ''; } $i = 0; @@ -438,7 +446,7 @@ if ($resql) } } // Hook fields - $parameters=array('arrayfields'=>$arrayfields); + $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['e.datec']['checked'])) print_liste_field_titre($arrayfields['e.datec']['label'],$_SERVER["PHP_SELF"],"e.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index 53837c76fd1..9d7d77cf290 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -275,17 +275,17 @@ foreach ($data as $val) while (! empty($year) && $oldyear > $year+1) { // If we have empty year $oldyear--; - - + + print '
'.$oldyear.'000
'; if ($year) print ''.$year.''; @@ -305,7 +305,7 @@ print '
'; // Show graphs -print '
'; +print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 1faa521d8b7..a2d67d627c0 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -44,9 +44,7 @@ if (! empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; } -$langs->load("trips"); -$langs->load("bills"); -$langs->load("mails"); +$langs->loadLangs(array("trips","bills","mails")); $action=GETPOST('action','aZ09'); $cancel=GETPOST('cancel','alpha'); diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index e68c9338b92..726aa158413 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -160,7 +160,7 @@ class ExpenseReports extends DolibarrApi * @param array $request_data Request data * @return int ID of Expense Report */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401, "Insuffisant rights"); @@ -228,7 +228,7 @@ class ExpenseReports extends DolibarrApi * @return int */ /* - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } @@ -290,7 +290,7 @@ class ExpenseReports extends DolibarrApi * @return object */ /* - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } @@ -380,7 +380,7 @@ class ExpenseReports extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index dc4f1c8a7af..67f074d7f92 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -34,10 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; -$langs->load("other"); -$langs->load("trips"); -$langs->load("companies"); -$langs->load("interventions"); +$langs->loadLangs(array("other","trips","companies","interventions")); $id = GETPOST('id','int'); $ref = GETPOST('ref', 'alpha'); @@ -58,7 +55,7 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="name"; +if (! $sortfield) $sortfield="position_name"; $object = new ExpenseReport($db); @@ -67,6 +64,9 @@ $object->fetch($id, $ref); $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart='trip'; +// 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 + /* * Actions diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 77db05da49a..5fba738809a 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -48,7 +48,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="d.date_create"; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; /* diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 2944220458d..2bc7a624514 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -328,7 +329,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } + $sql.= $db->plimit($limit+1, $offset); //print $sql; @@ -465,7 +472,9 @@ if ($resql) $newcardbutton=''; if ($user->rights->expensereport->creer) { - $newcardbutton=''.$langs->trans('NewTrip').''; + $newcardbutton=''.$langs->trans('NewTrip'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit); @@ -617,7 +626,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters=array('arrayfields'=>$arrayfields); + $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['d.date_create']['checked'])) print_liste_field_titre($arrayfields['d.date_create']['label'],$_SERVER["PHP_SELF"],"d.date_create","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php index a715d85f6a6..063406b1878 100644 --- a/htdocs/expensereport/note.php +++ b/htdocs/expensereport/note.php @@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; -var_dump($value_public); + $cssclass="titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index d2f3a4c3567..871805564c5 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -73,7 +73,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere $db->begin(); $result=$object->valide(); - + if ($result > 0) { $db->commit(); @@ -112,7 +112,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere llxHeader('', $langs->trans("ExpenseReportPayment")); -if ($id > 0) +if ($id > 0) { $result=$object->fetch($id); if (! $result) dol_print_error($db,'Failed to get payment id '.$id); @@ -240,8 +240,6 @@ if ($resql) if ($num > 0) { - $var=True; - while ($i < $num) { $objp = $db->fetch_object($resql); @@ -277,7 +275,7 @@ if ($resql) $i++; } } - + print "
\n"; print ''; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index d0e3a1164bc..819f0d4d351 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -288,7 +288,7 @@ print '
'; // Show graphs -print '
'; +print ''; - + print "\n"; $i ++; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index ca395d0cf47..4eead48abf4 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -55,7 +55,6 @@ print '
'; if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo { - $var=false; print ''; print ''; print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 0d9360b0e72..8b21b534856 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -188,7 +188,7 @@ class Interventions extends DolibarrApi * @param array $request_data Request data * @return int ID of intervention */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->ficheinter->creer) { throw new RestException(401, "Insuffisant rights"); @@ -249,7 +249,7 @@ class Interventions extends DolibarrApi * * @return int */ - function postLine($id, $request_data = NULL) + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->ficheinter->creer) { throw new RestException(401, "Insuffisant rights"); diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 9f596e61279..25f2e691265 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -55,9 +55,10 @@ class Fichinter extends CommonObject var $datet; var $datem; var $duration; - var $statut; // 0=draft, 1=validated, 2=invoiced, 3=Terminate + var $statut = 0; // 0=draft, 1=validated, 2=invoiced, 3=Terminate var $description; - var $fk_contrat; + var $fk_contrat = 0; + var $fk_project = 0; var $extraparams=array(); var $lines = array(); @@ -87,24 +88,8 @@ class Fichinter extends CommonObject function __construct($db) { $this->db = $db; - $this->products = array(); - $this->fk_project = 0; - $this->fk_contrat = 0; - $this->statut = 0; - // List of language codes for status - $this->statuts[0]='Draft'; - $this->statuts[1]='Validated'; - $this->statuts[2]='StatusInterInvoiced'; - $this->statuts[3]='Done'; - $this->statuts_short[0]='Draft'; - $this->statuts_short[1]='Validated'; - $this->statuts_short[2]='StatusInterInvoiced'; - $this->statuts_short[3]='Done'; - $this->statuts_logo[0]='statut0'; - $this->statuts_logo[1]='statut1'; - $this->statuts_logo[2]='statut6'; - $this->statuts_logo[3]='statut6'; + $this->products = array(); } /** @@ -634,22 +619,40 @@ class Fichinter extends CommonObject */ function LibStatut($statut,$mode=0) { - global $langs; + // Init/load array of translation of status + if (empty($this->statuts) || empty($this->statuts_short)) + { + global $langs; + $langs->load("fichinter"); + + $this->statuts[0]=$langs->trans('Draft'); + $this->statuts[1]=$langs->trans('Validated'); + $this->statuts[2]=$langs->trans('StatusInterInvoiced'); + $this->statuts[3]=$langs->trans('Done'); + $this->statuts_short[0]=$langs->trans('Draft'); + $this->statuts_short[1]=$langs->trans('Validated'); + $this->statuts_short[2]=$langs->trans('StatusInterInvoiced'); + $this->statuts_short[3]=$langs->trans('Done'); + $this->statuts_logo[0]='statut0'; + $this->statuts_logo[1]='statut1'; + $this->statuts_logo[2]='statut6'; + $this->statuts_logo[3]='statut6'; + } if ($mode == 0) - return $langs->trans($this->statuts[$statut]); + return $this->statuts[$statut]; if ($mode == 1) - return $langs->trans($this->statuts_short[$statut]); + return $this->statuts_short[$statut]; if ($mode == 2) - return img_picto($langs->trans($this->statuts_short[$statut]), $this->statuts_logo[$statut]).' '.$langs->trans($this->statuts_short[$statut]); + return img_picto($this->statuts_short[$statut], $this->statuts_logo[$statut]).' '.$this->statuts_short[$statut]; if ($mode == 3) - return img_picto($langs->trans($this->statuts_short[$statut]), $this->statuts_logo[$statut]); + return img_picto($this->statuts_short[$statut], $this->statuts_logo[$statut]); if ($mode == 4) - return img_picto($langs->trans($this->statuts_short[$statut]),$this->statuts_logo[$statut]).' '.$langs->trans($this->statuts[$statut]); + return img_picto($this->statuts_short[$statut], $this->statuts_logo[$statut]).' '.$this->statuts[$statut]; if ($mode == 5) - return ''.$langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),$this->statuts_logo[$statut]); + return ''.$this->statuts_short[$statut].' '.img_picto($this->statuts[$statut],$this->statuts_logo[$statut]); if ($mode == 6) - return ''.$langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),$this->statuts_logo[$statut]); + return ''.$this->statuts[$statut].' '.img_picto($this->statuts[$statut],$this->statuts_logo[$statut]); return ''; } diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index f7082770970..87d8b366ef8 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,7 +59,7 @@ $result = restrictedArea($user, 'ficheinter', $id,'fichinter'); $diroutputmassaction=$conf->ficheinter->dir_output . '/temp/massgeneration/'.$user->id; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); @@ -229,6 +230,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -274,7 +280,9 @@ if ($resql) $newcardbutton=''; if ($user->rights->ficheinter->creer) { - $newcardbutton=''.$langs->trans('NewIntervention').''; + $newcardbutton=''.$langs->trans('NewIntervention'); + $newcardbutton.= ''; + $newcardbutton.= ''; } // Lines of title fields @@ -378,6 +386,7 @@ if ($resql) if (! empty($arrayfields['f.fk_statut']['checked'])) { print ''; + $tmp = $objectstatic->LibStatut(0); // To load $this->statuts_short $liststatus=$objectstatic->statuts_short; if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1 print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1); @@ -400,7 +409,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters=array('arrayfields'=>$arrayfields); + $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre("DateCreationShort",$_SERVER["PHP_SELF"],"f.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 1c0ba5764ed..b00b1391003 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -255,6 +255,7 @@ print '
'; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); // Status print '
'.$langs->trans("Status").''; + $tmp = $objectstatic->LibStatut(0); // To load $this->statuts_short $liststatus=$objectstatic->statuts_short; if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1 print $form->selectarray('object_status', $liststatus, $object_status, 1, 0, 0, '', 1); @@ -324,7 +325,7 @@ print '
'; // Show graphs -print ''; } - $var=True; + while ($i < min($num,$MAXLIST)) { $obj = $db->fetch_object($resql); diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index e60fdccd4ad..68bb902b8fb 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -182,7 +182,7 @@ class SupplierInvoices extends DolibarrApi * @param array $request_data Request datas * @return int ID of supplier invoice */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { throw new RestException(401, "Insuffisant rights"); @@ -218,7 +218,7 @@ class SupplierInvoices extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { throw new RestException(401); diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 74b5bbe43b3..d9596bf3958 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -186,7 +186,7 @@ class SupplierOrders extends DolibarrApi * @param array $request_data Request datas * @return int ID of supplier order */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401, "Insuffisant rights"); @@ -222,7 +222,7 @@ class SupplierOrders extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401); diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php index 7364199fca5..ba486e066cc 100644 --- a/htdocs/fourn/class/fournisseur.class.php +++ b/htdocs/fourn/class/fournisseur.class.php @@ -34,8 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; class Fournisseur extends Societe { var $next_prev_filter="te.fournisseur = 1"; // Used to add a filter in Form::showrefnav method - - + + /** * Constructor * @@ -44,10 +44,9 @@ class Fournisseur extends Societe function __construct($db) { $this->db = $db; + $this->client = 0; - $this->fournisseur = 0; - $this->effectif_id = 0; - $this->forme_juridique_code = 0; + $this->fournisseur = 1; } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 07788e55947..b7ee4ee7232 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -184,23 +184,9 @@ class CommandeFournisseur extends CommonOrder */ public function __construct($db) { - global $conf; - $this->db = $db; - $this->products = array(); - // List of language codes for status - $this->statuts[0] = 'StatusOrderDraft'; - $this->statuts[1] = 'StatusOrderValidated'; - $this->statuts[2] = 'StatusOrderApproved'; - if (empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) $this->statuts[3] = 'StatusOrderOnProcess'; - else $this->statuts[3] = 'StatusOrderOnProcessWithValidation'; - $this->statuts[4] = 'StatusOrderReceivedPartially'; - $this->statuts[5] = 'StatusOrderReceivedAll'; - $this->statuts[6] = 'StatusOrderCanceled'; // Approved->Canceled - $this->statuts[7] = 'StatusOrderCanceled'; // Process running->canceled - //$this->statuts[8] = 'StatusOrderBilled'; // Everything is finished, order received totally and bill received - $this->statuts[9] = 'StatusOrderRefused'; + $this->products = array(); } @@ -318,97 +304,17 @@ class CommandeFournisseur extends CommonOrder if ($this->statut == 0) $this->brouillon = 1; - //$result=$this->fetch_lines(); - $this->lines=array(); - - $sql = "SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description, l.qty,"; - $sql.= " l.vat_src_code, l.tva_tx, l.remise_percent, l.subprice,"; - $sql.= " l.localtax1_tx, l. localtax2_tx, l.localtax1_type, l. localtax2_type, l.total_localtax1, l.total_localtax2,"; - $sql.= " l.total_ht, l.total_tva, l.total_ttc, l.special_code, l.fk_parent_line, l.rang,"; - $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc,"; - $sql.= " l.fk_unit,"; - $sql.= " l.date_start, l.date_end,"; - $sql.= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc'; - $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; - $sql.= " WHERE l.fk_commande = ".$this->id; - $sql.= " ORDER BY l.rang, l.rowid"; - //print $sql; - - dol_syslog(get_class($this)."::fetch get lines", LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) + /* + * Lines + */ + $result=$this->fetch_lines(); + if ($result < 0) { - $num = $this->db->num_rows($result); - $i = 0; - - while ($i < $num) - { - $objp = $this->db->fetch_object($result); - - $line = new CommandeFournisseurLigne($this->db); - - $line->id = $objp->rowid; - $line->desc = $objp->description; - $line->description = $objp->description; - $line->qty = $objp->qty; - $line->tva_tx = $objp->tva_tx; - $line->localtax1_tx = $objp->localtax1_tx; - $line->localtax2_tx = $objp->localtax2_tx; - $line->localtax1_type = $objp->localtax1_type; - $line->localtax2_type = $objp->localtax2_type; - $line->subprice = $objp->subprice; - $line->pu_ht = $objp->subprice; - $line->remise_percent = $objp->remise_percent; - - $line->vat_src_code = $objp->vat_src_code; - $line->total_ht = $objp->total_ht; - $line->total_tva = $objp->total_tva; - $line->total_localtax1 = $objp->total_localtax1; - $line->total_localtax2 = $objp->total_localtax2; - $line->total_ttc = $objp->total_ttc; - $line->product_type = $objp->product_type; - - $line->fk_product = $objp->fk_product; - - $line->libelle = $objp->product_label; - $line->product_label = $objp->product_label; - $line->product_desc = $objp->product_desc; - - $line->ref = $objp->product_ref; // Ref of product - $line->product_ref = $objp->product_ref; // Ref of product - $line->ref_fourn = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since - $line->ref_supplier = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since - - $line->date_start = $this->db->jdate($objp->date_start); - $line->date_end = $this->db->jdate($objp->date_end); - $line->fk_unit = $objp->fk_unit; - - // Multicurrency - $line->fk_multicurrency = $objp->fk_multicurrency; - $line->multicurrency_code = $objp->multicurrency_code; - $line->multicurrency_subprice = $objp->multicurrency_subprice; - $line->multicurrency_total_ht = $objp->multicurrency_total_ht; - $line->multicurrency_total_tva = $objp->multicurrency_total_tva; - $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; - - $line->special_code = $objp->special_code; - $line->fk_parent_line = $objp->fk_parent_line; - - $line->rang = $objp->rang; - - $this->lines[$i] = $line; - - $i++; - } - $this->db->free($result); - - return 1; + return -1; } else { - $this->error=$this->db->error()." sql=".$sql; - return -1; + return 1; } } else @@ -418,6 +324,113 @@ class CommandeFournisseur extends CommonOrder } } + /** + * Load array lines + * + * @param int $only_product Return only physical products + * @return int <0 if KO, >0 if OK + */ + function fetch_lines($only_product=0) + { + //$result=$this->fetch_lines(); + $this->lines=array(); + + $sql = "SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description, l.qty,"; + $sql.= " l.vat_src_code, l.tva_tx, l.remise_percent, l.subprice,"; + $sql.= " l.localtax1_tx, l. localtax2_tx, l.localtax1_type, l. localtax2_type, l.total_localtax1, l.total_localtax2,"; + $sql.= " l.total_ht, l.total_tva, l.total_ttc, l.special_code, l.fk_parent_line, l.rang,"; + $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc,"; + $sql.= " l.fk_unit,"; + $sql.= " l.date_start, l.date_end,"; + $sql.= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc'; + $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; + $sql.= " WHERE l.fk_commande = ".$this->id; + if ($only_product) $sql .= ' AND p.fk_product_type = 0'; + $sql.= " ORDER BY l.rang, l.rowid"; + //print $sql; + + dol_syslog(get_class($this)."::fetch get lines", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $num = $this->db->num_rows($result); + $i = 0; + + while ($i < $num) + { + $objp = $this->db->fetch_object($result); + + $line = new CommandeFournisseurLigne($this->db); + + $line->id = $objp->rowid; + $line->desc = $objp->description; + $line->description = $objp->description; + $line->qty = $objp->qty; + $line->tva_tx = $objp->tva_tx; + $line->localtax1_tx = $objp->localtax1_tx; + $line->localtax2_tx = $objp->localtax2_tx; + $line->localtax1_type = $objp->localtax1_type; + $line->localtax2_type = $objp->localtax2_type; + $line->subprice = $objp->subprice; + $line->pu_ht = $objp->subprice; + $line->remise_percent = $objp->remise_percent; + + $line->vat_src_code = $objp->vat_src_code; + $line->total_ht = $objp->total_ht; + $line->total_tva = $objp->total_tva; + $line->total_localtax1 = $objp->total_localtax1; + $line->total_localtax2 = $objp->total_localtax2; + $line->total_ttc = $objp->total_ttc; + $line->product_type = $objp->product_type; + + $line->fk_product = $objp->fk_product; + + $line->libelle = $objp->product_label; + $line->product_label = $objp->product_label; + $line->product_desc = $objp->product_desc; + + $line->ref = $objp->product_ref; // Ref of product + $line->product_ref = $objp->product_ref; // Ref of product + $line->ref_fourn = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since + $line->ref_supplier = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since + + $line->date_start = $this->db->jdate($objp->date_start); + $line->date_end = $this->db->jdate($objp->date_end); + $line->fk_unit = $objp->fk_unit; + + // Multicurrency + $line->fk_multicurrency = $objp->fk_multicurrency; + $line->multicurrency_code = $objp->multicurrency_code; + $line->multicurrency_subprice = $objp->multicurrency_subprice; + $line->multicurrency_total_ht = $objp->multicurrency_total_ht; + $line->multicurrency_total_tva = $objp->multicurrency_total_tva; + $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + + $line->special_code = $objp->special_code; + $line->fk_parent_line = $objp->fk_parent_line; + + $line->rang = $objp->rang; + + // Retreive all extrafield + // fetch optionals attributes and labels + $line->fetch_optionals(); + + $this->lines[$i] = $line; + + $i++; + } + $this->db->free($result); + + return $num; + } + else + { + $this->error=$this->db->error()." sql=".$sql; + return -1; + } + } + /** * Validate an order * @@ -560,24 +573,41 @@ class CommandeFournisseur extends CommonOrder */ function LibStatut($statut,$mode=0,$billed=0) { - global $langs; - $langs->load('orders'); + if (empty($this->statuts) || empty($statutshort)) + { + global $langs; + $langs->load('orders'); + + $this->statuts[0] = 'StatusOrderDraft'; + $this->statuts[1] = 'StatusOrderValidated'; + $this->statuts[2] = 'StatusOrderApproved'; + if (empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) $this->statuts[3] = 'StatusOrderOnProcess'; + else $this->statuts[3] = 'StatusOrderOnProcessWithValidation'; + $this->statuts[4] = 'StatusOrderReceivedPartially'; + $this->statuts[5] = 'StatusOrderReceivedAll'; + $this->statuts[6] = 'StatusOrderCanceled'; // Approved->Canceled + $this->statuts[7] = 'StatusOrderCanceled'; // Process running->canceled + //$this->statuts[8] = 'StatusOrderBilled'; // Everything is finished, order received totally and bill received + $this->statuts[9] = 'StatusOrderRefused'; + + // List of language codes for status + $statutshort[0] = 'StatusOrderDraftShort'; + $statutshort[1] = 'StatusOrderValidatedShort'; + $statutshort[2] = 'StatusOrderApprovedShort'; + $statutshort[3] = 'StatusOrderOnProcessShort'; + $statutshort[4] = 'StatusOrderReceivedPartiallyShort'; + $statutshort[5] = 'StatusOrderReceivedAllShort'; + $statutshort[6] = 'StatusOrderCanceledShort'; + $statutshort[7] = 'StatusOrderCanceledShort'; + $statutshort[9] = 'StatusOrderRefusedShort'; + } + + $langs->load('orders'); $billedtext=''; //if ($statut==5 && $this->billed == 1) $statut = 8; if ($billed == 1) $billedtext=$langs->trans("Billed"); - // List of language codes for status - $statutshort[0] = 'StatusOrderDraftShort'; - $statutshort[1] = 'StatusOrderValidatedShort'; - $statutshort[2] = 'StatusOrderApprovedShort'; - $statutshort[3] = 'StatusOrderOnProcessShort'; - $statutshort[4] = 'StatusOrderReceivedPartiallyShort'; - $statutshort[5] = 'StatusOrderReceivedAllShort'; - $statutshort[6] = 'StatusOrderCanceledShort'; - $statutshort[7] = 'StatusOrderCanceledShort'; - $statutshort[9] = 'StatusOrderRefusedShort'; - if ($mode == 0) { return $langs->trans($this->statuts[$statut]); @@ -1415,7 +1445,7 @@ class CommandeFournisseur extends CommonOrder $error = 0; - dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $fk_prod_fourn_price, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, $fk_unit"); + dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $fk_prod_fourn_price, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, $info_bits $notrigger $date_start $date_end $fk_unit $pu_ht_devise $origin $origin_id"); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; // Clean parameters @@ -1451,13 +1481,13 @@ class CommandeFournisseur extends CommonOrder } if ($type < 0) return -1; - if ($this->statut == 0) + if ($this->statut == self::STATUS_DRAFT) { $this->db->begin(); if ($fk_product > 0) { - if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) + if (! empty($conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY)) { // Check quantity is enough dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." ref_supplier=".$ref_supplier); @@ -1470,15 +1500,14 @@ class CommandeFournisseur extends CommonOrder // We use 'none' instead of $ref_supplier, because fourn_ref may not exists anymore. So we will take the first supplier price ok. // If we want a dedicated supplier price, we must provide $fk_prod_fourn_price. $result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc?$this->fk_soc:$this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$ref_supplier/$this->fk_soc + if ($result > 0) { - $pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice - $ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice - // is remise percent not keyed but present for the product we add it - if ($remise_percent == 0 && $prod->remise_percent !=0) + $pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice + $ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice + // is remise percent not keyed but present for the product we add it + if ($remise_percent == 0 && $prod->remise_percent !=0) $remise_percent =$prod->remise_percent; - - } if ($result == 0) // If result == 0, we failed to found the supplier reference price { @@ -1509,6 +1538,7 @@ class CommandeFournisseur extends CommonOrder else { $this->error=$prod->error; + $this->db->rollback(); return -1; } } @@ -1579,7 +1609,7 @@ class CommandeFournisseur extends CommonOrder $this->line->product_type=$product_type; $this->line->remise_percent=$remise_percent; $this->line->subprice=$pu_ht; - $this->line->rang=$this->rang; + $this->line->rang=$rang; $this->line->info_bits=$info_bits; $this->line->vat_src_code=$vat_src_code; @@ -1674,7 +1704,7 @@ class CommandeFournisseur extends CommonOrder $this->error='ErrorBadValueForParameterWarehouse'; return -1; } - if ($qty <= 0) + if ($qty == 0) { $this->error='ErrorBadValueForParameterQty'; return -1; @@ -3066,6 +3096,7 @@ class CommandeFournisseurLigne extends CommonOrderLine public $fk_facture; public $label; public $rang = 0; + public $special_code = 0; /** * Unit price without taxes @@ -3105,7 +3136,7 @@ class CommandeFournisseurLigne extends CommonOrderLine */ public function fetch($rowid) { - $sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_product, cd.product_type, cd.description, cd.qty, cd.tva_tx,'; + $sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_product, cd.product_type, cd.description, cd.qty, cd.tva_tx, cd.special_code,'; $sql.= ' cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.ref,'; $sql.= ' cd.remise, cd.remise_percent, cd.subprice,'; $sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,'; @@ -3144,6 +3175,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $this->total_localtax2 = $objp->total_localtax2; $this->total_ttc = $objp->total_ttc; $this->product_type = $objp->product_type; + $this->special_code = $objp->special_code; $this->ref = $objp->product_ref; $this->product_ref = $objp->product_ref; @@ -3159,6 +3191,8 @@ class CommandeFournisseurLigne extends CommonOrderLine $this->multicurrency_total_tva = $objp->multicurrency_total_tva; $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $this->fetch_optionals(); + $this->db->free($result); return 1; } @@ -3216,7 +3250,7 @@ class CommandeFournisseurLigne extends CommonOrderLine // Insertion dans base de la ligne $sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element; $sql.= " (fk_commande, label, description, date_start, date_end,"; - $sql.= " fk_product, product_type,"; + $sql.= " fk_product, product_type, special_code, rang,"; $sql.= " qty, vat_src_code, tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, remise_percent, subprice, ref,"; $sql.= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_unit,"; $sql.= " fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc"; @@ -3227,8 +3261,9 @@ class CommandeFournisseurLigne extends CommonOrderLine if ($this->fk_product) { $sql.= $this->fk_product.","; } else { $sql.= "null,"; } $sql.= "'".$this->db->escape($this->product_type)."',"; + $sql.= "'".$this->db->escape($this->special_code)."',"; + $sql.= "'".$this->db->escape($this->rang)."',"; $sql.= "'".$this->db->escape($this->qty)."', "; - $sql.= " ".(empty($this->vat_src_code)?"''":"'".$this->db->escape($this->vat_src_code)."'").","; $sql.= " ".$this->tva_tx.", "; $sql.= " ".$this->localtax1_tx.","; @@ -3330,6 +3365,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $sql.= ", total_localtax2='".price2num($this->total_localtax2)."'"; $sql.= ", total_ttc='".price2num($this->total_ttc)."'"; $sql.= ", product_type=".$this->product_type; + $sql.= ", special_code=".(!empty($this->special_code) ? $this->special_code : 0); $sql.= ($this->fk_unit ? ", fk_unit='".$this->db->escape($this->fk_unit)."'":", fk_unit=null"); // Multicurrency diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 35addb8ee13..d4b1c14b522 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -89,16 +89,16 @@ class FactureFournisseur extends CommonInvoice public $tms; // Last update date public $date; // Invoice date public $date_echeance; // Max payment date - public $amount; - public $remise; - public $tva; + public $amount=0; + public $remise=0; + public $tva=0; public $localtax1; public $localtax2; - public $total_ht; - public $total_tva; - public $total_localtax1; - public $total_localtax2; - public $total_ttc; + public $total_ht=0; + public $total_tva=0; + public $total_localtax1=0; + public $total_localtax2=0; + public $total_ttc=0; /** * @deprecated * @see note_private, note_public @@ -202,16 +202,6 @@ class FactureFournisseur extends CommonInvoice { $this->db = $db; - $this->amount = 0; - $this->remise = 0; - $this->tva = 0; - $this->total_localtax1 = 0; - $this->total_localtax2 = 0; - $this->total_ht = 0; - $this->total_tva = 0; - $this->total_ttc = 0; - $this->propalid = 0; - $this->products = array(); } @@ -404,7 +394,7 @@ class FactureFournisseur extends CommonInvoice $line = $this->lines[$i]; // Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array - //if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object. + //if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object. if (! is_object($line)) $line = (object) $line; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)'; @@ -1500,8 +1490,6 @@ class FactureFournisseur extends CommonInvoice * @param double $pu_ht_devise Amount in currency * @param string $ref_supplier Supplier ref * @return int >0 if OK, <0 if KO - * - * FIXME Add field ref (that should be named ref_supplier) and label into update. For example can be filled when product line created from order. */ public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0, $rang=-1, $notrigger=false, $array_options=0, $fk_unit=null, $origin_id=0, $pu_ht_devise=0, $ref_supplier='') { @@ -1519,6 +1507,71 @@ class FactureFournisseur extends CommonInvoice if (empty($txlocaltax1)) $txlocaltax1=0; if (empty($txlocaltax2)) $txlocaltax2=0; + $this->db->begin(); + + if ($fk_product > 0) + { + if (! empty($conf->global->SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY)) + { + // Check quantity is enough + dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." ref_supplier=".$ref_supplier); + $prod = new Product($this->db, $fk_product); + if ($prod->fetch($fk_product) > 0) + { + $product_type = $prod->type; + $label = $prod->label; + + // We use 'none' instead of $ref_supplier, because fourn_ref may not exists anymore. So we will take the first supplier price ok. + // If we want a dedicated supplier price, we must provide $fk_prod_fourn_price. + $result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc?$this->fk_soc:$this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$ref_supplier/$this->fk_soc + if ($result > 0) + { + $pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice + $ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice + // is remise percent not keyed but present for the product we add it + if ($remise_percent == 0 && $prod->remise_percent !=0) + $remise_percent =$prod->remise_percent; + } + if ($result == 0) // If result == 0, we failed to found the supplier reference price + { + $langs->load("errors"); + $this->error = "Ref " . $prod->ref . " " . $langs->trans("ErrorQtyTooLowForThisSupplier"); + $this->db->rollback(); + dol_syslog(get_class($this)."::addline we did not found supplier price, so we can't guess unit price"); + //$pu = $prod->fourn_pu; // We do not overwrite unit price + //$ref = $prod->ref_fourn; // We do not overwrite ref supplier price + return -1; + } + if ($result == -1) + { + $langs->load("errors"); + $this->error = "Ref " . $prod->ref . " " . $langs->trans("ErrorQtyTooLowForThisSupplier"); + $this->db->rollback(); + dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG); + return -1; + } + if ($result < -1) + { + $this->error=$prod->error; + $this->db->rollback(); + dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_ERR); + return -1; + } + } + else + { + $this->error=$prod->error; + $this->db->rollback(); + return -1; + } + } + } + else + { + $product_type = $type; + } + + $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $mysoc, $this->thirdparty); // Clean vat code @@ -1557,6 +1610,12 @@ class FactureFournisseur extends CommonInvoice // Check parameters if ($type < 0) return -1; + if ($rang < 0) + { + $rangmax = $this->line_max(); + $rang = $rangmax + 1; + } + // Insert line $this->line=new SupplierInvoiceLine($this->db); @@ -1656,12 +1715,13 @@ class FactureFournisseur extends CommonInvoice * @param array $array_options extrafields array * @param string $fk_unit Code of the unit to use. Null to use the default one * @param double $pu_ht_devise Amount in currency + * @param string $ref_supplier Supplier ref * @return int <0 if KO, >0 if OK */ - public function updateline($id, $desc, $pu, $vatrate, $txlocaltax1=0, $txlocaltax2=0, $qty=1, $idproduct=0, $price_base_type='HT', $info_bits=0, $type=0, $remise_percent=0, $notrigger=false, $date_start='', $date_end='', $array_options=0, $fk_unit = null, $pu_ht_devise=0) + public function updateline($id, $desc, $pu, $vatrate, $txlocaltax1=0, $txlocaltax2=0, $qty=1, $idproduct=0, $price_base_type='HT', $info_bits=0, $type=0, $remise_percent=0, $notrigger=false, $date_start='', $date_end='', $array_options=0, $fk_unit = null, $pu_ht_devise=0, $ref_supplier='') { global $mysoc; - dol_syslog(get_class($this)."::updateline $id,$desc,$pu,$vatrate,$qty,$idproduct,$price_base_type,$info_bits,$type,$remise_percent,$fk_unit", LOG_DEBUG); + dol_syslog(get_class($this)."::updateline $id,$desc,$pu,$vatrate,$qty,$idproduct,$price_base_type,$info_bits,$type,$remise_percent,$fk_unit,$pu_ht_devise,$ref_supplier", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; $pu = price2num($pu); @@ -1739,6 +1799,7 @@ class FactureFournisseur extends CommonInvoice $line->pu_ttc = $pu_ttc; $line->qty = $qty; $line->remise_percent = $remise_percent; + $line->ref_supplier = $ref_supplier; $line->vat_src_code=$vat_src_code; $line->tva_tx = $vatrate; @@ -2653,7 +2714,6 @@ class SupplierInvoiceLine extends CommonObjectLine $this->fk_facture_fourn = $obj->fk_facture_fourn; $this->description = $obj->description; $this->product_ref = $obj->product_ref; - $this->ref = $obj->product_ref; $this->ref_supplier = $obj->ref_supplier; $this->libelle = $obj->label; $this->label = $obj->label; @@ -2689,6 +2749,8 @@ class SupplierInvoiceLine extends CommonObjectLine $this->multicurrency_total_tva = $obj->multicurrency_total_tva; $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; + $this->fetch_optionals(); + return 1; } @@ -2700,6 +2762,8 @@ class SupplierInvoiceLine extends CommonObjectLine */ public function delete($notrigger = 0) { + global $user; + dol_syslog(get_class($this)."::deleteline rowid=".$this->id, LOG_DEBUG); $error = 0; @@ -2707,7 +2771,7 @@ class SupplierInvoiceLine extends CommonObjectLine $this->db->begin(); if (!$notrigger) { - if ($this->call_trigger('LINEBILL_SUPPLIER_DELETE',$user) < 0) { + if ($this->call_trigger('LINEBILL_SUPPLIER_DELETE', $user) < 0) { $error++; } } @@ -2779,12 +2843,12 @@ class SupplierInvoiceLine extends CommonObjectLine $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET"; $sql.= " description ='".$this->db->escape($this->description)."'"; - $sql.= ", ref ='".$this->db->escape($this->ref)."'"; + $sql.= ", ref ='".$this->db->escape($this->ref_supplier ? $this->ref_supplier : $this->ref)."'"; $sql.= ", pu_ht = ".price2num($this->pu_ht); $sql.= ", pu_ttc = ".price2num($this->pu_ttc); $sql.= ", qty = ".price2num($this->qty); $sql.= ", remise_percent = ".price2num($this->remise_percent); - $sql.= ", vat_src_code = '".(empty($this->vat_src_code)?'':$this->vat_src_code)."'"; + $sql.= ", vat_src_code = '".$this->db->escape(empty($this->vat_src_code)?'':$this->vat_src_code)."'"; $sql.= ", tva_tx = ".price2num($this->tva_tx); $sql.= ", localtax1_tx = ".price2num($this->localtax1_tx); $sql.= ", localtax2_tx = ".price2num($this->localtax2_tx); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index c0842bc253a..b80c202403d 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -364,12 +364,9 @@ if (empty($reshook)) { $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) // TODO this test seems useless - { - $idprod=0; - if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) - } - if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) + $idprod=0; + if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) + if (preg_match('/^idprod_([0-9]+)$/', GETPOST('idprodfournprice'), $reg)) { $idprod=$reg[1]; $res=$productsupplier->fetch($idprod); @@ -393,6 +390,9 @@ if (empty($reshook)) if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); $type = $productsupplier->type; + $price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT'); + + $ref_supplier = $productsupplier->ref_supplier; $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); @@ -408,8 +408,8 @@ if (empty($reshook)) $localtax1_tx, $localtax2_tx, $idprod, - $productsupplier->product_fourn_price_id, - $productsupplier->fourn_ref, + 0, // We already have the $idprod always defined + $ref_supplier, $remise_percent, 'HT', $pu_ttc, @@ -438,7 +438,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); } } - else if (empty($error)) + else if (empty($error)) // $price_ht is already set { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); @@ -457,22 +457,19 @@ if (empty($reshook)) $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty); - if (GETPOST('price_ht')!=='') + if ($price_ht !== '') { - $price_base_type = 'HT'; - $ht = price2num(GETPOST('price_ht')); - $ttc = 0; + $pu_ht = price2num($price_ht, 'MU'); // $pu_ht must be rounded according to settings } else { - $ttc = price2num(GETPOST('price_ttc')); - $ht = $ttc / (1 + ($tva_tx / 100)); - $price_base_type = 'HT'; + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings } - + $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'MU'); - $result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit, $pu_ht_devise); + $result=$object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit, $pu_ht_devise); } //print "xx".$tva_tx; exit; @@ -556,9 +553,12 @@ if (empty($reshook)) } $productsupplier = new ProductFournisseur($db); - if ($line->fk_product > 0 && $productsupplier->get_buyprice(0, price2num($_POST['qty']), $line->fk_product, 'none', GETPOST('socid','int')) < 0 ) + if (! empty($conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY)) { - setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings'); + if ($line->fk_product > 0 && $productsupplier->get_buyprice(0, price2num($_POST['qty']), $line->fk_product, 'none', GETPOST('socid','int')) < 0 ) + { + setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings'); + } } $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); @@ -1062,8 +1062,6 @@ if (empty($reshook)) $fk_parent_line = 0; $num = count($lines); - $productsupplier = new ProductFournisseur($db); - for($i = 0; $i < $num; $i ++) { @@ -1071,7 +1069,7 @@ if (empty($reshook)) continue; $label = (! empty($lines[$i]->label) ? $lines[$i]->label : ''); - $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle); + $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->product_desc); $product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0); // Reset fk_parent_line for no child products and special product @@ -1087,43 +1085,57 @@ if (empty($reshook)) $array_option = $lines[$i]->array_options; } - $result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty, $srcobject->socid); - if ($result>=0) + $ref_supplier = ''; + $product_fourn_price_id = 0; + if ($origin == "commande") { - $tva_tx = $lines[$i]->tva_tx; - - if ($origin=="commande") + $productsupplier = new ProductFournisseur($db); + $result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty, $srcobject->socid); + if ($result > 0) { - $soc=new societe($db); - $soc->fetch($socid); - $tva_tx=get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $productsupplier->product_fourn_price_id); + $ref_supplier = $productsupplier->ref_supplier; + $product_fourn_price_id = $productsupplier->product_fourn_price_id; } - - $result = $object->addline( - $desc, - $lines[$i]->subprice, - $lines[$i]->qty, - $tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, - $lines[$i]->fk_product > 0 ? $lines[$i]->fk_product : 0, - $productsupplier->product_fourn_price_id, - $productsupplier->ref_supplier, - $lines[$i]->remise_percent, - 'HT', - 0, - $lines[$i]->product_type, - '', - '', - null, - null, - array(), - $lines[$i]->fk_unit, - 0, - $element, - !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid - ); } + else + { + $ref_supplier = $lines[$i]->ref_fourn; + $product_fourn_price_id = 0; + } + + $tva_tx = $lines[$i]->tva_tx; + + if ($origin=="commande") + { + $soc=new societe($db); + $soc->fetch($socid); + $tva_tx=get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id); + } + + $result = $object->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product > 0 ? $lines[$i]->fk_product : 0, + $product_fourn_price_id, + $ref_supplier, + $lines[$i]->remise_percent, + 'HT', + 0, + $lines[$i]->product_type, + '', + '', + null, + null, + array(), + $lines[$i]->fk_unit, + 0, + $element, + !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid + ); if ($result < 0) { $error++; @@ -2165,8 +2177,10 @@ elseif (! empty($object->id)) // Add free products/services form global $forceall, $senderissupplier, $dateSelector; - $forceall=1; $senderissupplier=1; $dateSelector=0; - if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. + $forceall=1; $dateSelector=0; + $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. + //if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; + if (! empty($conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; // Show object lines $inputalsopricewithtax=0; @@ -2176,12 +2190,10 @@ elseif (! empty($object->id)) $num = count($object->lines); // Form to add new line - if ($object->statut == 0 && $user->rights->fournisseur->commande->creer) + if ($object->statut == CommandeFournisseur::STATUS_DRAFT && $user->rights->fournisseur->commande->creer) { if ($action != 'editline') { - $var = true; - // Add free products/services $object->formAddObjectLine(1, $societe, $mysoc); @@ -2208,6 +2220,7 @@ elseif (! empty($object->id)) // modified by hook if (empty($reshook)) { + $object->fetchObjectLinked(); // Links are used to show or not button, so we load them now. // Validate if ($object->statut == 0 && $num > 0) @@ -2336,11 +2349,11 @@ elseif (! empty($object->id)) // Ship if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - if (in_array($object->statut, array(3,4))) { + if (in_array($object->statut, array(3,4,5))) { if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->receptionner) { - print ''; + print ''; } else { - print ''; + print ''; } } } @@ -2659,7 +2672,7 @@ elseif (! empty($object->id)) // Ensure that price is equal and warn user if it's not $supplier_price = price($result_product["product"]["price_net"]); //Price of client tab in supplier dolibarr - $local_price = NULL; //Price of supplier as stated in product suppliers tab on this dolibarr, NULL if not found + $local_price = null; //Price of supplier as stated in product suppliers tab on this dolibarr, NULL if not found $product_fourn = new ProductFournisseur($db); $product_fourn_list = $product_fourn->list_product_fournisseur_price($line->fk_product); @@ -2674,7 +2687,7 @@ elseif (! empty($object->id)) } } - if ($local_price != NULL && $local_price != $supplier_price) { + if ($local_price != null && $local_price != $supplier_price) { setEventMessages($line_id.$langs->trans("RemotePriceMismatch")." ".$supplier_price." - ".$local_price, null, 'warnings'); } diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 837e32f9ff6..c55183921f2 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -62,6 +62,8 @@ if (empty($conf->stock->enabled)) { accessforbidden(); } +$hookmanager->initHooks(array('ordersupplierdispatch')); + // Recuperation de l'id de projet $projectid = 0; if ($_GET["projectid"]) @@ -85,6 +87,10 @@ if ($id > 0 || ! empty($ref)) { * Actions */ +$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 ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { $error=0; @@ -237,7 +243,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) $fk_commandefourndet = "fk_commandefourndet_" . $reg[1] . '_' . $reg[2]; // We ask to move a qty - if (GETPOST($qty) > 0) { + if (GETPOST($qty) != 0) { if (! (GETPOST($ent, 'int') > 0)) { dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed'); $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline); @@ -431,6 +437,9 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print "
'; +print ''; } - $var = True; while ($i < $num && $i <= $MAXLIST) { $obj = $db->fetch_object($resql); - print ''; print ''; } - $var = True; while ($i < $num && $i < $MAXLIST) { $obj = $db->fetch_object($resql); - print ''; print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index a3990333d46..eeb2c1113f6 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -24,10 +24,8 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 14b9a490da9..6dff84c5742 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -430,8 +430,6 @@ if ($object->id > 0) print $boxstat; - $var=true; - $MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT; // Lien recap @@ -549,12 +547,10 @@ if ($object->id > 0) print '
'; $proposalstatic->id = $obj->rowid; @@ -654,12 +650,10 @@ if ($object->id > 0) print '
'; $orderstatic->id = $obj->rowid; @@ -727,7 +721,7 @@ if ($object->id > 0) print '
'; print '
' . $author->getNomUrl(1, '', 0, 0, 0) . '
"; print '
'; @@ -701,7 +710,7 @@ if ($id > 0 || ! empty($ref)) { if ($nbproduct) { - $checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5])); + $checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv('StatusOrderReceivedAll')); print '
'; print $langs->trans("Comment") . ' : '; @@ -844,7 +853,7 @@ if ($id > 0 || ! empty($ref)) { } // date print '
' . dol_print_date($objp->datec) . '
'; @@ -86,8 +85,6 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - $var=True; - $total=0; $totalinprocess=0; $dataseries=array(); @@ -181,15 +178,13 @@ if ($resql) print ''; print ''; print "\n"; - $var=True; while ($i < $num) { $row = $db->fetch_row($resql); - print ''; - print ''; + print ''; print ''; print "\n"; @@ -231,11 +226,10 @@ if (! empty($conf->fournisseur->enabled)) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); + print ''; print '"; @@ -272,13 +266,11 @@ if ($resql) print '
'.$langs->trans("Status").''.$langs->trans("Nb").'
'.$langs->trans($commandestatic->statuts[$row[1]]).''.$commandestatic->LibStatut($row[1]).''.$row[0].' '.$commandestatic->LibStatut($row[1],3).'
'; print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."
'; print ''; print "\n"; - $var=True; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; print ''; @@ -399,11 +389,10 @@ print ''; } // Date delivery if (! empty($arrayfields['cf.date_delivery']['checked'])) { - print ''; } if (! empty($arrayfields['cf.total_ht']['checked'])) diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 13a40d9fe64..4c229518eba 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -542,13 +542,12 @@ if (($action != 'create' && $action != 'add') && !$error) { print ''; - $var = True; $generic_commande = new CommandeFournisseur($db); - while ( $i < $num ) { + while ($i < $num) { $objp = $db->fetch_object($resql); - $var = ! $var; - print ''; + + print ''; print '\n"; - $var=True; $i = 0; while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - - print ''; print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0725043f680..5cb8e42681e 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1000,8 +1000,17 @@ if (empty($reshook)) $price_base_type = 'TTC'; } - if (GETPOST('productid')) + if (GETPOST('productid') > 0) { + $productsupplier = new ProductFournisseur($db); + if (! empty($conf->global->SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY)) + { + if (GETPOST('productid') > 0 && $productsupplier->get_buyprice(0, price2num($_POST['qty']), GETPOST('productid'), 'none', GETPOST('socid','int')) < 0 ) + { + setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings'); + } + } + $prod = new Product($db); $prod->fetch(GETPOST('productid')); $label = $prod->description; @@ -1042,7 +1051,7 @@ if (empty($reshook)) } } - $result=$object->updateline(GETPOST('lineid'), $label, $up, $tva_tx, $localtax1_tx, $localtax2_tx, GETPOST('qty'), GETPOST('productid'), $price_base_type, $info_bits, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $_POST['units'], $pu_ht_devise); + $result=$object->updateline(GETPOST('lineid'), $label, $up, $tva_tx, $localtax1_tx, $localtax2_tx, GETPOST('qty'), GETPOST('productid'), $price_base_type, $info_bits, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $_POST['units'], $pu_ht_devise, GETPOST('fourn_ref','alpha')); if ($result >= 0) { unset($_POST['label']); @@ -1087,6 +1096,8 @@ if (empty($reshook)) // Set if we used free entry or predefined product $predef=''; $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); + $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { @@ -1105,9 +1116,6 @@ if (empty($reshook)) $remise_percent=GETPOST('remise_percent'.$predef); $price_ht_devise = GETPOST('multicurrency_price_ht'); - $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); - $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); - // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); @@ -1167,7 +1175,7 @@ if (empty($reshook)) $idprod=0; if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) - if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) + if (preg_match('/^idprod_([0-9]+)$/', GETPOST('idprodfournprice'), $reg)) { $idprod=$reg[1]; $res=$productsupplier->fetch($idprod); @@ -1183,7 +1191,6 @@ if (empty($reshook)) $res=$productsupplier->fetch($idprod); } - //Replaces $fk_unit with the product's if ($idprod > 0) { $label = $productsupplier->label; @@ -1191,15 +1198,17 @@ if (empty($reshook)) $desc = $productsupplier->description; if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); - $tva_tx=get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); - $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); + $type = $productsupplier->type; + $price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT'); + + $ref_supplier = $productsupplier->ref_supplier; + + $tva_tx=get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); + $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); if (empty($tva_tx)) $tva_npr=0; $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); - $type = $productsupplier->type; - $price_base_type = 'HT'; - $result=$object->addline( $desc, $productsupplier->fourn_pu, @@ -1221,7 +1230,7 @@ if (empty($reshook)) $productsupplier->fk_unit, 0, $productsupplier->fourn_multicurrency_unitprice, - $productsupplier->fourn_ref + $ref_supplier ); } if ($idprod == -99 || $idprod == 0) @@ -2926,7 +2935,10 @@ else print '
'.$langs->trans("UserWithApproveOrderGrant").'
'; $userstatic->id=$obj->rowid; @@ -330,10 +322,8 @@ if ($resql) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print '
'.$langs->trans("OrdersToProcess").' '; print ''; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 6f0b4899d6e..1ea820e09ad 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -24,10 +24,9 @@ /** * \file htdocs/fourn/commande/list.php * \ingroup fournisseur - * \brief List of suppliers orders + * \brief List of vendor orders */ - require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -40,13 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -$langs->load("orders"); -$langs->load("sendings"); -$langs->load('deliveries'); -$langs->load('companies'); -$langs->load('compta'); -$langs->load('bills'); -$langs->load('projects'); +$langs->loadLangs(array("orders","sendings",'deliveries','companies','compta','bills','projects','suppliers')); $action=GETPOST('action','aZ09'); $massaction=GETPOST('massaction','alpha'); @@ -472,7 +465,7 @@ if ($status) { if ($status == '1,2,3') $title.=' - '.$langs->trans("StatusOrderToProcessShort"); if ($status == '6,7') $title.=' - '.$langs->trans("StatusOrderCanceled"); - else $title.=' - '.$langs->trans($commandestatic->statuts[$status]); + else $title.=' - '.$commandestatic->LibStatut($status); } if ($search_billed > 0) $title.=' - '.$langs->trans("Billed"); @@ -584,6 +577,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -642,11 +640,13 @@ if ($resql) if ($user->rights->fournisseur->commande->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); if (in_array($massaction, array('presend','predelete','createbills'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); - + $newcardbutton=''; if($user->rights->fournisseur->commande->creer) { - $newcardbutton=''.$langs->trans('NewOrder').''; + $newcardbutton=''.$langs->trans('NewOrder'); + $newcardbutton.= ''; + $newcardbutton.= ''; } // Lignes des champs de filtre @@ -818,19 +818,19 @@ if ($resql) // Date order if (! empty($arrayfields['cf.date_commande']['checked'])) { - print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($search_orderyear?$search_orderyear:-1,'search_orderyear',1, 20, 5); print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - $formother->select_year($search_deliveryyear?$search_deliveryyear:-1,'search_deliveryyear',1, 20, 5); + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($search_deliveryyear?$search_deliveryyear:-1, 'search_deliveryyear', 1, 20, 5); print '
'; $generic_commande->id = $objp->rowid; diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index 584b053b3ba..a334442e9ab 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -50,7 +50,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="p.name"; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; /* @@ -105,14 +105,11 @@ if ($result) print_liste_field_titre("Phone"); print "
'.img_object($langs->trans("ShowContact"),"contact").' '.$obj->lastname.'
'; global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; - $forceall=1; $senderissupplier=1; $dateSelector=0; $inputalsopricewithtax=1; + $forceall=1; $dateSelector=0; $inputalsopricewithtax=1; + $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. + //if (! empty($conf->global->SUPPLIER_INVOICE_WITH_NOPRICEDEFINED)) $senderissupplier=2; + if (! empty($conf->global->SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; // Show object lines if (! empty($object->lines)) diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index fd081d5616d..c1c4be9fb76 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -223,7 +223,6 @@ if ($user->rights->fournisseur->facture->lire) if ($num > 0) { - $var=True; $total_ht=0; $total_ttc=0; $total_paid=0; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index d3fdcdcba01..90240cf8688 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -108,7 +108,7 @@ if ($option == 'late') { } $filter = GETPOST('filtre','alpha'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); @@ -412,6 +412,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -474,7 +479,9 @@ if ($resql) $newcardbutton=''; if ($user->rights->fournisseur->facture->creer) { - $newcardbutton=''.$langs->trans('NewBill').''; + $newcardbutton=''.$langs->trans('NewBill'); + $newcardbutton.= ''; + $newcardbutton.= ''; } $i = 0; @@ -636,18 +643,18 @@ if ($resql) // Date invoice if (! empty($arrayfields['f.datef']['checked'])) { - print ''; } // Date due if (! empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index cc636718bb7..74593cb8675 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -66,7 +66,7 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="p.rowid"; $optioncss = GETPOST('optioncss','alpha'); @@ -524,7 +524,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if (!empty($conf->multicurrency->enabled)) print ''; print ''; - $var=True; $total=0; $total_ttc=0; $totalrecu=0; @@ -725,7 +724,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie */ if (empty($action)) { - $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; + $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); @@ -785,6 +784,11 @@ if (empty($action)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -794,7 +798,6 @@ if (empty($action)) { $num = $db->num_rows($resql); $i = 0; - $var=True; $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; @@ -848,8 +851,8 @@ if (empty($action)) print ''; print ''; print ''; print ''; print "\n"; - $var=True; - - print ''; if ($loan->datestart > 0) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f1d6487d5de..eaea0dc420c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -198,7 +198,7 @@ if (! empty($_POST["DOL_AUTOSET_COOKIE"])) { $tmpautoset=explode(':',$_POST["DOL_AUTOSET_COOKIE"],2); $tmplist=explode(',',$tmpautoset[1]); - $cookiearrayvalue=''; + $cookiearrayvalue=array(); foreach ($tmplist as $tmpkey) { $postkey=$tmpautoset[0].'_'.$tmpkey; @@ -350,7 +350,7 @@ if (! defined('NOTOKENRENEWAL')) if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken']; // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] - $token = dol_hash(uniqid(mt_rand(),TRUE)); // Generates a hash of a random number + $token = dol_hash(uniqid(mt_rand(), true)); // Generates a hash of a random number $_SESSION['newtoken'] = $token; } if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) @@ -468,7 +468,7 @@ if (! defined('NOLOGIN')) if (GETPOST("username","alpha",2) && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { $sessionkey = 'dol_antispam_value'; - $ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); + $ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); // Check code if (! $ok) @@ -1077,20 +1077,48 @@ if (! function_exists("llxHeader")) */ function top_httphead($contenttype='text/html', $forcenocache=0) { - global $conf; + global $db, $conf, $hookmanager; if ($contenttype == 'text/html' ) header("Content-Type: text/html; charset=".$conf->file->character_set_client); else header("Content-Type: ".$contenttype); // Security options header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on) header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) - if (! empty($conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY)) + //header("X-XSS-Protection: 1"); // XSS protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated. + if (! defined('FORCECSP')) { - // For example, to restrict script, object, frames or img to some domains - // script-src https://api.google.com https://anotherhost.com; object-src https://youtube.com; child-src https://youtube.com; img-src: https://static.example.com - // For example, to restrict everything to one domain, except object, ... - // default-src https://cdn.example.net; object-src 'none' - header("Content-Security-Policy: ".$conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY); + //if (! isset($conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY)) + //{ + // // A default security policy that keep usage of js external component like ckeditor, stripe, google, working + // $contentsecuritypolicy = "font-src *; img-src *; style-src * 'unsafe-inline' 'unsafe-eval'; default-src 'self' *.stripe.com 'unsafe-inline' 'unsafe-eval'; script-src 'self' *.stripe.com 'unsafe-inline' 'unsafe-eval'; frame-src 'self' *.stripe.com; connect-src 'self';"; + //} + //else $contentsecuritypolicy = $conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY; + $contentsecuritypolicy = $conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY; + + if (! is_object($hookmanager)) $hookmanager = new HookManager($db); + $hookmanager->initHooks("main"); + + $parameters=array('contentsecuritypolicy'=>$contentsecuritypolicy); + $result=$hookmanager->executeHooks('setContentSecurityPolicy',$parameters); // Note that $action and $object may have been modified by some hooks + if ($result > 0) $contentsecuritypolicy = $hookmanager->resPrint; // Replace CSP + else $contentsecuritypolicy .= $hookmanager->resPrint; // Concat CSP + + if (! empty($contentsecuritypolicy)) + { + // For example, to restrict 'script', 'object', 'frames' or 'img' to some domains: + // script-src https://api.google.com https://anotherhost.com; object-src https://youtube.com; frame-src https://youtube.com; img-src: https://static.example.com + // For example, to restrict everything to one domain, except 'object', ...: + // default-src https://cdn.example.net; object-src 'none' + // For example, to restrict everything to itself except img that can be on other servers: + // default-src 'self'; img-src *; + // Pre-existing site that uses too much inline code to fix but wants to ensure resources are loaded only over https and disable plugins: + // default-src http: https: 'unsafe-eval' 'unsafe-inline'; object-src 'none' + header("Content-Security-Policy: ".$contentsecuritypolicy); + } + } + elseif (constant('FORCECSP')) + { + header("Content-Security-Policy: ".constant('FORCECSP')); } if ($forcenocache) { @@ -1502,7 +1530,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a { $toprightmenu.=$result; // For backward compatibility } - + // Link to module builder if (! empty($conf->modulebuilder->enabled)) { @@ -1553,6 +1581,10 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a if ($helpbaseurl && $helppage) { $text=''; + if(!empty($conf->global->MAIN_SHOWDATABASENAMEINHELPPAGESLINK)) { + $langs->load('admin'); + $appli .= '
' . $langs->trans("Database") . ': ' . $db->database_name; + } $title=$appli.'
'; $title.=$langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage': 'GoToHelpPage'); if ($mode == 'wiki') $title.=' - '.$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage,'_',' ')).'"'; @@ -1634,7 +1666,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra if ($conf->use_javascript_ajax && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) { //$searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1); - $searchform.=$form->selectArrayFilter('searchselectcombo', $arrayresult, $selected, '', 1, 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1); + $searchform.=$form->selectArrayFilter('searchselectcombo', $arrayresult, $selected, '', 1, 0, (empty($conf->global->MAIN_SEARCHBOX_CONTENT_LOADED_BEFORE_KEY)?1:0), 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1); } else { diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 559b5b13564..d37dfe0c83b 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -42,7 +42,7 @@ $action=GETPOST('action','alpha'); /* * Action */ -if (preg_match('/set_(.*)/',$action,$reg)) +if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'yesno', 0, '', $conf->entity) > 0) @@ -56,7 +56,7 @@ if (preg_match('/set_(.*)/',$action,$reg)) } } -if (preg_match('/del_(.*)/',$action,$reg)) +if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 0952efb2507..d1c682540ff 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -205,10 +205,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { dol_syslog(__FILE__, LOG_DEBUG); $result = $db->query($sql); - if ($result) { - $nbtotalofrecords = $db->num_rows($result); - } else { - setEventMessages($db->lasterror, null, 'errors'); + $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; } } diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index b216db9d430..dfa97bd7536 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -283,8 +283,6 @@ if ($result) if ($num > 0) { - $var=True; - while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); @@ -304,8 +302,6 @@ if ($result) $markRate = ($pv != 0)?(100 * $marge / $pv):'' ; } - - print ''; if ($client) { print ''; if ($id > 0) { print ''; print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine=0; -foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) +if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) + { + if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + } } diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index d2232019592..77934e68744 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -97,9 +97,17 @@ $fieldtosortuser=empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?'firstname': $newcardbutton=''; -if ($user->rights->opensurvey->read) +if (!$user->rights->opensurvey->creer) { - $newcardbutton=''.$langs->trans('NewSurvey').''; + $newcardbutton=''.$langs->trans('NewSurvey'); + $newcardbutton.= ''; + $newcardbutton.= ''; +} +else +{ + $newcardbutton=''.$langs->trans('NewSurvey'); + $newcardbutton.= ''; + $newcardbutton.= ''; } @@ -107,13 +115,6 @@ $sql = "SELECT p.id_sondage, p.fk_user_creat, p.format, p.date_fin, p.status, p. $sql.= " u.login, u.firstname, u.lastname"; $sql.= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON u.rowid = p.fk_user_creat"; -// Count total nb of records -$nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); -} $sql.= " WHERE p.entity IN (".getEntity('survey').")"; if ($search_status != '-1' && $search_status != '') $sql.=natural_search("p.status", $search_status, 2); if ($search_expired == 'expired') $sql.=" AND p.date_fin < '".$db->idate($now)."'"; @@ -128,6 +129,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -213,7 +219,7 @@ while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); if (empty($obj)) break; // Should not happen - + $sql2='select COUNT(*) as nb from '.MAIN_DB_PREFIX."opensurvey_user_studs where id_sondage='".$db->escape($obj->id_sondage)."'"; $resql2=$db->query($sql2); if ($resql2) diff --git a/htdocs/opensurvey/wizard/index.php b/htdocs/opensurvey/wizard/index.php index 0fdde4bbe40..f911321062b 100644 --- a/htdocs/opensurvey/wizard/index.php +++ b/htdocs/opensurvey/wizard/index.php @@ -18,12 +18,8 @@ */ -//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('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index c34e964c522..4855799c508 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -630,8 +630,8 @@ function hash_call($methodName,$nvpStr) curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->PAYPAL_SSLVERSION)?1:$conf->global->PAYPAL_SSLVERSION)); //turning off the server and peer verification(TrustManager Concept). - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT); curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT); @@ -639,7 +639,7 @@ function hash_call($methodName,$nvpStr) curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); - //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled. + //if USE_PROXY constant set to true in Constants.php, then only proxy will be enabled. if ($USE_PROXY) { dol_syslog("Paypal API hash_call set proxy to ".$PROXY_HOST. ":" . $PROXY_PORT." - ".$PROXY_USER. ":" . $PROXY_PASS); diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index c544b68cf8d..166265ba247 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -175,11 +175,11 @@ if ($id > 0 || $ref) { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) { - $morehtmlcenter.=''.$langs->trans("AddAction").''; + $morehtmlcenter.=''.$langs->trans("AddAction").''; } else { - $morehtmlcenter.=''.$langs->trans("AddAction").''; + $morehtmlcenter.=''.$langs->trans("AddAction").''; } } diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index e24222da70e..cce0f4254a0 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -21,20 +21,14 @@ * \file htdocs/product/ajax/products.php * \brief File to return Ajax response on product list request */ -if (! defined('NOTOKENRENEWAL')) - define('NOTOKENRENEWAL', 1); // Disables token renewal -if (! defined('NOREQUIREMENU')) - define('NOREQUIREMENU', '1'); -if (! defined('NOREQUIREHTML')) - define('NOREQUIREHTML', '1'); -if (! defined('NOREQUIREAJAX')) - define('NOREQUIREAJAX', '1'); -if (! defined('NOREQUIRESOC')) - define('NOREQUIRESOC', '1'); -if (! defined('NOCSRFCHECK')) - define('NOCSRFCHECK', '1'); -if (empty($_GET ['keysearch']) && ! defined('NOREQUIREHTML')) - define('NOREQUIREHTML', '1'); + +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); // Disables token renewal +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); +if (empty($_GET['keysearch']) && ! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); require '../../main.inc.php'; diff --git a/htdocs/product/canvas/service/tpl/list.tpl.php b/htdocs/product/canvas/service/tpl/list.tpl.php index 9951c71fcc3..ef6d461fc5c 100644 --- a/htdocs/product/canvas/service/tpl/list.tpl.php +++ b/htdocs/product/canvas/service/tpl/list.tpl.php @@ -89,10 +89,9 @@ if (empty($conf) || ! is_object($conf)) - > + $value) { foreach($fieldlist as $field) { diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 549eca022b0..a0ab4508d9c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1771,7 +1771,7 @@ else } //Parent product. - if (!empty($conf->variants->enabled) && $object->isProduct()) { + if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) { $combination = new ProductCombination($db); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 516c67f1fbe..8ba4eaaecc8 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -59,16 +59,16 @@ class Products extends DolibarrApi * * @param int $id ID of product * @param int $includestockdata Load also information about stock (slower) - * @return array|mixed data without useless information + * @return array|mixed Data without useless information * - * @throws RestException * @throws 401 + * @throws 403 * @throws 404 */ function get($id, $includestockdata=0) { if(! DolibarrApiAccess::$user->rights->produit->lire) { - throw new RestException(401); + throw new RestException(403); } $result = $this->product->fetch($id); @@ -178,7 +178,7 @@ class Products extends DolibarrApi * @param array $request_data Request data * @return int ID of product */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); @@ -208,7 +208,7 @@ class Products extends DolibarrApi * @throws 401 * @throws 404 */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { global $conf; @@ -340,7 +340,7 @@ class Products extends DolibarrApi } if ($result < 0) { - throw new RestException(503, 'Error when retrieve category list : '.$categories->error); + throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors)); } return $result; @@ -374,7 +374,7 @@ class Products extends DolibarrApi } if ($result < 0) { - throw new RestException(503, 'Error when retrieve prices list : '.$categories->error); + throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } return array( @@ -416,7 +416,7 @@ class Products extends DolibarrApi } if ($result < 0) { - throw new RestException(503, 'Error when retrieve prices list : '.$categories->error); + throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } throw new RestException(501, 'Feature not yet available'); @@ -451,7 +451,7 @@ class Products extends DolibarrApi } if ($result < 0) { - throw new RestException(503, 'Error when retrieve prices list : '.$categories->error); + throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } return array( diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bb245d8307c..2f36fd59035 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -160,16 +160,16 @@ class Product extends CommonObject //! Average price value for product entry into stock (PMP) public $pmp; - /** + /** * Stock alert * @var int */ - public $seuil_stock_alerte; + public $seuil_stock_alerte=0; /** * Ask for replenishment when $desiredstock < $stock_reel */ - public $desiredstock; + public $desiredstock=0; /* * Service expiration @@ -185,13 +185,13 @@ class Product extends CommonObject * Status indicates whether the product is on sale '1' or not '0' * @var int */ - public $status; + public $status=0; /** * Status indicate whether the product is available for purchase '1' or not '0' * @var int */ - public $status_buy; + public $status_buy=0; /** * Status indicates whether the product is a finished product '1' or a raw material '0' @@ -203,7 +203,7 @@ class Product extends CommonObject * We must manage lot/batch number, sell-by date and so on : '1':yes '0':no * @var int */ - public $status_batch; + public $status_batch=0; /** * Customs code @@ -227,10 +227,10 @@ class Product extends CommonObject public $volume; public $volume_units; - public $accountancy_code_buy; - public $accountancy_code_buy_intra; - public $accountancy_code_buy_export; public $accountancy_code_sell; + public $accountancy_code_sell_intra; + public $accountancy_code_sell_export; + public $accountancy_code_buy; /** * Main barcode @@ -266,7 +266,7 @@ class Product extends CommonObject //! Product ID already linked to a reference supplier public $product_id_already_linked; - public $nbphoto; + public $nbphoto=0; //! Contains detail of stock of product into each warehouse public $stock_warehouse=array(); @@ -332,14 +332,7 @@ class Product extends CommonObject global $langs; $this->db = $db; - $this->status = 0; - $this->status_buy = 0; - $this->nbphoto = 0; - $this->stock_reel = 0; - $this->seuil_stock_alerte = 0; - $this->desiredstock = 0; $this->canvas = ''; - $this->status_batch=0; } /** @@ -2767,7 +2760,7 @@ class Product extends CommonObject else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND prod.rowid = d.fk_product AND prod.fk_product_type =".$filteronproducttype; $sql.= " AND p.fk_soc = s.rowid"; - $sql.= " AND p.entity IN (".getEntity('propal').")"; + $sql.= " AND p.entity IN (".getEntity('supplier_proposal').")"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid > 0) $sql.= " AND p.fk_soc = ".$socid; $sql.=$morefilter; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index ebb7f9753dc..21439a1ac8a 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -852,7 +852,7 @@ SCRIPT; { print ''.img_edit().""; print '   '; - print ''.img_picto($langs->trans("Remove"),'disable.png').''; + print ''.img_picto($langs->trans("Remove"),'delete').''; } print ''; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index fd29143613a..1254af2213b 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -307,8 +307,6 @@ if ($result) print ''; - $var=True; - while ($i < $num) { $objp = $db->fetch_object($result); @@ -337,7 +335,7 @@ if ($result) $product_static->label = $objp->label; $product_static->type=$objp->fk_product_type; $product_static->entity = $objp->entity; - $product_static->status_batch = $objp->tobatch; + $product_static->status_batch = $objp->tobatch; print $product_static->getNomUrl(1,'',16); print "\n"; print ''; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index f1ecf079041..4a6ca485686 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -233,12 +233,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); -} -// if total resultset is smaller then paging size (filtering), goto and load page 0 -if (($page * $limit) > $nbtotalofrecords) -{ - $page = 0; - $offset = 0; + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } // if total resultset is smaller the limit, no need to do paging. if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 04f0bca71f9..11be839aa4f 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2013-2016 Juanjo Menent @@ -271,7 +271,7 @@ else $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,'; $sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; - $sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy,'; + $sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy,'; $sql.= ' p.datec as date_creation, p.tms as date_update, p.pmp,'; $sql.= ' MIN(pfp.unitprice) as minsellprice'; if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { @@ -317,25 +317,17 @@ else if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch); if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell); if ($search_accountancy_code_buy) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy); - // Add where from extra fields - - if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { - $sql .= " AND pac.rowid IS NULL"; - } - + if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) $sql .= " AND pac.rowid IS NULL"; // 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); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; - $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy, p.pmp'; - if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { - $sql .= ', pac.rowid'; - } + $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.pmp'; + if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) $sql .= ', pac.rowid'; // 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 : ''); @@ -346,12 +338,19 @@ else $sql.=$hookmanager->resPrint; //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet $sql.= $db->order($sortfield,$sortorder); + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } + $sql.= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); @@ -427,7 +426,9 @@ else { $label='NewProduct'; if($type == Product::TYPE_SERVICE) $label='NewService'; - $newcardbutton=''.$langs->trans($label).''; + $newcardbutton=''.$langs->trans($label); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''; @@ -698,7 +699,7 @@ else $sql = "SELECT label"; $sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql.= " WHERE fk_product=".$obj->rowid; - $sql.= " AND lang='". $langs->getDefaultLang() ."'"; + $sql.= " AND lang='". $db->escape($langs->getDefaultLang()) ."'"; $sql.= " LIMIT 1"; $result = $db->query($sql); @@ -719,6 +720,10 @@ else $product_static->status_batch = $obj->tobatch; $product_static->entity = $obj->entity; $product_static->pmp = $obj->pmp; + $product_static->accountancy_code_sell = $obj->accountancy_code_sell; + $product_static->accountancy_code_sell_export = $obj->accountancy_code_sell_export; + $product_static->accountancy_code_sell_intra = $obj->accountancy_code_sell_intra; + $product_static->accountancy_code_buy = $obj->accountancy_code_buy; if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock { diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index f71601e7bc0..88b9f2080aa 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -56,7 +56,7 @@ $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; // Load sale and categ filters @@ -155,6 +155,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1, $offset); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index fc2632fe5e2..423d0f4015d 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -61,7 +61,7 @@ $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; // Load sale and categ filters @@ -167,6 +167,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1, $offset); diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index dc3d9a9b7d6..2d01a2f6e9c 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -211,12 +211,10 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var=True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); - print ''; print '\n"; if ($num > 0) { - $var = True; + while ( $i < $num && $i < $conf->liste_limit ) { $objp = $db->fetch_object($result); - $var = ! $var; - print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; diff --git a/htdocs/product/stock/class/api_stockmovements.class.php b/htdocs/product/stock/class/api_stockmovements.class.php index cb861f78575..16d21c02eb3 100644 --- a/htdocs/product/stock/class/api_stockmovements.class.php +++ b/htdocs/product/stock/class/api_stockmovements.class.php @@ -173,7 +173,7 @@ class StockMovements extends DolibarrApi * @return int ID of stock movement */ //function post($product_id, $warehouse_id, $qty, $lot='', $movementcode='', $movementlabel='', $price=0) - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->stock->creer) { throw new RestException(401); @@ -212,7 +212,7 @@ class StockMovements extends DolibarrApi * @return int */ /* - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->stock->creer) { throw new RestException(401); diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index fd2dc4b2328..10b76d22a25 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -158,7 +158,7 @@ class Warehouses extends DolibarrApi * @param array $request_data Request data * @return int ID of warehouse */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->stock->creer) { throw new RestException(401); @@ -183,7 +183,7 @@ class Warehouses extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->stock->creer) { throw new RestException(401); diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 36f9e1a7f7c..a1414ab06ac 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -86,7 +86,6 @@ if ($result) { $entrepot=new Entrepot($db); - $var=True; while ($i < $num) { $objp = $db->fetch_object($result); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 29e5439b8e8..3d01e7a9f06 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -37,7 +37,7 @@ $search_ref=GETPOST("sref","alpha")?GETPOST("sref","alpha"):GETPOST("search_ref" $search_label=GETPOST("snom","alpha")?GETPOST("snom","alpha"):GETPOST("search_label","alpha"); $search_status=GETPOST("search_status","int"); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield"); $sortorder = GETPOST("sortorder"); if (! $sortfield) $sortfield="e.ref"; @@ -133,7 +133,9 @@ if ($result) $newcardbutton=''; if ($user->rights->stock->creer) { - $newcardbutton=''.$langs->trans('MenuNewWarehouse').''; + $newcardbutton=''.$langs->trans('MenuNewWarehouse'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index ebe1fbe5375..270217b33f9 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -64,7 +64,7 @@ if (!$sortfield) { if (!$sortorder) { $sortorder = 'ASC'; } -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; $listofdata=array(); diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 6093a252cb6..883cd316c76 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,7 +69,7 @@ $search_user = trim(GETPOST("search_user")); $search_batch = trim(GETPOST("search_batch")); $search_qty = trim(GETPOST("search_qty")); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $page = GETPOST("page",'int'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -472,6 +473,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -864,7 +870,7 @@ if ($resql) include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters=array('arrayfields'=>$arrayfields); + $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['m.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 1d1f6a89478..c9ac6269dbd 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -1,5 +1,6 @@ + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -252,6 +253,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -295,7 +301,7 @@ if ($resql) print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); $topicmail="Information"; $modelmail="productlot"; @@ -388,7 +394,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters=array('arrayfields'=>$arrayfields); + $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['t.datec']['checked'])) print_liste_field_titre($arrayfields['t.datec']['label'],$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 5a61e8b2a98..360a12a7c69 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -65,7 +65,7 @@ $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 -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; if (!$sortfield) { diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index 8332da36eaa..c10e1117024 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -52,7 +52,7 @@ $search_datemonth = GETPOST('search_datemonth', 'int'); $search_dateday = GETPOST('search_dateday', 'int'); $search_date = dol_mktime(0, 0, 0, $search_datemonth, $search_dateday, $search_dateyear); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield"); $sortorder = GETPOST("sortorder"); if (!$sortorder) $sortorder = 'DESC'; diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 76e741faa1d..bfc7cd80a78 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -41,7 +41,7 @@ if (! $sortfield) $sortfield="e.ref"; if (! $sortorder) $sortorder="ASC"; $page = $_GET["page"]; if ($page < 0) $page = 0; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page; $year = strftime("%Y",time()); diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 43720614a2e..d188be86c16 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -70,6 +70,7 @@ $search_task_ref=GETPOST('search_task_ref', 'alpha'); $search_task_label=GETPOST('search_task_label', 'alpha'); $search_project_ref=GETPOST('search_project_ref', 'alpha'); $search_thirdparty=GETPOST('search_thirdparty', 'alpha'); +$search_declared_progress=GETPOST('search_declared_progress', 'alpha'); $monthofday=GETPOST('addtimemonth'); $dayofday=GETPOST('addtimeday'); @@ -113,6 +114,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_task_label = ''; $search_project_ref = ''; $search_thirdparty = ''; + $search_declared_progress = ''; } if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha')) { @@ -331,6 +333,7 @@ if ($search_project_ref) $morewherefilter.=natural_search("p.ref", $search_proje if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); +if ($search_declared_progress) $morewherefilter.=natural_search("t.progress", $search_declared_progress, 1); $tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. if ($morewherefilter) // Get all task without any filter, so we can show total of time spent for not visible tasks @@ -357,6 +360,7 @@ $param.=($search_task_label?'&search_task_label='.$search_task_label:''); // Show navigation bar $nav =''.img_previous($langs->trans("Previous"))."\n"; +$nav.=dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"%A").' '; $nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"day")." \n"; $nav.=''.img_next($langs->trans("Next"))."\n"; $nav.="   (".$langs->trans("Today").")"; @@ -409,7 +413,7 @@ print '
'; $formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); print '
'; print ' '; -print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth200'); +print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); print ''; print ''; @@ -433,9 +437,22 @@ $moreforfilter.='
'; $moreforfilter.='
'.$langs->trans('User'). '
'; $includeonly='hierachyme'; 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.=$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.='
'; +if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) +{ + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('Project'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; + + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('ThirdParty'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; +} + if (! empty($moreforfilter)) { print '
'; @@ -451,12 +468,11 @@ print '
'; print '
'; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($year?$year:-1,'year',1, 20, 5); print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5); print '
'.$langs->trans("Late"); print '
'.$langs->trans('MulticurrencyPaymentAmount').'
'; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($year?$year:-1,'year',1, 20, 5); print ''; diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 8f34077ab34..033bcc63a2a 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -57,7 +57,6 @@ print '
'; // Orders -$commande = new CommandeFournisseur($db); $sql = "SELECT count(cf.rowid), cf.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; @@ -76,17 +75,15 @@ if ($resql) print ''; print ''; print "\n"; - $var=True; while ($i < $num) { $row = $db->fetch_row($resql); - print ''; - print ''; + print ''; print ''; - print ''; + print ''; print "\n"; $i++; @@ -129,11 +126,10 @@ if (! empty($conf->fournisseur->enabled)) print ''; $i = 0; - $var = true; while ($i < $num) { - $obj = $db->fetch_object($resql); + print ''; $i = 0; $tot_ttc = 0; - $var = True; + while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); @@ -259,12 +255,8 @@ if ($resql) print '\n"; print "\n"; - $var=True; - while ($obj = $db->fetch_object($resql) ) { - - print ''; print '\n"; @@ -296,12 +288,10 @@ if (count($companystatic->SupplierCategories)) print '\n"; - $var=True; foreach ($companystatic->SupplierCategories as $rowid => $label) { - - print "\n"; + print ''."\n"; print '\n"; $oldid = ''; - $var=True; + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index c653c756bba..e5b35b5a434 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1279,20 +1279,15 @@ else print '
'; // Boutons d'actions - if ($cancreate && $object->statut == 1) + if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) { print ''.$langs->trans("EditCP").''; } - if ($cancreate && $object->statut == 1) // If draft + if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) // If draft { print ''.$langs->trans("Validate").''; } - if ($user->rights->holiday->delete && ($object->statut == 1 || $object->statut == 4 || $object->statut == 5)) // If draft or canceled or refused - { - print ''.$langs->trans("DeleteCP").''; - } - - if ($object->statut == 2) // If validated + if ($object->statut == Holiday::STATUS_VALIDATED) // If validated { if ($user->id == $object->fk_validator) { @@ -1305,17 +1300,19 @@ else print ''.$langs->trans("ActionRefuseCP").''; } } - if (($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || ! empty($user->rights->holiday->write_all)) && ($object->statut == 2 || $object->statut == 3)) // Status validated or approved { if (($object->date_debut > dol_now()) || $user->admin) print ''.$langs->trans("ActionCancelCP").''; else print ''.$langs->trans("ActionCancelCP").''; } - - if ($cancreate && $object->statut == 4) + if ($cancreate && $object->statut == Holiday::STATUS_CANCELED) { 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 + { + print ''.$langs->trans("DeleteCP").''; + } print '
'; } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 950c297fb3b..f0b36f910d9 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -35,6 +35,7 @@ class Holiday extends CommonObject public $element='holiday'; public $table_element='holiday'; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + var $fk_element = 'fk_holiday'; public $picto = 'holiday'; /** @@ -70,6 +71,27 @@ class Holiday extends CommonObject var $optValue = ''; var $optRowid = ''; + /** + * Draft status + */ + const STATUS_DRAFT = 1; + /** + * Validated status + */ + const STATUS_VALIDATED = 2; + /** + * Approved + */ + const STATUS_APPROVED = 3; + /** + * Canceled + */ + const STATUS_CANCELED = 4; + /** + * Refused + */ + const STATUS_REFUSED = 5; + /** * Constructor @@ -779,25 +801,27 @@ class Holiday extends CommonObject /** - * Check a user is not on holiday for a particular timestamp + * Check that a user is not on holiday for a particular timestamp * * @param int $fk_user Id user * @param timestamp $timestamp Time stamp date for a day (YYYY-MM-DD) without hours (= 12:00AM in english and not 12:00PM that is 12:00) + * @param string $status Filter on holiday status. '-1' = no filter. * @return array array('morning'=> ,'afternoon'=> ), Boolean is true if user is available for day timestamp. * @see verifDateHolidayCP */ - function verifDateHolidayForTimestamp($fk_user, $timestamp) + function verifDateHolidayForTimestamp($fk_user, $timestamp, $status='-1') { global $langs, $conf; $isavailablemorning=true; $isavailableafternoon=true; - $sql = "SELECT cp.rowid, cp.date_debut as date_start, cp.date_fin as date_end, cp.halfday"; + $sql = "SELECT cp.rowid, cp.date_debut as date_start, cp.date_fin as date_end, cp.halfday, cp.statut"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp"; $sql.= " WHERE cp.entity IN (".getEntity('holiday').")"; $sql.= " AND cp.fk_user = ".(int) $fk_user; - $sql.= " AND date_debut <= '".$this->db->idate($timestamp)."' AND date_fin >= '".$this->db->idate($timestamp)."'"; + $sql.= " AND cp.date_debut <= '".$this->db->idate($timestamp)."' AND cp.date_fin >= '".$this->db->idate($timestamp)."'"; + if ($status != '-1') $sql.=" AND cp.statut IN (".$this->db->escape($status).")"; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 6e5137e5b57..52386acf93c 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -59,7 +59,7 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="name"; +if (! $sortfield) $sortfield="position_name"; $object = new Holiday($db); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 7335bfcf243..c5ea7c868e0 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -378,7 +378,13 @@ else //print $num; //print count($holiday->holiday); - $newcardbutton=''.$langs->trans('MenuAddCP').''; + $newcardbutton=''; + if ($user->rights->holiday->write) + { + $newcardbutton=''.$langs->trans('MenuAddCP'); + $newcardbutton.= ''; + $newcardbutton.= ''; + } print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm.png', 0, $newcardbutton, '', $limit); diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 23e92b83004..8f3b6c6a838 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -61,7 +61,7 @@ if ($page == -1) { $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $form = new Form($db); $establishmenttmp=new Establishment($db); diff --git a/htdocs/install/check.php b/htdocs/install/check.php index bba5ea85afa..112f742214d 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -62,7 +62,7 @@ pHeader('',''); // No next step for navigation buttons. Next step is defined //print "
\n"; //print $langs->trans("InstallEasy")."

\n"; -print '

Database '.$langs->trans("MiscellaneousChecks").":

\n"; +print '

Database '.$langs->trans("MiscellaneousChecks").":

\n"; // Check browser $useragent=$_SERVER['HTTP_USER_AGENT']; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index a240973f095..b0affb2218a 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -111,7 +111,7 @@ if (! empty($force_install_message)) @@ -234,7 +234,7 @@ if (! empty($force_install_message)) @@ -468,7 +468,7 @@ if (! empty($force_install_message)) ?> diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index d821ad2b454..7c2895eb835 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -391,8 +391,9 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='',$css print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index f1c5eea2279..502f7053106 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -489,7 +489,7 @@ DELETE FROM llx_categorie_product WHERE fk_categorie NOT IN (SELECT rowid FROM l DELETE FROM llx_categorie_societe WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type IN (1, 2)); DELETE FROM llx_categorie_member WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 3); DELETE FROM llx_categorie_contact WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 4); -DELETE FROM llx_categorie_project WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 5); +DELETE FROM llx_categorie_project WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 6); ALTER TABLE llx_inventory ADD COLUMN ref varchar(48); diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 465f408eb1b..70506ec202f 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -99,6 +99,8 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_MODIFY','Member subscribtion modified','Executed when a member subscribtion is modified','member',24); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_DELETE','Member subscribtion deleted','Executed when a member subscribtion is deleted','member',24); +-- VPGSQL8.4 ALTER TABLE llx_product_attribute DROP CONSTRAINT unique_ref; + ALTER TABLE llx_product_attribute_value DROP INDEX unique_ref; ALTER TABLE llx_product_attribute_value ADD UNIQUE INDEX uk_product_attribute_value (fk_product_attribute, ref); @@ -708,6 +710,10 @@ ALTER TABLE llx_facture_rec_extrafields ADD INDEX idx_facture_rec_extrafields (f -- VMYSQL4.1 ALTER TABLE llx_product_association ADD COLUMN rowid integer AUTO_INCREMENT PRIMARY KEY; - +-- drop very old table (bad name) DROP TABLE llx_c_accountancy_category; + +UPDATE llx_cronjob set entity = 1 where entity = 0 and label in ('RecurringInvoices', 'SendEmailsReminders'); +UPDATE llx_cronjob set entity = 0 where entity = 1 and label in ('PurgeDeleteTemporaryFilesShort', 'MakeLocalDatabaseDumpShort'); + diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 9f69e6203f0..3ca87e97053 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -9,12 +9,16 @@ -- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; -- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); -- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; --- To drop an index: -- VMYSQL4.0 DROP INDEX nomindex on llx_table --- To drop an index: -- VPGSQL8.0 DROP INDEX nomindex +-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table +-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y --- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; --- To make pk to be auto increment (postgres): -- VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE +-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): +-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid; +-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid); +-- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq'); +-- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table; -- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL; -- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; -- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL; @@ -36,6 +40,7 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_create integer; ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer; ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFAULT 'page'; +-- drop very old table (bad name) DROP TABLE llx_c_accountancy_category; DROP TABLE llx_c_accountingaccount; @@ -122,12 +127,20 @@ ALTER TABLE llx_website_page ADD COLUMN aliasalt varchar(255) after pageurl; DELETE FROM llx_c_paiement WHERE code = '' or code = '-' or id = 0; ALTER TABLE llx_c_paiement DROP INDEX uk_c_paiement; ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement_code(entity, code); -ALTER TABLE llx_c_paiement CHANGE COLUMN id id INTEGER AUTO_INCREMENT PRIMARY KEY; +-- VMYSQL4.3 ALTER TABLE llx_c_paiement CHANGE COLUMN id id INTEGER AUTO_INCREMENT PRIMARY KEY; +-- VPGSQL8.2 CREATE SEQUENCE llx_c_paiement_id_seq OWNED BY llx_c_paiement.id; +-- VPGSQL8.2 ALTER TABLE llx_c_paiement ADD PRIMARY KEY (id); +-- VPGSQL8.2 ALTER TABLE llx_c_paiement ALTER COLUMN id SET DEFAULT nextval('llx_c_paiement_id_seq'); +-- VPGSQL8.2 SELECT setval('llx_c_paiement_id_seq', MAX(id)) FROM llx_c_paiement; -- Add missing keys and primary key ALTER TABLE llx_c_payment_term DROP INDEX uk_c_payment_term; -ALTER TABLE llx_c_payment_term CHANGE COLUMN rowid rowid INTEGER AUTO_INCREMENT PRIMARY KEY; ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term_code(entity, code); +-- VMYSQL4.3 ALTER TABLE llx_c_payment_term CHANGE COLUMN rowid rowid INTEGER AUTO_INCREMENT PRIMARY KEY; +-- VPGSQL8.2 CREATE SEQUENCE llx_c_payment_term_rowid_seq OWNED BY llx_c_payment_term.rowid; +-- VPGSQL8.2 ALTER TABLE llx_c_payment_term ADD PRIMARY KEY (rowid); +-- VPGSQL8.2 ALTER TABLE llx_c_payment_term ALTER COLUMN rowid SET DEFAULT nextval('llx_c_payment_term_rowid_seq'); +-- VPGSQL8.2 SELECT setval('llx_c_payment_term_rowid_seq', MAX(rowid)) FROM llx_c_payment_term; ALTER TABLE llx_oauth_token ADD COLUMN tokenstring text; @@ -181,8 +194,8 @@ CREATE TABLE llx_ticketsup )ENGINE=innodb; ALTER TABLE llx_ticketsup ADD COLUMN notify_tiers_at_create integer; -ALTER TABLE llx_ticketsup ADD UNIQUE uk_ticketsup_rowid_track_id (rowid, track_id); -ALTER TABLE llx_ticketsup ADD INDEX id_ticketsup_track_id (track_id); +ALTER TABLE llx_ticketsup DROP INDEX uk_ticketsup_rowid_track_id; +ALTER TABLE llx_ticketsup ADD UNIQUE uk_ticketsup_track_id (track_id); CREATE TABLE llx_ticketsup_msg ( @@ -416,8 +429,25 @@ ALTER TABLE llx_asset_type_extrafields ADD INDEX idx_asset_type_extrafields (fk_ INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (7,'INV', 'Inventory journal', 8, 1); UPDATE llx_accounting_account set account_parent = 0 WHERE account_parent = '' OR account_parent IS NULL; -ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer DEFAULT 0; +-- VMYSQL4.1 ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer DEFAULT 0; +-- VPGSQL8.2 ALTER TABLE llx_accounting_account ALTER COLUMN account_parent DROP DEFAULT; +-- VPGSQL8.2 ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer USING account_parent::integer; +-- VPGSQL8.2 ALTER TABLE llx_accounting_account ALTER COLUMN account_parent SET DEFAULT 0; ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_account_parent (account_parent); +UPDATE llx_accounting_bookkeeping set date_creation = tms where date_creation IS NULL; + ALTER TABLE llx_extrafields MODIFY COLUMN list VARCHAR(128); +UPDATE llx_rights_def set module = 'asset' where module = 'assets'; + +ALTER TABLE llx_c_accounting_category ADD COLUMN entity integer NOT NULL DEFAULT 1 AFTER rowid; +-- VMYSQL4.1 DROP INDEX uk_c_accounting_category on llx_c_accounting_category; +-- VPGSQL8.2 DROP INDEX uk_c_accounting_category; +ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code,entity); +-- VMYSQL4.1 DROP INDEX uk_accounting_journal_code on llx_accounting_journal; +-- VPGSQL8.2 DROP INDEX uk_accounting_journal_code; +ALTER TABLE llx_accounting_journal ADD UNIQUE INDEX uk_accounting_journal_code (code,entity); + +UPDATE llx_c_email_templates SET lang = '' WHERE lang IS NULL; + diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 69cd2a3bc79..9493ef6c7c9 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -175,7 +175,7 @@ delete from llx_categorie_fournisseur where fk_categorie not in (select rowid fr delete from llx_categorie_societe where fk_categorie not in (select rowid from llx_categorie where type = 2); delete from llx_categorie_member where fk_categorie not in (select rowid from llx_categorie where type = 3); delete from llx_categorie_contact where fk_categorie not in (select rowid from llx_categorie where type = 4); -delete from llx_categorie_project where fk_categorie not in (select rowid from llx_categorie where type = 5); +delete from llx_categorie_project where fk_categorie not in (select rowid from llx_categorie where type = 6); -- Fix: delete orphelin deliveries. Note: deliveries are linked to shipment by llx_element_element only. No other links. @@ -429,3 +429,32 @@ drop table tmp_bank_url_expense_user; -- Backport a change of value into the hourly rate. -- update llx_projet_task_time as ptt set ptt.thm = (SELECT thm from llx_user as u where ptt.fk_user = u.rowid) where (ptt.thm is null) + +-- select * from llx_facturedet as fd, llx_product as p where fd.fk_product = p.rowid AND fd.product_type != p.fk_product_type; +update llx_facturedet set product_type = 0 where product_type = 1 AND fk_product > 0 AND fk_product IN (SELECT rowid FROM llx_product WHERE fk_product_type = 0); +update llx_facturedet set product_type = 1 where product_type = 0 AND fk_product > 0 AND fk_product IN (SELECT rowid FROM llx_product WHERE fk_product_type = 1); + +update llx_facture_fourn_det set product_type = 0 where product_type = 1 AND fk_product > 0 AND fk_product IN (SELECT rowid FROM llx_product WHERE fk_product_type = 0); +update llx_facture_fourn_det set product_type = 1 where product_type = 0 AND fk_product > 0 AND fk_product IN (SELECT rowid FROM llx_product WHERE fk_product_type = 1); + + +UPDATE llx_accounting_bookkeeping set date_creation = tms where date_creation IS NULL; + + +-- UPDATE llx_contratdet set label = NULL WHERE label IS NOT NULL; +-- UPDATE llx_facturedet_rec set label = NULL WHERE label IS NOT NULL; + + + +-- Note to migrate from old counter aquarium to new one +-- drop table tmp; +-- create table tmp select rowid, code_client, concat(substr(code_client, 1, 6),'-0',substr(code_client, 8, 5)) as code_client2 from llx_societe where code_client like 'CU____-____'; +-- update llx_societe as s set code_client = (select code_client2 from tmp as t where t.rowid = s.rowid) where code_client like 'CU____-____'; +-- drop table tmp; +-- create table tmp select rowid, code_fournisseur, concat(substr(code_fournisseur, 1, 6),'-0',substr(code_fournisseur, 8, 5)) as code_fournisseur2 from llx_societe where code_fournisseur like 'SU____-____'; +-- select * from tmp; +-- update llx_societe as s set s.code_fournisseur = (select code_fournisseur2 from tmp as t where t.rowid = s.rowid) where s.code_fournisseur like 'SU____-____'; +-- update llx_societe set code_compta = concat('411', substr(code_client, 3, 2),substr(code_client, 8, 5)) where client in (1,2,3) and code_compte is not null; +-- update llx_societe set code_compta_fournisseur = concat('401', substr(code_fournisseur, 3, 2),substr(code_fournisseur, 8, 5)) where fournisseur in (1,2,3) and code_fournisseur is not null; + + diff --git a/htdocs/install/mysql/tables/llx_accounting_journal.key.sql b/htdocs/install/mysql/tables/llx_accounting_journal.key.sql index e5083aa83d7..701c39e06a2 100644 --- a/htdocs/install/mysql/tables/llx_accounting_journal.key.sql +++ b/htdocs/install/mysql/tables/llx_accounting_journal.key.sql @@ -17,4 +17,4 @@ -- =========================================================================== -ALTER TABLE llx_accounting_journal ADD UNIQUE INDEX uk_accounting_journal_code (code); +ALTER TABLE llx_accounting_journal ADD UNIQUE INDEX uk_accounting_journal_code (code,entity); diff --git a/htdocs/install/mysql/tables/llx_c_accounting_category.key.sql b/htdocs/install/mysql/tables/llx_c_accounting_category.key.sql index 6b2d520a156..be927f6e761 100644 --- a/htdocs/install/mysql/tables/llx_c_accounting_category.key.sql +++ b/htdocs/install/mysql/tables/llx_c_accounting_category.key.sql @@ -17,5 +17,5 @@ -- Table with category for accounting account -- =================================================================== -ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code); +ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code,entity); diff --git a/htdocs/install/mysql/tables/llx_c_accounting_category.sql b/htdocs/install/mysql/tables/llx_c_accounting_category.sql index 253ff6aef46..9df9a9d6ab0 100644 --- a/htdocs/install/mysql/tables/llx_c_accounting_category.sql +++ b/htdocs/install/mysql/tables/llx_c_accounting_category.sql @@ -22,6 +22,7 @@ CREATE TABLE llx_c_accounting_category ( rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, code varchar(16) NOT NULL, label varchar(255) NOT NULL, range_account varchar(255) NOT NULL, -- Comment diff --git a/htdocs/install/mysql/tables/llx_ticketsup.key.sql b/htdocs/install/mysql/tables/llx_ticketsup.key.sql index abf853e718c..3a47ae18201 100755 --- a/htdocs/install/mysql/tables/llx_ticketsup.key.sql +++ b/htdocs/install/mysql/tables/llx_ticketsup.key.sql @@ -14,5 +14,4 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -ALTER TABLE llx_ticketsup ADD UNIQUE uk_ticketsup_rowid_track_id (rowid, track_id); -ALTER TABLE llx_ticketsup ADD INDEX id_ticketsup_track_id (track_id); +ALTER TABLE llx_ticketsup ADD UNIQUE uk_ticketsup_track_id (track_id); diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 920028a697c..f313a7a9595 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -356,7 +356,7 @@ if (! $error && $db->connected && $action == "set") } // Show title of step - print '

Configuration '.$langs->trans("ConfigurationFile").'

'; + print '

Configuration '.$langs->trans("ConfigurationFile").'

'; print '
'.$langs->trans("Orders").''.$langs->trans("Nb").' 
'.$langs->trans($commande->statuts[$row[1]]).''.$commandestatic->LibStatut($row[1]).''.$row[0].''.$commande->LibStatut($row[1],3).''.$commandestatic->LibStatut($row[1],3).'
'.$langs->trans("DraftOrders").' '.$num.'
'; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; @@ -186,7 +182,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print ''.$langs->trans("DraftBills").' '.$num.'
'.$langs->trans("DateModification")."
'.img_object($langs->trans("ShowSupplier"),"company").''; print " socid."\">".$obj->name."
'; print $langs->trans("Category"); print "
'; $categstatic->id=$rowid; $categstatic->ref=$label; diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 529feb86897..daa452d0c29 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -288,8 +288,6 @@ if ($result > 0) if ($num > 0) { - $var=True; - $facturestatic=new FactureFournisseur($db); while ($i < $num) diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index c71825eda0f..47bc949a758 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -157,14 +157,22 @@ if ($fourn_id > 0) { $sql .= " AND ppf.fk_soc = ".$fourn_id; } + +$sql .= $db->order($sortfield,$sortorder); + // Count total nb of records without orderby and limit $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } -$sql .= $db->order($sortfield,$sortorder); + $sql .= $db->plimit($limit + 1, $offset); dol_syslog("fourn/product/list.php:", LOG_DEBUG); @@ -253,7 +261,7 @@ if ($resql) print "
-

webserver trans("WebServer"); ?>

+

webserver trans("WebServer"); ?>


-

webserver trans("DolibarrDatabase"); ?>

+

webserver trans("DolibarrDatabase"); ?>


-

webserver trans("DatabaseSuperUserAccess"); ?>

+

webserver trans("DatabaseSuperUserAccess"); ?>

'; // Check parameter main_dir @@ -878,7 +878,7 @@ function write_conf_file($conffile) $error=0; - $key = md5(uniqid(mt_rand(),TRUE)); // Generate random hash + $key = md5(uniqid(mt_rand(), true)); // Generate random hash $fp = fopen("$conffile", "w"); if($fp) diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 576e5e868a8..30b3ff7d64f 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -86,7 +86,7 @@ if (! is_writable($conffile)) if ($action == "set") { - print '

Database '.$langs->trans("Database").'

'; + print '

Database '.$langs->trans("Database").'

'; print '
'; $error=0; diff --git a/htdocs/install/step4.php b/htdocs/install/step4.php index ccd328b5092..92bcb3dc1a7 100644 --- a/htdocs/install/step4.php +++ b/htdocs/install/step4.php @@ -69,7 +69,7 @@ if (! is_writable($conffile)) } -print '

Database '.$langs->trans("DolibarrAdminLogin").'

'; +print '

Database '.$langs->trans("DolibarrAdminLogin").'

'; print $langs->trans("LastStepDesc").'

'; diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 5d289fb695e..c2ee6e93ad4 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -61,7 +61,7 @@ $langs->setDefaultLang($setuplang); $versionfrom=GETPOST("versionfrom",'alpha',3)?GETPOST("versionfrom",'alpha',3):(empty($argv[1])?'':$argv[1]); $versionto=GETPOST("versionto",'alpha',3)?GETPOST("versionto",'',3):(empty($argv[2])?'':$argv[2]); $dirmodule=((GETPOST("dirmodule",'alpha',3) && GETPOST("dirmodule",'alpha',3) != 'ignoredbversion'))?GETPOST("dirmodule",'alpha',3):((empty($argv[3]) || $argv[3] == 'ignoredbversion')?'':$argv[3]); -$ignoredbversion=(GETPOST('ignoredbversion','',3)=='ignoredbversion')?GETPOST('ignoredbversion','',3):((empty($argv[3]) || $argv[3] != 'ignoredbversion')?'':$argv[3]); +$ignoredbversion=(GETPOST('ignoredbversion','alpha',3)=='ignoredbversion')?GETPOST('ignoredbversion','alpha',3):((empty($argv[3]) || $argv[3] != 'ignoredbversion')?'':$argv[3]); $langs->load("admin"); $langs->load("install"); @@ -106,7 +106,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 { $actiondone=1; - print '

Database '.$langs->trans("DatabaseMigration").'

'; + print '

Database '.$langs->trans("DatabaseMigration").'

'; print '
'; $error=0; @@ -254,6 +254,8 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 if (count($versioncommande) && count($versionarray) && versioncompare($versioncommande,$versionarray) <= 0) // Si mysql >= 4.0 { + dolibarr_install_syslog("Clean database from bad named constraints"); + // Suppression vieilles contraintes sans noms et en doubles // Les contraintes indesirables ont un nom qui commence par 0_ ou se termine par ibfk_999 $listtables=array( @@ -310,6 +312,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 { $dir = "mysql/migration/"; // We use mysql migration scripts whatever is database driver if (! empty($dirmodule)) $dir=dol_buildpath('/'.$dirmodule.'/sql/',0); + dolibarr_install_syslog("Scan sql files for migration files in ".$dir); // Clean last part to exclude minor version x.y.z -> x.y $newversionfrom=preg_replace('/(\.[0-9]+)$/i','.0',$versionfrom); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 376a9b799a7..1a40d2eb9c5 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -106,7 +106,7 @@ pHeader('','step5',GETPOST('action','aZ09')?GETPOST('action','aZ09'):'upgrade',' if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09'))) { - print '

Database '.$langs->trans('DataMigration').'

'; + print '

Database '.$langs->trans('DataMigration').'

'; print '
'; @@ -405,11 +405,12 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 } } - // Code executed only if migrate is LAST ONE. Must always be done. + // Code executed only if migration is LAST ONE. Must always be done. if (versioncompare($versiontoarray,$versionranarray) >= 0 || versioncompare($versiontoarray,$versionranarray) <= -3) { // Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version) $listofmodule=array( + 'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly', 'MAIN_MODULE_AGENDA'=>'newboxdefonly', 'MAIN_MODULE_BARCODE'=>'newboxdefonly', 'MAIN_MODULE_CRON'=>'newboxdefonly', @@ -422,17 +423,14 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 'MAIN_MODULE_HOLIDAY'=>'newboxdefonly', 'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly', 'MAIN_MODULE_PAYBOX'=>'newboxdefonly', + 'MAIN_MODULE_PRINTING'=>'newboxdefonly', 'MAIN_MODULE_PRODUIT'=>'newboxdefonly', + 'MAIN_MODULE_SALARIES'=>'newboxdefonly', 'MAIN_MODULE_SOCIETE'=>'newboxdefonly', 'MAIN_MODULE_SERVICE'=>'newboxdefonly', - 'MAIN_MODULE_USER'=>'newboxdefonly', - 'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly', - 'MAIN_MODULE_BARCODE'=>'newboxdefonly', - 'MAIN_MODULE_CRON'=>'newboxdefonly', - 'MAIN_MODULE_PRINTING'=>'newboxdefonly', - 'MAIN_MODULE_SALARIES'=>'newboxdefonly', - - 'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version) + 'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version) + 'MAIN_MODULE_VARIANTS'=>'newboxdefonly', + 'MAIN_MODULE_WEBSITE'=>'newboxdefonly', ); migrate_reload_modules($db,$langs,$conf,$listofmodule); @@ -4524,7 +4522,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_API') + elseif ($moduletoreload == 'MAIN_MODULE_API') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Rest API module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modApi.class.php'; @@ -4534,7 +4532,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_BARCODE') + elseif ($moduletoreload == 'MAIN_MODULE_BARCODE') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Barcode module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modBarcode.class.php'; @@ -4544,7 +4542,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_CRON') + elseif ($moduletoreload == 'MAIN_MODULE_CRON') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Cron module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php'; @@ -4554,7 +4552,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_SOCIETE') + elseif ($moduletoreload == 'MAIN_MODULE_SOCIETE') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php'; @@ -4564,7 +4562,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7 + elseif ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Produit module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php'; @@ -4574,7 +4572,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7 + elseif ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; @@ -4584,7 +4582,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9 + elseif ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; @@ -4594,7 +4592,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9 + elseif ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Facture module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; @@ -4604,7 +4602,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9 + elseif ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Fournisseur module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; @@ -4614,7 +4612,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8 + elseif ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Leave Request module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modHoliday.class.php'; @@ -4624,7 +4622,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0 + elseif ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Deplacement module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php'; @@ -4634,7 +4632,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0 + elseif ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php'; @@ -4644,7 +4642,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1 + elseif ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate ECM module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; @@ -4654,7 +4652,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0 + elseif ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Paybox module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php'; @@ -4664,7 +4662,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_SUPPLIERPROPOSAL') // Module after 3.5 + elseif ($moduletoreload == 'MAIN_MODULE_SUPPLIERPROPOSAL') // Module after 3.5 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Supplier Proposal module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSupplierProposal.class.php'; @@ -4674,7 +4672,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0 + elseif ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Opensurvey module"); $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php'; @@ -4684,34 +4682,24 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) $mod->init($reloadmode); } } - if ($moduletoreload == 'MAIN_MODULE_SALARIES') // Permission has changed into 6.0 + else { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Salaries module"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSalaries.class.php'; - if ($res) { - $mod=new modSalaries($db); - //$mod->remove('noboxes'); - $mod->init($reloadmode); + $tmp = preg_match('/MAIN_MODULE_([a-zA-Z0-9]+)/', $moduletoreload, $reg); + if (! empty($reg[1])) + { + $moduletoreloadshort = ucfirst(strtolower($reg[1])); + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ".$moduletoreloadshort); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php'; + if ($res) { + $classname = 'mod'.$moduletoreloadshort; + $mod=new $classname($db); + //$mod->remove('noboxes'); + $mod->init($reloadmode); + } } - } - if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate User module"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php'; - if ($res) { - $mod=new modUser($db); - //$mod->remove('noboxes'); - $mod->init($reloadmode); - } - } - if ($moduletoreload == 'MAIN_MODULE_WEBSITE') // Module added in 7.0 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Website module"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modWebsite.class.php'; - if ($res) { - $mod=new modWebsite($db); - //$mod->remove('noboxes'); - $mod->init($reloadmode); + else + { + print "Error, can't find module name"; } } diff --git a/htdocs/langs/bs_BA/accountancy.lang b/htdocs/langs/bs_BA/accountancy.lang index f919c0d7c12..b4e2dcadb2d 100644 --- a/htdocs/langs/bs_BA/accountancy.lang +++ b/htdocs/langs/bs_BA/accountancy.lang @@ -239,7 +239,11 @@ AccountingJournalType2=Sales AccountingJournalType3=Purchases AccountingJournalType4=Banka AccountingJournalType5=Expenses report +<<<<<<< HEAD AccountingJournalType8=Inventory +======= +AccountingJournalType8=Inventar +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git AccountingJournalType9=Has-new ErrorAccountingJournalIsAlreadyUse=This journal is already use AccountingAccountForSalesTaxAreDefinedInto=Note: Accounting account for Sales tax are defined into menu %s - %s diff --git a/htdocs/langs/bs_BA/agenda.lang b/htdocs/langs/bs_BA/agenda.lang index 78a6dcd0c6d..7c02ab7ff46 100644 --- a/htdocs/langs/bs_BA/agenda.lang +++ b/htdocs/langs/bs_BA/agenda.lang @@ -5,7 +5,11 @@ Agenda=Agenda TMenuAgenda=Agenda Agendas=Agende LocalAgenda=Lokalni kalendar +<<<<<<< HEAD ActionsOwnedBy=Event owned by +======= +ActionsOwnedBy=Događaj u vlasništvu +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git ActionsOwnedByShort=Vlasnik AffectedTo=Dodijeljeno korisniku Event=Događaj @@ -14,7 +18,7 @@ EventsNb=Broj događaja ListOfActions=Lista događaja EventReports=Event reports Location=Lokacija -ToUserOfGroup=To any user in group +ToUserOfGroup=Bilo koji korisnik u grupi EventOnFullDay=Događaj za cijeli dan(e) MenuToDoActions=Svi nepotpuni događaji MenuDoneActions=Sve završeni događaji @@ -28,45 +32,60 @@ ActionAssignedTo=Događaj dodijeljen ViewCal=Mjesečni pregled ViewDay=Dnevni pregled ViewWeek=Sedmični pregled -ViewPerUser=Per user view -ViewPerType=Per type view +ViewPerUser=Pregled po korisniku +ViewPerType=Pregled po vrsti AutoActions= Automatsko popunjavanje -AgendaAutoActionDesc= Define here events for which you want Dolibarr to create automatically an event in agenda. If nothing is checked, only manual actions will be included in logged and visible into agenda. Automatic tracking of business actions done on objects (validation, status change) will not be saved. +AgendaAutoActionDesc= Ovdje definirajte događaje za koje želite da Dolibarr automatski napravi događaj u kalendaru. Ako ništa nije obilježeno, samo ručno unesene akcije će biti uključene i vidljive u kalendaru. Automatsko praćenje biznis akcija urađenih na objektima (validacija, promjena statusa) neće biti spremljene. AgendaSetupOtherDesc= Ova stranica pruža mogućnosti izvoza svojih Dolibarr događaja u eksterni kalendar (Thunderbird, Google Calendar, ...) AgendaExtSitesDesc=Ova stranica omogućava definisanje eksternih izvora kalendara da vidite svoje događaje u Dolibarr agendi. ActionsEvents=Događaji za koje će Dolibarr stvoriti akciju u dnevni red automatski EventRemindersByEmailNotEnabled=Event reminders by email was not enabled into Agenda module setup. ##### Agenda event labels ##### NewCompanyToDolibarr=Kreirana treća strana %s +<<<<<<< HEAD ContractValidatedInDolibarr=Contract %s validated PropalClosedSignedInDolibarr=Proposal %s signed PropalClosedRefusedInDolibarr=Proposal %s refused +======= +ContractValidatedInDolibarr=Ugovor %s potvrđen +PropalClosedSignedInDolibarr=Prijedlog %s potpisan +PropalClosedRefusedInDolibarr=Prijedlog %s odbijen +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git PropalValidatedInDolibarr=Prijedlog %s potvrđen -PropalClassifiedBilledInDolibarr=Proposal %s classified billed +PropalClassifiedBilledInDolibarr=Prijedlog %s klasificiran kao fakturisan InvoiceValidatedInDolibarr=Faktura %s potvrđena InvoiceValidatedInDolibarrFromPos=Račun %s odobren na POSu InvoiceBackToDraftInDolibarr=Faktura %s vraćena u status izrade InvoiceDeleteDolibarr=Faktura %s obrisana -InvoicePaidInDolibarr=Invoice %s changed to paid -InvoiceCanceledInDolibarr=Invoice %s canceled -MemberValidatedInDolibarr=Member %s validated +InvoicePaidInDolibarr=Faktura %s promijenjena u status plaćeno +InvoiceCanceledInDolibarr=Faktura %s otkazana +MemberValidatedInDolibarr=Član %s potvrđen MemberModifiedInDolibarr=Member %s modified +<<<<<<< HEAD MemberResiliatedInDolibarr=Member %s terminated MemberDeletedInDolibarr=Member %s deleted MemberSubscriptionAddedInDolibarr=Subscription %s for member %s added MemberSubscriptionModifiedInDolibarr=Subscription %s for member %s modified MemberSubscriptionDeletedInDolibarr=Subscription %s for member %s deleted ShipmentValidatedInDolibarr=Shipment %s validated +======= +MemberResiliatedInDolibarr=Član %s ugašen +MemberDeletedInDolibarr=Član%s obrisan +MemberSubscriptionAddedInDolibarr=Subscription %s for member %s added +MemberSubscriptionModifiedInDolibarr=Subscription %s for member %s modified +MemberSubscriptionDeletedInDolibarr=Subscription %s for member %s deleted +ShipmentValidatedInDolibarr=Pošiljka %s odobrena +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git ShipmentClassifyClosedInDolibarr=Shipment %s classified billed ShipmentUnClassifyCloseddInDolibarr=Shipment %s classified reopened ShipmentDeletedInDolibarr=Shipment %s deleted OrderCreatedInDolibarr=Order %s created OrderValidatedInDolibarr=Narudžba %s potvrđena -OrderDeliveredInDolibarr=Order %s classified delivered +OrderDeliveredInDolibarr=Narudžba %s klasificirana kao isporučena OrderCanceledInDolibarr=Narudžba %s otkazana -OrderBilledInDolibarr=Order %s classified billed +OrderBilledInDolibarr=Narudžba %s klasificirana kao fakturisana OrderApprovedInDolibarr=Narudžba %s odobrena -OrderRefusedInDolibarr=Order %s refused +OrderRefusedInDolibarr=Narudžba %s odbijena OrderBackToDraftInDolibarr=NArudžbu %s vratiti u status izrade ProposalSentByEMail=Poslovni prijedlog %s poslan putem e-maila ContractSentByEMail=Contract %s sent by EMail @@ -75,11 +94,15 @@ InvoiceSentByEMail=Fakture za kupca %s poslana putem e-maila SupplierOrderSentByEMail=Narudžba za dobavljača %s poslan putem e-maila SupplierInvoiceSentByEMail=Predračun dobavljača %s poslan putem e-maila ShippingSentByEMail=Pošiljka%s poslana emailom +<<<<<<< HEAD ShippingValidated= Shipment %s validated +======= +ShippingValidated= Pošiljka %s odobrena +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git InterventionSentByEMail=Intervencija %s poslana putem e-maila -ProposalDeleted=Proposal deleted -OrderDeleted=Order deleted -InvoiceDeleted=Invoice deleted +ProposalDeleted=Ponuda obrisana +OrderDeleted=Narudžba obrisana +InvoiceDeleted=Faktura obrisana PRODUCT_CREATEInDolibarr=Product %s created PRODUCT_MODIFYInDolibarr=Product %s modified PRODUCT_DELETEInDolibarr=Product %s deleted @@ -105,16 +128,21 @@ AgendaShowBirthdayEvents=Pokaži rođendane kontakata AgendaHideBirthdayEvents=Sakrij rođendane kontakata Busy=Zauzet ExportDataset_event1=Lista događaja u agendi -DefaultWorkingDays=Default working days range in week (Example: 1-5, 1-6) -DefaultWorkingHours=Default working hours in day (Example: 9-18) +DefaultWorkingDays=Postavljeni period radnih dana u sedmici (naprimjer: 1-5, 1-6) +DefaultWorkingHours=Postavljeni radni sati u danu (naprimjer: 9-18) # External Sites ical ExportCal=Export kalendara ExtSites=Import eksternih kalendara -ExtSitesEnableThisTool=Show external calendars (defined into global setup) into agenda. Does not affect external calendars defined by users. +ExtSitesEnableThisTool=Prikazuje vanjske kalendare (definirane gobalnim postavkama) u agendi. Ne utječe na vanjske kalendare koje definiraju korisnici. ExtSitesNbOfAgenda=Broj kalendara +<<<<<<< HEAD AgendaExtNb=Calendar no. %s +======= +AgendaExtNb=Kalendar br. %s +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git ExtSiteUrlAgenda=URL za pristup .ical fajla ExtSiteNoLabel=Nema opisa +<<<<<<< HEAD VisibleTimeRange=Visible time range VisibleDaysRange=Visible days range AddEvent=Napravi događaj @@ -129,3 +157,19 @@ EveryMonth=Svakog mjeseca DayOfMonth=Day of month DayOfWeek=Day of week DateStartPlusOne=Date start + 1 hour +======= +VisibleTimeRange=Vidljivi raspon vremena +VisibleDaysRange=Vidljivi raspon dana +AddEvent=Napravi događaj +MyAvailability=Moja dostupnost +ActionType=Vrsta događaja +DateActionBegin=Početni datum događaja +CloneAction=Kloniraj događaj +ConfirmCloneEvent=Jeste li sigurni da želite duplirati događaj %s? +RepeatEvent=Ponovi događaj +EveryWeek=Svake sedmice +EveryMonth=Svakog mjeseca +DayOfMonth=Dan u mjesecu +DayOfWeek=Dan u sedmici +DateStartPlusOne=Datum početka + 1 sat +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/bs_BA/companies.lang b/htdocs/langs/bs_BA/companies.lang index 5fe2667b7bc..8e611ebd64d 100644 --- a/htdocs/langs/bs_BA/companies.lang +++ b/htdocs/langs/bs_BA/companies.lang @@ -267,7 +267,11 @@ Prospect=Mogući klijent CustomerCard=Kartica kupca Customer=Kupac CustomerRelativeDiscount=Relativni popust kupca +<<<<<<< HEAD SupplierRelativeDiscount=Relative supplier discount +======= +SupplierRelativeDiscount=Relativni popust dobavljača +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git CustomerRelativeDiscountShort=Relativni popust CustomerAbsoluteDiscountShort=Fiksni popust CompanyHasRelativeDiscount=Ovaj kupca ima defaultni popust od %s%% diff --git a/htdocs/langs/bs_BA/main.lang b/htdocs/langs/bs_BA/main.lang index 76845a3add3..6b8ad5ad4c3 100644 --- a/htdocs/langs/bs_BA/main.lang +++ b/htdocs/langs/bs_BA/main.lang @@ -64,14 +64,22 @@ ErrorNoVATRateDefinedForSellerCountry=Greška, nije definirana PDV stopa za drž ErrorNoSocialContributionForSellerCountry=Greška, nisu definirane vrste doprinosa i poreza za državu '%s'. ErrorFailedToSaveFile=Greška, neuspjelo spremanje datoteke. ErrorCannotAddThisParentWarehouse=Pokušavate dodati nadređeno skladište koje je već podređeno skladište ovom trenutnom +<<<<<<< HEAD MaxNbOfRecordPerPage=Max number of record per page +======= +MaxNbOfRecordPerPage=Maks broj unosa po stranici +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git NotAuthorized=Niste ovlašteni da to uradite. SetDate=Postavi datum SelectDate=Odaberi datum SeeAlso=Također pogledajte %s SeeHere=Pogledaj ovdje ClickHere=Klikni ovdje +<<<<<<< HEAD Here=Here +======= +Here=Ovdje +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git Apply=Primijeniti BackgroundColorByDefault=Osnovna boja pozadine FileRenamed=Datoteka je uspješno preimenovana @@ -866,7 +874,11 @@ FileNotShared=Datoteka nije dijeljena vanjskim korisnicima Project=Projekt Projects=Projekti Rights=Dozvole +<<<<<<< HEAD LineNb=Line no. +======= +LineNb=Red br. +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git IncotermLabel=Incoterms # Week day Monday=Ponedjeljak diff --git a/htdocs/langs/bs_BA/other.lang b/htdocs/langs/bs_BA/other.lang index 3a7b64383a0..3e54ae37590 100644 --- a/htdocs/langs/bs_BA/other.lang +++ b/htdocs/langs/bs_BA/other.lang @@ -47,7 +47,7 @@ Notify_PROPAL_SENTBYMAIL=Commercial proposal sent by mail Notify_WITHDRAW_TRANSMIT=Transmission withdrawal Notify_WITHDRAW_CREDIT=Credit withdrawal Notify_WITHDRAW_EMIT=Perform withdrawal -Notify_COMPANY_CREATE=Trća stranka kreirana +Notify_COMPANY_CREATE=Treća stranka kreirana Notify_COMPANY_SENTBYMAIL=Mails sent from third party card Notify_BILL_VALIDATE=Customer invoice validated Notify_BILL_UNVALIDATE=Customer invoice unvalidated @@ -246,4 +246,8 @@ WEBSITE_PAGEURL=URL of page WEBSITE_TITLE=Titula WEBSITE_DESCRIPTION=Opis WEBSITE_KEYWORDS=Keywords +<<<<<<< HEAD LinesToImport=Lines to import +======= +LinesToImport=Linija za uvoz +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/bs_BA/projects.lang b/htdocs/langs/bs_BA/projects.lang index 65b0a46f87d..1abc7a6b648 100644 --- a/htdocs/langs/bs_BA/projects.lang +++ b/htdocs/langs/bs_BA/projects.lang @@ -226,4 +226,8 @@ AllowCommentOnProject=Allow user comments on projects DontHavePermissionForCloseProject=You do not have permissions to close the project %s DontHaveTheValidateStatus=The project %s must be open to be closed RecordsClosed=%s project(s) closed +<<<<<<< HEAD SendProjectRef=About project %s +======= +SendProjectRef=O projektu %s +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/bs_BA/stocks.lang b/htdocs/langs/bs_BA/stocks.lang index 38403e646ce..9db682cf5b8 100644 --- a/htdocs/langs/bs_BA/stocks.lang +++ b/htdocs/langs/bs_BA/stocks.lang @@ -8,9 +8,17 @@ WarehouseEdit=Modifikovanje skladišta MenuNewWarehouse=Novo skladište WarehouseSource=Izvorno skladište WarehouseSourceNotDefined=Nema definisanog skladišta, +<<<<<<< HEAD AddWarehouse=Create warehouse +======= +AddWarehouse=Napravi skladište +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git AddOne=Dodaj jedno +<<<<<<< HEAD DefaultWarehouse=Default warehouse +======= +DefaultWarehouse=Glavno skladište +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git WarehouseTarget=Ciljano skladište ValidateSending=Obriši slanje CancelSending=Poništi slanje @@ -24,7 +32,11 @@ Movements=Kretanja ErrorWarehouseRefRequired=Referentno ime skladište je potrebno ListOfWarehouses=Lista skladišta ListOfStockMovements=Lista kretanja zaliha +<<<<<<< HEAD ListOfInventories=List of inventories +======= +ListOfInventories=Spisak inventara +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git MovementId=Movement ID StockMovementForId=Movement ID %d ListMouvementStockProject=List of stock movements associated to project @@ -161,7 +173,7 @@ inventoryCreatePermission=Create new inventory inventoryReadPermission=View inventories inventoryWritePermission=Update inventories inventoryValidatePermission=Validate inventory -inventoryTitle=Inventory +inventoryTitle=Inventar inventoryListTitle=Inventories inventoryListEmpty=No inventory in progress inventoryCreateDelete=Create/Delete inventory @@ -177,7 +189,7 @@ inventoryMvtStock=By inventory inventoryWarningProductAlreadyExists=This product is already into list SelectCategory=Category filter SelectFournisseur=Supplier filter -inventoryOnDate=Inventory +inventoryOnDate=Inventar INVENTORY_DISABLE_VIRTUAL=Allow to not destock child product from a kit on inventory 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 have date of inventory diff --git a/htdocs/langs/bs_BA/withdrawals.lang b/htdocs/langs/bs_BA/withdrawals.lang index ff670b631b4..7c60c9af042 100644 --- a/htdocs/langs/bs_BA/withdrawals.lang +++ b/htdocs/langs/bs_BA/withdrawals.lang @@ -100,7 +100,11 @@ DirectDebitOrderCreated=Direct debit order %s created AmountRequested=Amount requested SEPARCUR=SEPA CUR SEPAFRST=SEPA FRST +<<<<<<< HEAD ExecutionDate=Execution date +======= +ExecutionDate=Datum izvršenja +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git CreateForSepa=Create direct debit file ### Notifications diff --git a/htdocs/langs/ca_ES/accountancy.lang b/htdocs/langs/ca_ES/accountancy.lang index ba6ffcf42ad..dd7fb9db672 100644 --- a/htdocs/langs/ca_ES/accountancy.lang +++ b/htdocs/langs/ca_ES/accountancy.lang @@ -234,7 +234,11 @@ AccountingJournal=Diari comptable NewAccountingJournal=Nou diari comptable ShowAccoutingJournal=Mostrar diari comptable Nature=Caràcter +<<<<<<< HEAD AccountingJournalType1=Miscellaneous operations +======= +AccountingJournalType1=Operacions diverses +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git AccountingJournalType2=Vendes AccountingJournalType3=Compres AccountingJournalType4=Banc diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 2b3aab45d9b..c9649df73f0 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -470,7 +470,11 @@ WatermarkOnDraftExpenseReports=Marca d'aigua en informes de despeses esborrany AttachMainDocByDefault=Establiu-lo a 1 si voleu adjuntar el document principal al correu electrònic de manera predeterminada (si escau) FilesAttachedToEmail=Adjuntar fitxer SendEmailsReminders=Enviar recordatoris d'agenda per correu electrònic +<<<<<<< HEAD davDescription=Add a component to be a DAV server +======= +davDescription=Afegeix un component per ser un servidor DAV +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git # Modules Module0Name=Usuaris i grups Module0Desc=Gestió d'usuaris / empleats i grups @@ -838,11 +842,21 @@ Permission1251=Llançar les importacions en massa a la base de dades (càrrega d Permission1321=Exporta factures de clients, atributs i cobraments Permission1322=Reobrir una factura pagada Permission1421=Exporta comandes de clients i atributs +<<<<<<< HEAD Permission20001=Read leave requests (your leaves and the one of your subordinates) Permission20002=Create/modify your leave requests (yours leaves and the one of your subordinates) +======= +Permission20001=Consulta els dies de lliure disposició (els propis i els dels teus subordinats) +Permission20002=Crea/modifica els teus dies de lliure disposició (els propis i els dels teus subordinats) +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git Permission20003=Elimina les peticions de dies lliures retribuïts +<<<<<<< HEAD Permission20004=Read all leave requests (even of user not subordinates) Permission20005=Create/modify leave requests for everybody (even of user not subordinates) +======= +Permission20004=Consulta tots els dies de lliure disposició (inclòs els usuaris no subordinats) +Permission20005=Crea/modifica els dies de lliure disposició per tothom (inclòs els usuaris no subordinats) +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git Permission20006=Administra els dies de lliure disposició (configura i actualitza el balanç) Permission23001=Consulta les tasques programades Permission23002=Crear/Modificar les tasques programades @@ -1448,9 +1462,15 @@ SyslogFilename=Nom i ruta de l'arxiu YouCanUseDOL_DATA_ROOT=Utilitza DOL_DATA_ROOT/dolibarr.log per un fitxer de registre en la carpeta documents de Dolibarr. Tanmateix, es pot definir una carpeta diferent per guardar aquest fitxer. ErrorUnknownSyslogConstant=La constant %s no és una constant syslog coneguda OnlyWindowsLOG_USER=Windows només suporta LOG_USER +<<<<<<< HEAD CompressSyslogs=Syslog files compression and backup SyslogFileNumberOfSaves=Còpies del log ConfigureCleaningCronjobToSetFrequencyOfSaves=Configure cleaning scheduled job to set log backup frequency +======= +CompressSyslogs=Compressió i còpia de seguretat d'arxius Syslog +SyslogFileNumberOfSaves=Còpies del log +ConfigureCleaningCronjobToSetFrequencyOfSaves=Configura la tasca programada de neteja per establir la freqüència de còpia de seguretat del registre +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git ##### Donations ##### DonationsSetup=Configuració del mòdul donacions DonationsReceiptModel=Plantilla de rebut de donació @@ -1547,11 +1567,19 @@ FailedToInitializeMenu=Error al inicialitzar el menú ##### Tax ##### TaxSetup=Configuració del mòdul d'impostos varis i dividends OptionVatMode=Opció de càrrega d'IVA +<<<<<<< HEAD OptionVATDefault=Standard basis +======= +OptionVATDefault=Base estàndard +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git OptionVATDebitOption=Dèbit OptionVatDefaultDesc=La càrrega de l'IVA és:
-en l'enviament dels béns (en la pràctica s'usa la data de la factura)
-sobre el pagament pels serveis OptionVatDebitOptionDesc=La càrrega de l'IVA és:
-en l'enviament dels béns en la pràctica s'usa la data de la factura
-sobre la facturació dels serveis +<<<<<<< HEAD OptionPaymentForProductAndServices=Cash basis for products and services +======= +OptionPaymentForProductAndServices=Base de caixa de productes i serveis +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git OptionPaymentForProductAndServicesDesc=VAT is due:
- on payment for goods
- on payments for services SummaryOfVatExigibilityUsedByDefault=Moment d'exigibilitat per defecte l'IVA per a l'opció escollida: OnDelivery=Al lliurament @@ -1730,7 +1758,11 @@ MailToSendContract=Per a enviar un contracte MailToThirdparty=Per enviar correu electrònic des de la pàgina del tercer MailToMember=Enviar correu electrònic des de la pàgina del membre MailToUser=Enviar correu electrònic des de la pàgina d'usuari +<<<<<<< HEAD MailToProject= To send email from project page +======= +MailToProject= Enviar correu electrònic des de la pàgina de projecte +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git ByDefaultInList=Mostra per defecte en la vista del llistat YouUseLastStableVersion=Estàs utilitzant l'última versió estable TitleExampleForMajorRelease=Exemple de missatge que es pot utilitzar per anunciar aquesta actualització de versió (ets lliure d'utilitzar-ho a les teves webs) @@ -1779,7 +1811,11 @@ MAIN_PDF_MARGIN_TOP=Marge superior al PDF MAIN_PDF_MARGIN_BOTTOM=Marge inferior al PDF SetToYesIfGroupIsComputationOfOtherGroups=Estableixi a SÍ si aquest grup és un càlcul d'altres grups EnterCalculationRuleIfPreviousFieldIsYes=Introduïu la regla de càlculs si el camp anterior ha estat posat a SÍ (Per exemple 'CODEGRP1 + CODEGRP2') +<<<<<<< HEAD SeveralLangugeVariatFound=Several language variants found +======= +SeveralLangugeVariatFound=S'ha trobat diverses variants d'idiomes +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git WebDavServer=URL of %s server : %s ##### Resource #### ResourceSetup=Configuració del mòdul Recurs diff --git a/htdocs/langs/ca_ES/bills.lang b/htdocs/langs/ca_ES/bills.lang index a780879f865..220d5a62766 100644 --- a/htdocs/langs/ca_ES/bills.lang +++ b/htdocs/langs/ca_ES/bills.lang @@ -348,10 +348,17 @@ NextDateToExecution=Data de la propera generació de factures NextDateToExecutionShort=Data següent gen. DateLastGeneration=Data de l'última generació DateLastGenerationShort=Data última gen. +<<<<<<< HEAD MaxPeriodNumber=Max number of invoice generation NbOfGenerationDone=Number of invoice generation already done NbOfGenerationDoneShort=Number of generation done MaxGenerationReached=Maximum number of generations reached +======= +MaxPeriodNumber=Número màxim de generació de factures +NbOfGenerationDone=Número de generació de factura ja realitzat +NbOfGenerationDoneShort=Número de generació realitzat +MaxGenerationReached=Número màxim de generacions aconseguides +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git InvoiceAutoValidate=Valida les factures automàticament GeneratedFromRecurringInvoice=Generat des de la plantilla de factura recurrent %s DateIsNotEnough=Encara no s'ha arribat a la data diff --git a/htdocs/langs/ca_ES/companies.lang b/htdocs/langs/ca_ES/companies.lang index d6d14deb6b5..684b87aa3f5 100644 --- a/htdocs/langs/ca_ES/companies.lang +++ b/htdocs/langs/ca_ES/companies.lang @@ -267,23 +267,40 @@ Prospect=Client potencial CustomerCard=Fitxa client Customer=Client CustomerRelativeDiscount=Descompte client relatiu +<<<<<<< HEAD SupplierRelativeDiscount=Relative supplier discount +======= +SupplierRelativeDiscount=Descompte relatiu de proveïdor +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git CustomerRelativeDiscountShort=Descompte relatiu CustomerAbsoluteDiscountShort=Descompte fixe CompanyHasRelativeDiscount=Aquest client té un descompte per defecte de %s%% CompanyHasNoRelativeDiscount=Aquest client no té descomptes relatius per defecte HasRelativeDiscountFromSupplier=You have a default discount of %s%% from this supplier +<<<<<<< HEAD HasNoRelativeDiscountFromSupplier=You have no default relative discount from this supplier +======= +HasNoRelativeDiscountFromSupplier=No tens descomptes relatius per defecte d'aquest proveïdor +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git CompanyHasAbsoluteDiscount=Aquest client té descomptes disponibles (notes de crèdit o bestretes) per %s %s CompanyHasDownPaymentOrCommercialDiscount=Aquest client té un descompte disponible (comercial, de pagament) per a %s%s CompanyHasCreditNote=Aquest client encara té abonaments per %s %s +<<<<<<< HEAD HasNoAbsoluteDiscountFromSupplier=You have no discount credit available from this supplier +======= +HasNoAbsoluteDiscountFromSupplier=No tens crèdit disponible per descomptar d'aquest proveïdor +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git HasAbsoluteDiscountFromSupplier=You have discounts available (credits notes or down payments) for %s %s from this supplier HasDownPaymentOrCommercialDiscountFromSupplier=You have discounts available (commercial, down payments) for %s %s from this supplier HasCreditNoteFromSupplier=You have credit notes for %s %s from this supplier CompanyHasNoAbsoluteDiscount=Aquest client no té més descomptes fixos disponibles +<<<<<<< HEAD CustomerAbsoluteDiscountAllUsers=Absolute customer discounts (granted by all users) CustomerAbsoluteDiscountMy=Absolute customer discounts (granted by yourself) +======= +CustomerAbsoluteDiscountAllUsers=Descomptes absoluts dels clients (concedits per tots els usuaris) +CustomerAbsoluteDiscountMy=Descomptes absoluts dels clients (concedits per tu mateix) +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git SupplierAbsoluteDiscountAllUsers=Absolute supplier discounts (granted by all users) SupplierAbsoluteDiscountMy=Absolute supplier discounts (granted by yourself) DiscountNone=Cap @@ -390,7 +407,11 @@ NoDolibarrAccess=Sense accés d'usuari ExportDataset_company_1=Tercers (empreses/entitats/persones físiques) i propietats ExportDataset_company_2=Contactes de tercers i atributs ImportDataset_company_1=Tercers (empreses/entitats/persones físiques) i propietats +<<<<<<< HEAD ImportDataset_company_2=Contacts/Addresses (of third parties or not) and attributes +======= +ImportDataset_company_2=Contactes/Adreces (de tercers o no) i atributs +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git ImportDataset_company_3=Comptes bancaris de tercers ImportDataset_company_4=Tercers/Comercials (Assigna usuaris comercials a tercers) PriceLevel=Nivell de preus diff --git a/htdocs/langs/ca_ES/compta.lang b/htdocs/langs/ca_ES/compta.lang index 1ff1d21c026..c6a94b93fb1 100644 --- a/htdocs/langs/ca_ES/compta.lang +++ b/htdocs/langs/ca_ES/compta.lang @@ -169,9 +169,15 @@ LT1ReportByCustomers=Report tax 2 by third party LT2ReportByCustomers=Report tax 3 by third party LT1ReportByCustomersES=Informe de RE per tercers LT2ReportByCustomersES=Informe per tercer del IRPF +<<<<<<< HEAD VATReport=Sale tax report VATReportByPeriods=Sale tax report by period VATReportByCustomers=Sale tax report by customer +======= +VATReport=Informe d'IVA de vendes +VATReportByPeriods=Sale tax report by period +VATReportByCustomers=Informe d'IVA sobre vendes per client +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git VATReportByCustomersInInputOutputMode=Informe per clients d'IVA cobrat i pagat VATReportByQuartersInInputOutputMode=Report by Sale tax rate of the tax collected and paid LT1ReportByQuarters=Report tax 2 by rate diff --git a/htdocs/langs/ca_ES/cron.lang b/htdocs/langs/ca_ES/cron.lang index f6815f7a4ad..243a8302d80 100644 --- a/htdocs/langs/ca_ES/cron.lang +++ b/htdocs/langs/ca_ES/cron.lang @@ -43,7 +43,11 @@ CronNoJobs=Sense treballs actualment CronPriority=Prioritat CronLabel=Etiqueta CronNbRun=Nº execucions +<<<<<<< HEAD CronMaxRun=Max number launch +======= +CronMaxRun=Número màxim d'execucions +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git CronEach=Tota (s) JobFinished=Tasques llançades i finalitzades #Page card diff --git a/htdocs/langs/ca_ES/holiday.lang b/htdocs/langs/ca_ES/holiday.lang index d0a062b1b82..f24eaf1d822 100644 --- a/htdocs/langs/ca_ES/holiday.lang +++ b/htdocs/langs/ca_ES/holiday.lang @@ -39,9 +39,15 @@ TypeOfLeaveId=Tipus d'identificador de baixa TypeOfLeaveCode=Tipus de codi de baixa TypeOfLeaveLabel=Tipus d'etiqueta de baixa NbUseDaysCP=Nombre de dies lliures consumits +<<<<<<< HEAD NbUseDaysCPShort=Days consumed NbUseDaysCPShortInMonth=Days consumed in month DateStartInMonth=Start date in month +======= +NbUseDaysCPShort=Dies consumits +NbUseDaysCPShortInMonth=Dies consumits al mes +DateStartInMonth=Data d'inici al mes +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git DateEndInMonth=End date in month EditCP=Modificar DeleteCP=Eliminar @@ -97,7 +103,11 @@ AllHolidays=Totes les sol·licituds de permís HalfDay=Mig dia NotTheAssignedApprover=No sou l'aprovador assignat LEAVE_PAID=Vacances pagades +<<<<<<< HEAD LEAVE_SICK=Sick leave +======= +LEAVE_SICK=Baixa per enfermetat +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git LEAVE_OTHER=Other leave LEAVE_PAID_FR=Vacances pagades ## Configuration du Module ## diff --git a/htdocs/langs/ca_ES/loan.lang b/htdocs/langs/ca_ES/loan.lang index 5458b01f336..a759cfa5cfc 100644 --- a/htdocs/langs/ca_ES/loan.lang +++ b/htdocs/langs/ca_ES/loan.lang @@ -52,4 +52,8 @@ LOAN_ACCOUNTING_ACCOUNT_INTEREST=Compte comptable per al interès per defecte LOAN_ACCOUNTING_ACCOUNT_INSURANCE=Compte comptable de l'assegurança per defecte FinancialCommitment=Financial commitment CreateCalcSchedule=Edit financial commitment +<<<<<<< HEAD InterestAmount=Interest amount +======= +InterestAmount=Import d'interès +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/ca_ES/mails.lang b/htdocs/langs/ca_ES/mails.lang index 93b7fe3e0f5..12f60619fa8 100644 --- a/htdocs/langs/ca_ES/mails.lang +++ b/htdocs/langs/ca_ES/mails.lang @@ -78,7 +78,11 @@ ResultOfMailSending=Resultat de l'enviament massiu d'e-mails NbSelected=Nº seleccionats NbIgnored=Nº ignorats NbSent=Nº enviats +<<<<<<< HEAD SentXXXmessages=%s message(s) sent. +======= +SentXXXmessages=%s missatge(s) enviat(s). +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git ConfirmUnvalidateEmailing=Are you sure you want to change email %s to draft status? MailingModuleDescContactsWithThirdpartyFilter=Contacte amb filtres de client MailingModuleDescContactsByCompanyCategory=Contactes per categoria de tercer diff --git a/htdocs/langs/ca_ES/main.lang b/htdocs/langs/ca_ES/main.lang index c42ba9da1e6..57aeb431d9a 100644 --- a/htdocs/langs/ca_ES/main.lang +++ b/htdocs/langs/ca_ES/main.lang @@ -64,14 +64,22 @@ ErrorNoVATRateDefinedForSellerCountry=Error, cap tipus d'IVA definit per al paí ErrorNoSocialContributionForSellerCountry=Error, cap tipus d'impost varis definit per al país '%s'. ErrorFailedToSaveFile=Error, el registre del fitxer ha fallat. ErrorCannotAddThisParentWarehouse=Està intentant afegir un magatzem pare que ja és fill de l'actual +<<<<<<< HEAD MaxNbOfRecordPerPage=Max number of record per page +======= +MaxNbOfRecordPerPage=Número màxim de registres per pàgina +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git NotAuthorized=No està autoritzat per fer-ho. SetDate=Indica la data SelectDate=Seleccioneu una data SeeAlso=Veure també %s SeeHere=Mira aquí ClickHere=Fes clic aquí +<<<<<<< HEAD Here=Here +======= +Here=Aquí +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git Apply=Aplicar BackgroundColorByDefault=Color de fons FileRenamed=L'arxiu s'ha renombrat correctament @@ -328,7 +336,11 @@ Default=Defecte DefaultValue=Valor per defecte DefaultValues=Valors per defecte Price=Preu +<<<<<<< HEAD PriceCurrency=Price (currency) +======= +PriceCurrency=Preu (moneda) +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git UnitPrice=Preu unitari UnitPriceHT=Preu base UnitPriceHTCurrency=Unit price (net) (currency) @@ -438,7 +450,11 @@ ActionsOnMember=Esdeveniments d'aquest soci ActionsOnProduct=Esdeveniments sobre aquest producte NActionsLate=%s en retard ToDo=A realitzar +<<<<<<< HEAD Completed=Completed +======= +Completed=Finalitzat +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git Running=En progrés RequestAlreadyDone=Sol·licitud ja recollida Filter=Filtre @@ -866,7 +882,11 @@ FileNotShared=Fitxer no compartit amb el públic extern Project=Projecte Projects=Projectes Rights=Permisos +<<<<<<< HEAD LineNb=Line no. +======= +LineNb=Núm. línia +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git IncotermLabel=Incoterms # Week day Monday=Dilluns @@ -933,11 +953,20 @@ CommentDeleted=Comentari suprimit Everybody=Projecte compartit PayedBy=Pagat per PayedTo=Pagat a +<<<<<<< HEAD Monthly=Monthly Quarterly=Quarterly Annual=Annual Local=Local Remote=Remote LocalAndRemote=Local and Remote +======= +Monthly=Mensual +Quarterly=Trimestral +Annual=Anual +Local=Local +Remote=Remot +LocalAndRemote=Local i remota +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git KeyboardShortcut=Keyboard shortcut AssignedTo=Assignada a diff --git a/htdocs/langs/ca_ES/members.lang b/htdocs/langs/ca_ES/members.lang index 2c8f350545d..050d74521bd 100644 --- a/htdocs/langs/ca_ES/members.lang +++ b/htdocs/langs/ca_ES/members.lang @@ -117,7 +117,11 @@ SendingEmailOnCancelation=Sending email on cancelation YourMembershipRequestWasReceived=Your membership was received. YourMembershipWasValidated=Your membership was validated YourSubscriptionWasRecorded=Your new subscription was recorded +<<<<<<< HEAD SubscriptionReminderEmail=Subscription reminder +======= +SubscriptionReminderEmail=Recordatori de subscripció +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git YourMembershipWasCanceled=Your membership was canceled CardContent=Contingut de la seva fitxa de soci # Text of email templates diff --git a/htdocs/langs/ca_ES/other.lang b/htdocs/langs/ca_ES/other.lang index 3f968449ad6..d410724304e 100644 --- a/htdocs/langs/ca_ES/other.lang +++ b/htdocs/langs/ca_ES/other.lang @@ -246,4 +246,8 @@ WEBSITE_PAGEURL=URL de pàgina WEBSITE_TITLE=Títol WEBSITE_DESCRIPTION=Descripció WEBSITE_KEYWORDS=Paraules clau +<<<<<<< HEAD LinesToImport=Lines to import +======= +LinesToImport=Línies per importar +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/ca_ES/projects.lang b/htdocs/langs/ca_ES/projects.lang index feded59ec43..b97e5315228 100644 --- a/htdocs/langs/ca_ES/projects.lang +++ b/htdocs/langs/ca_ES/projects.lang @@ -140,7 +140,11 @@ ProjectReportDate=Canvia les dates de les tasques en funció de la nova data d'i ErrorShiftTaskDate=S'ha produït un error en el canvi de les dates de les tasques ProjectsAndTasksLines=Projectes i tasques ProjectCreatedInDolibarr=Projecte %s creat +<<<<<<< HEAD ProjectValidatedInDolibarr=Project %s validated +======= +ProjectValidatedInDolibarr=Projecte %s validat +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git ProjectModifiedInDolibarr=Projecte %s modificat TaskCreatedInDolibarr=La tasca %s a sigut creada TaskModifiedInDolibarr=La tasca %s a sigut modificada @@ -225,5 +229,10 @@ AllowCommentOnTask=Permet comentaris dels usuaris a les tasques AllowCommentOnProject=Permetre comentaris dels usuaris als projectes DontHavePermissionForCloseProject=You do not have permissions to close the project %s DontHaveTheValidateStatus=The project %s must be open to be closed +<<<<<<< HEAD RecordsClosed=%s project(s) closed SendProjectRef=About project %s +======= +RecordsClosed=%s projecte(s) tancat(s) +SendProjectRef=Sobre el projecte %s +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/ca_ES/salaries.lang b/htdocs/langs/ca_ES/salaries.lang index 9de2324c398..fb0315b9f84 100644 --- a/htdocs/langs/ca_ES/salaries.lang +++ b/htdocs/langs/ca_ES/salaries.lang @@ -15,4 +15,8 @@ THMDescription=Aquest valor es pot utilitzar per calcular el cost del temps cons TJMDescription=Aquest valor només és informatiu i no s'utilitza en cap càlcul LastSalaries=Últims %s pagaments de salari AllSalaries=Tots els pagaments de salari +<<<<<<< HEAD SalariesStatistics=Statistiques salaires +======= +SalariesStatistics=Estadistiques de salaris +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/ca_ES/stocks.lang b/htdocs/langs/ca_ES/stocks.lang index ecaaa5beceb..48ca7fd499d 100644 --- a/htdocs/langs/ca_ES/stocks.lang +++ b/htdocs/langs/ca_ES/stocks.lang @@ -8,9 +8,17 @@ WarehouseEdit=Edició magatzem MenuNewWarehouse=Nou magatzem WarehouseSource=Magatzem origen WarehouseSourceNotDefined=Sense magatzems definits, +<<<<<<< HEAD AddWarehouse=Create warehouse +======= +AddWarehouse=Crea un magatzem +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git AddOne=Afegir un +<<<<<<< HEAD DefaultWarehouse=Default warehouse +======= +DefaultWarehouse=Magatzem predeterminat +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git WarehouseTarget=Magatzem destinació ValidateSending=Elimina l'enviament CancelSending=Cancel·la l'enviament @@ -24,7 +32,11 @@ Movements=Moviments ErrorWarehouseRefRequired=El nom de referència del magatzem és obligatori ListOfWarehouses=Llistat de magatzems ListOfStockMovements=Llistat de moviments de estoc +<<<<<<< HEAD ListOfInventories=List of inventories +======= +ListOfInventories=Llista d'inventaris +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git MovementId=ID del moviment StockMovementForId=ID de moviment %d ListMouvementStockProject=Llista de moviments d'estoc associats al projecte diff --git a/htdocs/langs/ca_ES/stripe.lang b/htdocs/langs/ca_ES/stripe.lang index 71ba200bb44..4fea61fd51a 100644 --- a/htdocs/langs/ca_ES/stripe.lang +++ b/htdocs/langs/ca_ES/stripe.lang @@ -47,6 +47,7 @@ StripeGateways=Stripe gateways OAUTH_STRIPE_TEST_ID=Stripe Connect Client ID (ca_...) OAUTH_STRIPE_LIVE_ID=Stripe Connect Client ID (ca_...) BankAccountForBankTransfer=Bank account for fund payouts +<<<<<<< HEAD StripeAccount=Stripe account StripeChargeList=List of Stripe charges StripeTransactionList=List of Stripe transactions @@ -63,3 +64,21 @@ ConfirmDeleteCard=Are you sure you want to delete this Card record? CreateCustomerOnStripe=Create customer on Stripe CreateCardOnStripe=Create card on Stripe ShowInStripe=Show in Stripe +======= +StripeAccount=Compte de Stripe +StripeChargeList=Llista de càrregues de Stripe +StripeTransactionList=Llista de transaccions de Stripe +StripeCustomerId=ID de client de Stripe +StripePaymentModes=Formes de pagament de Stripe +LocalID=ID local +StripeID=ID de Stripe +NameOnCard=Nom a la targeta +CardNumber=Número de targeta +ExpiryDate=Data de caducitat +CVN=CVN +DeleteACard=Delete Card record +ConfirmDeleteCard=Estàs segur que vols eliminar aquest registre de la targeta? +CreateCustomerOnStripe=Crea un client a Stripe +CreateCardOnStripe=Crea una targeta a Stripe +ShowInStripe=Mostra a Stripe +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git diff --git a/htdocs/langs/ca_ES/website.lang b/htdocs/langs/ca_ES/website.lang index 17dbd595ffe..1c18f49dbe7 100644 --- a/htdocs/langs/ca_ES/website.lang +++ b/htdocs/langs/ca_ES/website.lang @@ -40,7 +40,11 @@ SetHereVirtualHost=Si pots crear, al teu servidor web (Apache, Nginx...), un Hos YouCanAlsoTestWithPHPS=En l'entorn de desenvolupament, és possible que preferiu provar el lloc amb el servidor web incrustat de PHP (requereix PHP 5.5) executant-se
php -S 0.0.0.0:8080 -t %s CheckVirtualHostPerms=Check also that virtual host has permission %s on files into
%s ReadPerm=Llegit +<<<<<<< HEAD WritePerm=Write +======= +WritePerm=Escriu +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git PreviewSiteServedByWebServer=
  • Vista prèvia %s en una nova pestanya.


  • El %s serà servit per un servidor web extern (com ara Apache, Nginx, IIS). Heu d'instal·lar i configurar aquest servidor abans d'apuntar al directori:
    %s
    URL servit per un servidor extern:
    %s
    PreviewSiteServedByDolibarr= Previsualitza %s en una nova pestanya.

    El servidor %s serà servit pel servidor Dolibarr d'aquesta manera no es necessita instal·la cap servidor web addicional (com ara Apache, Nginx, IIS).
    L'inconvenient és que l'URL de les pàgines no son amigables i començen per la ruta del vostre Dolibarr.
    URL servit per Dolibarr:
    %s

    Per utilitzar el vostre propi servidor web extern per a servir a aquest lloc web, creeu un amfitrió ('host') virtual al vostre servidor web que apunti al directori
    %s
    , llavors introduïu el nom d'aquest servidor virtual i feu clic a l'altre botó de vista prèvia (botó de 'preview'). VirtualHostUrlNotDefined=No s'ha definit la URL de l'amfitrió virtual que serveix el servidor web extern diff --git a/htdocs/langs/ca_ES/withdrawals.lang b/htdocs/langs/ca_ES/withdrawals.lang index 8b9fa906494..37afcba976a 100644 --- a/htdocs/langs/ca_ES/withdrawals.lang +++ b/htdocs/langs/ca_ES/withdrawals.lang @@ -100,7 +100,11 @@ DirectDebitOrderCreated=S'ha creat l'ordre de domiciliació bancària %s AmountRequested=Quantitat sol·licitada SEPARCUR=SEPA CUR SEPAFRST=SEPA FRST +<<<<<<< HEAD ExecutionDate=Execution date +======= +ExecutionDate=Data d'execució +>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git CreateForSepa=Create direct debit file ### Notifications diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index c8973887d2d..f3acb7ac39c 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -1,4 +1,5 @@ # Dolibarr language file - en_US - Accounting Expert +Accounting=Accounting ACCOUNTING_EXPORT_SEPARATORCSV=Column separator for export file ACCOUNTING_EXPORT_DATE=Date format for export file ACCOUNTING_EXPORT_PIECE=Export the number of piece @@ -39,11 +40,11 @@ AccountWithNonZeroValues=Accounts with non zero values ListOfAccounts=List of accounts MainAccountForCustomersNotDefined=Main accounting account for customers not defined in setup -MainAccountForSuppliersNotDefined=Main accounting account for suppliers not defined in setup +MainAccountForSuppliersNotDefined=Main accounting account for veo not defined in setup MainAccountForUsersNotDefined=Main accounting account for users not defined in setup MainAccountForVatPaymentNotDefined=Main accounting account for VAT payment not defined in setup -AccountancyArea=Accountancy area +AccountancyArea=Accounting area AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: AccountancyAreaDescActionOnce=The following actions are usually executed one time only, or once per year... AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you the correct default accounting account when making the journalization (writing record in Journals and General ledger) @@ -89,7 +90,7 @@ MenuProductsAccounts=Product accounts ProductsBinding=Products accounts Ventilation=Binding to accounts CustomersVentilation=Customer invoice binding -SuppliersVentilation=Supplier invoice binding +SuppliersVentilation=Vendor invoice binding ExpenseReportsVentilation=Expense report binding CreateMvts=Create new transaction UpdateMvts=Modification of a transaction @@ -185,7 +186,7 @@ ListeMvts=List of movements ErrorDebitCredit=Debit and Credit cannot have a value at the same time AddCompteFromBK=Add accounting accounts to the group ReportThirdParty=List third party account -DescThirdPartyReport=Consult here the list of the third party customers and suppliers and their accounting accounts +DescThirdPartyReport=Consult here the list of the third party customers and vendors and their accounting accounts ListAccounts=List of the accounting accounts UnknownAccountForThirdparty=Unknown third party account. We will use %s UnknownAccountForThirdpartyBlocking=Unknown third party account. Blocking error @@ -204,8 +205,8 @@ DescVentilDoneCustomer=Consult here the list of the lines of invoices customers DescVentilTodoCustomer=Bind invoice lines not already bound with a product accounting account ChangeAccount=Change the product/service accounting account for selected lines with the following accounting account: Vide=- -DescVentilSupplier=Consult here the list of supplier invoice lines bound or not yet bound to a product accounting account -DescVentilDoneSupplier=Consult here the list of the lines of invoices supplier and their accounting account +DescVentilSupplier=Consult here the list of vndor invoice lines bound or not yet bound to a product accounting account +DescVentilDoneSupplier=Consult here the list of the lines of invoices vendors and their accounting account DescVentilTodoExpenseReport=Bind expense report lines not already bound with a fee accounting account DescVentilExpenseReport=Consult here the list of expense report lines bound (or not) to a fee accounting account DescVentilExpenseReportMore=If you setup accounting account on type of expense report lines, the application will be able to make all the binding between your expense report lines and the accounting account of your chart of accounts, just in one click with the button "%s". If account was not set on fees dictionary or if you still has some lines not bound to any account, you will have to make a manual binding from the menu "%s". @@ -215,7 +216,7 @@ ValidateHistory=Bind Automatically AutomaticBindingDone=Automatic binding done ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used -MvtNotCorrectlyBalanced=Movement not correctly balanced. Credit = %s. Debit = %s +MvtNotCorrectlyBalanced=Movement not correctly balanced. Debit = %s | Credit = %s FicheVentilation=Binding card GeneralLedgerIsWritten=Transactions are written in the Ledger GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be journalized. If there is no other error message, this is probably because they were already journalized. diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 699b7690249..9be2b2d4de1 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -269,7 +269,7 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender email for automatic emails (By default in php.ini: %s) -MAIN_MAIL_ERRORS_TO=Email used as 'Errors-To' field in emails sent +MAIN_MAIL_ERRORS_TO=Eemail used for error returns emails (fields 'Errors-To' in emails sent) MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all emails sendings (for test purposes or demos) MAIN_MAIL_FORCE_SENDTO=Send all emails to (instead of real recipients, for test purposes) @@ -292,7 +292,7 @@ ModuleSetup=Module setup ModulesSetup=Modules/Application setup ModuleFamilyBase=System ModuleFamilyCrm=Customer Relation Management (CRM) -ModuleFamilySrm=Supplier Relation Management (SRM) +ModuleFamilySrm=Vendor Relation Management (SRM) ModuleFamilyProducts=Products Management (PM) ModuleFamilyHr=Human Resource Management (HR) ModuleFamilyProjects=Projects/Collaborative work @@ -374,7 +374,8 @@ NoSmsEngine=No SMS sender manager available. SMS sender manager are not installe PDF=PDF PDFDesc=You can set each global options related to the PDF generation PDFAddressForging=Rules to forge address boxes -HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF +HideAnyVATInformationOnPDF=Hide all information related to Sales tax / VAT on generated PDF +PDFRulesForSalesTax=Rules for Sales Tax / VAT PDFLocaltax=Rules for %s HideLocalTaxOnPDF=Hide %s rate into pdf column tax sale HideDescOnPDF=Hide products description on generated PDF @@ -446,7 +447,8 @@ DisplayCompanyInfo=Display company address DisplayCompanyManagers=Display manager names DisplayCompanyInfoAndManagers=Display company address and manager names EnableAndSetupModuleCron=If you want to have this recurring invoice beeing generated automatically, module *%s* must be enabled and correctly setup. Otherwise, generation of invoices must be done manually from this template with button *Create*. Note that even if you enabled automatic generation, you can still safely launch manual generation. Duplicates generation for same period are not possible. -ModuleCompanyCodeAquarium=Return an accounting code built by:
    %s followed by third party supplier code for a supplier accounting code,
    %s followed by third party customer code for a customer accounting code. +ModuleCompanyCodeCustomerAquarium=%s followed by third party customer code for a customer accounting code +ModuleCompanyCodeSupplierAquarium=%s followed by third party supplier code for a supplier accounting code ModuleCompanyCodePanicum=Return an empty accounting code. ModuleCompanyCodeDigitaria=Accounting code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code. Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).
    Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required. @@ -472,6 +474,9 @@ AttachMainDocByDefault=Set this to 1 if you want to attach main document to emai FilesAttachedToEmail=Attach file SendEmailsReminders=Send agenda reminders by emails davDescription=Add a component to be a DAV server +DAVSetup=Setup of module DAV +DAV_ALLOW_PUBLIC_DIR=Enable the public directory (WebDav directory with no login required) +DAV_ALLOW_PUBLIC_DIRTooltip=The WebDav public directory is a WebDAV directory everybody can access to (in read and write mode), with no need to have/use an existing login/password account. # Modules Module0Name=Users & groups Module0Desc=Users / Employees and Groups management @@ -480,7 +485,7 @@ Module1Desc=Companies and contact management (customers, prospects...) Module2Name=Commercial Module2Desc=Commercial management Module10Name=Accounting -Module10Desc=Simple accounting reports (journals, turnover) based onto database content. No dispatching. +Module10Desc=Simple accounting reports (journals, turnover) based onto database content. Does not use any ledger table. Module20Name=Proposals Module20Desc=Commercial proposal management Module22Name=Mass E-mailings @@ -547,8 +552,8 @@ Module400Name=Projects/Opportunities/Leads Module400Desc=Management of projects, opportunities/leads and/or tasks. You can also assign any element (invoice, order, proposal, intervention, ...) to a project and get a transversal view from the project view. Module410Name=Webcalendar Module410Desc=Webcalendar integration -Module500Name=Special expenses -Module500Desc=Management of special expenses (taxes, social or fiscal taxes, dividends) +Module500Name=Taxes and Special expenses +Module500Desc=Management of special expenses (sale taxes, social or fiscal taxes, dividends, ...) Module510Name=Payment of employee wages Module510Desc=Record and follow payment of your employee wages Module520Name=Loan @@ -562,14 +567,14 @@ Module700Name=Donations Module700Desc=Donation management Module770Name=Expense reports Module770Desc=Management and claim expense reports (transportation, meal, ...) -Module1120Name=Supplier commercial proposal -Module1120Desc=Request supplier commercial proposal and prices +Module1120Name=Vendor commercial proposal +Module1120Desc=Request vndor commercial proposal and prices Module1200Name=Mantis Module1200Desc=Mantis integration Module1520Name=Document Generation Module1520Desc=Mass mail document generation Module1780Name=Tags/Categories -Module1780Desc=Create tags/category (products, customers, suppliers, contacts or members) +Module1780Desc=Create tags/category (products, customers, vendors, contacts or members) Module2000Name=WYSIWYG editor Module2000Desc=Allow to edit some text area using an advanced editor (Based on CKEditor) Module2200Name=Dynamic Prices @@ -577,7 +582,7 @@ Module2200Desc=Enable the usage of math expressions for prices Module2300Name=Scheduled jobs Module2300Desc=Scheduled jobs management (alias cron or chrono table) Module2400Name=Events/Agenda -Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous. +Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous. This is the main important module for a good Customer or Supplier Relationship Management. Module2500Name=DMS / ECM Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need. Module2600Name=API/Web services (SOAP server) @@ -614,7 +619,7 @@ Module50100Desc=Point of sales module (POS). Module50200Name=Paypal Module50200Desc=Module to offer an online payment page accepting payments using PayPal (credit card or PayPal credit). This can be used to allow your customers to make free payments or for a payment on a particular Dolibarr object (invoice, order, ...) Module50400Name=Accounting (advanced) -Module50400Desc=Accounting management (double entries, support general and auxiliary ledgers) +Module50400Desc=Accounting management (double entries, support general and auxiliary ledgers). Export the ledger in several other accounting software format. Module54000Name=PrintIPP Module54000Desc=Direct print (without opening the documents) using Cups IPP interface (Printer must be visible from server, and CUPS must be installe on server). Module55000Name=Poll, Survey or Vote @@ -1034,9 +1039,9 @@ Delays_MAIN_DELAY_MEMBERS=Tolerance delay (in days) before alert on delayed memb Delays_MAIN_DELAY_CHEQUES_TO_DEPOSIT=Tolerance delay (in days) before alert for cheques deposit to do Delays_MAIN_DELAY_EXPENSEREPORTS=Tolerance delay (in days) before alert for expense reports to approve SetupDescription1=The setup area is for initial setup parameters before starting to use Dolibarr. -SetupDescription2=The two mandatory setup steps are the first two in the setup menu on the left: %s setup page and %s setup page : -SetupDescription3=Parameters in menu %s -> %s are required because defined data are used on Dolibarr screens and to customize the default behavior of the software (for country-related features for example). -SetupDescription4=Parameters in menu %s -> %s are required because Dolibarr ERP/CRM is a collection of several modules/applications, all more or less independent. New features will be added to menus for every module you will activate. +SetupDescription2=The two mandatory setup steps are the following steps (the two first entries in the left setup menu): +SetupDescription3=Settings in menu %s -> %s. This step is required because it defines data used on Dolibarr screens to customize the default behavior of the software (for country-related features for example). +SetupDescription4=Settings in menu %s -> %s. This step is required because Dolibarr ERP/CRM is a collection of several modules/applications, all more or less independent. New features are added to menus for every module you activate. SetupDescription5=Other menu entries manage optional parameters. LogEvents=Security audit events Audit=Audit @@ -1190,11 +1195,11 @@ UserMailRequired=EMail required to create a new user HRMSetup=HRM module setup ##### Company setup ##### CompanySetup=Companies module setup -CompanyCodeChecker=Module for third parties code generation and checking (customer or supplier) -AccountCodeManager=Module for accounting code generation (customer or supplier) +CompanyCodeChecker=Module for third parties code generation and checking (customer or vendor) +AccountCodeManager=Module for accounting code generation (customer or vendor) NotificationsDesc=EMails notifications feature allows you to silently send automatic mail, for some Dolibarr events. Targets of notifications can be defined: NotificationsDescUser=* per users, one user at time. -NotificationsDescContact=* per third parties contacts (customers or suppliers), one contact at time. +NotificationsDescContact=* per third parties contacts (customers or vendors), one contact at time. NotificationsDescGlobal=* or by setting global target emails in module setup page. ModelModules=Documents templates DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT or .ODS files for OpenOffice, KOffice, TextEdit,...) @@ -1205,6 +1210,9 @@ MustBeUnique=Must be unique? MustBeMandatory=Mandatory to create third parties? MustBeInvoiceMandatory=Mandatory to validate invoices? TechnicalServicesProvided=Technical services provided +#####DAV ##### +WebDAVSetupDesc=This is the links to access the WebDAV directory. It contains a "public" dir open to any user knowing the URL (if public directory access allowed) and a "private" directory that need an existing login account/password to access to. +WebDavServer=Root URL of %s server : %s ##### Webcal setup ##### WebCalUrlForVCalExport=An export link to %s format is available at following link: %s ##### Invoices ##### @@ -1231,15 +1239,15 @@ FreeLegalTextOnProposal=Free text on commercial proposals WatermarkOnDraftProposal=Watermark on draft commercial proposals (none if empty) BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL=Ask for bank account destination of proposal ##### SupplierProposal ##### -SupplierProposalSetup=Price requests suppliers module setup -SupplierProposalNumberingModules=Price requests suppliers numbering models -SupplierProposalPDFModules=Price requests suppliers documents models -FreeLegalTextOnSupplierProposal=Free text on price requests suppliers -WatermarkOnDraftSupplierProposal=Watermark on draft price requests suppliers (none if empty) +SupplierProposalSetup=Price requests vendors module setup +SupplierProposalNumberingModules=Price requests vendors numbering models +SupplierProposalPDFModules=Price requests vendors documents models +FreeLegalTextOnSupplierProposal=Free text on price requests vendors +WatermarkOnDraftSupplierProposal=Watermark on draft price requests vendors (none if empty) BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL=Ask for bank account destination of price request WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER=Ask for Warehouse Source for order ##### Suppliers Orders ##### -BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER=Ask for bank account destination of supplier order +BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER=Ask for bank account destination of purchase order ##### Orders ##### OrdersSetup=Order management setup OrdersNumberingModules=Orders numbering models @@ -1629,8 +1637,8 @@ ChequeReceiptsNumberingModule=Cheque Receipts Numbering module MultiCompanySetup=Multi-company module setup ##### Suppliers ##### SuppliersSetup=Supplier module setup -SuppliersCommandModel=Complete template of supplier order (logo...) -SuppliersInvoiceModel=Complete template of supplier invoice (logo...) +SuppliersCommandModel=Complete template of prchase order (logo...) +SuppliersInvoiceModel=Complete template of vendor invoice (logo...) SuppliersInvoiceNumberingModel=Supplier invoices numbering models IfSetToYesDontForgetPermission=If set to yes, don't forget to provide permissions to groups or users allowed for the second approval ##### GeoIPMaxmind ##### @@ -1667,7 +1675,7 @@ NoAmbiCaracAutoGeneration=Do not use ambiguous characters ("1","l","i","|","0"," SalariesSetup=Setup of module salaries SortOrder=Sort order Format=Format -TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both customers and suppliers payment type +TypePaymentDesc=0:Customer payment type, 1:Vndor payment type, 2:Both customers and vendors payment type IncludePath=Include path (defined into variable %s) ExpenseReportsSetup=Setup of module Expense Reports TemplatePDFExpenseReports=Document templates to generate expense report document @@ -1689,7 +1697,7 @@ InstallModuleFromWebHasBeenDisabledByFile=Install of external module from applic ConfFileMustContainCustom=Installing or building an external module from application need to save the module files into directory %s. To have this directory processed by Dolibarr, you must setup your conf/conf.php to add the 2 directive lines:
    $dolibarr_main_url_root_alt='/custom';
    $dolibarr_main_document_root_alt='%s/custom'; HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over HighlightLinesColor=Highlight color of the line when the mouse passes over (keep empty for no highlight) -TextTitleColor=Color of page title +TextTitleColor=Text color of Page title LinkColor=Color of links PressF5AfterChangingThis=Press CTRL+F5 on keyboard or clear your browser cache after changing this value to have it effective NotSupportedByAllThemes=Will works with core themes, may not be supported by external themes @@ -1698,6 +1706,7 @@ TopMenuBackgroundColor=Background color for Top menu TopMenuDisableImages=Hide images in Top menu LeftMenuBackgroundColor=Background color for Left menu BackgroundTableTitleColor=Background color for Table title line +BackgroundTableTitleTextColor=Text color for Table title line BackgroundTableLineOddColor=Background color for odd table lines BackgroundTableLineEvenColor=Background color for even table lines MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay) @@ -1720,19 +1729,19 @@ FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced) ExpectedChecksum=Expected Checksum CurrentChecksum=Current Checksum ForcedConstants=Required constant values -MailToSendProposal=To send customer proposal -MailToSendOrder=To send customer order -MailToSendInvoice=To send customer invoice -MailToSendShipment=To send shipment -MailToSendIntervention=To send intervention -MailToSendSupplierRequestForQuotation=To send quotation request to supplier -MailToSendSupplierOrder=To send supplier order -MailToSendSupplierInvoice=To send supplier invoice -MailToSendContract=To send a contract -MailToThirdparty=To send email from third party page -MailToMember=To send email from member page -MailToUser=To send email from user page -MailToProject= To send email from project page +MailToSendProposal=Customer proposals +MailToSendOrder=Customer orders +MailToSendInvoice=Customer invoices +MailToSendShipment=Shipments +MailToSendIntervention=Interventions +MailToSendSupplierRequestForQuotation=Quotation request +MailToSendSupplierOrder=Purchase orders +MailToSendSupplierInvoice=Vendor invoices +MailToSendContract=Contracts +MailToThirdparty=Third parties +MailToMember=Members +MailToUser=Users +MailToProject=Projects page ByDefaultInList=Show by default on list view YouUseLastStableVersion=You use the latest stable version TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites) @@ -1782,7 +1791,8 @@ MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups EnterCalculationRuleIfPreviousFieldIsYes=Enter calculcation rule if previous field was set to Yes (For example 'CODEGRP1+CODEGRP2') SeveralLangugeVariatFound=Several language variants found -WebDavServer=URL of %s server : %s +COMPANY_AQUARIUM_REMOVE_SPECIAL=Remove special characters +COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN_REGEX) ##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index f92e17321b6..b4891579763 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -299,7 +299,7 @@ DiscountOfferedBy=Granted by DiscountStillRemaining=Discounts or credits available DiscountAlreadyCounted=Discounts or credits already consumed CustomerDiscounts=Customer discounts -SupplierDiscounts=Supplier discounts +SupplierDiscounts=Vendors discounts BillAddress=Bill address HelpEscompte=This discount is a discount granted to customer because its payment was made before term. HelpAbandonBadCustomer=This amount has been abandoned (customer said to be a bad customer) and is considered as an exceptional loose. @@ -532,3 +532,4 @@ AutoFillDateFrom=Set start date for service line with invoice date AutoFillDateFromShort=Set start date AutoFillDateTo=Set end date for service line with next invoice date AutoFillDateToShort=Set end date +MaxNumberOfGenerationReached=Max number of gen. reached diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 24f5bc100f6..9f2e16857de 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -60,8 +60,8 @@ ActionAC_CLO=Close ActionAC_EMAILING=Send mass email ActionAC_COM=Send customer order by mail ActionAC_SHIP=Send shipping by mail -ActionAC_SUP_ORD=Send supplier order by mail -ActionAC_SUP_INV=Send supplier invoice by mail +ActionAC_SUP_ORD=Send purchase order by mail +ActionAC_SUP_INV=Send vendor invoice by mail ActionAC_OTH=Other ActionAC_OTH_AUTO=Automatically inserted events ActionAC_MANUAL=Manually inserted events diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 3473667fe55..b3c458833d9 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -8,11 +8,11 @@ ConfirmDeleteContact=Are you sure you want to delete this contact and all inheri MenuNewThirdParty=New third party MenuNewCustomer=New customer MenuNewProspect=New prospect -MenuNewSupplier=New supplier +MenuNewSupplier=New vendor MenuNewPrivateIndividual=New private individual -NewCompany=New company (prospect, customer, supplier) -NewThirdParty=New third party (prospect, customer, supplier) -CreateDolibarrThirdPartySupplier=Create a third party (supplier) +NewCompany=New company (prospect, customer, vendor) +NewThirdParty=New third party (prospect, customer, vendor) +CreateDolibarrThirdPartySupplier=Create a third party (vendor) CreateThirdPartyOnly=Create third party CreateThirdPartyAndContact=Create a third party + a child contact ProspectionArea=Prospection area @@ -37,7 +37,7 @@ ThirdPartyProspectsStats=Prospects ThirdPartyCustomers=Customers ThirdPartyCustomersStats=Customers ThirdPartyCustomersWithIdProf12=Customers with %s or %s -ThirdPartySuppliers=Suppliers +ThirdPartySuppliers=Vendors ThirdPartyType=Third party type Individual=Private individual ToCreateContactWithSameName=Will create automatically a contact/address with same information than third party under the third party. In most cases, even if your third party is a physical people, creating a third party alone is enough. @@ -80,7 +80,7 @@ VATIsUsed=Sales tax is used VATIsUsedWhenSelling=This define if this thirdparty includes a sale tax or not when it makes an invoice to its own customers VATIsNotUsed=Sales tax is not used CopyAddressFromSoc=Fill address with third party address -ThirdpartyNotCustomerNotSupplierSoNoRef=Thirdparty neither customer nor supplier, no available refering objects +ThirdpartyNotCustomerNotSupplierSoNoRef=Thirdparty neither customer nor vendor, no available refering objects ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts=Thirdparty neither customer nor supplier, discounts are not available PaymentBankAccount=Payment bank account OverAllProposals=Proposals @@ -99,9 +99,9 @@ LocalTax2ES=IRPF TypeLocaltax1ES=RE Type TypeLocaltax2ES=IRPF Type WrongCustomerCode=Customer code invalid -WrongSupplierCode=Supplier code invalid +WrongSupplierCode=Vendor code invalid CustomerCodeModel=Customer code model -SupplierCodeModel=Supplier code model +SupplierCodeModel=Vendor code model Gencod=Bar code ##### Professional ID ##### ProfId1Short=Prof. id 1 @@ -267,7 +267,7 @@ Prospect=Prospect CustomerCard=Customer Card Customer=Customer CustomerRelativeDiscount=Relative customer discount -SupplierRelativeDiscount=Relative supplier discount +SupplierRelativeDiscount=Relative vendor discount CustomerRelativeDiscountShort=Relative discount CustomerAbsoluteDiscountShort=Absolute discount CompanyHasRelativeDiscount=This customer has a default discount of %s%% @@ -284,8 +284,8 @@ HasCreditNoteFromSupplier=You have credit notes for %s %s from this suppl CompanyHasNoAbsoluteDiscount=This customer has no discount credit available CustomerAbsoluteDiscountAllUsers=Absolute customer discounts (granted by all users) CustomerAbsoluteDiscountMy=Absolute customer discounts (granted by yourself) -SupplierAbsoluteDiscountAllUsers=Absolute supplier discounts (granted by all users) -SupplierAbsoluteDiscountMy=Absolute supplier discounts (granted by yourself) +SupplierAbsoluteDiscountAllUsers=Absolute vendor discounts (granted by all users) +SupplierAbsoluteDiscountMy=Absolute vendor discounts (granted by yourself) DiscountNone=None Supplier=Supplier AddContact=Create contact @@ -304,13 +304,13 @@ DeleteACompany=Delete a company PersonalInformations=Personal data AccountancyCode=Accounting account CustomerCode=Customer code -SupplierCode=Supplier code +SupplierCode=Vendor code CustomerCodeShort=Customer code -SupplierCodeShort=Supplier code +SupplierCodeShort=Vendor code CustomerCodeDesc=Customer code, unique for all customers -SupplierCodeDesc=Supplier code, unique for all suppliers +SupplierCodeDesc=Vendor code, unique for all vendors RequiredIfCustomer=Required if third party is a customer or prospect -RequiredIfSupplier=Required if third party is a supplier +RequiredIfSupplier=Required if third party is a vendor ValidityControledByModule=Validity controled by module ThisIsModuleRules=This is rules for this module ProspectToContact=Prospect to contact @@ -338,7 +338,7 @@ MyContacts=My contacts Capital=Capital CapitalOf=Capital of %s EditCompany=Edit company -ThisUserIsNot=This user is not a prospect, customer nor supplier +ThisUserIsNot=This user is not a prospect, customer nor vendor VATIntraCheck=Check VATIntraCheckDesc=The link %s allows to ask the european VAT checker service. An external internet access from server is required for this service to work. VATIntraCheckURL=http://ec.europa.eu/taxation_customs/vies/vieshome.do @@ -396,7 +396,7 @@ ImportDataset_company_4=Third parties/Sales representatives (Assign sales repres PriceLevel=Price level DeliveryAddress=Delivery address AddAddress=Add address -SupplierCategory=Supplier category +SupplierCategory=Vendor category JuridicalStatus200=Independent DeleteFile=Delete file ConfirmDeleteFile=Are you sure you want to delete this file? @@ -406,7 +406,7 @@ FiscalYearInformation=Information on the fiscal year FiscalMonthStart=Starting month of the fiscal year YouMustAssignUserMailFirst=You must create email for this user first to be able to add emails notifications for him. YouMustCreateContactFirst=To be able to add email notifications, you must first define contacts with valid emails for the third party -ListSuppliersShort=List of suppliers +ListSuppliersShort=List of vendors ListProspectsShort=List of prospects ListCustomersShort=List of customers ThirdPartiesArea=Third parties and contact area @@ -420,7 +420,7 @@ CurrentOutstandingBill=Current outstanding bill OutstandingBill=Max. for outstanding bill OutstandingBillReached=Max. for outstanding bill reached OrderMinAmount=Minimum amount for order -MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for supplier code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0. +MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for vendor code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0. LeopardNumRefModelDesc=The code is free. This code can be modified at any time. ManagingDirectors=Manager(s) name (CEO, director, president...) MergeOriginThirdparty=Duplicate third party (third party you want to delete) @@ -431,4 +431,4 @@ SaleRepresentativeLogin=Login of sales representative SaleRepresentativeFirstname=First name of sales representative SaleRepresentativeLastname=Last name of sales representative ErrorThirdpartiesMerge=There was an error when deleting the third parties. Please check the log. Changes have been reverted. -NewCustomerSupplierCodeProposed=New customer or supplier code suggested on duplicate code +NewCustomerSupplierCodeProposed=New customer or vendor code suggested on duplicate code diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 24724088e45..9c1574c77ef 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -34,7 +34,8 @@ AmountHTVATRealPaid=Net paid VATToPay=Tax sales VATReceived=Tax received VATToCollect=Tax purchases -VATSummary=Tax Balance +VATSummary=Tax monthly +VATBalance=Tax Balance VATPaid=Tax paid LT1Summary=Tax 2 summary LT2Summary=Tax 3 summary @@ -80,12 +81,12 @@ AccountancyTreasuryArea=Accountancy/Treasury area NewPayment=New payment Payments=Payments PaymentCustomerInvoice=Customer invoice payment -PaymentSupplierInvoice=Supplier invoice payment +PaymentSupplierInvoice=Vendor invoice payment PaymentSocialContribution=Social/fiscal tax payment PaymentVat=VAT payment ListPayment=List of payments ListOfCustomerPayments=List of customer payments -ListOfSupplierPayments=List of supplier payments +ListOfSupplierPayments=List of vendor payments DateStartPeriod=Date start period DateEndPeriod=Date end period newLT1Payment=New tax 2 payment @@ -110,7 +111,7 @@ ShowVatPayment=Show VAT payment TotalToPay=Total to pay BalanceVisibilityDependsOnSortAndFilters=Balance is visible in this list only if table is sorted ascending on %s and filtered for 1 bank account CustomerAccountancyCode=Customer accounting code -SupplierAccountancyCode=Supplier accounting code +SupplierAccountancyCode=Vendor accounting code CustomerAccountancyCodeShort=Cust. account. code SupplierAccountancyCodeShort=Sup. account. code AccountNumber=Account number @@ -171,6 +172,8 @@ LT1ReportByCustomersES=Report by third party RE LT2ReportByCustomersES=Report by third party IRPF VATReport=Sale tax report VATReportByPeriods=Sale tax report by period +VATReportByRates=Sale tax report by rates +VATReportByThirdParties=Sale tax report by third parties VATReportByCustomers=Sale tax report by customer VATReportByCustomersInInputOutputMode=Report by the customer VAT collected and paid VATReportByQuartersInInputOutputMode=Report by Sale tax rate of the tax collected and paid @@ -223,7 +226,7 @@ ACCOUNTING_VAT_BUY_ACCOUNT=Accounting account by default for VAT on purchases (u ACCOUNTING_VAT_PAY_ACCOUNT=Accounting account by default for paying VAT ACCOUNTING_ACCOUNT_CUSTOMER=Accounting account used for customer third parties ACCOUNTING_ACCOUNT_CUSTOMER_Desc=The dedicated accounting account defined on third party card will be used for Subledger accouting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated customer accouting account on third party is not defined. -ACCOUNTING_ACCOUNT_SUPPLIER=Accounting account used for supplier third parties +ACCOUNTING_ACCOUNT_SUPPLIER=Accounting account used for vendor third parties ACCOUNTING_ACCOUNT_SUPPLIER_Desc=The dedicated accounting account defined on third party card will be used for Subledger accouting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated supplier accouting account on third party is not defined. CloneTax=Clone a social/fiscal tax ConfirmCloneTax=Confirm the clone of a social/fiscal tax payment @@ -242,3 +245,7 @@ FiscalPeriod=Accounting period ListSocialContributionAssociatedProject=List of social contributions associated with the project DeleteFromCat=Remove from accounting group AccountingAffectation=Accounting assignement +LastDayTaxIsRelatedTo=Last day of period the tax is related to +VATDue=Sale tax claimed +ClaimedForThisPeriod=Claimed for the period +PaidDuringThisPeriod=Paid during this period \ No newline at end of file diff --git a/htdocs/langs/en_US/dict.lang b/htdocs/langs/en_US/dict.lang index f0fa27bcbf8..81f62469896 100644 --- a/htdocs/langs/en_US/dict.lang +++ b/htdocs/langs/en_US/dict.lang @@ -5,7 +5,8 @@ CountryIT=Italy CountryES=Spain CountryDE=Germany CountryCH=Switzerland -CountryGB=Great Britain +# Warning, country code GB is for United Kingdom. UK Does not exists as country code in ISO standard. +CountryGB=United Kingdom CountryUK=United Kingdom CountryIE=Ireland CountryCN=China diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang index 588044f18df..2352e704bde 100644 --- a/htdocs/langs/en_US/ecm.lang +++ b/htdocs/langs/en_US/ecm.lang @@ -39,8 +39,8 @@ ShowECMSection=Show directory DeleteSection=Remove directory ConfirmDeleteSection=Can you confirm you want to delete the directory %s? ECMDirectoryForFiles=Relative directory for files -CannotRemoveDirectoryContainsFilesOrDirs=Removed not possible because it contains some files or sub-directories -CannotRemoveDirectoryContainsFiles=Removed not possible because it contains some files +CannotRemoveDirectoryContainsFilesOrDirs=Removal not possible because it contains some files or sub-directories +CannotRemoveDirectoryContainsFiles=Removal not possible because it contains some files ECMFileManager=File manager ECMSelectASection=Select a directory in the tree... DirNotSynchronizedSyncFirst=This directory seems to be created or modified outside ECM module. You must click on "Resync" button first to synchronize disk and database to get content of this directory. diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index efee041cbf4..4141df0c967 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -32,9 +32,9 @@ ErrorBarCodeRequired=Bar code required ErrorCustomerCodeAlreadyUsed=Customer code already used ErrorBarCodeAlreadyUsed=Bar code already used ErrorPrefixRequired=Prefix required -ErrorBadSupplierCodeSyntax=Bad syntax for supplier code -ErrorSupplierCodeRequired=Supplier code required -ErrorSupplierCodeAlreadyUsed=Supplier code already used +ErrorBadSupplierCodeSyntax=Bad syntax for endor code +ErrorSupplierCodeRequired=Vendor code required +ErrorSupplierCodeAlreadyUsed=Vendor code already used ErrorBadParameters=Bad parameters ErrorBadValueForParameter=Wrong value '%s' for parameter '%s' ErrorBadImageFormat=Image file has not a supported format (Your PHP does not support functions to convert images of this format) @@ -87,7 +87,7 @@ ErrorsOnXLines=Errors on %s source record(s) ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus) ErrorSpecialCharNotAllowedForField=Special characters are not allowed for field "%s" ErrorNumRefModel=A reference exists into database (%s) and is not compatible with this numbering rule. Remove record or renamed reference to activate this module. -ErrorQtyTooLowForThisSupplier=Quantity too low for this supplier or no price defined on this product for this supplier +ErrorQtyTooLowForThisSupplier=Quantity too low for this vendor or no price defined on this product for this supplier ErrorModuleSetupNotComplete=Setup of module looks to be uncomplete. Go on Home - Setup - Modules to complete. ErrorBadMask=Error on mask ErrorBadMaskFailedToLocatePosOfSequence=Error, mask without sequence number @@ -177,7 +177,7 @@ ErrorBadDefinitionOfMenuArrayInModuleDescriptor=Bad Definition Of Menu Array In ErrorSavingChanges=An error has ocurred when saving the changes ErrorWarehouseRequiredIntoShipmentLine=Warehouse is required on the line to ship ErrorFileMustHaveFormat=File must have format %s -ErrorSupplierCountryIsNotDefined=Country for this supplier is not defined. Correct this first. +ErrorSupplierCountryIsNotDefined=Country for this vendor is not defined. Correct this first. ErrorsThirdpartyMerge=Failed to merge the two records. Request canceled. ErrorStockIsNotEnoughToAddProductOnOrder=Stock is not enough for product %s to add it into a new order. ErrorStockIsNotEnoughToAddProductOnInvoice=Stock is not enough for product %s to add it into a new invoice. diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 27a2edd1fda..fe96d7c0f97 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -146,7 +146,7 @@ NothingToDo=Nothing to do # upgrade MigrationFixData=Fix for denormalized data MigrationOrder=Data migration for customer's orders -MigrationSupplierOrder=Data migration for supplier's orders +MigrationSupplierOrder=Data migration for vendor's orders MigrationProposal=Data migration for commercial proposals MigrationInvoice=Data migration for customer's invoices MigrationContract=Data migration for contracts diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 1d29afa1fa5..418042f1da9 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -231,7 +231,7 @@ Limit=Limit Limits=Limits Logout=Logout NoLogoutProcessWithAuthMode=No applicative disconnect feature with authentication mode %s -Connection=Connection +Connection=Login Setup=Setup Alert=Alert MenuWarnings=Alerts @@ -402,6 +402,7 @@ DefaultTaxRate=Default tax rate Average=Average Sum=Sum Delta=Delta +RemainToPay=Remain to pay Module=Module/Application Modules=Modules/Applications Option=Option @@ -414,7 +415,7 @@ Favorite=Favorite ShortInfo=Info. Ref=Ref. ExternalRef=Ref. extern -RefSupplier=Ref. supplier +RefSupplier=Ref. vendor RefPayment=Ref. payment CommercialProposalsShort=Commercial proposals Comment=Comment @@ -619,9 +620,9 @@ BuildDoc=Build Doc Entity=Environment Entities=Entities CustomerPreview=Customer preview -SupplierPreview=Supplier preview +SupplierPreview=Vendor preview ShowCustomerPreview=Show customer preview -ShowSupplierPreview=Show supplier preview +ShowSupplierPreview=Show vendor preview RefCustomer=Ref. customer Currency=Currency InfoAdmin=Information for administrators @@ -679,7 +680,7 @@ Color=Color Documents=Linked files Documents2=Documents UploadDisabled=Upload disabled -MenuAccountancy=Accountancy +MenuAccountancy=Accounting MenuECM=Documents MenuAWStats=AWStats MenuMembers=Members @@ -915,11 +916,11 @@ SearchIntoProductsOrServices=Products or services SearchIntoProjects=Projects SearchIntoTasks=Tasks SearchIntoCustomerInvoices=Customer invoices -SearchIntoSupplierInvoices=Supplier invoices +SearchIntoSupplierInvoices=Vendor invoices SearchIntoCustomerOrders=Customer orders -SearchIntoSupplierOrders=Supplier orders +SearchIntoSupplierOrders=Purchase orders SearchIntoCustomerProposals=Customer proposals -SearchIntoSupplierProposals=Supplier proposals +SearchIntoSupplierProposals=Vendor proposals SearchIntoInterventions=Interventions SearchIntoContracts=Contracts SearchIntoCustomerShipments=Customer shipments diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang index 9f590ef3718..b9d52dcfdc6 100644 --- a/htdocs/langs/en_US/margins.lang +++ b/htdocs/langs/en_US/margins.lang @@ -28,10 +28,10 @@ UseDiscountAsService=As a service UseDiscountOnTotal=On subtotal MARGIN_METHODE_FOR_DISCOUNT_DETAILS=Defines if a global discount is treated as a product, a service, or only on subtotal for margin calculation. MARGIN_TYPE=Buying/Cost price suggested by default for margin calculation -MargeType1=Margin on Best supplier price +MargeType1=Margin on Best vendor price MargeType2=Margin on Weighted Average Price (WAP) MargeType3=Margin on Cost Price -MarginTypeDesc=* Margin on best buying price = Selling price - Best supplier price defined on product card
    * Margin on Weighted Average Price (WAP) = Selling price - Product Weighted Average Price (WAP) or best supplier price if WAP not yet defined
    * Margin on Cost price = Selling price - Cost price defined on product card or WAP if cost price not defined, or best supplier price if WAP not yet defined +MarginTypeDesc=* Margin on best buying price = Selling price - Best vendor price defined on product card
    * Margin on Weighted Average Price (WAP) = Selling price - Product Weighted Average Price (WAP) or best supplier price if WAP not yet defined
    * Margin on Cost price = Selling price - Cost price defined on product card or WAP if cost price not defined, or best supplier price if WAP not yet defined CostPrice=Cost price UnitCharges=Unit charges Charges=Charges diff --git a/htdocs/langs/en_US/opensurvey.lang b/htdocs/langs/en_US/opensurvey.lang index 1f8a90b5657..0819a077f71 100644 --- a/htdocs/langs/en_US/opensurvey.lang +++ b/htdocs/langs/en_US/opensurvey.lang @@ -57,4 +57,5 @@ ErrorInsertingComment=There was an error while inserting your comment MoreChoices=Enter more choices for the voters SurveyExpiredInfo=The poll has been closed or voting delay has expired. EmailSomeoneVoted=%s has filled a line.\nYou can find your poll at the link: \n%s -ShowSurvey=Show survey \ No newline at end of file +ShowSurvey=Show survey +UserMustBeSameThanUserUsedToVote=You must have voted and use the same user name, that the one used to vote, to post a comment \ No newline at end of file diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 8ab5b85b7e6..06191d9f7b7 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -1,6 +1,6 @@ # Dolibarr language file - Source file is en_US - orders OrdersArea=Customers orders area -SuppliersOrdersArea=Suppliers orders area +SuppliersOrdersArea=Purchase orders area OrderCard=Order card OrderId=Order Id Order=Order @@ -13,18 +13,18 @@ OrderToProcess=Order to process NewOrder=New order ToOrder=Make order MakeOrder=Make order -SupplierOrder=Supplier order -SuppliersOrders=Suppliers orders -SuppliersOrdersRunning=Current suppliers orders -CustomerOrder=Customer order -CustomersOrders=Customer orders +SupplierOrder=Purchase order +SuppliersOrders=Purchase orders +SuppliersOrdersRunning=Current purchase orders +CustomerOrder=Customer Order +CustomersOrders=Customer Orders CustomersOrdersRunning=Current customer orders CustomersOrdersAndOrdersLines=Customer orders and order lines OrdersDeliveredToBill=Customer orders delivered to bill OrdersToBill=Customer orders delivered OrdersInProcess=Customer orders in process OrdersToProcess=Customer orders to process -SuppliersOrdersToProcess=Supplier orders to process +SuppliersOrdersToProcess=Purchase orders to process StatusOrderCanceledShort=Canceled StatusOrderDraftShort=Draft StatusOrderValidatedShort=Validated @@ -75,15 +75,15 @@ ShowOrder=Show order OrdersOpened=Orders to process NoDraftOrders=No draft orders NoOrder=No order -NoSupplierOrder=No supplier order +NoSupplierOrder=No purchase order LastOrders=Latest %s customer orders LastCustomerOrders=Latest %s customer orders -LastSupplierOrders=Latest %s supplier orders +LastSupplierOrders=Latest %s purchase orders LastModifiedOrders=Latest %s modified orders AllOrders=All orders NbOfOrders=Number of orders OrdersStatistics=Order's statistics -OrdersStatisticsSuppliers=Supplier order's statistics +OrdersStatisticsSuppliers=Purchase order statistics NumberOfOrdersByMonth=Number of orders by month AmountOfOrdersByMonthHT=Amount of orders by month (net of tax) ListOfOrders=List of orders @@ -97,12 +97,12 @@ ConfirmMakeOrder=Are you sure you want to confirm you made this order on %s%s? DispatchSupplierOrder=Receiving supplier order %s FirstApprovalAlreadyDone=First approval already done SecondApprovalAlreadyDone=Second approval already done -SupplierOrderReceivedInDolibarr=Supplier order %s received %s -SupplierOrderSubmitedInDolibarr=Supplier order %s submited -SupplierOrderClassifiedBilled=Supplier order %s set billed +SupplierOrderReceivedInDolibarr=Purchase Order %s received %s +SupplierOrderSubmitedInDolibarr=Purchase Order %s submited +SupplierOrderClassifiedBilled=Purchase Order %s set billed OtherOrders=Other orders ##### Types de contacts ##### TypeContact_commande_internal_SALESREPFOLL=Representative following-up customer order @@ -125,11 +125,11 @@ TypeContact_commande_internal_SHIPPING=Representative following-up shipping TypeContact_commande_external_BILLING=Customer invoice contact TypeContact_commande_external_SHIPPING=Customer shipping contact TypeContact_commande_external_CUSTOMER=Customer contact following-up order -TypeContact_order_supplier_internal_SALESREPFOLL=Representative following-up supplier order +TypeContact_order_supplier_internal_SALESREPFOLL=Representative following-up purchase order TypeContact_order_supplier_internal_SHIPPING=Representative following-up shipping -TypeContact_order_supplier_external_BILLING=Supplier invoice contact -TypeContact_order_supplier_external_SHIPPING=Supplier shipping contact -TypeContact_order_supplier_external_CUSTOMER=Supplier contact following-up order +TypeContact_order_supplier_external_BILLING=Vendor invoice contact +TypeContact_order_supplier_external_SHIPPING=Vendor shipping contact +TypeContact_order_supplier_external_CUSTOMER=Vendor contact following-up order Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constant COMMANDE_SUPPLIER_ADDON not defined Error_COMMANDE_ADDON_NotDefined=Constant COMMANDE_ADDON not defined Error_OrderNotChecked=No orders to invoice selected diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 2afabe43b06..04b38e531ef 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -218,7 +218,7 @@ FileIsTooBig=Files is too big PleaseBePatient=Please be patient... NewPassword=New password ResetPassword=Reset password -RequestToResetPasswordReceived=A request to change your Dolibarr password has been received +RequestToResetPasswordReceived=A request to change your password has been received NewKeyIs=This is your new keys to login NewKeyWillBe=Your new key to login to software will be ClickHereToGoTo=Click here to go to %s diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index e5393466c3d..a8f9f815cb6 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -70,6 +70,7 @@ SoldAmount=Sold amount PurchasedAmount=Purchased amount NewPrice=New price MinPrice=Min. selling price +EditSellingPriceLabel=Edit selling price label CantBeLessThanMinPrice=The selling price can't be lower than minimum allowed for this product (%s without tax). This message can also appears if you type a too important discount. ContractStatusClosed=Closed ErrorProductAlreadyExists=A product with reference %s already exists. @@ -332,4 +333,4 @@ ConfirmCloneProductCombinations=Would you like to copy all the product variants CloneDestinationReference=Destination product reference ErrorCopyProductCombinations=There was an error while copying the product variants ErrorDestinationProductNotFound=Destination product not found -ErrorProductCombinationNotFound=Product variant not found \ No newline at end of file +ErrorProductCombinationNotFound=Product variant not found diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 31873ad527e..d1b1f85224f 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -202,4 +202,5 @@ inventoryDeleteLine=Delete line RegulateStock=Regulate Stock ListInventory=List StockSupportServices=Stock management support services -StockSupportServicesDesc=By default, you can stock only product with type "product". If on, and if module service is on, you can also stock a product with type "service" \ No newline at end of file +StockSupportServicesDesc=By default, you can stock only product with type "product". If on, and if module service is on, you can also stock a product with type "service" +ReceiveProducts=Receive products \ No newline at end of file diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang index d5b51978920..ef2e7242e31 100644 --- a/htdocs/langs/en_US/supplier_proposal.lang +++ b/htdocs/langs/en_US/supplier_proposal.lang @@ -1,22 +1,22 @@ # Dolibarr language file - Source file is en_US - supplier_proposal -SupplierProposal=Supplier commercial proposals -supplier_proposalDESC=Manage price requests to suppliers +SupplierProposal=Vendor commercial proposals +supplier_proposalDESC=Manage price requests to vendors SupplierProposalNew=New price request CommRequest=Price request CommRequests=Price requests SearchRequest=Find a request DraftRequests=Draft requests -SupplierProposalsDraft=Draft supplier proposals +SupplierProposalsDraft=Draft vendor proposals LastModifiedRequests=Latest %s modified price requests RequestsOpened=Open price requests -SupplierProposalArea=Supplier proposals area -SupplierProposalShort=Supplier proposal -SupplierProposals=Supplier proposals -SupplierProposalsShort=Supplier proposals +SupplierProposalArea=Vendor proposals area +SupplierProposalShort=Vendor proposal +SupplierProposals=Vendor proposals +SupplierProposalsShort=Vendor proposals NewAskPrice=New price request ShowSupplierProposal=Show price request AddSupplierProposal=Create a price request -SupplierProposalRefFourn=Supplier ref +SupplierProposalRefFourn=Vendor ref SupplierProposalDate=Delivery date SupplierProposalRefFournNotice=Before closing to "Accepted", think to grasp suppliers references. ConfirmValidateAsk=Are you sure you want to validate this price request under name %s? @@ -47,9 +47,9 @@ CommercialAsk=Price request DefaultModelSupplierProposalCreate=Default model creation DefaultModelSupplierProposalToBill=Default template when closing a price request (accepted) DefaultModelSupplierProposalClosed=Default template when closing a price request (refused) -ListOfSupplierProposals=List of supplier proposal requests -ListSupplierProposalsAssociatedProject=List of supplier proposals associated with project -SupplierProposalsToClose=Supplier proposals to close -SupplierProposalsToProcess=Supplier proposals to process +ListOfSupplierProposals=List of vendor proposal requests +ListSupplierProposalsAssociatedProject=List of vendor proposals associated with project +SupplierProposalsToClose=Vendor proposals to close +SupplierProposalsToProcess=Vendor proposals to process LastSupplierProposals=Latest %s price requests AllPriceRequests=All requests diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index f9e383e09af..d0cf540d3eb 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -1,11 +1,11 @@ # Dolibarr language file - Source file is en_US - suppliers -Suppliers=Suppliers -SuppliersInvoice=Suppliers invoice -ShowSupplierInvoice=Show Supplier Invoice -NewSupplier=New supplier +Suppliers=Vendors +SuppliersInvoice=Vendor invoice +ShowSupplierInvoice=Show Vendor Invoice +NewSupplier=New vendor History=History -ListOfSuppliers=List of suppliers -ShowSupplier=Show supplier +ListOfSuppliers=List of vendors +ShowSupplier=Show vendor OrderDate=Order date BuyingPriceMin=Best buying price BuyingPriceMinShort=Best buying price @@ -14,34 +14,34 @@ TotalSellingPriceMinShort=Total of subproducts selling prices SomeSubProductHaveNoPrices=Some sub-products have no price defined AddSupplierPrice=Add buying price ChangeSupplierPrice=Change buying price -SupplierPrices=Supplier prices +SupplierPrices=Vendor prices ReferenceSupplierIsAlreadyAssociatedWithAProduct=This reference supplier is already associated with a reference: %s -NoRecordedSuppliers=No suppliers recorded -SupplierPayment=Supplier payment -SuppliersArea=Suppliers area -RefSupplierShort=Ref. supplier +NoRecordedSuppliers=No vendor recorded +SupplierPayment=Vendor payment +SuppliersArea=Vendor area +RefSupplierShort=Ref. vendor Availability=Availability -ExportDataset_fournisseur_1=Supplier invoices list and invoice lines -ExportDataset_fournisseur_2=Supplier invoices and payments -ExportDataset_fournisseur_3=Supplier orders and order lines +ExportDataset_fournisseur_1=Vendor invoices list and invoice lines +ExportDataset_fournisseur_2=Vendor invoices and payments +ExportDataset_fournisseur_3=Purchase orders and order lines ApproveThisOrder=Approve this order ConfirmApproveThisOrder=Are you sure you want to approve order %s? DenyingThisOrder=Deny this order ConfirmDenyingThisOrder=Are you sure you want to deny this order %s? ConfirmCancelThisOrder=Are you sure you want to cancel this order %s? -AddSupplierOrder=Create supplier order -AddSupplierInvoice=Create supplier invoice -ListOfSupplierProductForSupplier=List of products and prices for supplier %s -SentToSuppliers=Sent to suppliers -ListOfSupplierOrders=List of supplier orders -MenuOrdersSupplierToBill=Supplier orders to invoice +AddSupplierOrder=Create Purchase Order +AddSupplierInvoice=Create vendor invoice +ListOfSupplierProductForSupplier=List of products and prices for vendor %s +SentToSuppliers=Sent to vendors +ListOfSupplierOrders=List of purchase orders +MenuOrdersSupplierToBill=Purchase orders to invoice NbDaysToDelivery=Delivery delay in days DescNbDaysToDelivery=The biggest deliver delay of the products from this order -SupplierReputation=Supplier reputation +SupplierReputation=Vendor reputation DoNotOrderThisProductToThisSupplier=Do not order NotTheGoodQualitySupplier=Wrong quality ReputationForThisProduct=Reputation BuyerName=Buyer name AllProductServicePrices=All product / service prices AllProductReferencesOfSupplier=All product / service references of supplier -BuyingPriceNumShort=Supplier prices +BuyingPriceNumShort=Vendor prices diff --git a/htdocs/langs/en_US/ticketsup.lang b/htdocs/langs/en_US/ticketsup.lang index 3ce1b9c44ce..84cc786ef6d 100644 --- a/htdocs/langs/en_US/ticketsup.lang +++ b/htdocs/langs/en_US/ticketsup.lang @@ -103,7 +103,7 @@ TicketPublicInterfaceTopicHelp=This text will appear as the title of the public TicketPublicInterfaceTextHelpMessageLabelAdmin=Help text to the message entry TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the message input area of the user. ExtraFieldsTicketSup=Extra attributes -TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL contant equal to 1 +TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL content to 1 to get it. TicketsDisableEmail=Do not send ticket creation or message send emails TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications TicketsLogEnableEmail=Enable log by email @@ -171,7 +171,6 @@ TicketChangeType=Change type TicketChangeCategory=Change category TicketChangeSeverity=Change severity TicketAddMessage=Add a message -TicketEditProperties=Edit properties AddMessage=Add a message MessageSuccessfullyAdded=Ticket added TicketMessageSuccessfullyAdded=Message successfully added diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index eba04cc44d1..ed19a531c07 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -14,7 +14,7 @@ descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source custome descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid (and if amount of the invoice is same than total amount of linked orders) descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source customer order to shipped when a shipment is validated (and if quantity shipped by all shipments is the same as in the order to update) # Autoclassify supplier order -descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source supplier proposal(s) to billed when supplier invoice is validated (and if amount of the invoice is same than total amount of linked proposals) -descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source supplier order(s) to billed when supplier invoice is validated (and if amount of the invoice is same than total amount of linked orders) +descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal(s) to billed when vendor invoice is validated (and if amount of the invoice is same than total amount of linked proposals) +descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source purchase order(s) to billed when vendor invoice is validated (and if amount of the invoice is same than total amount of linked orders) AutomaticCreation=Automatic creation AutomaticClassification=Automatic classification \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 4d32e4fd948..49a80dabe7a 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1169,6 +1169,7 @@ BrowserIsKO=Vous utilisez le navigateur %s. Ce navigateur est déconseillé pour XDebugInstalled=XDebug est chargé. XCacheInstalled=XCache est chargé. AddRefInList=Afficher les références client/fournisseur dans les listes (listes déroulantes ou à autocomplétion) et les libellés des liens clicables. Les tiers apparaîtront alors sous la forme "CC12345 - SC45678 - La big company coorp", au lieu de "La big company coorp". +OnSearchAndListGoOnCustomerOrSupplierCard = A la recherche, ou sur une liste, aller directement sur la fiche client ou fournisseur (si le tiers est client ou fournisseur) AskForPreferredShippingMethod=Demander la méthode d'expédition préférée pour les tiers. FieldEdition=Édition du champ %s FillThisOnlyIfRequired=Exemple: +2 (ne remplir que si un décalage d'heure est constaté dans l'export) diff --git a/htdocs/langs/fr_FR/ticketsup.lang b/htdocs/langs/fr_FR/ticketsup.lang index 843d33462d3..c53b53bd759 100644 --- a/htdocs/langs/fr_FR/ticketsup.lang +++ b/htdocs/langs/fr_FR/ticketsup.lang @@ -115,8 +115,6 @@ TicketsShowCompanyLogo=Afficher le logo de la société dans l'interface publiqu TicketsShowCompanyLogoHelp=Enable this option to hide the logo of the main company in the pages of the public interface TicketsEmailAlsoSendToMainAddress=Also send notification to main email address TicketsEmailAlsoSendToMainAddressHelp=Enable this option to send an email to "Notification email from" address (see setup below) -TicketsShowExtrafieldsIntoPublicArea=Show Extras fields in the public interface -TicketsShowExtrafieldsIntoPublicAreaHelp=When this option is enabled, additional attributes defined on the tickets will be shown in the public interface of ticket creation. TicketsLimitViewAssignedOnly=Restrict the display to tickets assigned to the current user (not effective for external users, always be limited to the thirdparty they depend on) TicketsLimitViewAssignedOnlyHelp=Seuls les tickets affectés à l'utilisateur actuel seront visibles. Ne s'applique pas à un utilisateur disposant de droits de gestion des tickets. TicketsActivatePublicInterface=Activer l'interface publique @@ -129,8 +127,6 @@ TicketNotifyTiersAtCreation=Notifier le tiers à la création # # About page # -About=À propos -TicketSupAbout=À propos du module Ticket TicketSupAboutModule=The development of this module has been initiated by the company Libr&thic. TicketSupAboutModuleHelp=You can get help by using the contact form on the website librethic.io TicketSupAboutModuleImprove=Feel free to suggest improvements! Please visit the project page on Doliforge website to report bugs and add tasks. diff --git a/htdocs/loan/calc.php b/htdocs/loan/calc.php index 434d57b43c2..fedf26e6a36 100644 --- a/htdocs/loan/calc.php +++ b/htdocs/loan/calc.php @@ -28,7 +28,7 @@ $default_sale_price = "150000"; $default_annual_interest_percent = 7.0; $default_year_term = 30; $default_down_percent = 10; -$default_show_progress = TRUE; +$default_show_progress = true; /* --------------------------------------------------- * * Initialize Variables @@ -241,7 +241,7 @@ if ($form_complete && $monthly_payment) print ''; print ''; */ - + print '
    '; print ''; print ''; print ''; - ($current_month % 12) ? $show_legend = FALSE : $show_legend = TRUE; + ($current_month % 12) ? ($show_legend = false) : ($show_legend = true); if ($show_legend) { print ''; diff --git a/htdocs/loan/calcmens.php b/htdocs/loan/calcmens.php index 96c8b5204b8..fbe1cecab2d 100644 --- a/htdocs/loan/calcmens.php +++ b/htdocs/loan/calcmens.php @@ -21,16 +21,10 @@ * \file tvi/ajax/list.php * \brief File to return datables output */ -if (! defined('NOTOKENRENEWAL')) - define('NOTOKENRENEWAL', '1'); // Disables token renewal -if (! defined('NOREQUIREMENU')) - define('NOREQUIREMENU', '1'); - // if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); -if (! defined('NOREQUIREAJAX')) - define('NOREQUIREAJAX', '1'); - // if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); - // if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); require '../main.inc.php'; require DOL_DOCUMENT_ROOT.'/loan/class/loanschedule.class.php'; diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 59b4da544db..53cf9e7cb82 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -702,7 +702,6 @@ if ($id > 0) print ''; print ''; - $var=True; while ($i < $num) { $objp = $db->fetch_object($resql); diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index 24ea1ab72f9..7a6bee5d79f 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -37,7 +37,7 @@ $socid = GETPOST('socid', 'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'loan', '', '', ''); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -91,6 +91,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -114,7 +119,9 @@ if ($resql) $newcardbutton=''; if ($user->rights->loan->write) { - $newcardbutton=''.$langs->trans('NewLoan').''; + $newcardbutton=''.$langs->trans('NewLoan'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''."\n"; diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 206e3e64de7..47efb9c8cde 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -40,7 +40,7 @@ if ($user->societe_id) $socid=$user->societe_id; //$result = restrictedArea($user, 'facture', $id,''); $payment = new PaymentLoan($db); -if ($id > 0) +if ($id > 0) { $result=$payment->fetch($id); if (! $result) dol_print_error($db,'Failed to get payment id '.$id); @@ -76,7 +76,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->loan->wri $db->begin(); $result=$payment->valide(); - + if ($result > 0) { $db->commit(); @@ -141,7 +141,7 @@ if ($action == 'delete') if ($action == 'valide') { $facid = $_GET['facid']; - print $form->formconfirm('card.php?id='.$payment->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); + print $form->formconfirm('card.php?id='.$payment->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); } @@ -220,13 +220,10 @@ if ($resql) if ($num > 0) { - $var=True; - while ($i < $num) { $objp = $db->fetch_object($resql); - print ''; // Ref print '
    TOTAL Monthly Payment:' . number_format(($monthly_payment + $pmi_per_month + $residential_monthly_tax), "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '
    '; @@ -352,7 +352,7 @@ if ($form_complete && $show_progress) { print '
    ' . number_format($remaining_balance, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '
    '.$langs->trans("LoanCapital").'
    '; @@ -250,7 +247,7 @@ if ($resql) $i++; } } - + print "
    \n"; $db->free($resql); diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index bea15f288a0..8faac08fb60 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -245,9 +245,6 @@ if ($action == 'create') print '
    '.$langs->trans("Amount").'
    '; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index ef99e593b82..ad1fc773bd3 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -258,8 +258,6 @@ if ($result) if ($num > 0) { - $var=True; - while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); @@ -278,8 +276,6 @@ if ($result) $markRate = ($pv != 0)?(100 * $marge / $pv):'' ; } - - print '
    '; diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 605a4272081..94eff1911e7 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -193,11 +193,9 @@ if ($id > 0 || ! empty($ref)) $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); if ($num > 0) { - $var=True; while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); - $marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ; $markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 5d80814099d..eb61e4ec41f 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -199,7 +199,6 @@ if ($socid > 0) if ($num > 0) { - $var=True; while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); @@ -207,8 +206,6 @@ if ($socid > 0) $marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ; $markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ; - - print '
    '; $invoicestatic->id=$objp->facid; diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index a068715b521..b4abf60861e 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -192,7 +192,7 @@ class MyModuleApi extends DolibarrApi * * @url POST myobjects/ */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->myobject->create) { throw new RestException(401); @@ -218,7 +218,7 @@ class MyModuleApi extends DolibarrApi * * @url PUT myobjects/{id} */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->myobject->create) { throw new RestException(401); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index b6aa06cb273..9815d664ae3 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -335,62 +335,65 @@ class MyObject extends CommonObject } /** - * Retourne le libelle du status d'un user (actif, inactif) + * Return label of the status * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @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 */ function getLibStatut($mode=0) { - return $this->LibStatut($this->status,$mode); + return $this->LibStatut($this->status, $mode); } /** * 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 + * @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 */ - static function LibStatut($status,$mode=0) + static function LibStatut($status, $mode=0) { - global $langs; + if (empty($this->labelstatus)) + { + global $langs; + //$langs->load("mymodule"); + $this->labelstatus[1] = $langs->trans('Enabled'); + $this->labelstatus[0] = $langs->trans('Disabled'); + } if ($mode == 0) { - $prefix=''; - if ($status == 1) return $langs->trans('Enabled'); - if ($status == 0) return $langs->trans('Disabled'); + return $this->labelstatus[$status]; } if ($mode == 1) { - if ($status == 1) return $langs->trans('Enabled'); - if ($status == 0) return $langs->trans('Disabled'); + return $this->labelstatus[$status]; } if ($mode == 2) { - if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); - if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; + if ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; } if ($mode == 3) { - if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); - if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4'); + if ($status == 0) return img_picto($this->labelstatus[$status],'statut5'); } if ($mode == 4) { - if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); - if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; + if ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; } if ($mode == 5) { - if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); - if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); + if ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); } if ($mode == 6) { - if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); - if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); + if ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); } } diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php index b8b39dd6e8b..cd9a4b6035b 100644 --- a/htdocs/modulebuilder/template/css/mymodule.css.php +++ b/htdocs/modulebuilder/template/css/mymodule.css.php @@ -48,7 +48,7 @@ if (! $res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -session_cache_limiter(FALSE); +session_cache_limiter(false); // Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS /*if (empty($user->id) && ! empty($_SESSION['dol_login'])) diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 3d5638bd270..5b2a1213c0f 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -22,22 +22,25 @@ * \brief Page to create/edit/view myobject */ -//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('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test done when option 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('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 -//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'); -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); +//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("FORCECSP")) define('FORCECSP','none'); // Disable all Content Security Policies + // Load Dolibarr environment $res=0; @@ -118,6 +121,7 @@ if (empty($reshook)) $permissiontoadd = $user->rights->mymodule->write; $permissiontodelete = $user->rights->mymodule->delete; + if (empty($backtopage)) $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).'?id=__ID__'; $backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1); $triggermodname = 'MYMODULE_MODIFY'; diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 8ce85b8eee6..905f16d8780 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -81,8 +81,8 @@ $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] . "/packages/" . dol_sanitizeFileName($object->id); -if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->ref); +//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); /* diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 1ed34d5681c..8d4cf6439a4 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -22,23 +22,23 @@ * \brief List page for myobject */ -//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('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test done when option 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('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 -//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'); -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); - +//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 // Load Dolibarr environment $res=0; @@ -132,7 +132,7 @@ foreach($object->fields as $key => $val) 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'])) +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) { @@ -262,14 +262,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } -// if total resultset is smaller then paging size (filtering), goto and load page 0 -if (($page * $limit) > $nbtotalofrecords) -{ - $page = 0; - $offset = 0; -} -// if total resultset is smaller the limit, no need to do paging. +// if total resultset is smaller than limit, no need to do paging adn restart select with limits. if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; @@ -350,7 +349,15 @@ print ''; print ''; print ''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); +$newcardbutton=''; +//if ($user->rights->mymodule->creer) +//{ + $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="SendMyObjectRef"; @@ -439,9 +446,12 @@ print '
    '.$transRecordedType.'
    '.dol_trunc($objp->label,32).'
    '; $orderstatic->id=$objp->commandeid; diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 4526af86f96..63bb9028a4e 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -220,12 +220,11 @@ if ($id > 0 || ! empty($ref)) { print "
    '; $supplierorderstatic->id = $objp->commandeid; $supplierorderstatic->ref = $objp->ref; diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index ef3723e2e55..ed4d989011e 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -177,7 +177,6 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var=True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 794d939bc6e..47abbee30a0 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -234,7 +234,6 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var=True; while ($i < min($num,$conf->liste_limit)) { $objp = $db->fetch_object($result); diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 47ca357b0cd..e17d03fe7e9 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -213,7 +213,6 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var = True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 3173a04ee55..36dcc945fe1 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -216,13 +216,11 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var = True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); - $var = ! $var; - print '
    '; $propalstatic->id=$objp->propalid; $propalstatic->ref=$objp->ref; diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 07e8015d846..587d024b4c4 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -137,7 +137,7 @@ if ($id > 0 || ! empty($ref)) if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc"; $sql .= " WHERE p.fk_soc = s.rowid"; - $sql .= " AND p.entity IN (".getEntity('propal').")"; + $sql .= " AND p.entity IN (".getEntity('supplier_proposal').")"; $sql .= " AND d.fk_supplier_proposal = p.rowid"; $sql .= " AND d.fk_product =" . $product->id; if (! empty($search_month)) @@ -216,13 +216,11 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var = True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); - $var = ! $var; - print '
    '; $propalstatic->id=$objp->propalid; $propalstatic->ref=$objp->ref; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 1566e5d36c0..4fccbf4622f 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -460,7 +460,6 @@ else { $num = $db->num_rows($resql); $i = 0; - $var=True; while ($i < $num) { $objp = $db->fetch_object($resql); @@ -491,7 +490,7 @@ else $productstatic->label = $objp->produit; $productstatic->type=$objp->type; $productstatic->entity=$objp->entity; - $productstatic->status_batch=$objp->tobatch; + $productstatic->status_batch=$objp->tobatch; print $productstatic->getNomUrl(1,'stock',16); print '
    '."\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -470,9 +486,8 @@ print ''; print "\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; print ''; @@ -498,7 +513,8 @@ if (! empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)) } } -$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse); // $daytoparse is a date with hours = 0 +$statusofholidaytocheck = '3'; +$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse, $statusofholiday); // $daytoparse is a date with hours = 0 $isavailable[$daytoparse]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day $tmparray = dol_getdate($daytoparse,true); // detail of current day @@ -522,7 +538,7 @@ print ''; print ''; print "\n"; -$colspan = 8; +$colspan = 6+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2);; if ($conf->use_javascript_ajax) { @@ -607,13 +623,9 @@ if (count($tasksarray) > 0) if ($isdiff) { print ''; - print ''; - print ''; - print ''; - print ''; - print ''; print ''; print '
    '.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("Task").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("Note").'
    '; + print ''; print $langs->trans("OtherFilteredTasks"); print ''; $timeonothertasks=($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]); diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index b7d731d786b..3f2c5255143 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -70,6 +70,7 @@ $search_task_ref=GETPOST('search_task_ref', 'alpha'); $search_task_label=GETPOST('search_task_label', 'alpha'); $search_project_ref=GETPOST('search_project_ref', 'alpha'); $search_thirdparty=GETPOST('search_thirdparty', 'alpha'); +$search_declared_progress=GETPOST('search_declared_progress', 'alpha'); $startdayarray=dol_get_first_day_week($day, $month, $year); @@ -124,6 +125,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_task_label = ''; $search_project_ref = ''; $search_thirdparty = ''; + $search_declared_progress = ''; } if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha')) { @@ -290,6 +292,7 @@ if ($action == 'addtime' && $user->rights->projet->lire) $param.=($search_project_ref?'&search_project_ref='.$search_project_ref:''); $param.=($search_usertoprocessid > 0?'&search_usertoprocessid='.$search_usertoprocessid:''); $param.=($search_thirdparty?'&search_thirdparty='.$search_thirdparty:''); + $param.=($search_declared_progress?'&search_declared_progress='.$search_declared_progress:''); $param.=($search_task_ref?'&search_task_ref='.$search_task_ref:''); $param.=($search_task_label?'&search_task_label='.$search_task_label:''); @@ -333,6 +336,7 @@ if ($search_project_ref) $morewherefilter.=natural_search("p.ref", $search_proje if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); +if ($search_declared_progress) $morewherefilter.=natural_search("t.progress", $search_declared_progress, 1); $tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. if ($morewherefilter) // Get all task without any filter, so we can show total of time spent for not visible tasks @@ -411,7 +415,7 @@ print '
    '; $formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); print '
    '; print ' '; -print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth200'); +print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); print ''; print ''; @@ -445,7 +449,9 @@ for ($idw=0; $idw<7; $idw++) //print dol_print_date($dayinloopwithouthours, 'dayhour').' '; //print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour').'
    '; - $isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow); + $statusofholidaytocheck = '3'; + + $isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow, $statusofholidaytocheck); $isavailable[$dayinloopfromfirstdaytoshow]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day } @@ -471,6 +477,19 @@ 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.=''; +if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) +{ + $moreforfilter.='
    '; + $moreforfilter.='
    '.$langs->trans('Project'). '
    '; + $moreforfilter.=''; + $moreforfilter.='
    '; + + $moreforfilter.='
    '; + $moreforfilter.='
    '.$langs->trans('ThirdParty'). '
    '; + $moreforfilter.=''; + $moreforfilter.='
    '; +} + if (! empty($moreforfilter)) { print '
    '; @@ -485,12 +504,11 @@ print '
    '; print ''."\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; for ($idw=0;$idw<7;$idw++) @@ -505,9 +523,8 @@ print ''; print "\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; print ''; @@ -540,7 +557,7 @@ for ($idw=0; $idw<7; $idw++) print ''; print "\n"; -$colspan=7; +$colspan=5+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2); if ($conf->use_javascript_ajax) { @@ -634,7 +651,7 @@ if (count($tasksarray) > 0) if ($isdiff) { print ''; - print ''; for ($idw = 0; $idw < 7; $idw++) diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index b1cf4d9773b..4135d547be3 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -274,12 +274,11 @@ elseif ($action == 'updateoptions') $conf->global->PROJECT_USE_SEARCH_TO_SELECT = $companysearch; } } -} -else if ($action == "linkOtherCompany") -{ - $projectToSelect = GETPOST('projectToSelect'); - - dolibarr_set_const($db, 'PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY', $projectToSelect, 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value + if (GETPOST('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) + { + $projectToSelect = GETPOST('projectToSelect','alpha'); + dolibarr_set_const($db, 'PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY', $projectToSelect, 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value + } } diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index bf98938074d..ab157bf237c 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -179,7 +179,7 @@ class Projects extends DolibarrApi * @param array $request_data Request data * @return int ID of project */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401, "Insuffisant rights"); @@ -300,7 +300,7 @@ class Projects extends DolibarrApi * @return int */ /* - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } @@ -362,7 +362,7 @@ class Projects extends DolibarrApi * @return object */ /* - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } @@ -418,7 +418,7 @@ class Projects extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 81e28663cc4..3125546c10a 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -187,7 +187,7 @@ class Tasks extends DolibarrApi * @param array $request_data Request data * @return int ID of project */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401, "Insuffisant rights"); @@ -305,7 +305,7 @@ class Tasks extends DolibarrApi * @return int */ /* - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } @@ -367,7 +367,7 @@ class Tasks extends DolibarrApi * @return object */ /* - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } @@ -422,7 +422,7 @@ class Tasks extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } diff --git a/htdocs/projet/jsgantt_language.js.php b/htdocs/projet/jsgantt_language.js.php index a702432998e..79280868ecb 100644 --- a/htdocs/projet/jsgantt_language.js.php +++ b/htdocs/projet/jsgantt_language.js.php @@ -20,10 +20,7 @@ * \brief Fichier de javascript de traduction pour JSGantt */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url. if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); if (! defined('NOLOGIN')) define('NOLOGIN',1); @@ -31,7 +28,6 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); - require_once __DIR__.'/../main.inc.php'; // Define mime type diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index e57eab2d109..94a3850fe33 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Claudio Aschieri + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -372,6 +373,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1,$offset); @@ -441,7 +447,9 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->projet->creer) { - $newcardbutton = ''.$langs->trans('NewProject').''; + $newcardbutton = ''.$langs->trans('NewProject'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''; @@ -657,7 +665,7 @@ if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters=array('arrayfields'=>$arrayfields); +$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index 67504974759..5f6c526d1d5 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -322,7 +322,7 @@ foreach ($data_all_year as $val) while ($year && $oldyear > $year+1) { // If we have empty year $oldyear--; - + print ''; print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) @@ -334,7 +334,7 @@ foreach ($data_all_year as $val) print ''; print ''; } - + print ''; print ''; print ''; @@ -352,7 +352,7 @@ print '
    '.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("Task").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").'
    '; + print ''; print $langs->trans("OtherFilteredTasks"); print '
    0?'&userid='.$userid:'').'">'.$oldyear.'0
    0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].'
    '; print '
    '; -$stringtoshow.= ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine=0; -foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) -{ - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object +if (! empty($extrafields->attributes[$object->table_element]['computed'])) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) + { + if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + } } - // Loop on record // -------------------------------------------------------------------- $i=0; @@ -676,18 +694,18 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb { $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->ticketsup->read; $delallowed=$user->rights->ticketsup->write; - + print $formfile->showdocuments('massfilesarea_ticketsup','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty); } diff --git a/htdocs/ticketsup/new.php b/htdocs/ticketsup/new.php index 0428f5286c2..9fe7411186a 100644 --- a/htdocs/ticketsup/new.php +++ b/htdocs/ticketsup/new.php @@ -88,7 +88,7 @@ if ($action == 'create_ticket') { $defaultref = ''; } - $formticket->showForm(); + $formticket->showForm(1); } //$somethingshown=$object->showLinkedObjectBlock(); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 192ff3b1191..48dc1049706 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -818,10 +818,17 @@ if ($action == 'create' || $action == 'adduserldap') $valuetoshow.= ($valuetoshow?', ':'').''; } } + + // Other form for user password + $parameters=array('valuetoshow' => $valuetoshow, 'password' => $password); + $reshook=$hookmanager->executeHooks('printUserPasswordField',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if ($reshook > 0) $valuetoshow=$hookmanager->resPrint; // to replace + else $valuetoshow.=$hookmanager->resPrint; // to add + print $valuetoshow; print ''; - if(! empty($conf->api->enabled)) + if (! empty($conf->api->enabled)) { // API key $generated_api_key = ''; @@ -1363,6 +1370,13 @@ else else $valuetoshow.= ($valuetoshow?(' '.$langs->trans("or").' '):'').$langs->trans("Hidden"); } } + + // Other form for user password + $parameters=array('valuetoshow' => $valuetoshow); + $reshook=$hookmanager->executeHooks('printUserPasswordField',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if ($reshook > 0) $valuetoshow=$hookmanager->resPrint; // to replace + else $valuetoshow.=$hookmanager->resPrint; // to add + print $valuetoshow; print ""; print ''."\n"; @@ -1923,6 +1937,13 @@ else $valuetoshow.=($valuetoshow?(' '.$langs->trans("or").' '):'').preg_replace('/./i','*',$object->pass); } } + + // Other form for user password + $parameters=array('valuetoshow' => $valuetoshow, 'caneditpassword' => $caneditpassword); + $reshook=$hookmanager->executeHooks('printUserPasswordField',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if ($reshook > 0) $valuetoshow=$hookmanager->resPrint; // to replace + else $valuetoshow.=$hookmanager->resPrint; // to add + print $valuetoshow; print "\n"; @@ -2033,7 +2054,7 @@ else else { $type=0; - if ($object->contact_id) $type=$object->contact_id; + if ($object->contactid) $type=$object->contactid; print $form->selectcontacts(0,$type,'contactid',2,'','',1,'',false,1); if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')'; } @@ -2203,12 +2224,12 @@ else print ''; print ""; diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index c30cacd72c0..556b86332bc 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -162,7 +162,7 @@ class Users extends DolibarrApi * @param array $request_data New user data * @return int */ - function post($request_data = NULL) { + function post($request_data = null) { // check user authorization //if(! DolibarrApiAccess::$user->rights->user->creer) { // throw new RestException(401, "User creation not allowed"); @@ -194,7 +194,7 @@ class Users extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { //if (!DolibarrApiAccess::$user->rights->user->user->creer) { //throw new RestException(401); //} diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index cf0c23f9fec..c5dcb7a53bd 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -141,7 +141,9 @@ if ($resql) $newcardbutton=''; if ($caneditperms) { - $newcardbutton=''.$langs->trans('NewGroup').''; + $newcardbutton=''.$langs->trans('NewGroup'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''."\n"; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 3521b4bbde0..b3b0ff91ff8 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -277,7 +277,9 @@ $text = $langs->trans("ListOfUsers"); $newcardbutton=''; if ($canadduser) { - $newcardbutton=''.$langs->trans('NewUser').''; + $newcardbutton=''.$langs->trans('NewUser'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''."\n"; diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 096567d728a..2bcf4fc0663 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -411,6 +411,11 @@ if ($result > 0) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index cde5c5199e0..584fa6f2427 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -96,7 +96,7 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) if ($action == 'buildnewpassword' && $username) { $sessionkey = 'dol_antispam_value'; - $ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); + $ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); // Verify code if (! $ok) diff --git a/htdocs/variants/ajax/getCombinations.php b/htdocs/variants/ajax/getCombinations.php index 5c57191c3eb..14f2c2a415c 100644 --- a/htdocs/variants/ajax/getCombinations.php +++ b/htdocs/variants/ajax/getCombinations.php @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -define('NOTOKENRENEWAL','1'); -define('NOREQUIREMENU','1'); -define('NOREQUIREHTML','1'); -define('NOREQUIREAJAX','1'); -define('NOREQUIRESOC','1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; diff --git a/htdocs/variants/ajax/get_attribute_values.php b/htdocs/variants/ajax/get_attribute_values.php index 6f3571c1856..8fd5c45fade 100644 --- a/htdocs/variants/ajax/get_attribute_values.php +++ b/htdocs/variants/ajax/get_attribute_values.php @@ -1,5 +1,4 @@ * * This program is free software; you can redistribute it and/or modify @@ -16,11 +15,11 @@ * along with this program. If not, see . */ -define('NOTOKENRENEWAL','1'); -define('NOREQUIREMENU','1'); -define('NOREQUIREHTML','1'); -define('NOREQUIREAJAX','1'); -define('NOREQUIRESOC','1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; diff --git a/htdocs/variants/ajax/orderAttribute.php b/htdocs/variants/ajax/orderAttribute.php index 95bad6a427d..92bbcc241d5 100644 --- a/htdocs/variants/ajax/orderAttribute.php +++ b/htdocs/variants/ajax/orderAttribute.php @@ -22,10 +22,10 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks require '../../main.inc.php'; + /* * View */ diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 04f53e55d21..dbc413542c4 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -71,7 +71,7 @@ if ($cancel) { unset($_SESSION['addvariant_'.$object->id]); } -if (! $object->isProduct()) { +if (! $object->isProduct() && ! $object->isService()) { header('Location: '.dol_buildpath('/product/card.php?id='.$object->id, 2)); exit(); } @@ -327,11 +327,31 @@ if (! empty($id) || ! empty($ref)) if ($action == 'add') { $title = $langs->trans('NewProductCombination'); + print dol_fiche_head(); + $features = $_SESSION['addvariant_'.$object->id]; + //First, sanitize + print '
    '; + if (! empty($features)) { + foreach ($features as $feature) { + + $explode = explode(':', $feature); + + if ($prodattr->fetch($explode[0]) < 0) { + continue; + } + + if ($prodattr_val->fetch($explode[1]) < 0) { + continue; + } + + print '' . $prodattr->label . ':'. $prodattr_val->value . ' '; + } + } + print '
    '; + print dol_fiche_end(); } else { $title = $langs->trans('EditProductCombination'); } - - print '
    '; print_fiche_titre($title); if ($action == 'add') { @@ -346,8 +366,8 @@ if (! empty($id) || ! empty($ref)) foreach ($prodattr_all as $each) { $prodattr_alljson[$each->id] = $each; } - - ?> + + ?>
    '; +$stringtoshow.= '
    '; if ($mesg) { print $mesg; } else { $stringtoshow.= $px1->show(); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index e29a1d6826e..67dd84a1572 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -464,16 +464,16 @@ else if ($id > 0 || ! empty($ref)) { if ($object->public || $userWrite > 0) { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } else { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } } else { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 9e14c462bef..b15207513ef 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2006-2010 Regis Houssin + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -326,6 +327,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1,$offset); @@ -393,7 +399,9 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->projet->creer) { - $newcardbutton = ''.$langs->trans('NewTask').''; + $newcardbutton = ''.$langs->trans('NewTask'); + $newcardbutton.= ''; + $newcardbutton.= ''; } print ''; @@ -579,7 +587,7 @@ if (! empty($arrayfields['t.progress']['checked'])) print_liste_field_titre // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters=array('arrayfields'=>$arrayfields); +$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (! empty($arrayfields['t.datec']['checked'])) print_liste_field_titre($arrayfields['t.datec']['label'],$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index b03d01a8006..d030f858f4e 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -199,7 +199,7 @@ print '
    '; print '
    '; -$stringtoshow.= ''; print ''; - $var = True; - foreach ( $prodcustprice->lines as $line ) { - print ''; + print ''; $staticprod = new Product($db); $staticprod->fetch($line->fk_product); @@ -558,11 +556,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { if (count($prodcustprice->lines) > 0) { - $var = False; - foreach ($prodcustprice->lines as $line) { - print ""; + print ''; $staticprod = new Product($db); $staticprod->fetch($line->fk_product); diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 6b3e833abb0..dfe78041f8a 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -253,7 +253,6 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre("EndSubscription",$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); print "\n"; - $var=True; $i=0; while ($i < $num && $i < $conf->liste_limit) { @@ -269,7 +268,6 @@ if ($id > 0 || ! empty($ref)) $companyname=$objp->company; - print ''; // Ref diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 1f3e69a674c..97b31e09010 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -6,6 +6,7 @@ * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2015 Marcos García + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -220,12 +221,16 @@ print ''; dol_fiche_end(); -$morehtmlcenter = ''; +$newcardbutton = ''; if (! empty($conf->website->enabled)) { if (! empty($user->rights->societe->lire)) { - $morehtmlcenter .= '' . $langs->trans("AddWebsiteAccount") . ''; + $newcardbutton .= '' . $langs->trans("AddWebsiteAccount"); + $newcardbutton.= ''; + $newcardbutton.= ''; } else { - $morehtmlcenter .= '' . $langs->trans("AddAction") . ''; + $newcardbutton .= '' . $langs->trans("AddAction"); + $newcardbutton.= ''; + $newcardbutton.= ''; } } @@ -287,6 +292,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -322,7 +332,7 @@ print ''; print ''; print ''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $morehtmlcenter, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); $topicmail="Information"; $modelmail="websiteaccount"; @@ -401,7 +411,7 @@ foreach($objectwebsiteaccount->fields as $key => $val) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters=array('arrayfields'=>$arrayfields); +$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $objectwebsiteaccount); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index b005eb63b41..62ca1000822 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -76,6 +76,9 @@ if ($action == 'setvalue' && $user->admin) $result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", GETPOST('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 'int'), 'chaine', 0, '', $conf->entity); if (! $result > 0) $error ++; + $result = dolibarr_set_const($db, "STRIPE_MINIMAL_3DSECURE", GETPOST('STRIPE_MINIMAL_3DSECURE', 'int'), 'chaine', 0, '', $conf->entity); + if (! $result > 0) + $error ++; $result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity); if (! $result > 0) $error ++; @@ -264,6 +267,11 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ? print ''; } +// Minimal amount for force 3Dsecure if it's optionnal +print ''; + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ? { // Stock for automatic decrement diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 39a3c3bb28b..90779d24962 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -38,7 +38,7 @@ $socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; //$result = restrictedArea($user, 'salaries', '', '', ''); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $rowid = GETPOST("rowid",'alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 6ed703d7a92..3b53b4572f0 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -217,7 +217,7 @@ class Stripe extends CommonObject //$sql.= " AND sa.entity IN (".getEntity('societe').")"; $sql.= " AND sa.type = 'card'"; - dol_syslog(get_class($this) . "::fetch search stripe card id for paymentmode id=".$object->id, LOG_DEBUG); + dol_syslog(get_class($this) . "::fetch search stripe card id for paymentmode id=".$object->id.", stripeacc=".$stripeacc, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); @@ -225,13 +225,15 @@ class Stripe extends CommonObject { $obj = $this->db->fetch_object($resql); $cardref = $obj->stripe_card_ref; + dol_syslog("*************".$cardref); if ($cardref) { try { if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage $card = $cu->sources->retrieve($cardref); } else { - $card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); + //$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided + $card = $cu->sources->retrieve($cardref); } } catch(Exception $e) @@ -334,10 +336,10 @@ class Stripe extends CommonObject $obj = $this->db->fetch_object($result); $key = $obj->fk_soc; } else { - $key = NULL; + $key = null; } } else { - $key = NULL; + $key = null; } $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 4eeae97ee71..68a695e2f33 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -32,6 +32,7 @@ // Load Dolibarr environment $res=@include("../main.inc.php"); // For root directory if (! $res) $res=@include("../../main.inc.php"); +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -240,42 +241,43 @@ if (empty($reshook)) if ($action == 'confirm_paiement' && $confirm == 'yes') { - $error=0; + $error=0; - $datepaye = dol_now(); + $datepaye = dol_now(); - $db->begin(); + $db->begin(); - // Clean parameters amount if payment is for a credit note - if (GETPOST('type') == 2) - { - foreach ($amounts as $key => $value) // How payment is dispatch - { - $newvalue = price2num($value,'MT'); - $amounts[$key] = -$newvalue; - } + // Clean parameters amount if payment is for a credit note + if (GETPOST('type') == 2) + { + foreach ($amounts as $key => $value) // How payment is dispatch + { + $newvalue = price2num($value,'MT'); + $amounts[$key] = -$newvalue; + } foreach ($multicurrency_amounts as $key => $value) // How payment is dispatch - { - $newvalue = price2num($value,'MT'); - $multicurrency_amounts[$key] = -$newvalue; - } - } + { + $newvalue = price2num($value,'MT'); + $multicurrency_amounts[$key] = -$newvalue; + } + } - if (! empty($conf->banque->enabled)) - { - // Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement - if (GETPOST('accountid') <= 0) - { - setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), null, 'errors'); - $error++; - } - } -$facture = new Facture($db); -$facture->fetch($facid); -$facture->fetch_thirdparty(); + if (! empty($conf->banque->enabled)) + { + // Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement + if (GETPOST('accountid') <= 0) + { + setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), null, 'errors'); + $error++; + } + } - $error = 0; + $facture = new Facture($db); + $facture->fetch($facid); + $facture->fetch_thirdparty(); + + $error = 0; if (is_object($stripe) && $stripeacc) { @@ -286,56 +288,59 @@ $facture->fetch_thirdparty(); } } -$stripeamount=0; - foreach ($amounts as $key => $value) // How payment is dispatch - { -$stripeamount+=price2num($value,'MT'); -} + $stripeamount=0; + foreach ($amounts as $key => $value) // How payment is dispatch + { + $stripeamount+=price2num($value,'MT'); + } -if (preg_match('/acct_/i',$source)) -{ -$paiementcode ="VIR"; -} -elseif (preg_match('/card_/i',$source)) -{ -$paiementcode ="CB"; -} -elseif (preg_match('/src_/i',$source)) -{ -$customer2 = \Stripe\Customer::retrieve($customer->id,array("stripe_account" => $stripe->getStripeAccount($entity))); -$src = $customer2->sources->retrieve("$source"); -if ($src->type=='card'){ -$paiementcode ="CB"; -} -} -$societe = new Societe($db); -$societe->fetch($facture->socid); - dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe'); + if (preg_match('/acct_/i',$source)) + { + $paiementcode ="VIR"; + } + elseif (preg_match('/card_/i',$source)) + { + $paiementcode ="CB"; + } + elseif (preg_match('/src_/i',$source)) + { + + $customer2 = $customerstripe=$stripe->customerStripe($facture->thirdparty, $stripeacc, $servicestatus); + $src = $customer2->sources->retrieve("$source"); + if ($src->type=='card') + { + $paiementcode ="CB"; + } + } -$charge=$stripe->CreatePaymentStripe($stripeamount,"EUR","invoice",$facid,$source,$customer->id,$stripe->getStripeAccount($conf->entity)); + $societe = new Societe($db); + $societe->fetch($facture->socid); + dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe'); - if (!$error) - { - // Creation of payment line - $paiement = new Paiement($db); - $paiement->datepaye = $datepaye; - $paiement->amounts = $amounts; // Array with all payments dispatching - $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching - $paiement->paiementid = dol_getIdFromCode($db,$paiementcode,'c_paiement'); - $paiement->num_paiement = $charge->message; - $paiement->note = GETPOST('comment'); - } + $charge=$stripe->CreatePaymentStripe($stripeamount,"EUR","invoice",$facid,$source,$customer->id,$stripe->getStripeAccount($conf->entity)); - if (! $error) - { + if (!$error) + { + // Creation of payment line + $paiement = new Paiement($db); + $paiement->datepaye = $datepaye; + $paiement->amounts = $amounts; // Array with all payments dispatching + $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching + $paiement->paiementid = dol_getIdFromCode($db,$paiementcode,'c_paiement'); + $paiement->num_paiement = $charge->message; + $paiement->note = GETPOST('comment'); + } - $paiement_id = $paiement->create($user, 0); - if ($paiement_id < 0) - { - setEventMessages($paiement->error, $paiement->errors, 'errors'); - $error++; - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($facture->lines)) + if (! $error) + { + + $paiement_id = $paiement->create($user, 0); + if ($paiement_id < 0) + { + setEventMessages($paiement->error, $paiement->errors, 'errors'); + $error++; + } + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($facture->lines)) { $outputlangs = $langs; $newlang = ''; @@ -349,53 +354,53 @@ $charge=$stripe->CreatePaymentStripe($stripeamount,"EUR","invoice",$facid,$sourc $ret = $facture->fetch($facid); // Reload to get new records $facture->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - } + } - if (! $error) - { - $label='(CustomerInvoicePayment)'; - if (GETPOST('type') == 2) $label='(CustomerInvoicePaymentBack)'; - $result=$paiement->addPaymentToBank($user,'payment',$label,GETPOST('accountid'),'',''); - if ($result < 0) - { - setEventMessages($paiement->error, $paiement->errors, 'errors'); - $error++; - } - elseif (GETPOST('closepaidinvoices')=='on') { - $facture->set_paid($user); - } - } + if (! $error) + { + $label='(CustomerInvoicePayment)'; + if (GETPOST('type') == 2) $label='(CustomerInvoicePaymentBack)'; + $result=$paiement->addPaymentToBank($user,'payment',$label,GETPOST('accountid'),'',''); + if ($result < 0) + { + setEventMessages($paiement->error, $paiement->errors, 'errors'); + $error++; + } + elseif (GETPOST('closepaidinvoices')=='on') { + $facture->set_paid($user); + } + } - if (! $error) - { - $db->commit(); + if (! $error) + { + $db->commit(); - // If payment dispatching on more than one invoice, we keep on summary page, otherwise go on invoice card - $invoiceid=0; - foreach ($paiement->amounts as $key => $amount) - { - $facid = $key; - if (is_numeric($amount) && $amount <> 0) - { - if ($invoiceid != 0) $invoiceid=-1; // There is more than one invoice payed by this payment - else $invoiceid=$facid; - } - } - if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/compta/facture/card.php?facid='.$invoiceid; - else $loc = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id; - header('Location: '.$loc); - exit; - } - else - { - $loc = dol_buildpath('/stripeconnect/payment.php?facid='.$facid.'&action=create&error='.$e->getMessage().'', 1); - $db->rollback(); - header('Location: '.$loc); - } + // If payment dispatching on more than one invoice, we keep on summary page, otherwise go on invoice card + $invoiceid=0; + foreach ($paiement->amounts as $key => $amount) + { + $facid = $key; + if (is_numeric($amount) && $amount <> 0) + { + if ($invoiceid != 0) $invoiceid=-1; // There is more than one invoice payed by this payment + else $invoiceid=$facid; + } + } + if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/compta/facture/card.php?facid='.$invoiceid; + else $loc = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id; + header('Location: '.$loc); + exit; + } + else + { + $loc = DOL_URL_ROOT.'/stripeconnect/payment.php?facid='.$facid.'&action=create&error='.$e->getMessage(); + $db->rollback(); + header('Location: '.$loc); + exit; + } } } @@ -418,7 +423,7 @@ else { } if (GETPOST('error')){ - setEventMessages(GETPOST('error'), NULL, 'errors'); + setEventMessages(GETPOST('error'), null, 'errors'); } if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement') @@ -1060,7 +1065,7 @@ print ''; if (! GETPOST('action')) { if ($page == -1) $page = 0 ; - $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; + $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page ; if (! $sortorder) $sortorder='DESC'; diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index 6628a3b46cd..28848106361 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -38,7 +38,7 @@ $socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; //$result = restrictedArea($user, 'salaries', '', '', ''); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $rowid = GETPOST("rowid",'alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index 8d9429051f8..cea668cfae2 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -87,10 +87,8 @@ print ''; print ''; print "\n"; -$var=True; foreach($extrafields->attribute_type as $key => $value) { - print ''; print "\n"; print "\n"; diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index 75a0374a14c..41101ec7759 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -91,10 +91,8 @@ print ''; print ''; print "\n"; -$var=True; foreach($extrafields->attribute_type as $key => $value) { - print ''; print "\n"; print "\n"; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 8e391b0f1dd..1c9b4afc5ec 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -527,8 +527,8 @@ if (empty($reshook)) $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); $ref_supplier = GETPOST('fourn_ref','alpha'); - - if (GETPOST('prod_entry_mode') == 'free') + $prod_entry_mode = GETPOST('prod_entry_mode'); + if ($prod_entry_mode == 'free') { $idprod=0; $price_ht = GETPOST('price_ht'); @@ -543,6 +543,7 @@ if (empty($reshook)) $qty = GETPOST('qty' . $predef); $remise_percent = GETPOST('remise_percent' . $predef); + $price_ht_devise = GETPOST('multicurrency_price_ht'); // Extrafields $extrafieldsline = new ExtraFields($db); @@ -556,17 +557,17 @@ if (empty($reshook)) } } - if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) { + if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error ++; } - if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && $price_ht == '') // Unit price can be 0 but not ''. Also price can be negative for proposal. + if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '') // Unit price can be 0 but not ''. Also price can be negative for proposal. { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error ++; } - if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) { + if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors'); $error ++; } @@ -581,16 +582,14 @@ if (empty($reshook)) // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit - if ((GETPOST('prod_entry_mode') != 'free') && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' + if ($prod_entry_mode != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' { $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) // TODO this test seems useless - { - $idprod=0; - if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) - } - if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) + $idprod=0; + if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) + + if (preg_match('/^idprod_([0-9]+)$/', GETPOST('idprodfournprice'), $reg)) { $idprod=$reg[1]; $res=$productsupplier->fetch($idprod); @@ -608,12 +607,16 @@ if (empty($reshook)) if ($idprod > 0) { - $pu_ht = $productsupplier->fourn_pu; - $price_base_type = $productsupplier->fourn_price_base_type; - $type = $productsupplier->type; $label = $productsupplier->label; + $desc = $productsupplier->description; if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); + + $pu_ht = $productsupplier->fourn_pu; + + $type = $productsupplier->type; + $price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT'); + $ref_supplier = $productsupplier->ref_supplier; $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); @@ -665,7 +668,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); } } - else if((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error)) // Free product + else if((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error)) // Free product. // $price_ht is already set { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); @@ -683,20 +686,19 @@ if (empty($reshook)) $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty); - if (GETPOST('price_ht')!=='') + if ($price_ht !== '') { - $price_base_type = 'HT'; - $ht = price2num(GETPOST('price_ht')); - $ttc = 0; + $pu_ht = price2num($price_ht, 'MU'); // $pu_ht must be rounded according to settings } else { - $ttc = price2num(GETPOST('price_ttc')); - $ht = $ttc / (1 + ($tva_tx / 100)); - $price_base_type = 'HT'; + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings } + $price_base_type = 'HT'; + $pu_ht_devise = price2num($price_ht_devise, 'MU'); - $result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $ttc, $info_bits, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $ref_supplier, $fk_unit); + $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $pu_ttc, $info_bits, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $ref_supplier, $fk_unit); //$result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit); } @@ -772,6 +774,7 @@ if (empty($reshook)) // Mise a jour d'une ligne dans la demande de prix else if ($action == 'updateligne' && $user->rights->supplier_proposal->creer && GETPOST('save') == $langs->trans("Save")) { + // Define info_bits $info_bits = 0; if (preg_match('/\*/', GETPOST('tva_tx'))) @@ -810,6 +813,16 @@ if (empty($reshook)) // Check minimum price $productid = GETPOST('productid', 'int'); if (! empty($productid)) { + + $productsupplier = new ProductFournisseur($db); + if (! empty($conf->global->SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY)) + { + if ($productid > 0 && $productsupplier->get_buyprice(0, price2num($_POST['qty']), $productid, 'none', GETPOST('socid','int')) < 0 ) + { + setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings'); + } + } + $product = new Product($db); $res = $product->fetch($productid); @@ -1674,7 +1687,9 @@ if ($action == 'create') // Add free products/services form global $forceall, $senderissupplier, $dateSelector; - $forceall=1; $senderissupplier=2; $dateSelector=0; // $senderissupplier=2 is same than 1 but disable test on minimum qty. + $forceall=1; $dateSelector=0; + $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); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 991e3ad5af8..a39fba04b81 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -124,9 +124,9 @@ class SupplierProposal extends CommonObject var $cond_reglement_code; var $mode_reglement_code; - var $remise; - var $remise_percent; - var $remise_absolue; + var $remise = 0; + var $remise_percent = 0; + var $remise_absolue = 0; var $products=array(); var $extraparams=array(); @@ -185,24 +185,11 @@ class SupplierProposal extends CommonObject global $conf,$langs; $this->db = $db; + $this->socid = $socid; $this->id = $supplier_proposalid; - $this->products = array(); - $this->remise = 0; - $this->remise_percent = 0; - $this->remise_absolue = 0; - $langs->load("supplier_proposal"); - $this->labelstatut[0]=$langs->trans("SupplierProposalStatusDraft"); - $this->labelstatut[1]=$langs->trans("SupplierProposalStatusValidated"); - $this->labelstatut[2]=$langs->trans("SupplierProposalStatusSigned"); - $this->labelstatut[3]=$langs->trans("SupplierProposalStatusNotSigned"); - $this->labelstatut[4]=$langs->trans("SupplierProposalStatusClosed"); - $this->labelstatut_short[0]=$langs->trans("SupplierProposalStatusDraftShort"); - $this->labelstatut_short[1]=$langs->trans("Opened"); - $this->labelstatut_short[2]=$langs->trans("SupplierProposalStatusSignedShort"); - $this->labelstatut_short[3]=$langs->trans("SupplierProposalStatusNotSignedShort"); - $this->labelstatut_short[4]=$langs->trans("SupplierProposalStatusClosedShort"); + $this->products = array(); } @@ -407,10 +394,72 @@ class SupplierProposal extends CommonObject // Check parameters if ($type < 0) return -1; - if ($this->statut == 0) + if ($this->statut == self::STATUS_DRAFT) { $this->db->begin(); + if ($fk_product > 0) + { + if (! empty($conf->global->SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY)) + { + // Check quantity is enough + dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." ref_supplier=".$ref_supplier); + $prod = new Product($this->db, $fk_product); + if ($prod->fetch($fk_product) > 0) + { + $product_type = $prod->type; + $label = $prod->label; + + // We use 'none' instead of $ref_supplier, because fourn_ref may not exists anymore. So we will take the first supplier price ok. + // If we want a dedicated supplier price, we must provide $fk_prod_fourn_price. + $result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc?$this->fk_soc:$this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$ref_supplier/$this->fk_soc + if ($result > 0) + { + $pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice + $ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice + // is remise percent not keyed but present for the product we add it + if ($remise_percent == 0 && $prod->remise_percent !=0) + $remise_percent =$prod->remise_percent; + } + if ($result == 0) // If result == 0, we failed to found the supplier reference price + { + $langs->load("errors"); + $this->error = "Ref " . $prod->ref . " " . $langs->trans("ErrorQtyTooLowForThisSupplier"); + $this->db->rollback(); + dol_syslog(get_class($this)."::addline we did not found supplier price, so we can't guess unit price"); + //$pu = $prod->fourn_pu; // We do not overwrite unit price + //$ref = $prod->ref_fourn; // We do not overwrite ref supplier price + return -1; + } + if ($result == -1) + { + $langs->load("errors"); + $this->error = "Ref " . $prod->ref . " " . $langs->trans("ErrorQtyTooLowForThisSupplier"); + $this->db->rollback(); + dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG); + return -1; + } + if ($result < -1) + { + $this->error=$prod->error; + $this->db->rollback(); + dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_ERR); + return -1; + } + } + else + { + $this->error=$prod->error; + $this->db->rollback(); + return -1; + } + } + } + else + { + $product_type = $type; + } + // Calcul du total TTC et de la TVA pour la ligne a partir de // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker @@ -2072,9 +2121,24 @@ class SupplierProposal extends CommonObject */ function LibStatut($statut,$mode=1) { - global $langs; - $langs->load("supplier_proposal"); + // Init/load array of translation of status + if (empty($this->labelstatut) || empty($this->labelstatut_short)) + { + global $langs; + $langs->load("supplier_proposal"); + $this->labelstatut[0]=$langs->trans("SupplierProposalStatusDraft"); + $this->labelstatut[1]=$langs->trans("SupplierProposalStatusValidated"); + $this->labelstatut[2]=$langs->trans("SupplierProposalStatusSigned"); + $this->labelstatut[3]=$langs->trans("SupplierProposalStatusNotSigned"); + $this->labelstatut[4]=$langs->trans("SupplierProposalStatusClosed"); + $this->labelstatut_short[0]=$langs->trans("SupplierProposalStatusDraftShort"); + $this->labelstatut_short[1]=$langs->trans("Opened"); + $this->labelstatut_short[2]=$langs->trans("SupplierProposalStatusSignedShort"); + $this->labelstatut_short[3]=$langs->trans("SupplierProposalStatusNotSignedShort"); + $this->labelstatut_short[4]=$langs->trans("SupplierProposalStatusClosedShort"); + } + $statuttrans=''; if ($statut==0) $statuttrans='statut0'; if ($statut==1) $statuttrans='statut1'; if ($statut==2) $statuttrans='statut3'; @@ -2109,16 +2173,16 @@ class SupplierProposal extends CommonObject $sql = "SELECT p.rowid, p.ref, p.datec as datec"; $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p"; - if (!$user->rights->societe->client->voir && !$user->societe_id) + if (!$user->rights->societe->client->voir && !$user->socid) { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; $sql.= " WHERE sc.fk_user = " .$user->id; $clause = " AND"; } - $sql.= $clause." p.entity = ".$conf->entity; + $sql.= $clause." p.entity IN (".getEntity('supplier_proposal').")"; if ($mode == 'opened') $sql.= " AND p.fk_statut = 1"; if ($mode == 'signed') $sql.= " AND p.fk_statut = 2"; - if ($user->societe_id) $sql.= " AND p.fk_soc = ".$user->societe_id; + if ($user->socid) $sql.= " AND p.fk_soc = ".$user->socid; $resql=$this->db->query($sql); if ($resql) @@ -2266,13 +2330,13 @@ class SupplierProposal extends CommonObject $sql = "SELECT count(p.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->societe_id) + if (!$user->rights->societe->client->voir && !$user->socid) { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql.= " WHERE sc.fk_user = " .$user->id; $clause = "AND"; } - $sql.= " ".$clause." p.entity = ".$conf->entity; + $sql.= " ".$clause." p.entity IN (".getEntity('supplier_proposal').")"; $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 4b25dfb82ac..17565e7f140 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -84,7 +84,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."supplier_proposal as p"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_soc = s.rowid"; -$sql.= " AND p.entity = ".$conf->entity; +$sql.= " AND p.entity IN (".getEntity('supplier_proposal').")"; if ($user->societe_id) $sql.=' AND p.fk_soc = '.$user->societe_id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " AND p.fk_statut IN (0,1,2,3,4)"; @@ -184,11 +184,10 @@ if (! empty($conf->supplier_proposal->enabled)) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); + print ''; $supplier_proposalstatic->id=$obj->rowid; @@ -242,10 +241,8 @@ if ($resql) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print ''; @@ -303,7 +300,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos $sql.= ", ".MAIN_DB_PREFIX."supplier_proposal as p"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_soc = s.rowid"; - $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND p.entity IN (".getEntity('supplier_proposal').")"; $sql.= " AND p.fk_statut = 1"; 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; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 09cbd063e64..aa5c7e70ab3 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -82,7 +82,7 @@ $month=GETPOST("month"); $yearvalid=GETPOST("yearvalid"); $monthvalid=GETPOST("monthvalid"); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -332,6 +332,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit + 1,$offset); @@ -389,7 +394,9 @@ if ($resql) $newcardbutton=''; if($user->rights->supplier_proposal->creer) { - $newcardbutton=''.$langs->trans('NewAskPrice').''; + $newcardbutton=''.$langs->trans('NewAskPrice'); + $newcardbutton.= ''; + $newcardbutton.= ''; } // Lignes des champs de filtre @@ -470,13 +477,13 @@ if ($resql) if (! empty($arrayfields['sp.ref']['checked'])) { print ''; } if (! empty($arrayfields['s.nom']['checked'])) { print ''; } if (! empty($arrayfields['s.town']['checked'])) print ''; @@ -507,7 +514,7 @@ if ($resql) { print ''; } if (! empty($arrayfields['sp.total_vat']['checked'])) { // Amount print ''; } if (! empty($arrayfields['sp.total_ttc']['checked'])) { // Amount print ''; } if (! empty($arrayfields['u.login']['checked'])) { // Author print ''; } // Extra fields diff --git a/htdocs/theme/common/dolistore.jpg b/htdocs/theme/common/dolistore.jpg deleted file mode 100644 index 65a2d6ffae1..00000000000 Binary files a/htdocs/theme/common/dolistore.jpg and /dev/null differ diff --git a/htdocs/theme/common/octicons/.gitignore b/htdocs/theme/common/octicons/.gitignore deleted file mode 100644 index b0e34801fac..00000000000 --- a/htdocs/theme/common/octicons/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -.DS_Store -build -*.log diff --git a/htdocs/theme/common/octicons/.npmignore b/htdocs/theme/common/octicons/.npmignore deleted file mode 100644 index f50769fa751..00000000000 --- a/htdocs/theme/common/octicons/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.github -.travis.yml -Gruntfile.js -lib -test diff --git a/htdocs/theme/common/octicons/.travis.yml b/htdocs/theme/common/octicons/.travis.yml deleted file mode 100644 index 435bc15d7af..00000000000 --- a/htdocs/theme/common/octicons/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - '5' diff --git a/htdocs/theme/common/octicons/CHANGELOG.md b/htdocs/theme/common/octicons/CHANGELOG.md deleted file mode 100644 index 2085dcb0169..00000000000 --- a/htdocs/theme/common/octicons/CHANGELOG.md +++ /dev/null @@ -1,363 +0,0 @@ -### HEAD - -### 5.0.1 - -Fixes: - -- projects icon renders as a block, using `fill-rule` fixes it - -### 5.0.0 - -Adds: - -- `project` -- `note` -- `screen-full` -- `screen-normal` -- More node.js api endpoints for accessing icons https://github.com/primer/octicons/pull/120 -- Creating a spritesheet demo https://github.com/primer/octicons/pull/121 - -Removes: - -- Deprecating support for the webfont https://github.com/primer/octicons/pull/117 -- Stop checking `/build/` directory into repository https://github.com/primer/octicons/pull/118 -- Removing sass as a dependency https://github.com/primer/octicons/pull/119 - -### 4.4.0 - -Adds: - -- svg.json file that is accessible from node require - -### 4.3.0 - -Fixes: - -- Vertical alignment on `italic` - -Modifies: - -- `person` -- `organization` - -### 4.2.1 - -Fixes: - -- Removing inline sourcemap from `min` versions of css. - -### 4.2.0 - -Adds: - -- Keywords.json file that has an index of all octicons with alias names - -### 4.1.1 (June 16, 2016) - -Fixes: - -- Putting the `$octicons-font-path` back in the scss file. - -### 4.1.0 (June 6, 2016) - -Adds: - -- Installation docs https://github.com/primer/octicons/pull/94 -- `grabber` -- `plus-small` - -Modifies: - -- `smiley` - -Refines: - -- Renames `mail-reply` to `reply` and refines its shape. - -Fixes: - -- Revert license back to SPDX standard - -### 4.0.0 (June 6, 2016) - -Adds: - -- Whole new grunt build system including svg sprite sheet. -- adding css min https://github.com/primer/octicons/pull/60 -- adding woff2 format https://github.com/primer/octicons/issues/3 -- creates spritesheet of svg files https://github.com/primer/octicons/issues/88 - -Removes: - -- Bower support - -Fixes: - -- all svg icons include viewBox https://github.com/primer/octicons/issues/87 -- license in package.json https://github.com/primer/octicons/issues/85 - -### 3.5.0 (February 12, 2016) - -Adds: - -- `unverified` - -Refines: - -- `verified` - -### 3.4.1 (January 24, 2016) - -This includes various SVG viewport refinements. - -Refines: - -- `thumbs-down` -- `logo-github` - -### 3.4.0 (January 22, 2016) - -Adds: - -- `verified` -- `smiley` - -Removes: - -- `color-mode` - -Refines: - -- `primitive-dot` -- `horizontal-rule` -- `triangle-down` -- `triangle-up` -- `triangle-left` -- `triangle-right` -- `globe` -- `flame` -- `comment-discussion` - -### 3.3.0 (November 12, 2015) - -Adds: - -- `logo-gist` - -Resizes all our SVG to be 16x16 instead of 1024x1024 - -### 3.2.0 (November 6, 2015) - -Adds: - -- `bold` -- `text-size` -- `italic` -- `tasklist` - -It also normalizes some styling in: - -- `list-unordered` -- `list-ordered` -- `quote` -- `mention` -- `bookmark` -- `threebars` - -Removes - -- `screen-normal` -- `screen-full` - - -### 3.1.0 (August 13, 2015) - -Adds - -- `shield` - -This thickens stroke widths slightly on the following icons: - -- `circle-slash` -- `clock` -- `cloud-upload` -- `cloud-download` -- `dashboard` -- `info` -- `issue-closed` -- `issue` -- `issue-reopened` -- `history` -- `question` -- `search` - -Fills `comment-discussion` - -Thickens `x` to match `checkmark` - -### 3.0.1 (August 10, 2015) - -Some files were missing in `3.0.0` - -### 3.0.0 (August 10, 2015) - -Removes - -- `microscope` -- `beer` -- `split` -- `puzzle` -- `steps` -- `podium` -- `timer` -- all `alignment` icons -- all `move` icons -- all `playback` icons -- all `jump` icons - -Adds - -- `beaker` -- `bell` -- `desktop-download` -- `watch` - -Line-weight changes, sizing normalization, and new drawings - -- `circle-slash` -- `lock` -- `cloud-upload` -- `cloud-download` -- `plus` -- `✕` -- `broadcast` -- `lock` -- all `repo` icons -- organization -- person -- all `chevrons` & `triangles` -- all `diff` icons -- `clippy` -- all `issue` and circular icons -- `rss` -- `ruby` -- `cancel` -- `settings` -- `mirror` -- `external-link` -- `history` -- `gear` -- `settings` -- `info` -- `history` -- `package` -- `gist-secret` -- `rocket` -- `law` -- `telescope` -- `search` -- `tag` -- `normal-screen` -- `iphone` -- `no-new-line` -- `desktop` -- all `git` icons -- `circuit-board` -- `heart` -- `home` -- `briefcase` -- `wiki` -- `bookmark` -- `briefcase` -- `calendar` -- `color-mode` -- `comment` -- `discussions` -- `credit-card` -- `dashboard` -- `camera` -- `video` -- `bug` -- `desktop` -- `ellipses` -- `eye` -- all `files` & `folders` -- `fold` -- `unfold` -- `gift` -- `graph` -- `hubot` -- `inbox` -- `jersey` -- `keyboard` -- `light-bulb` -- `link` -- `location` -- `mail` -- `mail-read` -- `marker` -- `plug` -- `mute` -- `pencil` -- `push-pin` -- `fullscreen` -- `unfullscreen` -- `server` -- `sign-in` -- `sign-out` -- `tag` -- `terminal` -- `thumbs-up` -- `thumbs-down` -- `trash` -- `unmute` -- `versions` -- `gist` -- `key` -- `megaphone` -- `checklist` - -## 2.4.1 (June 2, 2015) - -- Add the scss file I forgot to include - -## 2.4.0 (June 2, 2015) - -- Add `octicons.scss` -- Revert path changes to `sprockets-octicons.scss`, as they broke octicons in sprockets. - -## 2.3.0 (May 28, 2015) - -- Add a path variable to `sprockets-octicons.scss` to be consistent with octicons.less` - -## 2.2.3 (May 21, 2015) - -- Use SPDX license identifiers in package.json - -## 2.2.2 (April 1, 2015) - -Fixes file icons for - -- `file-binary` -- `file-code` -- `file-media` -- `file-pdf` -- `file-symlink-file` -- `file-text` -- `file-zip` - -## 2.2.1 (March 30, 2015) - -- Fix vector artifact and smooth curves in `mark-github` - -## 2.2.0 (Feb 18, 2015) - -- Add two new icons: `thumbsup` and `thumbsdown` - -## 2.0.1 (June 16, 2014) - -- Add mention of github.com/logos to the license - -## 2.0.0 (June 16, 2014) - -- Hello world diff --git a/htdocs/theme/common/octicons/Gruntfile.js b/htdocs/theme/common/octicons/Gruntfile.js deleted file mode 100644 index 48e0c300427..00000000000 --- a/htdocs/theme/common/octicons/Gruntfile.js +++ /dev/null @@ -1,137 +0,0 @@ -var fs = require("fs") -var path = require("path") - -module.exports = function(grunt) { - - grunt.initConfig({ - - pkg: grunt.file.readJSON('package.json'), - - cssnano: { - options: {}, - dist: { - files: { - 'build/octicons.min.css': 'build/octicons.css' - } - } - }, - - svgmin: { - dist: { - options: { - plugins: [ - {removeTitle: true}, - {removeStyleElement: true}, - {removeAttrs: { attrs: ['id', 'class', 'data-name', 'fill'] }}, - {removeEmptyContainers: true}, - {sortAttrs: true}, - {removeUselessDefs: true}, - {removeEmptyText: true}, - {removeEditorsNSData: true}, - {removeEmptyAttrs: true}, - {removeHiddenElems: true} - ] - }, - files: [{ - expand: true, - cwd: 'lib/svg', - src: ['*.svg'], - dest: 'build/svg' - }] - } - }, - - svgstore: { - options: { - includeTitleElement: false, - inheritviewbox: true, - includedemo: function(arg) { - var octicons = require("./index.js") - - var icons = function() { - var result = [] - Object.keys(octicons).forEach(function(key){ - result.push("
    " + octicons[key].toSVGUse({ height: 32 }) + "
    " + key + "
    ") - }) - return result.join("\n") - } - - return ` - - - - - Octicons Spritesheet test - - - - - ${arg.svg} -
    Octicons SVG Spritesheet demo
    -
    All the icons rendered below use the svg spriteheet located in the /build/ directory.
    -
    - ${icons()} -
    - - -` - } - }, - default: { - files: { - "build/sprite.octicons.svg": ['build/svg/*.svg'] - } - }, - }, - - clean: { - build: [ - 'build/*' - ] - }, - - copy: { - css: { - src: "lib/octicons.css", - dest: "build/octicons.css" - } - } - }); - - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-svgstore'); - grunt.loadNpmTasks('grunt-svgmin'); - grunt.loadNpmTasks('grunt-cssnano'); - - // build tasks - grunt.registerTask('css', ['copy', 'cssnano']); - grunt.registerTask('svg', ['clean', 'svgmin']); - - // default task, build /dist/ - grunt.registerTask('default', [ 'svg', 'css', 'json:svg', 'svgstore']); - - grunt.registerTask('json:svg', 'add svg string to data.json build', function() { - var files = fs.readdirSync("./build/svg/") - var data = JSON.parse(fs.readFileSync("./lib/data.json")) - - files.forEach(function(file) { - var svg = fs.readFileSync(path.resolve("./build/svg", file)) - var key = path.basename(file, ".svg") - if (data[key]) { - var raw = svg.toString() - data[key].path = //g.exec(raw)[0] - data[key].height = /height="(\d+)"/g.exec(raw)[1] - data[key].width = /width="(\d+)"/g.exec(raw)[1] - } - }) - - fs.writeFileSync("build/data.json", JSON.stringify(data)); - }) -}; diff --git a/htdocs/theme/common/octicons/LICENSE b/htdocs/theme/common/octicons/LICENSE index 4cf2020ce77..9317777c6c3 100644 --- a/htdocs/theme/common/octicons/LICENSE +++ b/htdocs/theme/common/octicons/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2012-2016 GitHub, Inc. +Copyright (c) 2018 GitHub Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/htdocs/theme/common/octicons/README.md b/htdocs/theme/common/octicons/README.md index 84edd84dce5..e7cb3064a8a 100644 --- a/htdocs/theme/common/octicons/README.md +++ b/htdocs/theme/common/octicons/README.md @@ -1,29 +1,25 @@ # GitHub Octicons -[![NPM version](https://img.shields.io/npm/v/octicons.svg)](https://www.npmjs.org/package/octicons) +[![npm version](https://img.shields.io/npm/v/octicons.svg)](https://www.npmjs.org/package/octicons) [![Build Status](https://travis-ci.org/primer/octicons.svg?branch=master)](https://travis-ci.org/primer/octicons) > Octicons are a scalable set of icons handcrafted with <3 by GitHub. ## Install -**NOTE:** The compiled files are located in `/build/`. This directory is located in the published npm package. Which means you can access it when you `npm install octicons`. You can also build this directory by following the [building octicons directions](#building-octicons). The files in the `/lib/` directory are the raw source files and are not compiled or optimized. +**NOTE:** The compiled files are located in `build/`. This directory is located in the published npm package. Which means you can access it when you `npm install octicons`. You can also build this directory by following the [building octicons directions](#building-octicons). The files in the `lib/` directory are the raw source files and are not compiled or optimized. -#### NPM +#### npm This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `octicons` with this command. ``` -$ npm install --save octicons +$ npm install octicons --save ``` ## Usage -For all the usages, we recommend using the CSS located in `./build/octicons.css`. This is some simple CSS to normalize the icons and inherit colors. - -### Spritesheet - -With a [SVG sprite icon system](https://css-tricks.com/svg-sprites-use-better-icon-fonts/) you can include the sprite sheet located `./build/sprite.octicons.svg` after you [build the icons](#building-octicons) or from the npm package. There is a demo of how to use the spritesheet in the build directory also. +For all the usages, we recommend using the CSS located in `build/build.css`. This is some simple CSS to normalize the icons and inherit colors. ### Node @@ -47,11 +43,11 @@ octicons.alert // toSVG: [Function] } ``` -There will be a key for every icon, with `keywords` and `svg`. +There will be a key for every icon, with [`toSVG`](#octiconsalerttosvg) and other properties. #### `octicons.alert.symbol` -Returns the string of the symbol name +Returns the string of the symbol name, same as the key for that icon. ```js octicons.x.symbol @@ -60,7 +56,7 @@ octicons.x.symbol #### `octicons.person.path` -Path returns the string representation of the path of the icon. +Returns the string representation of the path of the icon. ```js octicons.x.path @@ -69,7 +65,7 @@ octicons.x.path #### `octicons.issue.options` -This is a json object of all the `options` that will be added to the output tag. +This is an object of all the attributes that will be added to the output tag. ```js octicons.x.options @@ -78,15 +74,15 @@ octicons.x.options #### `octicons.alert.width` -Width is the icon's true width. Based on the svg view box width. _Note, this doesn't change if you scale it up with size options, it only is the natural width of the icon_ +Returns the icon's true width, based on the svg view box width. _Note, this doesn't change if you scale it up with size options, it only is the natural width of the icon._ #### `octicons.alert.height` -Height is the icon's true height. Based on the svg view box height. _Note, this doesn't change if you scale it up with size options, it only is the natural height of the icon_ +Returns the icon's true height, based on the svg view box height. _Note, this doesn't change if you scale it up with size options, it only is the natural height of the icon._ #### `keywords` -Returns an array of keywords for the icon. The data [comes from the octicons repository](https://github.com/primer/octicons/blob/master/lib/data.json). Consider contributing more aliases for the icons. +Returns an array of keywords for the icon. The data comes from the [data file in lib](../data.json). Consider contributing more aliases for the icons. ```js octicons.x.keywords @@ -95,7 +91,7 @@ octicons.x.keywords #### `octicons.alert.toSVG()` -Returns a string of the svg tag +Returns a string of the `` tag. ```js octicons.x.toSVG() @@ -131,64 +127,16 @@ octicons.x.toSVG({ "width": 45 }) // ``` -#### `octicons.alert.toSVGUse()` - -Returns a string of the svg tag with the `` tag, for use with the spritesheet located in the /build/ directory. - -```js -octicons.x.toSVGUse() -// -``` - -### Ruby - -If your environment is Ruby on Rails, we have a [octicons_helper](https://github.com/primer/octicons_helper) gem available that renders SVG in your page. The octicons_helper uses the [octicons_gem](https://github.com/primer/octicons_gem) to do the computing and reading of the SVG files. - -### Jekyll - -For jekyll, there's a [jekyll-octicons](https://github.com/primer/jekyll-octicons) plugin available. This works exactly like the octicons_helper. - -## Changing, adding, or deleting icons - -1. Open the [Sketch document][sketch-document] in `/lib/`. Each icon exists as an artboard within our master Sketch document. If you’re adding an icon, duplicate one of the artboards and add your shapes to it. Be sure to give your artboard a name that makes sense. -2. Once you’re happy with your icon set, choose File > Export… -3. Choose all the artboards you’d like to export and then press “Export” -4. Export to `/lib/svg/` - -You’ll next need to build your Octicons. - -## Building Octicons - -All the files you need will be in the `/build/` directory already, but if you’ve made changes to the `/lib/` directory and need to regenerate, follow these steps: - -1. Open the Octicons directory in Terminal -2. `npm install` to install all dependencies for the project. -3. Run the command `npm run build`. This will run the grunt task to build the SVGs, placing them in the `/build/` directory. - -## Publishing - -If you have access to publish this repository, these are the steps to publishing. If you need access, contact [#design-systems](https://github.slack.com/archives/design-systems). - -1. Update the [CHANGELOG.md](./CHANGELOG.md) with relevant version number and any updates made to the repository. -2. `npm version ` Run [npm version](https://docs.npmjs.com/cli/version) inputing the relevant version type. The versioning is [semver](http://semver.org/), so version appropriately based on what has changed. -3. `npm publish` This will publish the new version to npmjs.org -4. `git push && git push --tags` Push all these changes to origin. - ## License -(c) 2012-2016 GitHub, Inc. +(c) GitHub, Inc. When using the GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos). -_SVG License:_ [SIL OFL 1.1](http://scripts.sil.org/OFL) -Applies to all SVG files - -_Code License:_ [MIT](./LICENSE) -Applies to all other files +[MIT](./LICENSE) [primer]: https://github.com/primer/primer [docs]: http://primercss.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ -[sketch-document]: https://github.com/primer/octicons/blob/master/lib/octicons-master.sketch diff --git a/htdocs/theme/common/octicons/lib/octicons.css b/htdocs/theme/common/octicons/build/build.css similarity index 100% rename from htdocs/theme/common/octicons/lib/octicons.css rename to htdocs/theme/common/octicons/build/build.css diff --git a/htdocs/theme/common/octicons/build/data.json b/htdocs/theme/common/octicons/build/data.json new file mode 100644 index 00000000000..41fa0740b8a --- /dev/null +++ b/htdocs/theme/common/octicons/build/data.json @@ -0,0 +1 @@ +{"alert":{"name":"alert","figma":{"id":"0:5","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["warning","triangle","exclamation","point"],"width":16,"height":16,"path":""},"arrow-down":{"name":"arrow-down","figma":{"id":"0:8","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["point","direction"],"width":10,"height":16,"path":""},"arrow-left":{"name":"arrow-left","figma":{"id":"0:10","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["point","direction"],"width":10,"height":16,"path":""},"arrow-right":{"name":"arrow-right","figma":{"id":"0:12","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["point","direction"],"width":10,"height":16,"path":""},"arrow-up":{"name":"arrow-up","figma":{"id":"0:14","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["point","direction"],"width":10,"height":16,"path":""},"arrow-small-down":{"name":"arrow-small-down","figma":{"id":"0:16","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["point","direction","little","tiny"],"width":6,"height":16,"path":""},"arrow-small-left":{"name":"arrow-small-left","figma":{"id":"0:18","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["point","direction","little","tiny"],"width":6,"height":16,"path":""},"arrow-small-right":{"name":"arrow-small-right","figma":{"id":"0:20","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["point","direction","little","tiny"],"width":6,"height":16,"path":""},"arrow-small-up":{"name":"arrow-small-up","figma":{"id":"0:22","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["point","direction","little","tiny"],"width":6,"height":16,"path":""},"beaker":{"name":"beaker","figma":{"id":"0:26","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["experiment","labs","experimental","feature","test","science","education","study","development","testing"],"width":16,"height":16,"path":""},"bell":{"name":"bell","figma":{"id":"0:34","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["notification"],"width":14,"height":16,"path":""},"bold":{"name":"bold","figma":{"id":"0:38","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["markdown","bold","text"],"width":10,"height":16,"path":""},"book":{"name":"book","figma":{"id":"0:43","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["book","journal","wiki","readme"],"width":16,"height":16,"path":""},"bookmark":{"name":"bookmark","figma":{"id":"0:54","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["tab","star"],"width":10,"height":16,"path":""},"briefcase":{"name":"briefcase","figma":{"id":"0:58","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["suitcase","business"],"width":14,"height":16,"path":""},"broadcast":{"name":"broadcast","figma":{"id":"0:63","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["rss","radio","signal"],"width":16,"height":16,"path":""},"browser":{"name":"browser","figma":{"id":"0:70","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["window","web"],"width":14,"height":16,"path":""},"bug":{"name":"bug","figma":{"id":"0:78","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["insect","issue"],"width":16,"height":16,"path":""},"calendar":{"name":"calendar","figma":{"id":"0:82","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["time","day","month","year","date","appointment"],"width":14,"height":16,"path":""},"check":{"name":"check","figma":{"id":"0:104","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["mark","yes","confirm","accept","ok","success"],"width":12,"height":16,"path":""},"checklist":{"name":"checklist","figma":{"id":"0:108","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["todo","tasks"],"width":16,"height":16,"path":""},"chevron-down":{"name":"chevron-down","figma":{"id":"0:117","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["triangle","arrow"],"width":10,"height":16,"path":""},"chevron-left":{"name":"chevron-left","figma":{"id":"0:119","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["triangle","arrow"],"width":8,"height":16,"path":""},"chevron-right":{"name":"chevron-right","figma":{"id":"0:121","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["triangle","arrow"],"width":8,"height":16,"path":""},"chevron-up":{"name":"chevron-up","figma":{"id":"0:123","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["triangle","arrow"],"width":10,"height":16,"path":""},"circle-slash":{"name":"circle-slash","figma":{"id":"0:127","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["no","deny","fail","failure","error","bad"],"width":14,"height":16,"path":""},"circuit-board":{"name":"circuit-board","figma":{"id":"0:132","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["developer","hardware","electricity"],"width":14,"height":16,"path":""},"clippy":{"name":"clippy","figma":{"id":"0:138","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["copy","paste","save","capture","clipboard"],"width":14,"height":16,"path":""},"clock":{"name":"clock","figma":{"id":"0:147","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["time","hour","minute","second","watch"],"width":14,"height":16,"path":""},"cloud-download":{"name":"cloud-download","figma":{"id":"0:152","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["save","install","get"],"width":16,"height":16,"path":""},"cloud-upload":{"name":"cloud-upload","figma":{"id":"0:156","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["put","export"],"width":16,"height":16,"path":""},"code":{"name":"code","figma":{"id":"0:160","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["brackets"],"width":14,"height":16,"path":""},"comment-discussion":{"name":"comment-discussion","figma":{"id":"0:164","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["converse","talk"],"width":16,"height":16,"path":""},"comment":{"name":"comment","figma":{"id":"0:169","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["speak","bubble"],"width":16,"height":16,"path":""},"credit-card":{"name":"credit-card","figma":{"id":"0:173","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["money","billing","payments","transactions"],"width":16,"height":16,"path":""},"dash":{"name":"dash","figma":{"id":"0:178","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["hyphen","range"],"width":8,"height":16,"path":""},"dashboard":{"name":"dashboard","figma":{"id":"0:182","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["speed","dial"],"width":16,"height":16,"path":""},"database":{"name":"database","figma":{"id":"0:190","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["disks","data"],"width":12,"height":16,"path":""},"desktop-download":{"name":"desktop-download","figma":{"id":"0:196","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["clone","download"],"width":16,"height":16,"path":""},"device-camera-video":{"name":"device-camera-video","figma":{"id":"0:198","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["watch","view","media","stream"],"width":16,"height":16,"path":""},"device-camera":{"name":"device-camera","figma":{"id":"0:202","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["photo","picture","image","snapshot"],"width":16,"height":16,"path":""},"device-desktop":{"name":"device-desktop","figma":{"id":"0:208","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["computer","monitor"],"width":16,"height":16,"path":""},"device-mobile":{"name":"device-mobile","figma":{"id":"0:212","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["phone","iphone","cellphone"],"width":10,"height":16,"path":""},"diff-added":{"name":"diff-added","figma":{"id":"0:217","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["new","addition","plus"],"width":14,"height":16,"path":""},"diff-ignored":{"name":"diff-ignored","figma":{"id":"0:222","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["slash"],"width":14,"height":16,"path":""},"diff-modified":{"name":"diff-modified","figma":{"id":"0:227","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["dot","changed","updated"],"width":14,"height":16,"path":""},"diff-removed":{"name":"diff-removed","figma":{"id":"0:232","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["deleted","subtracted","dash"],"width":14,"height":16,"path":""},"diff-renamed":{"name":"diff-renamed","figma":{"id":"0:237","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["moved","arrow"],"width":14,"height":16,"path":""},"diff":{"name":"diff","figma":{"id":"0:242","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["difference","changes","compare"],"width":13,"height":16,"path":""},"ellipsis":{"name":"ellipsis","figma":{"id":"0:249","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["dot","read","more","hidden","expand"],"width":12,"height":16,"path":""},"eye":{"name":"eye","figma":{"id":"0:255","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["look","watch","see"],"width":16,"height":16,"path":""},"file-binary":{"name":"file-binary","figma":{"id":"0:260","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["image","video","word","powerpoint","excel"],"width":12,"height":16,"path":""},"file-code":{"name":"file-code","figma":{"id":"0:270","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["text","javascript","html","css","php","ruby","coffeescript","sass","scss"],"width":12,"height":16,"path":""},"file-directory":{"name":"file-directory","figma":{"id":"0:276","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["folder"],"width":14,"height":16,"path":""},"file-media":{"name":"file-media","figma":{"id":"0:280","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["image","video","audio"],"width":12,"height":16,"path":""},"file-pdf":{"name":"file-pdf","figma":{"id":"0:285","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["adobe"],"width":12,"height":16,"path":""},"file-submodule":{"name":"file-submodule","figma":{"id":"0:292","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["folder"],"width":14,"height":16,"path":""},"file-symlink-directory":{"name":"file-symlink-directory","figma":{"id":"0:298","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["folder","subfolder","link","alias"],"width":14,"height":16,"path":""},"file-symlink-file":{"name":"file-symlink-file","figma":{"id":"0:303","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["link","alias"],"width":12,"height":16,"path":""},"file":{"name":"file","figma":{"id":"0:308","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["file","text","words"],"width":12,"height":16,"path":""},"file-zip":{"name":"file-zip","figma":{"id":"0:316","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["compress","archive"],"width":12,"height":16,"path":""},"flame":{"name":"flame","figma":{"id":"0:325","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["fire","hot","burn","trending"],"width":12,"height":16,"path":""},"fold":{"name":"fold","figma":{"id":"0:329","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["unfold","hide","collapse"],"width":14,"height":16,"path":""},"gear":{"name":"gear","figma":{"id":"0:334","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["settings"],"width":14,"height":16,"path":""},"gift":{"name":"gift","figma":{"id":"0:338","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["package","present","skill","craft","freebie"],"width":14,"height":16,"path":""},"gist-secret":{"name":"gist-secret","figma":{"id":"0:347","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["gist","secret","private"],"width":14,"height":16,"path":""},"gist":{"name":"gist","figma":{"id":"0:354","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["gist","github"],"width":12,"height":16,"path":""},"git-branch":{"name":"git-branch","figma":{"id":"0:360","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["fork","branch","git","duplicate"],"width":10,"height":16,"path":""},"git-commit":{"name":"git-commit","figma":{"id":"0:366","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["save"],"width":14,"height":16,"path":""},"git-compare":{"name":"git-compare","figma":{"id":"0:370","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["difference","changes"],"width":14,"height":16,"path":""},"git-merge":{"name":"git-merge","figma":{"id":"0:376","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["join"],"width":12,"height":16,"path":""},"git-pull-request":{"name":"git-pull-request","figma":{"id":"0:382","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["review"],"width":12,"height":16,"path":""},"globe":{"name":"globe","figma":{"id":"0:389","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["world","earth","planet"],"width":14,"height":16,"path":""},"graph":{"name":"graph","figma":{"id":"0:396","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["trend","stats","statistics"],"width":16,"height":16,"path":""},"heart":{"name":"heart","figma":{"id":"0:400","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["love","beat"],"width":12,"height":16,"path":""},"history":{"name":"history","figma":{"id":"0:404","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["time","past","revert","back"],"width":14,"height":16,"path":""},"home":{"name":"home","figma":{"id":"0:408","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["welcome","index","house","building"],"width":16,"height":16,"path":""},"horizontal-rule":{"name":"horizontal-rule","figma":{"id":"0:412","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["hr"],"width":10,"height":16,"path":""},"hubot":{"name":"hubot","figma":{"id":"0:419","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["robot","bot"],"width":14,"height":16,"path":""},"inbox":{"name":"inbox","figma":{"id":"0:426","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["mail","todo","new","messages"],"width":14,"height":16,"path":""},"info":{"name":"info","figma":{"id":"0:430","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["help"],"width":14,"height":16,"path":""},"issue-closed":{"name":"issue-closed","figma":{"id":"0:436","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["done","complete"],"width":16,"height":16,"path":""},"issue-opened":{"name":"issue-opened","figma":{"id":"0:442","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["new"],"width":14,"height":16,"path":""},"issue-reopened":{"name":"issue-reopened","figma":{"id":"0:448","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["regression"],"width":14,"height":16,"path":""},"italic":{"name":"italic","figma":{"id":"0:454","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["font","italic","style"],"width":6,"height":16,"path":""},"jersey":{"name":"jersey","figma":{"id":"0:458","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["team","game","basketball"],"width":14,"height":16,"path":""},"keyboard":{"name":"keyboard","figma":{"id":"0:466","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["type","keys","write","shortcuts"],"width":16,"height":16,"path":""},"law":{"name":"law","figma":{"id":"0:490","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["legal","bill"],"width":14,"height":16,"path":""},"link":{"name":"link","figma":{"id":"0:496","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["connect","hyperlink"],"width":16,"height":16,"path":""},"list-ordered":{"name":"list-ordered","figma":{"id":"0:500","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["numbers","tasks","todo","items"],"width":12,"height":16,"path":""},"list-unordered":{"name":"list-unordered","figma":{"id":"0:508","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["bullet","point","tasks","todo","items"],"width":12,"height":16,"path":""},"location":{"name":"location","figma":{"id":"0:516","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["here","marker"],"width":12,"height":16,"path":""},"lock":{"name":"lock","figma":{"id":"0:521","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["secure","safe","protected"],"width":12,"height":16,"path":""},"logo-gist":{"name":"logo-gist","figma":{"id":"0:529","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["brand","github","logo"],"width":25,"height":16,"path":""},"logo-github":{"name":"logo-github","figma":{"id":"0:536","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["brand","github","logo"],"width":45,"height":16,"path":""},"mail-read":{"name":"mail-read","figma":{"id":"0:547","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["email","open"],"width":14,"height":16,"path":""},"reply":{"name":"reply","figma":{"id":"0:554","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["reply all","back"],"width":14,"height":16,"path":""},"mail":{"name":"mail","figma":{"id":"0:558","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["email","unread"],"width":14,"height":16,"path":""},"mark-github":{"name":"mark-github","figma":{"id":"0:563","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["octocat","brand","github","logo"],"width":16,"height":16,"path":""},"markdown":{"name":"markdown","figma":{"id":"0:567","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["markup","style"],"width":16,"height":16,"path":""},"megaphone":{"name":"megaphone","figma":{"id":"0:572","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["bullhorn","loud","shout","broadcast"],"width":16,"height":16,"path":""},"mention":{"name":"mention","figma":{"id":"0:579","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["at","ping"],"width":14,"height":16,"path":""},"milestone":{"name":"milestone","figma":{"id":"0:583","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["marker"],"width":14,"height":16,"path":""},"mirror":{"name":"mirror","figma":{"id":"0:589","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["reflect"],"width":16,"height":16,"path":""},"mortar-board":{"name":"mortar-board","figma":{"id":"0:594","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["education","learn","teach"],"width":16,"height":16,"path":""},"mute":{"name":"mute","figma":{"id":"0:599","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["quiet","sound","audio","turn","off"],"width":16,"height":16,"path":""},"no-newline":{"name":"no-newline","figma":{"id":"0:603","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["return"],"width":16,"height":16,"path":""},"octoface":{"name":"octoface","figma":{"id":"0:609","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["octocat","brand"],"width":16,"height":16,"path":""},"organization":{"name":"organization","figma":{"id":"0:613","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["people","group","team"],"width":16,"height":16,"path":""},"package":{"name":"package","figma":{"id":"0:617","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["box","ship"],"width":16,"height":16,"path":""},"paintcan":{"name":"paintcan","figma":{"id":"0:624","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["style","theme","art","color"],"width":12,"height":16,"path":""},"pencil":{"name":"pencil","figma":{"id":"0:630","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["edit","change","update","write"],"width":14,"height":16,"path":""},"person":{"name":"person","figma":{"id":"0:633","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["people","man","woman","human"],"width":12,"height":16,"path":""},"pin":{"name":"pin","figma":{"id":"0:635","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["save","star","bookmark"],"width":16,"height":16,"path":""},"plug":{"name":"plug","figma":{"id":"0:637","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["hook","webhook"],"width":14,"height":16,"path":""},"plus":{"name":"plus","figma":{"id":"0:639","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["add","new","more"],"width":12,"height":16,"path":""},"primitive-dot":{"name":"primitive-dot","figma":{"id":"0:641","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["circle"],"width":8,"height":16,"path":""},"primitive-square":{"name":"primitive-square","figma":{"id":"0:643","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["box"],"width":8,"height":16,"path":""},"pulse":{"name":"pulse","figma":{"id":"0:645","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["graph","trend","line","activity"],"width":14,"height":16,"path":""},"question":{"name":"question","figma":{"id":"0:649","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["help","explain"],"width":14,"height":16,"path":""},"quote":{"name":"quote","figma":{"id":"0:655","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["quotation"],"width":14,"height":16,"path":""},"radio-tower":{"name":"radio-tower","figma":{"id":"0:659","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["broadcast"],"width":16,"height":16,"path":""},"repo-clone":{"name":"repo-clone","figma":{"id":"0:669","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["book","journal","repository"],"width":16,"height":16,"path":""},"repo-force-push":{"name":"repo-force-push","figma":{"id":"0:681","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["book","journal","put"],"width":12,"height":16,"path":""},"repo-forked":{"name":"repo-forked","figma":{"id":"0:685","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["book","journal","copy"],"width":10,"height":16,"path":""},"repo-pull":{"name":"repo-pull","figma":{"id":"0:691","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["book","journal","get"],"width":16,"height":16,"path":""},"repo-push":{"name":"repo-push","figma":{"id":"0:700","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["book","journal","repository","put"],"width":12,"height":16,"path":""},"repo":{"name":"repo","figma":{"id":"0:706","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["book","journal","repository"],"width":12,"height":16,"path":""},"rocket":{"name":"rocket","figma":{"id":"0:715","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["staff","stafftools","blast","off","space","launch","ship"],"width":16,"height":16,"path":""},"rss":{"name":"rss","figma":{"id":"0:719","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["broadcast","feed","atom"],"width":10,"height":16,"path":""},"ruby":{"name":"ruby","figma":{"id":"0:724","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["code","language"],"width":16,"height":16,"path":""},"search":{"name":"search","figma":{"id":"0:729","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["magnifying","glass"],"width":16,"height":16,"path":""},"server":{"name":"server","figma":{"id":"0:733","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["computers","racks","ops"],"width":12,"height":16,"path":""},"settings":{"name":"settings","figma":{"id":"0:751","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["sliders","filters","controls","levels"],"width":16,"height":16,"path":""},"shield":{"name":"shield","figma":{"id":"0:762","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["protect","shield","lock"],"width":14,"height":16,"path":""},"sign-in":{"name":"sign-in","figma":{"id":"0:764","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["door","arrow","direction","enter","log in"],"width":14,"height":16,"path":""},"sign-out":{"name":"sign-out","figma":{"id":"0:768","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["door","arrow","direction","leave","log out"],"width":16,"height":16,"path":""},"smiley":{"name":"smiley","figma":{"id":"0:772","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["emoji","smile","mood","emotion"],"width":16,"height":16,"path":""},"squirrel":{"name":"squirrel","figma":{"id":"0:779","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["ship","shipit","launch"],"width":16,"height":16,"path":""},"star":{"name":"star","figma":{"id":"0:781","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["save","remember","like"],"width":14,"height":16,"path":""},"stop":{"name":"stop","figma":{"id":"0:785","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["block","spam","report"],"width":14,"height":16,"path":""},"sync":{"name":"sync","figma":{"id":"0:791","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["cycle","refresh","loop"],"width":12,"height":16,"path":""},"tag":{"name":"tag","figma":{"id":"0:795","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["release"],"width":14,"height":16,"path":""},"tasklist":{"name":"tasklist","figma":{"id":"0:800","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["todo"],"width":16,"height":16,"path":""},"telescope":{"name":"telescope","figma":{"id":"0:806","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["science","space","look","view","explore"],"width":14,"height":16,"path":""},"terminal":{"name":"terminal","figma":{"id":"0:815","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["code","ops","shell"],"width":14,"height":16,"path":""},"text-size":{"name":"text-size","figma":{"id":"0:821","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["font","size","text"],"width":18,"height":16,"path":""},"three-bars":{"name":"three-bars","figma":{"id":"0:826","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["hamburger","menu","dropdown"],"width":12,"height":16,"path":""},"thumbsdown":{"name":"thumbsdown","figma":{"id":"0:831","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["thumb","thumbsdown","rejected","dislike"],"width":16,"height":16,"path":""},"thumbsup":{"name":"thumbsup","figma":{"id":"0:835","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["thumb","thumbsup","prop","ship","like"],"width":16,"height":16,"path":""},"tools":{"name":"tools","figma":{"id":"0:839","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["screwdriver","wrench","settings"],"width":16,"height":16,"path":""},"trashcan":{"name":"trashcan","figma":{"id":"0:844","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["garbage","rubbish","recycle","delete"],"width":12,"height":16,"path":""},"triangle-down":{"name":"triangle-down","figma":{"id":"0:847","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["arrow","point","direction"],"width":12,"height":16,"path":""},"triangle-left":{"name":"triangle-left","figma":{"id":"0:849","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["arrow","point","direction"],"width":6,"height":16,"path":""},"triangle-right":{"name":"triangle-right","figma":{"id":"0:851","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["arrow","point","direction"],"width":6,"height":16,"path":""},"triangle-up":{"name":"triangle-up","figma":{"id":"0:853","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["arrow","point","direction"],"width":12,"height":16,"path":""},"unfold":{"name":"unfold","figma":{"id":"0:857","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["expand","open","reveal"],"width":14,"height":16,"path":""},"unmute":{"name":"unmute","figma":{"id":"0:862","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["loud","volume","audio","sound","play"],"width":16,"height":16,"path":""},"project":{"name":"project","figma":{"id":"0:868","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["board","kanban","columns","scrum"],"width":15,"height":16,"path":""},"kebab-horizontal":{"name":"kebab-horizontal","figma":{"id":"0:875","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["kebab","dot","menu","more"],"width":13,"height":16,"path":""},"kebab-vertical":{"name":"kebab-vertical","figma":{"id":"0:880","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["kebab","dot","menu","more"],"width":3,"height":16,"path":""},"report":{"name":"report","figma":{"id":"0:885","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["report","abuse","flag"],"width":16,"height":16,"path":""},"note":{"name":"note","figma":{"id":"0:891","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["card","paper","ticket"],"width":14,"height":16,"path":""},"screen-full":{"name":"screen-full","figma":{"id":"0:898","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["fullscreen","expand"],"width":14,"height":16,"path":""},"screen-normal":{"name":"screen-normal","figma":{"id":"0:906","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["fullscreen","expand","exit"],"width":14,"height":16,"path":""},"unverified":{"name":"unverified","figma":{"id":"0:914","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["insecure","untrusted","signed"],"width":16,"height":16,"path":""},"verified":{"name":"verified","figma":{"id":"0:919","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["trusted","secure","trustworthy","signed"],"width":16,"height":16,"path":""},"versions":{"name":"versions","figma":{"id":"0:923","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["history","commits"],"width":14,"height":16,"path":""},"watch":{"name":"watch","figma":{"id":"0:929","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["wait","hourglass","time","date"],"width":12,"height":16,"path":""},"x":{"name":"x","figma":{"id":"0:932","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["remove","close","delete"],"width":12,"height":16,"path":""},"zap":{"name":"zap","figma":{"id":"0:934","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["electricity","lightning","props","like","star","save"],"width":10,"height":16,"path":""},"key":{"name":"key","figma":{"id":"0:938","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["key","lock","secure","safe"],"width":14,"height":16,"path":""},"grabber":{"name":"grabber","figma":{"id":"0:942","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["mover","drap","drop","sort"],"width":8,"height":16,"path":""},"plus-small":{"name":"plus-small","figma":{"id":"0:947","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["add","new","more","small"],"width":7,"height":16,"path":""},"light-bulb":{"name":"light-bulb","figma":{"id":"0:951","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["idea"],"width":12,"height":16,"path":""},"link-external":{"name":"link-external","figma":{"id":"0:956","file":"FP7lqd1V00LUaT5zvdklkkZr"},"keywords":["out","see","more","go","to"],"width":12,"height":16,"path":""}} \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/alert.svg b/htdocs/theme/common/octicons/build/svg/alert.svg new file mode 100644 index 00000000000..ca50ea8b557 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/alert.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/arrow-down.svg b/htdocs/theme/common/octicons/build/svg/arrow-down.svg new file mode 100644 index 00000000000..c1acf0ac259 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/arrow-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/arrow-left.svg b/htdocs/theme/common/octicons/build/svg/arrow-left.svg new file mode 100644 index 00000000000..f3cda4f5067 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/arrow-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/arrow-right.svg b/htdocs/theme/common/octicons/build/svg/arrow-right.svg new file mode 100644 index 00000000000..04a4fbffb37 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/arrow-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/arrow-small-down.svg b/htdocs/theme/common/octicons/build/svg/arrow-small-down.svg new file mode 100644 index 00000000000..57c1ee86034 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/arrow-small-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/arrow-small-left.svg b/htdocs/theme/common/octicons/build/svg/arrow-small-left.svg new file mode 100644 index 00000000000..9fa227ea82e --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/arrow-small-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/arrow-small-right.svg b/htdocs/theme/common/octicons/build/svg/arrow-small-right.svg new file mode 100644 index 00000000000..bca68473434 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/arrow-small-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/arrow-small-up.svg b/htdocs/theme/common/octicons/build/svg/arrow-small-up.svg new file mode 100644 index 00000000000..6c132f182c2 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/arrow-small-up.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/arrow-up.svg b/htdocs/theme/common/octicons/build/svg/arrow-up.svg new file mode 100644 index 00000000000..63be8901bc4 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/arrow-up.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/beaker.svg b/htdocs/theme/common/octicons/build/svg/beaker.svg new file mode 100644 index 00000000000..19377609a5d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/beaker.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/bell.svg b/htdocs/theme/common/octicons/build/svg/bell.svg new file mode 100644 index 00000000000..d076a0c2129 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/bell.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/bold.svg b/htdocs/theme/common/octicons/build/svg/bold.svg new file mode 100644 index 00000000000..d2f29953034 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/bold.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/book.svg b/htdocs/theme/common/octicons/build/svg/book.svg new file mode 100644 index 00000000000..d21fa56a72d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/book.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/bookmark.svg b/htdocs/theme/common/octicons/build/svg/bookmark.svg new file mode 100644 index 00000000000..de64157315d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/bookmark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/briefcase.svg b/htdocs/theme/common/octicons/build/svg/briefcase.svg new file mode 100644 index 00000000000..5104b8193bd --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/briefcase.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/broadcast.svg b/htdocs/theme/common/octicons/build/svg/broadcast.svg new file mode 100644 index 00000000000..ddc1458f1e9 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/broadcast.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/browser.svg b/htdocs/theme/common/octicons/build/svg/browser.svg new file mode 100644 index 00000000000..00f512adb15 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/browser.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/bug.svg b/htdocs/theme/common/octicons/build/svg/bug.svg new file mode 100644 index 00000000000..bd533f829e7 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/bug.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/calendar.svg b/htdocs/theme/common/octicons/build/svg/calendar.svg new file mode 100644 index 00000000000..fede886f63c --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/calendar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/check.svg b/htdocs/theme/common/octicons/build/svg/check.svg new file mode 100644 index 00000000000..2d59600912e --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/check.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/checklist.svg b/htdocs/theme/common/octicons/build/svg/checklist.svg new file mode 100644 index 00000000000..671aa3b507e --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/checklist.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/chevron-down.svg b/htdocs/theme/common/octicons/build/svg/chevron-down.svg new file mode 100644 index 00000000000..3a4e0aad5c6 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/chevron-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/chevron-left.svg b/htdocs/theme/common/octicons/build/svg/chevron-left.svg new file mode 100644 index 00000000000..2de62df36b3 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/chevron-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/chevron-right.svg b/htdocs/theme/common/octicons/build/svg/chevron-right.svg new file mode 100644 index 00000000000..a5dadc68eed --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/chevron-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/chevron-up.svg b/htdocs/theme/common/octicons/build/svg/chevron-up.svg new file mode 100644 index 00000000000..19db9dd3992 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/chevron-up.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/circle-slash.svg b/htdocs/theme/common/octicons/build/svg/circle-slash.svg new file mode 100644 index 00000000000..edfb3d8046a --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/circle-slash.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/circuit-board.svg b/htdocs/theme/common/octicons/build/svg/circuit-board.svg new file mode 100644 index 00000000000..f9a4c7e6119 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/circuit-board.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/clippy.svg b/htdocs/theme/common/octicons/build/svg/clippy.svg new file mode 100644 index 00000000000..9cb633776de --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/clippy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/clock.svg b/htdocs/theme/common/octicons/build/svg/clock.svg new file mode 100644 index 00000000000..4bb89e09b51 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/clock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/cloud-download.svg b/htdocs/theme/common/octicons/build/svg/cloud-download.svg new file mode 100644 index 00000000000..8cc3d0f51a0 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/cloud-download.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/cloud-upload.svg b/htdocs/theme/common/octicons/build/svg/cloud-upload.svg new file mode 100644 index 00000000000..c17e1d35d67 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/cloud-upload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/code.svg b/htdocs/theme/common/octicons/build/svg/code.svg new file mode 100644 index 00000000000..6e6560e42d1 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/comment-discussion.svg b/htdocs/theme/common/octicons/build/svg/comment-discussion.svg new file mode 100644 index 00000000000..c155b889337 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/comment-discussion.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/comment.svg b/htdocs/theme/common/octicons/build/svg/comment.svg new file mode 100644 index 00000000000..2c6d88c0b92 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/comment.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/credit-card.svg b/htdocs/theme/common/octicons/build/svg/credit-card.svg new file mode 100644 index 00000000000..7da9f29aca3 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/credit-card.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/dash.svg b/htdocs/theme/common/octicons/build/svg/dash.svg new file mode 100644 index 00000000000..b9a28fef746 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/dash.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/dashboard.svg b/htdocs/theme/common/octicons/build/svg/dashboard.svg new file mode 100644 index 00000000000..dad1fd7a983 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/database.svg b/htdocs/theme/common/octicons/build/svg/database.svg new file mode 100644 index 00000000000..08b036d9aee --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/database.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/desktop-download.svg b/htdocs/theme/common/octicons/build/svg/desktop-download.svg new file mode 100644 index 00000000000..74b2c7d837b --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/desktop-download.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/device-camera-video.svg b/htdocs/theme/common/octicons/build/svg/device-camera-video.svg new file mode 100644 index 00000000000..8f989c86e9c --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/device-camera-video.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/device-camera.svg b/htdocs/theme/common/octicons/build/svg/device-camera.svg new file mode 100644 index 00000000000..609be0ea905 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/device-camera.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/device-desktop.svg b/htdocs/theme/common/octicons/build/svg/device-desktop.svg new file mode 100644 index 00000000000..3671fd0418d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/device-desktop.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/device-mobile.svg b/htdocs/theme/common/octicons/build/svg/device-mobile.svg new file mode 100644 index 00000000000..84559ca7730 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/device-mobile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/diff-added.svg b/htdocs/theme/common/octicons/build/svg/diff-added.svg new file mode 100644 index 00000000000..8394151ee59 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/diff-added.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/diff-ignored.svg b/htdocs/theme/common/octicons/build/svg/diff-ignored.svg new file mode 100644 index 00000000000..eaa2bee6df5 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/diff-ignored.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/diff-modified.svg b/htdocs/theme/common/octicons/build/svg/diff-modified.svg new file mode 100644 index 00000000000..6a17dc3a9a1 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/diff-modified.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/diff-removed.svg b/htdocs/theme/common/octicons/build/svg/diff-removed.svg new file mode 100644 index 00000000000..2dfe2a1b23d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/diff-removed.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/diff-renamed.svg b/htdocs/theme/common/octicons/build/svg/diff-renamed.svg new file mode 100644 index 00000000000..c1f0982bf51 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/diff-renamed.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/diff.svg b/htdocs/theme/common/octicons/build/svg/diff.svg new file mode 100644 index 00000000000..cbaa51ff7d1 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/diff.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/ellipsis.svg b/htdocs/theme/common/octicons/build/svg/ellipsis.svg new file mode 100644 index 00000000000..7d4b9d8dc65 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/ellipsis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/eye.svg b/htdocs/theme/common/octicons/build/svg/eye.svg new file mode 100644 index 00000000000..4f43a098921 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file-binary.svg b/htdocs/theme/common/octicons/build/svg/file-binary.svg new file mode 100644 index 00000000000..93d0f547f0a --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file-binary.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file-code.svg b/htdocs/theme/common/octicons/build/svg/file-code.svg new file mode 100644 index 00000000000..5b4b199531b --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file-code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file-directory.svg b/htdocs/theme/common/octicons/build/svg/file-directory.svg new file mode 100644 index 00000000000..4bf1f1caa89 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file-directory.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file-media.svg b/htdocs/theme/common/octicons/build/svg/file-media.svg new file mode 100644 index 00000000000..018e533e2e8 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file-media.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file-pdf.svg b/htdocs/theme/common/octicons/build/svg/file-pdf.svg new file mode 100644 index 00000000000..1b1703e19fd --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file-pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file-submodule.svg b/htdocs/theme/common/octicons/build/svg/file-submodule.svg new file mode 100644 index 00000000000..355a90546fe --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file-submodule.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file-symlink-directory.svg b/htdocs/theme/common/octicons/build/svg/file-symlink-directory.svg new file mode 100644 index 00000000000..4b6263acc2b --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file-symlink-directory.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file-symlink-file.svg b/htdocs/theme/common/octicons/build/svg/file-symlink-file.svg new file mode 100644 index 00000000000..b2aaf249407 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file-symlink-file.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file-zip.svg b/htdocs/theme/common/octicons/build/svg/file-zip.svg new file mode 100644 index 00000000000..e2bb5b0a94e --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file-zip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/file.svg b/htdocs/theme/common/octicons/build/svg/file.svg new file mode 100644 index 00000000000..0997406531c --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/file.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/flame.svg b/htdocs/theme/common/octicons/build/svg/flame.svg new file mode 100644 index 00000000000..49507a1073a --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/flame.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/fold.svg b/htdocs/theme/common/octicons/build/svg/fold.svg new file mode 100644 index 00000000000..1b0b399b688 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/fold.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/gear.svg b/htdocs/theme/common/octicons/build/svg/gear.svg new file mode 100644 index 00000000000..aded0c46675 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/gear.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/gift.svg b/htdocs/theme/common/octicons/build/svg/gift.svg new file mode 100644 index 00000000000..761be5473ca --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/gift.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/gist-secret.svg b/htdocs/theme/common/octicons/build/svg/gist-secret.svg new file mode 100644 index 00000000000..a6459e19bf2 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/gist-secret.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/gist.svg b/htdocs/theme/common/octicons/build/svg/gist.svg new file mode 100644 index 00000000000..9584460c593 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/gist.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/git-branch.svg b/htdocs/theme/common/octicons/build/svg/git-branch.svg new file mode 100644 index 00000000000..21ca8d8d3ac --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/git-branch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/git-commit.svg b/htdocs/theme/common/octicons/build/svg/git-commit.svg new file mode 100644 index 00000000000..3cc2e82a86f --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/git-commit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/git-compare.svg b/htdocs/theme/common/octicons/build/svg/git-compare.svg new file mode 100644 index 00000000000..4737499a242 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/git-compare.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/git-merge.svg b/htdocs/theme/common/octicons/build/svg/git-merge.svg new file mode 100644 index 00000000000..fedb516064a --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/git-merge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/git-pull-request.svg b/htdocs/theme/common/octicons/build/svg/git-pull-request.svg new file mode 100644 index 00000000000..4f597593774 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/git-pull-request.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/globe.svg b/htdocs/theme/common/octicons/build/svg/globe.svg new file mode 100644 index 00000000000..990554c05eb --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/globe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/grabber.svg b/htdocs/theme/common/octicons/build/svg/grabber.svg new file mode 100644 index 00000000000..1a41fd02857 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/grabber.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/graph.svg b/htdocs/theme/common/octicons/build/svg/graph.svg new file mode 100644 index 00000000000..cd3909ed9fa --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/graph.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/heart.svg b/htdocs/theme/common/octicons/build/svg/heart.svg new file mode 100644 index 00000000000..8b81f8845fe --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/heart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/history.svg b/htdocs/theme/common/octicons/build/svg/history.svg new file mode 100644 index 00000000000..ee4d9fb1ca6 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/history.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/home.svg b/htdocs/theme/common/octicons/build/svg/home.svg new file mode 100644 index 00000000000..f3d3138fe7c --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/horizontal-rule.svg b/htdocs/theme/common/octicons/build/svg/horizontal-rule.svg new file mode 100644 index 00000000000..9a05c305c3d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/horizontal-rule.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/hubot.svg b/htdocs/theme/common/octicons/build/svg/hubot.svg new file mode 100644 index 00000000000..fea9f4b2237 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/hubot.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/inbox.svg b/htdocs/theme/common/octicons/build/svg/inbox.svg new file mode 100644 index 00000000000..f9cfec28bce --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/inbox.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/info.svg b/htdocs/theme/common/octicons/build/svg/info.svg new file mode 100644 index 00000000000..745ef337a3d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/info.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/issue-closed.svg b/htdocs/theme/common/octicons/build/svg/issue-closed.svg new file mode 100644 index 00000000000..0a7819ac084 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/issue-closed.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/issue-opened.svg b/htdocs/theme/common/octicons/build/svg/issue-opened.svg new file mode 100644 index 00000000000..a88cbcc7fd1 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/issue-opened.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/issue-reopened.svg b/htdocs/theme/common/octicons/build/svg/issue-reopened.svg new file mode 100644 index 00000000000..789e18bffb5 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/issue-reopened.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/italic.svg b/htdocs/theme/common/octicons/build/svg/italic.svg new file mode 100644 index 00000000000..51d65f10a1a --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/italic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/jersey.svg b/htdocs/theme/common/octicons/build/svg/jersey.svg new file mode 100644 index 00000000000..776e4567941 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/jersey.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/kebab-horizontal.svg b/htdocs/theme/common/octicons/build/svg/kebab-horizontal.svg new file mode 100644 index 00000000000..7c472d3657e --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/kebab-horizontal.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/kebab-vertical.svg b/htdocs/theme/common/octicons/build/svg/kebab-vertical.svg new file mode 100644 index 00000000000..2aaee6009fe --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/kebab-vertical.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/key.svg b/htdocs/theme/common/octicons/build/svg/key.svg new file mode 100644 index 00000000000..ac8badc2661 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/key.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/keyboard.svg b/htdocs/theme/common/octicons/build/svg/keyboard.svg new file mode 100644 index 00000000000..89712ade509 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/keyboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/law.svg b/htdocs/theme/common/octicons/build/svg/law.svg new file mode 100644 index 00000000000..5ccc46420fc --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/law.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/light-bulb.svg b/htdocs/theme/common/octicons/build/svg/light-bulb.svg new file mode 100644 index 00000000000..d2ff74ce4f7 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/light-bulb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/link-external.svg b/htdocs/theme/common/octicons/build/svg/link-external.svg new file mode 100644 index 00000000000..70b569d3742 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/link-external.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/link.svg b/htdocs/theme/common/octicons/build/svg/link.svg new file mode 100644 index 00000000000..820aef771e0 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/list-ordered.svg b/htdocs/theme/common/octicons/build/svg/list-ordered.svg new file mode 100644 index 00000000000..64126c3b8ef --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/list-ordered.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/list-unordered.svg b/htdocs/theme/common/octicons/build/svg/list-unordered.svg new file mode 100644 index 00000000000..0b435366758 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/list-unordered.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/location.svg b/htdocs/theme/common/octicons/build/svg/location.svg new file mode 100644 index 00000000000..f6372a3c441 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/location.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/lock.svg b/htdocs/theme/common/octicons/build/svg/lock.svg new file mode 100644 index 00000000000..55870644246 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/logo-gist.svg b/htdocs/theme/common/octicons/build/svg/logo-gist.svg new file mode 100644 index 00000000000..29f2213e1e8 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/logo-gist.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/logo-github.svg b/htdocs/theme/common/octicons/build/svg/logo-github.svg new file mode 100644 index 00000000000..253c13ecbaa --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/logo-github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/mail-read.svg b/htdocs/theme/common/octicons/build/svg/mail-read.svg new file mode 100644 index 00000000000..bf4deaf9b29 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/mail-read.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/mail.svg b/htdocs/theme/common/octicons/build/svg/mail.svg new file mode 100644 index 00000000000..9fca68be5d6 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/mail.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/mark-github.svg b/htdocs/theme/common/octicons/build/svg/mark-github.svg new file mode 100644 index 00000000000..af1bfa1f96c --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/mark-github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/markdown.svg b/htdocs/theme/common/octicons/build/svg/markdown.svg new file mode 100644 index 00000000000..999110e268c --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/markdown.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/megaphone.svg b/htdocs/theme/common/octicons/build/svg/megaphone.svg new file mode 100644 index 00000000000..a62f82dc892 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/megaphone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/mention.svg b/htdocs/theme/common/octicons/build/svg/mention.svg new file mode 100644 index 00000000000..c09499bd9cd --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/mention.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/milestone.svg b/htdocs/theme/common/octicons/build/svg/milestone.svg new file mode 100644 index 00000000000..803465bdba9 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/milestone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/mirror.svg b/htdocs/theme/common/octicons/build/svg/mirror.svg new file mode 100644 index 00000000000..76e0c37e070 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/mirror.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/mortar-board.svg b/htdocs/theme/common/octicons/build/svg/mortar-board.svg new file mode 100644 index 00000000000..302415b1736 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/mortar-board.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/mute.svg b/htdocs/theme/common/octicons/build/svg/mute.svg new file mode 100644 index 00000000000..4d894a1cadd --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/mute.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/no-newline.svg b/htdocs/theme/common/octicons/build/svg/no-newline.svg new file mode 100644 index 00000000000..2a8fb94fe31 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/no-newline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/note.svg b/htdocs/theme/common/octicons/build/svg/note.svg new file mode 100644 index 00000000000..cbf7963eb1a --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/note.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/octoface.svg b/htdocs/theme/common/octicons/build/svg/octoface.svg new file mode 100644 index 00000000000..bb1a40dce94 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/octoface.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/organization.svg b/htdocs/theme/common/octicons/build/svg/organization.svg new file mode 100644 index 00000000000..af333e418dd --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/organization.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/package.svg b/htdocs/theme/common/octicons/build/svg/package.svg new file mode 100644 index 00000000000..720e30026a5 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/package.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/paintcan.svg b/htdocs/theme/common/octicons/build/svg/paintcan.svg new file mode 100644 index 00000000000..08b4a4ba574 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/paintcan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/pencil.svg b/htdocs/theme/common/octicons/build/svg/pencil.svg new file mode 100644 index 00000000000..41c6e7ec6f8 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/pencil.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/person.svg b/htdocs/theme/common/octicons/build/svg/person.svg new file mode 100644 index 00000000000..5871e2f447a --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/person.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/pin.svg b/htdocs/theme/common/octicons/build/svg/pin.svg new file mode 100644 index 00000000000..861ae05afdc --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/pin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/plug.svg b/htdocs/theme/common/octicons/build/svg/plug.svg new file mode 100644 index 00000000000..42865d52931 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/plug.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/plus-small.svg b/htdocs/theme/common/octicons/build/svg/plus-small.svg new file mode 100644 index 00000000000..5e093a4bb22 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/plus-small.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/plus.svg b/htdocs/theme/common/octicons/build/svg/plus.svg new file mode 100644 index 00000000000..23c27d8a45a --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/primitive-dot.svg b/htdocs/theme/common/octicons/build/svg/primitive-dot.svg new file mode 100644 index 00000000000..6f465da5a76 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/primitive-dot.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/primitive-square.svg b/htdocs/theme/common/octicons/build/svg/primitive-square.svg new file mode 100644 index 00000000000..9d4058bb51e --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/primitive-square.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/project.svg b/htdocs/theme/common/octicons/build/svg/project.svg new file mode 100644 index 00000000000..a728f7457ca --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/project.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/pulse.svg b/htdocs/theme/common/octicons/build/svg/pulse.svg new file mode 100644 index 00000000000..d87d04ea419 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/pulse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/question.svg b/htdocs/theme/common/octicons/build/svg/question.svg new file mode 100644 index 00000000000..a6fc75310c9 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/question.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/quote.svg b/htdocs/theme/common/octicons/build/svg/quote.svg new file mode 100644 index 00000000000..7b5f4a7f191 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/quote.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/radio-tower.svg b/htdocs/theme/common/octicons/build/svg/radio-tower.svg new file mode 100644 index 00000000000..a438661ce55 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/radio-tower.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/reply.svg b/htdocs/theme/common/octicons/build/svg/reply.svg new file mode 100644 index 00000000000..5f89aad3010 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/reply.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/repo-clone.svg b/htdocs/theme/common/octicons/build/svg/repo-clone.svg new file mode 100644 index 00000000000..32b86e87c88 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/repo-clone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/repo-force-push.svg b/htdocs/theme/common/octicons/build/svg/repo-force-push.svg new file mode 100644 index 00000000000..0aece33a4c9 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/repo-force-push.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/repo-forked.svg b/htdocs/theme/common/octicons/build/svg/repo-forked.svg new file mode 100644 index 00000000000..cc5e46a521c --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/repo-forked.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/repo-pull.svg b/htdocs/theme/common/octicons/build/svg/repo-pull.svg new file mode 100644 index 00000000000..dfe8e6c9152 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/repo-pull.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/repo-push.svg b/htdocs/theme/common/octicons/build/svg/repo-push.svg new file mode 100644 index 00000000000..408dca6a089 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/repo-push.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/repo.svg b/htdocs/theme/common/octicons/build/svg/repo.svg new file mode 100644 index 00000000000..e653d4ecfcd --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/repo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/report.svg b/htdocs/theme/common/octicons/build/svg/report.svg new file mode 100644 index 00000000000..3f93ee49a90 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/report.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/rocket.svg b/htdocs/theme/common/octicons/build/svg/rocket.svg new file mode 100644 index 00000000000..98303f854be --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/rocket.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/rss.svg b/htdocs/theme/common/octicons/build/svg/rss.svg new file mode 100644 index 00000000000..3b2705d2f04 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/rss.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/ruby.svg b/htdocs/theme/common/octicons/build/svg/ruby.svg new file mode 100644 index 00000000000..846390841c3 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/ruby.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/screen-full.svg b/htdocs/theme/common/octicons/build/svg/screen-full.svg new file mode 100644 index 00000000000..e78d3718ba1 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/screen-full.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/screen-normal.svg b/htdocs/theme/common/octicons/build/svg/screen-normal.svg new file mode 100644 index 00000000000..a884713e162 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/screen-normal.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/search.svg b/htdocs/theme/common/octicons/build/svg/search.svg new file mode 100644 index 00000000000..d0304b6a41e --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/server.svg b/htdocs/theme/common/octicons/build/svg/server.svg new file mode 100644 index 00000000000..78bc79f95ee --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/server.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/settings.svg b/htdocs/theme/common/octicons/build/svg/settings.svg new file mode 100644 index 00000000000..f22b92e0ddc --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/shield.svg b/htdocs/theme/common/octicons/build/svg/shield.svg new file mode 100644 index 00000000000..087a96954b9 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/shield.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/sign-in.svg b/htdocs/theme/common/octicons/build/svg/sign-in.svg new file mode 100644 index 00000000000..91560c6ad61 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/sign-in.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/sign-out.svg b/htdocs/theme/common/octicons/build/svg/sign-out.svg new file mode 100644 index 00000000000..e0893cbce43 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/sign-out.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/smiley.svg b/htdocs/theme/common/octicons/build/svg/smiley.svg new file mode 100644 index 00000000000..0d93af54bdd --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/smiley.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/squirrel.svg b/htdocs/theme/common/octicons/build/svg/squirrel.svg new file mode 100644 index 00000000000..7c974be5979 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/squirrel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/star.svg b/htdocs/theme/common/octicons/build/svg/star.svg new file mode 100644 index 00000000000..9444880acf4 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/stop.svg b/htdocs/theme/common/octicons/build/svg/stop.svg new file mode 100644 index 00000000000..6ae8523457d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/stop.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/sync.svg b/htdocs/theme/common/octicons/build/svg/sync.svg new file mode 100644 index 00000000000..61bef53cbd0 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/sync.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/tag.svg b/htdocs/theme/common/octicons/build/svg/tag.svg new file mode 100644 index 00000000000..6c8a9c43c1e --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/tag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/tasklist.svg b/htdocs/theme/common/octicons/build/svg/tasklist.svg new file mode 100644 index 00000000000..a0bd560991f --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/tasklist.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/telescope.svg b/htdocs/theme/common/octicons/build/svg/telescope.svg new file mode 100644 index 00000000000..ce4bfaaa184 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/telescope.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/terminal.svg b/htdocs/theme/common/octicons/build/svg/terminal.svg new file mode 100644 index 00000000000..d6072fc6611 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/terminal.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/text-size.svg b/htdocs/theme/common/octicons/build/svg/text-size.svg new file mode 100644 index 00000000000..f83a5f964fb --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/text-size.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/three-bars.svg b/htdocs/theme/common/octicons/build/svg/three-bars.svg new file mode 100644 index 00000000000..bb3b2c86984 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/three-bars.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/thumbsdown.svg b/htdocs/theme/common/octicons/build/svg/thumbsdown.svg new file mode 100644 index 00000000000..ac4c7c6996b --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/thumbsdown.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/thumbsup.svg b/htdocs/theme/common/octicons/build/svg/thumbsup.svg new file mode 100644 index 00000000000..e77f1e30e57 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/thumbsup.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/tools.svg b/htdocs/theme/common/octicons/build/svg/tools.svg new file mode 100644 index 00000000000..67a5984052b --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/tools.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/trashcan.svg b/htdocs/theme/common/octicons/build/svg/trashcan.svg new file mode 100644 index 00000000000..3d8c051f4cf --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/trashcan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/triangle-down.svg b/htdocs/theme/common/octicons/build/svg/triangle-down.svg new file mode 100644 index 00000000000..faa889630e7 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/triangle-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/triangle-left.svg b/htdocs/theme/common/octicons/build/svg/triangle-left.svg new file mode 100644 index 00000000000..8762036160f --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/triangle-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/triangle-right.svg b/htdocs/theme/common/octicons/build/svg/triangle-right.svg new file mode 100644 index 00000000000..59c2ac6346d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/triangle-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/triangle-up.svg b/htdocs/theme/common/octicons/build/svg/triangle-up.svg new file mode 100644 index 00000000000..98d06543b8d --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/triangle-up.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/unfold.svg b/htdocs/theme/common/octicons/build/svg/unfold.svg new file mode 100644 index 00000000000..ab043392e69 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/unfold.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/unmute.svg b/htdocs/theme/common/octicons/build/svg/unmute.svg new file mode 100644 index 00000000000..531aafc8b46 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/unmute.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/unverified.svg b/htdocs/theme/common/octicons/build/svg/unverified.svg new file mode 100644 index 00000000000..becff6dfc8f --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/unverified.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/verified.svg b/htdocs/theme/common/octicons/build/svg/verified.svg new file mode 100644 index 00000000000..8420d2ac554 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/verified.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/versions.svg b/htdocs/theme/common/octicons/build/svg/versions.svg new file mode 100644 index 00000000000..274bbdb3ac8 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/versions.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/watch.svg b/htdocs/theme/common/octicons/build/svg/watch.svg new file mode 100644 index 00000000000..45b2499cff8 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/watch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/x.svg b/htdocs/theme/common/octicons/build/svg/x.svg new file mode 100644 index 00000000000..3725777be40 --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/x.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/build/svg/zap.svg b/htdocs/theme/common/octicons/build/svg/zap.svg new file mode 100644 index 00000000000..e778194b9de --- /dev/null +++ b/htdocs/theme/common/octicons/build/svg/zap.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/htdocs/theme/common/octicons/index.html b/htdocs/theme/common/octicons/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/common/octicons/index.js b/htdocs/theme/common/octicons/index.js index 186af5cb46c..8fb8e4c9044 100644 --- a/htdocs/theme/common/octicons/index.js +++ b/htdocs/theme/common/octicons/index.js @@ -1,11 +1,12 @@ var data = require('./build/data.json') +var objectAssign = require('object-assign') Object.keys(data).forEach(function(key) { // Returns a string representation of html attributes var htmlAttributes = function(icon, options) { var attributes = [] - var attrObj = Object.assign({}, data[key].options, options) + var attrObj = objectAssign({}, data[key].options, options) // If the user passed in options if (options) { @@ -56,11 +57,6 @@ Object.keys(data).forEach(function(key) { data[key].toSVG = function(options) { return "" + data[key].path + "" } - - // Function to return an SVG object with a use, assuming you use the svg sprite - data[key].toSVGUse = function(options) { - return "" - } }) // Import data into exports diff --git a/htdocs/theme/common/octicons/index.scss b/htdocs/theme/common/octicons/index.scss new file mode 100644 index 00000000000..31d97867a12 --- /dev/null +++ b/htdocs/theme/common/octicons/index.scss @@ -0,0 +1,5 @@ +.octicon { + display: inline-block; + vertical-align: text-top; + fill: currentColor; +} diff --git a/htdocs/theme/common/octicons/lib/data.json b/htdocs/theme/common/octicons/lib/data.json deleted file mode 100644 index af6b94aa6b1..00000000000 --- a/htdocs/theme/common/octicons/lib/data.json +++ /dev/null @@ -1,1174 +0,0 @@ -{ - "alert": { - "keywords": [ - "warning", - "triangle", - "exclamation", - "point" - ] - }, - "arrow-down": { - "keywords": [ - "point", - "direction" - ] - }, - "arrow-left": { - "keywords": [ - "point", - "direction" - ] - }, - "arrow-right": { - "keywords": [ - "point", - "direction" - ] - }, - "arrow-small-down": { - "keywords": [ - "point", - "direction" - ] - }, - "arrow-small-left": { - "keywords": [ - "point", - "direction", - "little", - "tiny" - ] - }, - "arrow-small-right": { - "keywords": [ - "point", - "direction", - "little", - "tiny" - ] - }, - "arrow-small-up": { - "keywords": [ - "point", - "direction", - "little", - "tiny" - ] - }, - "arrow-up": { - "keywords": [ - "point", - "direction" - ] - }, - "beaker": { - "keywords": [ - "experiment", - "labs", - "experimental", - "feature", - "test", - "science", - "education", - "study", - "development", - "testing" - ] - }, - "bell": { - "keywords": [ - "notification" - ] - }, - "bold": { - "keywords": [ - "bold" - ] - }, - "book": { - "keywords": [ - "book", - "journal", - "wiki", - "readme" - ] - }, - "bookmark": { - "keywords": [ - "tabbard" - ] - }, - "briefcase": { - "keywords": [ - "suitcase", - "business" - ] - }, - "broadcast": { - "keywords": [ - "rss", - "radio", - "signal" - ] - }, - "browser": { - "keywords": [ - "window", - "web" - ] - }, - "bug": { - "keywords": [ - "insect" - ] - }, - "calendar": { - "keywords": [ - "time", - "day", - "month", - "year" - ] - }, - "check": { - "keywords": [ - "mark", - "yes", - "confirm", - "accept", - "ok", - "success" - ] - }, - "checklist": { - "keywords": [ - "todo" - ] - }, - "chevron-down": { - "keywords": [ - "triangle", - "arrow" - ] - }, - "chevron-left": { - "keywords": [ - "triangle", - "arrow" - ] - }, - "chevron-right": { - "keywords": [ - "triangle", - "arrow" - ] - }, - "chevron-up": { - "keywords": [ - "triangle", - "arrow" - ] - }, - "circle-slash": { - "keywords": [ - "no", - "deny", - "fail", - "failure", - "error", - "bad" - ] - }, - "circuit-board": { - "keywords": [ - "developer", - "hardware", - "electricity" - ] - }, - "clippy": { - "keywords": [ - "copy", - "paste", - "save", - "capture" - ] - }, - "clock": { - "keywords": [ - "time", - "hour", - "minute", - "second" - ] - }, - "cloud-download": { - "keywords": [ - "save", - "install", - "get" - ] - }, - "cloud-upload": { - "keywords": [ - "put", - "export" - ] - }, - "code": { - "keywords": [ - "brackets" - ] - }, - "comment": { - "keywords": [ - "speak", - "bubble" - ] - }, - "comment-discussion": { - "keywords": [ - "converse", - "talk" - ] - }, - "credit-card": { - "keywords": [ - "money", - "billing", - "payments", - "transactions" - ] - }, - "dash": { - "keywords": [ - "hyphen", - "range" - ] - }, - "dashboard": { - "keywords": [ - "speed", - "dial" - ] - }, - "database": { - "keywords": [ - "disks", - "data" - ] - }, - "desktop-download": { - "keywords": [ - "clone", - "download" - ] - }, - "device-camera": { - "keywords": [ - "photo", - "picture", - "image", - "snapshot" - ] - }, - "device-camera-video": { - "keywords": [ - "watch", - "view", - "media", - "stream" - ] - }, - "device-desktop": { - "keywords": [ - "computer", - "monitor" - ] - }, - "device-mobile": { - "keywords": [ - "phone", - "iphone", - "cellphone" - ] - }, - "diff": { - "keywords": [ - "difference", - "changes", - "compare" - ] - }, - "diff-added": { - "keywords": [ - "new", - "addition" - ] - }, - "diff-ignored": { - "keywords": [ - "slash" - ] - }, - "diff-modified": { - "keywords": [ - "dot", - "changed", - "updated" - ] - }, - "diff-removed": { - "keywords": [ - "deleted", - "subtracted", - "dash" - ] - }, - "diff-renamed": { - "keywords": [ - "moved", - "arrow" - ] - }, - "ellipses": { - "keywords": [ - "dot", - "more" - ] - }, - "ellipsis": { - "keywords": [ - "read", - "more", - "hidden", - "expand" - ] - }, - "eye": { - "keywords": [ - "look", - "watch", - "see" - ] - }, - "file": { - "keywords": [ - "file" - ] - }, - "file-binary": { - "keywords": [ - "image", - "video", - "word", - "powerpoint", - "excel" - ] - }, - "file-code": { - "keywords": [ - "text", - "javascript", - "html", - "css", - "php", - "ruby", - "coffeescript", - "sass", - "scss" - ] - }, - "file-directory": { - "keywords": [ - "folder" - ] - }, - "file-media": { - "keywords": [ - "image", - "video", - "audio" - ] - }, - "file-pdf": { - "keywords": [ - "adobe" - ] - }, - "file-submodule": { - "keywords": [ - "folder" - ] - }, - "file-symlink-directory": { - "keywords": [ - "folder", - "subfolder", - "link", - "alias" - ] - }, - "file-symlink-file": { - "keywords": [ - "link", - "alias" - ] - }, - "file-text": { - "keywords": [ - "document" - ] - }, - "file-zip": { - "keywords": [ - "compress", - "archive" - ] - }, - "flame": { - "keywords": [ - "fire", - "hot", - "burn", - "trending" - ] - }, - "fold": { - "keywords": [ - "unfold", - "hide", - "collapse" - ] - }, - "gear": { - "keywords": [ - "settings" - ] - }, - "gift": { - "keywords": [ - "package", - "present", - "skill", - "craft", - "freebie" - ] - }, - "gist": { - "keywords": [ - "gist", - "github" - ] - }, - "gist-secret": { - "keywords": [ - "gist", - "secret", - "private" - ] - }, - "git-branch": { - "keywords": [ - "branch", - "git" - ] - }, - "git-commit": { - "keywords": [ - "save" - ] - }, - "git-compare": { - "keywords": [ - "difference", - "changes" - ] - }, - "git-merge": { - "keywords": [ - "join" - ] - }, - "git-pull-request": { - "keywords": [ - "review" - ] - }, - "globe": { - "keywords": [ - "world" - ] - }, - "grabber": { - "keywords": [ - "mover", - "drap", - "drop" - ] - }, - "graph": { - "keywords": [ - "trend", - "stats", - "statistics" - ] - }, - "heart": { - "keywords": [ - "love" - ] - }, - "history": { - "keywords": [ - "time", - "past", - "revert", - "back" - ] - }, - "home": { - "keywords": [ - "welcome", - "index", - "house", - "building" - ] - }, - "horizontal-rule": { - "keywords": [ - "hr" - ] - }, - "hubot": { - "keywords": [ - "robot" - ] - }, - "inbox": { - "keywords": [ - "mail", - "todo", - "new", - "messages" - ] - }, - "info": { - "keywords": [ - "help" - ] - }, - "issue-closed": { - "keywords": [ - "done", - "complete" - ] - }, - "issue-opened": { - "keywords": [ - "new" - ] - }, - "issue-reopened": { - "keywords": [ - "regression" - ] - }, - "italic": { - "keywords": [ - "font", - "italic", - "style" - ] - }, - "jersey": { - "keywords": [ - "team", - "game", - "basketball" - ] - }, - "key": { - "keywords": [ - "key", - "lock", - "secure", - "safe" - ] - }, - "keyboard": { - "keywords": [ - "type", - "keys", - "write", - "shortcuts" - ] - }, - "law": { - "keywords": [ - "legal", - "bill" - ] - }, - "light-bulb": { - "keywords": [ - "idea" - ] - }, - "link": { - "keywords": [ - "connect", - "hyperlink" - ] - }, - "link-external": { - "keywords": [ - "out", - "see", - "more", - "go", - "to" - ] - }, - "list-ordered": { - "keywords": [ - "numbers", - "tasks", - "todo", - "items" - ] - }, - "list-unordered": { - "keywords": [ - "bullet", - "point", - "tasks", - "todo", - "items" - ] - }, - "location": { - "keywords": [ - "here", - "marker" - ] - }, - "lock": { - "keywords": [ - "secure", - "safe", - "protected" - ] - }, - "logo-gist": { - "keywords": [ - "logo", - "gist" - ] - }, - "logo-github": { - "keywords": [ - "brand" - ] - }, - "mail": { - "keywords": [ - "email", - "unread" - ] - }, - "mail-read": { - "keywords": [ - "email", - "open" - ] - }, - "mail-reply": { - "keywords": [ - "email" - ] - }, - "mark-github": { - "keywords": [ - "octocat" - ] - }, - "markdown": { - "keywords": [ - "markup", - "style" - ] - }, - "megaphone": { - "keywords": [ - "bullhorn", - "loud", - "shout", - "broadcast" - ] - }, - "mention": { - "keywords": [ - "at", - "ping" - ] - }, - "milestone": { - "keywords": [ - "marker" - ] - }, - "mirror": { - "keywords": [ - "reflect" - ] - }, - "mortar-board": { - "keywords": [ - "education", - "learn", - "teach" - ] - }, - "mute": { - "keywords": [ - "quiet", - "sound", - "audio", - "turn", - "off" - ] - }, - "no-newline": { - "keywords": [ - "return" - ] - }, - "note": { - "keywords": [ - "card", - "paper", - "ticket" - ] - }, - "octoface": { - "keywords": [ - "octocat" - ] - }, - "organization": { - "keywords": [ - "people", - "group", - "team" - ] - }, - "package": { - "keywords": [ - "box", - "ship" - ] - }, - "paintcan": { - "keywords": [ - "style", - "theme", - "art", - "color" - ] - }, - "pencil": { - "keywords": [ - "edit", - "change", - "update", - "write" - ] - }, - "person": { - "keywords": [ - "people", - "man", - "woman", - "human" - ] - }, - "pin": { - "keywords": [ - "people", - "save", - "star", - "bookmark" - ] - }, - "plug": { - "keywords": [ - "hook", - "webhook" - ] - }, - "plus": { - "keywords": [ - "add", - "new", - "more" - ] - }, - "plus-small": { - "keywords": [ - "add", - "new", - "more", - "small" - ] - }, - "primitive-dot": { - "keywords": [ - "circle" - ] - }, - "primitive-square": { - "keywords": [ - "box" - ] - }, - "project": { - "keywords": [ - "board", - "kanban", - "columns", - "scrum" - ] - }, - "pulse": { - "keywords": [ - "graph", - "trend", - "line" - ] - }, - "question": { - "keywords": [ - "help", - "explain" - ] - }, - "quote": { - "keywords": [ - "quotation" - ] - }, - "radio-tower": { - "keywords": [ - "broadcast" - ] - }, - "reply": { - "keywords": [ - "reply all", - "back" - ] - }, - "repo": { - "keywords": [ - "book", - "journal" - ] - }, - "repo-clone": { - "keywords": [ - "book", - "journal" - ] - }, - "repo-force-push": { - "keywords": [ - "book", - "journal", - "put" - ] - }, - "repo-forked": { - "keywords": [ - "book", - "journal", - "copy" - ] - }, - "repo-pull": { - "keywords": [ - "book", - "journal", - "get" - ] - }, - "repo-push": { - "keywords": [ - "book", - "journal", - "put" - ] - }, - "rocket": { - "keywords": [ - "staff", - "stafftools", - "blast", - "off", - "space" - ] - }, - "rss": { - "keywords": [ - "broadcast", - "feed" - ] - }, - "ruby": { - "keywords": [ - "code" - ] - }, - "screen-full": { - "keywords": [ - "fullscreen", - "expand" - ] - }, - "screen-normal": { - "keywords": [ - "fullscreen", - "expand", - "exit" - ] - }, - "search": { - "keywords": [ - "magnifying", - "glass" - ] - }, - "server": { - "keywords": [ - "computers", - "racks", - "ops" - ] - }, - "settings": { - "keywords": [ - "sliders", - "filters" - ] - }, - "shield": { - "keywords": [ - "protect", - "shield", - "lock" - ] - }, - "sign-in": { - "keywords": [ - "door", - "arrow", - "direction", - "enter" - ] - }, - "sign-out": { - "keywords": [ - "door", - "arrow", - "direction", - "leave" - ] - }, - "smiley": { - "keywords": [ - "emoji", - "smile", - "mood", - "emotion" - ] - }, - "squirrel": { - "keywords": [ - "ship", - "shipit" - ] - }, - "star": { - "keywords": [ - "save", - "remember", - "like" - ] - }, - "stop": { - "keywords": [ - "block", - "spam" - ] - }, - "sync": { - "keywords": [ - "cycle", - "refresh", - "loop" - ] - }, - "tag": { - "keywords": [ - "release" - ] - }, - "tasklist": { - "keywords": [ - "todo" - ] - }, - "telescope": { - "keywords": [ - "science", - "space", - "look", - "view", - "explore" - ] - }, - "terminal": { - "keywords": [ - "code", - "ops", - "shell" - ] - }, - "text-size": { - "keywords": [ - "font", - "size", - "text" - ] - }, - "three-bars": { - "keywords": [ - "hamburger" - ] - }, - "thumbsdown": { - "keywords": [ - "thumb", - "thumbsdown", - "rejected" - ] - }, - "thumbsup": { - "keywords": [ - "thumb", - "thumbsup", - "prop", - "ship" - ] - }, - "tools": { - "keywords": [ - "screwdriver", - "wrench", - "settings" - ] - }, - "trashcan": { - "keywords": [ - "garbage", - "rubbish", - "recycle", - "delete" - ] - }, - "triangle-down": { - "keywords": [ - "arrow", - "point", - "direction" - ] - }, - "triangle-left": { - "keywords": [ - "arrow", - "point", - "direction" - ] - }, - "triangle-right": { - "keywords": [ - "arrow", - "point", - "direction" - ] - }, - "triangle-up": { - "keywords": [ - "arrow", - "point", - "direction" - ] - }, - "unfold": { - "keywords": [ - "expand", - "open", - "reveal" - ] - }, - "unmute": { - "keywords": [ - "loud", - "volume", - "audio", - "sound", - "play" - ] - }, - "unverified": { - "keywords": [ - "insecure", - "untrusted" - ] - }, - "verified": { - "keywords": [ - "trusted", - "secure", - "trustworthy" - ] - }, - "versions": { - "keywords": [ - "history" - ] - }, - "watch": { - "keywords": [ - "wait", - "hourglass" - ] - }, - "x": { - "keywords": [ - "remove", - "close", - "delete" - ] - }, - "zap": { - "keywords": [ - "electricity", - "lightning", - "props", - "like", - "star", - "save" - ] - } -} diff --git a/htdocs/theme/common/octicons/lib/octicons-master.sketch b/htdocs/theme/common/octicons/lib/octicons-master.sketch deleted file mode 100644 index 85a3f1d431d..00000000000 Binary files a/htdocs/theme/common/octicons/lib/octicons-master.sketch and /dev/null differ diff --git a/htdocs/theme/common/octicons/lib/svg/alert.svg b/htdocs/theme/common/octicons/lib/svg/alert.svg deleted file mode 100644 index 3a75a6a4702..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/alert.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - alert - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/arrow-down.svg b/htdocs/theme/common/octicons/lib/svg/arrow-down.svg deleted file mode 100644 index 49a04c4b48d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/arrow-down.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - arrow-down - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/arrow-left.svg b/htdocs/theme/common/octicons/lib/svg/arrow-left.svg deleted file mode 100644 index b6153c0eff2..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/arrow-left.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - arrow-left - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/arrow-right.svg b/htdocs/theme/common/octicons/lib/svg/arrow-right.svg deleted file mode 100644 index 5d7f96ac2d8..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/arrow-right.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - arrow-right - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/arrow-small-down.svg b/htdocs/theme/common/octicons/lib/svg/arrow-small-down.svg deleted file mode 100644 index bcb668d9c2c..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/arrow-small-down.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - arrow-small-down - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/arrow-small-left.svg b/htdocs/theme/common/octicons/lib/svg/arrow-small-left.svg deleted file mode 100644 index a98f8a13e03..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/arrow-small-left.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - arrow-small-left - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/arrow-small-right.svg b/htdocs/theme/common/octicons/lib/svg/arrow-small-right.svg deleted file mode 100644 index ac121726607..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/arrow-small-right.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - arrow-small-right - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/arrow-small-up.svg b/htdocs/theme/common/octicons/lib/svg/arrow-small-up.svg deleted file mode 100644 index 9bd85161df4..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/arrow-small-up.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - arrow-small-up - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/arrow-up.svg b/htdocs/theme/common/octicons/lib/svg/arrow-up.svg deleted file mode 100644 index a015f862bb2..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/arrow-up.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - arrow-up - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/beaker.svg b/htdocs/theme/common/octicons/lib/svg/beaker.svg deleted file mode 100644 index 48aa51a85a2..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/beaker.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - beaker - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/bell.svg b/htdocs/theme/common/octicons/lib/svg/bell.svg deleted file mode 100644 index 70607e932e7..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/bell.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - bell - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/bold.svg b/htdocs/theme/common/octicons/lib/svg/bold.svg deleted file mode 100644 index a63af7ac7a1..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/bold.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - bold - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/book.svg b/htdocs/theme/common/octicons/lib/svg/book.svg deleted file mode 100644 index 76026481ccb..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/book.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - book - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/bookmark.svg b/htdocs/theme/common/octicons/lib/svg/bookmark.svg deleted file mode 100644 index 24fe161ed0d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/bookmark.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - bookmark - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/briefcase.svg b/htdocs/theme/common/octicons/lib/svg/briefcase.svg deleted file mode 100644 index ae56b711b3c..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/briefcase.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - briefcase - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/broadcast.svg b/htdocs/theme/common/octicons/lib/svg/broadcast.svg deleted file mode 100644 index 491048fb87a..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/broadcast.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - broadcast - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/browser.svg b/htdocs/theme/common/octicons/lib/svg/browser.svg deleted file mode 100644 index 5c9251d0f91..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/browser.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - browser - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/bug.svg b/htdocs/theme/common/octicons/lib/svg/bug.svg deleted file mode 100644 index 8f515ad1b98..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/bug.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - bug - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/calendar.svg b/htdocs/theme/common/octicons/lib/svg/calendar.svg deleted file mode 100644 index 47755281156..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/calendar.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - calendar - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/check.svg b/htdocs/theme/common/octicons/lib/svg/check.svg deleted file mode 100644 index fffa457ac33..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/check.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - check - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/checklist.svg b/htdocs/theme/common/octicons/lib/svg/checklist.svg deleted file mode 100644 index 2ba6b100be0..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/checklist.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - checklist - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/chevron-down.svg b/htdocs/theme/common/octicons/lib/svg/chevron-down.svg deleted file mode 100644 index a77c7eae8c0..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/chevron-down.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - chevron-down - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/chevron-left.svg b/htdocs/theme/common/octicons/lib/svg/chevron-left.svg deleted file mode 100644 index d09f2f39e97..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/chevron-left.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - chevron-left - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/chevron-right.svg b/htdocs/theme/common/octicons/lib/svg/chevron-right.svg deleted file mode 100644 index aaaa6f036f3..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/chevron-right.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - chevron-right - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/chevron-up.svg b/htdocs/theme/common/octicons/lib/svg/chevron-up.svg deleted file mode 100644 index 4bd14a27c5d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/chevron-up.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - chevron-up - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/circle-slash.svg b/htdocs/theme/common/octicons/lib/svg/circle-slash.svg deleted file mode 100644 index f0f5143a802..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/circle-slash.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - circle-slash - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/circuit-board.svg b/htdocs/theme/common/octicons/lib/svg/circuit-board.svg deleted file mode 100644 index 5c4e07e59b1..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/circuit-board.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - circuit-board - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/clippy.svg b/htdocs/theme/common/octicons/lib/svg/clippy.svg deleted file mode 100644 index 4001b75a296..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/clippy.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - clippy - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/clock.svg b/htdocs/theme/common/octicons/lib/svg/clock.svg deleted file mode 100644 index fb25a9ac451..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/clock.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - clock - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/cloud-download.svg b/htdocs/theme/common/octicons/lib/svg/cloud-download.svg deleted file mode 100644 index 0cd213d57c4..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/cloud-download.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - cloud-download - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/cloud-upload.svg b/htdocs/theme/common/octicons/lib/svg/cloud-upload.svg deleted file mode 100644 index b8c24ce596d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/cloud-upload.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - cloud-upload - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/code.svg b/htdocs/theme/common/octicons/lib/svg/code.svg deleted file mode 100644 index a297c9ba1d6..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/code.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - code - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/comment-discussion.svg b/htdocs/theme/common/octicons/lib/svg/comment-discussion.svg deleted file mode 100644 index 85243149efe..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/comment-discussion.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - comment-discussion - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/comment.svg b/htdocs/theme/common/octicons/lib/svg/comment.svg deleted file mode 100644 index 55279771463..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/comment.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - comment - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/credit-card.svg b/htdocs/theme/common/octicons/lib/svg/credit-card.svg deleted file mode 100644 index c801be4b18a..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/credit-card.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - credit-card - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/dash.svg b/htdocs/theme/common/octicons/lib/svg/dash.svg deleted file mode 100644 index 6c000a991b0..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/dash.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - dash - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/dashboard.svg b/htdocs/theme/common/octicons/lib/svg/dashboard.svg deleted file mode 100644 index 7c37b3a6637..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/dashboard.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - dashboard - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/database.svg b/htdocs/theme/common/octicons/lib/svg/database.svg deleted file mode 100644 index f1b798a970c..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/database.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - database - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/desktop-download.svg b/htdocs/theme/common/octicons/lib/svg/desktop-download.svg deleted file mode 100644 index 6c9d08d97e0..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/desktop-download.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - desktop-download - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/device-camera-video.svg b/htdocs/theme/common/octicons/lib/svg/device-camera-video.svg deleted file mode 100644 index e8e8167a812..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/device-camera-video.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - device-camera-video - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/device-camera.svg b/htdocs/theme/common/octicons/lib/svg/device-camera.svg deleted file mode 100644 index f0fa4bc7cfd..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/device-camera.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - device-camera - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/device-desktop.svg b/htdocs/theme/common/octicons/lib/svg/device-desktop.svg deleted file mode 100644 index d2cae7ae900..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/device-desktop.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - device-desktop - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/device-mobile.svg b/htdocs/theme/common/octicons/lib/svg/device-mobile.svg deleted file mode 100644 index 549767577c0..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/device-mobile.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - device-mobile - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/diff-added.svg b/htdocs/theme/common/octicons/lib/svg/diff-added.svg deleted file mode 100644 index 0b1cd1779c3..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/diff-added.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff-added - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/diff-ignored.svg b/htdocs/theme/common/octicons/lib/svg/diff-ignored.svg deleted file mode 100644 index bd11f983b1e..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/diff-ignored.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff-ignored - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/diff-modified.svg b/htdocs/theme/common/octicons/lib/svg/diff-modified.svg deleted file mode 100644 index 03929da650f..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/diff-modified.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff-modified - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/diff-removed.svg b/htdocs/theme/common/octicons/lib/svg/diff-removed.svg deleted file mode 100644 index b5c25a3ccc6..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/diff-removed.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff-removed - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/diff-renamed.svg b/htdocs/theme/common/octicons/lib/svg/diff-renamed.svg deleted file mode 100644 index 3f385f1fab8..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/diff-renamed.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff-renamed - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/diff.svg b/htdocs/theme/common/octicons/lib/svg/diff.svg deleted file mode 100644 index 0ea237dfbd7..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/diff.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/ellipses.svg b/htdocs/theme/common/octicons/lib/svg/ellipses.svg deleted file mode 100644 index cba76eb46dd..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/ellipses.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - ellipses - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/ellipsis.svg b/htdocs/theme/common/octicons/lib/svg/ellipsis.svg deleted file mode 100644 index 60acf955383..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/ellipsis.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/htdocs/theme/common/octicons/lib/svg/eye.svg b/htdocs/theme/common/octicons/lib/svg/eye.svg deleted file mode 100644 index f2021488709..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/eye.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - eye - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file-binary.svg b/htdocs/theme/common/octicons/lib/svg/file-binary.svg deleted file mode 100644 index 8efbe8f5d2b..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-binary.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file-binary - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file-code.svg b/htdocs/theme/common/octicons/lib/svg/file-code.svg deleted file mode 100644 index 3bc2b299a42..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-code.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file-code - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file-directory.svg b/htdocs/theme/common/octicons/lib/svg/file-directory.svg deleted file mode 100644 index 3b0ea6d66cb..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-directory.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file-directory - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file-media.svg b/htdocs/theme/common/octicons/lib/svg/file-media.svg deleted file mode 100644 index db00315d134..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-media.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file-media - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file-pdf.svg b/htdocs/theme/common/octicons/lib/svg/file-pdf.svg deleted file mode 100644 index dcd774e9bc4..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-pdf.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file-pdf - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file-submodule.svg b/htdocs/theme/common/octicons/lib/svg/file-submodule.svg deleted file mode 100644 index aa782e68dff..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-submodule.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file-submodule - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file-symlink-directory.svg b/htdocs/theme/common/octicons/lib/svg/file-symlink-directory.svg deleted file mode 100644 index 5d689bec548..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-symlink-directory.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file-symlink-directory - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file-symlink-file.svg b/htdocs/theme/common/octicons/lib/svg/file-symlink-file.svg deleted file mode 100644 index 710224295de..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-symlink-file.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file-symlink-file - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file-text.svg b/htdocs/theme/common/octicons/lib/svg/file-text.svg deleted file mode 100644 index 874cf5b9100..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-text.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/htdocs/theme/common/octicons/lib/svg/file-zip.svg b/htdocs/theme/common/octicons/lib/svg/file-zip.svg deleted file mode 100644 index c0d0f282fb5..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file-zip.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file-zip - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/file.svg b/htdocs/theme/common/octicons/lib/svg/file.svg deleted file mode 100644 index a704f0c7118..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/file.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - file - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/flame.svg b/htdocs/theme/common/octicons/lib/svg/flame.svg deleted file mode 100644 index a9b69abaafc..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/flame.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - flame - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/fold.svg b/htdocs/theme/common/octicons/lib/svg/fold.svg deleted file mode 100644 index 5446d76a46e..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/fold.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - fold - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/gear.svg b/htdocs/theme/common/octicons/lib/svg/gear.svg deleted file mode 100644 index 2fdf75deec1..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/gear.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - gear - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/gift.svg b/htdocs/theme/common/octicons/lib/svg/gift.svg deleted file mode 100644 index 1cb9cff4535..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/gift.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - gift - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/gist-secret.svg b/htdocs/theme/common/octicons/lib/svg/gist-secret.svg deleted file mode 100644 index e427060c776..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/gist-secret.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - gist-secret - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/gist.svg b/htdocs/theme/common/octicons/lib/svg/gist.svg deleted file mode 100644 index ff79f169b27..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/gist.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - gist - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/git-branch.svg b/htdocs/theme/common/octicons/lib/svg/git-branch.svg deleted file mode 100644 index 0d2e53fd28f..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/git-branch.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - git-branch - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/git-commit.svg b/htdocs/theme/common/octicons/lib/svg/git-commit.svg deleted file mode 100644 index 0ee7457f455..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/git-commit.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - git-commit - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/git-compare.svg b/htdocs/theme/common/octicons/lib/svg/git-compare.svg deleted file mode 100644 index 6f7481f8293..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/git-compare.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - git-compare - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/git-merge.svg b/htdocs/theme/common/octicons/lib/svg/git-merge.svg deleted file mode 100644 index d0f41029b10..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/git-merge.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - git-merge - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/git-pull-request.svg b/htdocs/theme/common/octicons/lib/svg/git-pull-request.svg deleted file mode 100644 index 492dda2ff46..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/git-pull-request.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - git-pull-request - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/globe.svg b/htdocs/theme/common/octicons/lib/svg/globe.svg deleted file mode 100644 index 8e9d0196ff2..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/globe.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - globe - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/grabber.svg b/htdocs/theme/common/octicons/lib/svg/grabber.svg deleted file mode 100644 index cd3b15112ca..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/grabber.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - grabber - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/graph.svg b/htdocs/theme/common/octicons/lib/svg/graph.svg deleted file mode 100644 index f72a1875263..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/graph.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - graph - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/heart.svg b/htdocs/theme/common/octicons/lib/svg/heart.svg deleted file mode 100644 index 688a14d9a5e..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/heart.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - heart - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/history.svg b/htdocs/theme/common/octicons/lib/svg/history.svg deleted file mode 100644 index 77010ba5c6c..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/history.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - history - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/home.svg b/htdocs/theme/common/octicons/lib/svg/home.svg deleted file mode 100644 index d2862e50f48..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/home.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - home - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/horizontal-rule.svg b/htdocs/theme/common/octicons/lib/svg/horizontal-rule.svg deleted file mode 100644 index cf444e7b3d2..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/horizontal-rule.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - horizontal-rule - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/hubot.svg b/htdocs/theme/common/octicons/lib/svg/hubot.svg deleted file mode 100644 index d2fb9ad052b..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/hubot.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - hubot - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/inbox.svg b/htdocs/theme/common/octicons/lib/svg/inbox.svg deleted file mode 100644 index 1b288f2570f..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/inbox.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - inbox - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/info.svg b/htdocs/theme/common/octicons/lib/svg/info.svg deleted file mode 100644 index 7c6de3ebd66..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/info.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - info - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/issue-closed.svg b/htdocs/theme/common/octicons/lib/svg/issue-closed.svg deleted file mode 100644 index f06480bb847..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/issue-closed.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - issue-closed - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/issue-opened.svg b/htdocs/theme/common/octicons/lib/svg/issue-opened.svg deleted file mode 100644 index d8ba7c46c35..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/issue-opened.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - issue-opened - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/issue-reopened.svg b/htdocs/theme/common/octicons/lib/svg/issue-reopened.svg deleted file mode 100644 index 1d5eab6bdba..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/issue-reopened.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - issue-reopened - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/italic.svg b/htdocs/theme/common/octicons/lib/svg/italic.svg deleted file mode 100644 index d488293cbe0..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/italic.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - italic - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/jersey.svg b/htdocs/theme/common/octicons/lib/svg/jersey.svg deleted file mode 100644 index 56e85ee4cd8..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/jersey.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - jersey - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/key.svg b/htdocs/theme/common/octicons/lib/svg/key.svg deleted file mode 100644 index bc3b52382af..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/key.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - key - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/keyboard.svg b/htdocs/theme/common/octicons/lib/svg/keyboard.svg deleted file mode 100644 index 77aa0f5fe04..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/keyboard.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - keyboard - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/law.svg b/htdocs/theme/common/octicons/lib/svg/law.svg deleted file mode 100644 index 0b144363d9a..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/law.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - law - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/light-bulb.svg b/htdocs/theme/common/octicons/lib/svg/light-bulb.svg deleted file mode 100644 index 364cb691527..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/light-bulb.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - light-bulb - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/link-external.svg b/htdocs/theme/common/octicons/lib/svg/link-external.svg deleted file mode 100644 index e4d0aecb71a..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/link-external.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - link-external - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/link.svg b/htdocs/theme/common/octicons/lib/svg/link.svg deleted file mode 100644 index b28cf283854..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/link.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - link - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/list-ordered.svg b/htdocs/theme/common/octicons/lib/svg/list-ordered.svg deleted file mode 100644 index 16f458cbfe6..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/list-ordered.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - list-ordered - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/list-unordered.svg b/htdocs/theme/common/octicons/lib/svg/list-unordered.svg deleted file mode 100644 index e0fce86f0b1..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/list-unordered.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - list-unordered - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/location.svg b/htdocs/theme/common/octicons/lib/svg/location.svg deleted file mode 100644 index 2bb33c679b6..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/location.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - location - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/lock.svg b/htdocs/theme/common/octicons/lib/svg/lock.svg deleted file mode 100644 index 3e81d98ee0d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/lock.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - lock - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/logo-gist.svg b/htdocs/theme/common/octicons/lib/svg/logo-gist.svg deleted file mode 100644 index c95f58fc0cc..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/logo-gist.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - logo-gist - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/logo-github.svg b/htdocs/theme/common/octicons/lib/svg/logo-github.svg deleted file mode 100644 index bb6c20a7b01..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/logo-github.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - logo-github - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/mail-read.svg b/htdocs/theme/common/octicons/lib/svg/mail-read.svg deleted file mode 100644 index 9a6ee16730d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/mail-read.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - mail-read - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/mail-reply.svg b/htdocs/theme/common/octicons/lib/svg/mail-reply.svg deleted file mode 100644 index 03c8212f636..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/mail-reply.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - mail-reply - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/mail.svg b/htdocs/theme/common/octicons/lib/svg/mail.svg deleted file mode 100644 index 1ff97533bb5..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/mail.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - mail - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/mark-github.svg b/htdocs/theme/common/octicons/lib/svg/mark-github.svg deleted file mode 100644 index 2bda9afa081..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/mark-github.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - mark-github - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/markdown.svg b/htdocs/theme/common/octicons/lib/svg/markdown.svg deleted file mode 100644 index fb33c140c80..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/markdown.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - markdown - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/megaphone.svg b/htdocs/theme/common/octicons/lib/svg/megaphone.svg deleted file mode 100644 index e8f10228767..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/megaphone.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - megaphone - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/mention.svg b/htdocs/theme/common/octicons/lib/svg/mention.svg deleted file mode 100644 index f82be86a72a..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/mention.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - mention - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/milestone.svg b/htdocs/theme/common/octicons/lib/svg/milestone.svg deleted file mode 100644 index 829bba95ef5..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/milestone.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - milestone - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/mirror.svg b/htdocs/theme/common/octicons/lib/svg/mirror.svg deleted file mode 100644 index 39055e601eb..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/mirror.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - mirror - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/mortar-board.svg b/htdocs/theme/common/octicons/lib/svg/mortar-board.svg deleted file mode 100644 index ee3b5f8b9a3..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/mortar-board.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - mortar-board - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/mute.svg b/htdocs/theme/common/octicons/lib/svg/mute.svg deleted file mode 100644 index f29643f227d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/mute.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - mute - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/no-newline.svg b/htdocs/theme/common/octicons/lib/svg/no-newline.svg deleted file mode 100644 index fae7c4fe789..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/no-newline.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - no-newline - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/note.svg b/htdocs/theme/common/octicons/lib/svg/note.svg deleted file mode 100644 index 49c1a3892b3..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/note.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - note - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/octoface.svg b/htdocs/theme/common/octicons/lib/svg/octoface.svg deleted file mode 100644 index 87aadac2360..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/octoface.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - octoface - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/organization.svg b/htdocs/theme/common/octicons/lib/svg/organization.svg deleted file mode 100644 index 51cb253acfa..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/organization.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - organization - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/package.svg b/htdocs/theme/common/octicons/lib/svg/package.svg deleted file mode 100644 index cb41bcf6a03..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/package.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - package - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/paintcan.svg b/htdocs/theme/common/octicons/lib/svg/paintcan.svg deleted file mode 100644 index 387195bff62..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/paintcan.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - paintcan - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/pencil.svg b/htdocs/theme/common/octicons/lib/svg/pencil.svg deleted file mode 100644 index 354df31f3f2..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/pencil.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - pencil - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/person.svg b/htdocs/theme/common/octicons/lib/svg/person.svg deleted file mode 100644 index a26225e1c4a..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/person.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - person - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/pin.svg b/htdocs/theme/common/octicons/lib/svg/pin.svg deleted file mode 100644 index d08cb652dd1..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/pin.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - pin - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/plug.svg b/htdocs/theme/common/octicons/lib/svg/plug.svg deleted file mode 100644 index 8f4ee9f46ba..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/plug.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - plug - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/plus-small.svg b/htdocs/theme/common/octicons/lib/svg/plus-small.svg deleted file mode 100644 index ccb9d2d6256..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/plus-small.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - plus-small - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/plus.svg b/htdocs/theme/common/octicons/lib/svg/plus.svg deleted file mode 100644 index 3882ee5a1c7..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/plus.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - plus - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/primitive-dot.svg b/htdocs/theme/common/octicons/lib/svg/primitive-dot.svg deleted file mode 100644 index b9a2f416c28..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/primitive-dot.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - primitive-dot - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/primitive-square.svg b/htdocs/theme/common/octicons/lib/svg/primitive-square.svg deleted file mode 100644 index 361b7c383ac..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/primitive-square.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - primitive-square - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/project.svg b/htdocs/theme/common/octicons/lib/svg/project.svg deleted file mode 100644 index 606672f3f52..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/project.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - project - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/pulse.svg b/htdocs/theme/common/octicons/lib/svg/pulse.svg deleted file mode 100644 index a17f9c00d3a..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/pulse.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - pulse - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/question.svg b/htdocs/theme/common/octicons/lib/svg/question.svg deleted file mode 100644 index 554fc5bf02c..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/question.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - question - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/quote.svg b/htdocs/theme/common/octicons/lib/svg/quote.svg deleted file mode 100644 index 882882f0fbd..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/quote.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - quote - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/radio-tower.svg b/htdocs/theme/common/octicons/lib/svg/radio-tower.svg deleted file mode 100644 index 6f27ab3d9ce..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/radio-tower.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - radio-tower - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/reply.svg b/htdocs/theme/common/octicons/lib/svg/reply.svg deleted file mode 100644 index 7dbde79bfa5..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/reply.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - reply - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/repo-clone.svg b/htdocs/theme/common/octicons/lib/svg/repo-clone.svg deleted file mode 100644 index 8fb3ea1688d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/repo-clone.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - repo-clone - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/repo-force-push.svg b/htdocs/theme/common/octicons/lib/svg/repo-force-push.svg deleted file mode 100644 index a9cb1d62609..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/repo-force-push.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - repo-force-push - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/repo-forked.svg b/htdocs/theme/common/octicons/lib/svg/repo-forked.svg deleted file mode 100644 index b1db2556a49..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/repo-forked.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - repo-forked - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/repo-pull.svg b/htdocs/theme/common/octicons/lib/svg/repo-pull.svg deleted file mode 100644 index 9ca11006c80..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/repo-pull.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - repo-pull - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/repo-push.svg b/htdocs/theme/common/octicons/lib/svg/repo-push.svg deleted file mode 100644 index be7433ce792..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/repo-push.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - repo-push - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/repo.svg b/htdocs/theme/common/octicons/lib/svg/repo.svg deleted file mode 100644 index 613f72d52f3..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/repo.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - repo - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/rocket.svg b/htdocs/theme/common/octicons/lib/svg/rocket.svg deleted file mode 100644 index 1f227b7dae8..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/rocket.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - rocket - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/rss.svg b/htdocs/theme/common/octicons/lib/svg/rss.svg deleted file mode 100644 index 6d82aaf8c20..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/rss.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - rss - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/ruby.svg b/htdocs/theme/common/octicons/lib/svg/ruby.svg deleted file mode 100644 index fff3baf760c..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/ruby.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - ruby - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/screen-full.svg b/htdocs/theme/common/octicons/lib/svg/screen-full.svg deleted file mode 100644 index 302ef1725d4..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/screen-full.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - screen-full - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/screen-normal.svg b/htdocs/theme/common/octicons/lib/svg/screen-normal.svg deleted file mode 100644 index e144fc5a04d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/screen-normal.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - screen-normal - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/search.svg b/htdocs/theme/common/octicons/lib/svg/search.svg deleted file mode 100644 index 547eb505ef6..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/search.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - search - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/server.svg b/htdocs/theme/common/octicons/lib/svg/server.svg deleted file mode 100644 index 3f439fd5a7c..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/server.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - server - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/settings.svg b/htdocs/theme/common/octicons/lib/svg/settings.svg deleted file mode 100644 index 70f860c411e..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/settings.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - settings - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/shield.svg b/htdocs/theme/common/octicons/lib/svg/shield.svg deleted file mode 100644 index f83a8d0c549..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/shield.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - shield - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/sign-in.svg b/htdocs/theme/common/octicons/lib/svg/sign-in.svg deleted file mode 100644 index 99bc42b6ccc..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/sign-in.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - sign-in - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/sign-out.svg b/htdocs/theme/common/octicons/lib/svg/sign-out.svg deleted file mode 100644 index dca0faa5cb9..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/sign-out.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - sign-out - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/smiley.svg b/htdocs/theme/common/octicons/lib/svg/smiley.svg deleted file mode 100644 index 6041ee91f61..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/smiley.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - smiley - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/squirrel.svg b/htdocs/theme/common/octicons/lib/svg/squirrel.svg deleted file mode 100644 index 0cff65843f9..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/squirrel.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - squirrel - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/star.svg b/htdocs/theme/common/octicons/lib/svg/star.svg deleted file mode 100644 index 9d8ca6a7fc0..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/star.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - star - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/stop.svg b/htdocs/theme/common/octicons/lib/svg/stop.svg deleted file mode 100644 index bc74f95f8d7..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/stop.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - stop - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/sync.svg b/htdocs/theme/common/octicons/lib/svg/sync.svg deleted file mode 100644 index 59b5f3c4000..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/sync.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - sync - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/tag.svg b/htdocs/theme/common/octicons/lib/svg/tag.svg deleted file mode 100644 index 1b425c8a69d..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/tag.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - tag - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/tasklist.svg b/htdocs/theme/common/octicons/lib/svg/tasklist.svg deleted file mode 100644 index e9291f70a26..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/tasklist.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - tasklist - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/telescope.svg b/htdocs/theme/common/octicons/lib/svg/telescope.svg deleted file mode 100644 index 961891fcf90..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/telescope.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - telescope - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/terminal.svg b/htdocs/theme/common/octicons/lib/svg/terminal.svg deleted file mode 100644 index 9980e86827f..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/terminal.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - terminal - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/text-size.svg b/htdocs/theme/common/octicons/lib/svg/text-size.svg deleted file mode 100644 index 9c40dd04ab3..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/text-size.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - text-size - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/three-bars.svg b/htdocs/theme/common/octicons/lib/svg/three-bars.svg deleted file mode 100644 index 585dfeee331..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/three-bars.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - three-bars - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/thumbsdown.svg b/htdocs/theme/common/octicons/lib/svg/thumbsdown.svg deleted file mode 100644 index e0e642d9455..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/thumbsdown.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - thumbsdown - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/thumbsup.svg b/htdocs/theme/common/octicons/lib/svg/thumbsup.svg deleted file mode 100644 index a9bc8529976..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/thumbsup.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - thumbsup - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/tools.svg b/htdocs/theme/common/octicons/lib/svg/tools.svg deleted file mode 100644 index 52aafd2555e..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/tools.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - tools - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/trashcan.svg b/htdocs/theme/common/octicons/lib/svg/trashcan.svg deleted file mode 100644 index 4a4ad77d458..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/trashcan.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - trashcan - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/triangle-down.svg b/htdocs/theme/common/octicons/lib/svg/triangle-down.svg deleted file mode 100644 index dba0fc4ac70..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/triangle-down.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - triangle-down - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/triangle-left.svg b/htdocs/theme/common/octicons/lib/svg/triangle-left.svg deleted file mode 100644 index 7011b15bbe2..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/triangle-left.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - triangle-left - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/triangle-right.svg b/htdocs/theme/common/octicons/lib/svg/triangle-right.svg deleted file mode 100644 index 8abb5e92e25..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/triangle-right.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - triangle-right - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/triangle-up.svg b/htdocs/theme/common/octicons/lib/svg/triangle-up.svg deleted file mode 100644 index e6488cf35f3..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/triangle-up.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - triangle-up - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/unfold.svg b/htdocs/theme/common/octicons/lib/svg/unfold.svg deleted file mode 100644 index 3f40744b9d9..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/unfold.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - unfold - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/unmute.svg b/htdocs/theme/common/octicons/lib/svg/unmute.svg deleted file mode 100644 index 71a5624a738..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/unmute.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - unmute - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/unverified.svg b/htdocs/theme/common/octicons/lib/svg/unverified.svg deleted file mode 100644 index c91b44e5f4a..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/unverified.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - unverified - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/verified.svg b/htdocs/theme/common/octicons/lib/svg/verified.svg deleted file mode 100644 index c0c0a7223e5..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/verified.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - verified - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/versions.svg b/htdocs/theme/common/octicons/lib/svg/versions.svg deleted file mode 100644 index 62b9c199811..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/versions.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - versions - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/watch.svg b/htdocs/theme/common/octicons/lib/svg/watch.svg deleted file mode 100644 index 705f441ae5f..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/watch.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - watch - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/x.svg b/htdocs/theme/common/octicons/lib/svg/x.svg deleted file mode 100644 index 51466da25a4..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/x.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - x - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/lib/svg/zap.svg b/htdocs/theme/common/octicons/lib/svg/zap.svg deleted file mode 100644 index 95641465029..00000000000 --- a/htdocs/theme/common/octicons/lib/svg/zap.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - zap - Created with Sketch. - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/common/octicons/package.json b/htdocs/theme/common/octicons/package.json index 61def286fac..77188450670 100644 --- a/htdocs/theme/common/octicons/package.json +++ b/htdocs/theme/common/octicons/package.json @@ -1,14 +1,15 @@ { - "version": "5.0.1", + "version": "7.2.0", "name": "octicons", "description": "A scalable set of icons handcrafted with <3 by GitHub.", "homepage": "https://octicons.github.com", "author": "GitHub Inc.", - "license": "(OFL-1.1 OR MIT)", - "style": "build/octicons.css", + "license": "MIT", + "style": "index.scss", "main": "index.js", "files": [ "index.js", + "index.scss", "build" ], "repository": "https://github.com/primer/octicons.git", @@ -16,24 +17,18 @@ "url": "https://github.com/primer/octicons/issues" }, "scripts": { - "build": "grunt", - "prepublish": "npm run build", - "test": "npm run build && ava --verbose \"test/**/*.js\"" - }, - "devDependencies": { - "autoprefixer": "^6.3.6", - "ava": "^0.16.0", - "grunt": "^1.0.1", - "grunt-contrib-clean": "^1.0.0", - "grunt-contrib-copy": "^1.0.0", - "grunt-cssnano": "^2.1.0", - "grunt-svgmin": "^4.0.0", - "grunt-svgstore": "^1.0.0" + "publish": "../../script/notify success", + "prepublishOnly": "../../script/notify pending", + "prepare": "cp -R ../build . && cp index.scss build/build.css", + "test": "ava --verbose 'tests/*.js'" }, "keywords": [ "GitHub", "icons", "svg", "octicons" - ] + ], + "dependencies": { + "object-assign": "^4.1.1" + } } diff --git a/htdocs/theme/eldy/img/menus/chart.png b/htdocs/theme/eldy/img/menus/chart.png deleted file mode 100644 index 6efce90a788..00000000000 Binary files a/htdocs/theme/eldy/img/menus/chart.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/holiday_over.png b/htdocs/theme/eldy/img/menus/holiday_over.png new file mode 100644 index 00000000000..493974477f3 Binary files /dev/null and b/htdocs/theme/eldy/img/menus/holiday_over.png differ diff --git a/htdocs/theme/eldy/img/menus/money_over.png b/htdocs/theme/eldy/img/menus/money_over.png index 9a501e762d0..82b864a83d7 100644 Binary files a/htdocs/theme/eldy/img/menus/money_over.png and b/htdocs/theme/eldy/img/menus/money_over.png differ diff --git a/htdocs/theme/eldy/img/menus/ticketsup.png b/htdocs/theme/eldy/img/menus/ticketsup.png index 03354cc98e0..98a482c4701 100644 Binary files a/htdocs/theme/eldy/img/menus/ticketsup.png and b/htdocs/theme/eldy/img/menus/ticketsup.png differ diff --git a/htdocs/theme/eldy/img/menus/ticketsup_over.png b/htdocs/theme/eldy/img/menus/ticketsup_over.png new file mode 100644 index 00000000000..246b638e71f Binary files /dev/null and b/htdocs/theme/eldy/img/menus/ticketsup_over.png differ diff --git a/htdocs/theme/eldy/img/menus_black/holiday_over.png b/htdocs/theme/eldy/img/menus_black/holiday_over.png new file mode 100644 index 00000000000..de788526bc1 Binary files /dev/null and b/htdocs/theme/eldy/img/menus_black/holiday_over.png differ diff --git a/htdocs/theme/eldy/img/menus_black/ticketsup.png b/htdocs/theme/eldy/img/menus_black/ticketsup.png index 3ec332075e6..132888161e7 100644 Binary files a/htdocs/theme/eldy/img/menus_black/ticketsup.png and b/htdocs/theme/eldy/img/menus_black/ticketsup.png differ diff --git a/htdocs/theme/eldy/img/menus_black/ticketsup_over.png b/htdocs/theme/eldy/img/menus_black/ticketsup_over.png new file mode 100644 index 00000000000..5012d189410 Binary files /dev/null and b/htdocs/theme/eldy/img/menus_black/ticketsup_over.png differ diff --git a/htdocs/theme/eldy/img/object_ticketsup.png b/htdocs/theme/eldy/img/object_ticketsup.png index 8ece94fbefc..38df927744e 100644 Binary files a/htdocs/theme/eldy/img/object_ticketsup.png and b/htdocs/theme/eldy/img/object_ticketsup.png differ diff --git a/htdocs/theme/eldy/img/statut3.png b/htdocs/theme/eldy/img/statut3.png index 158c640bb60..77476349d6d 100644 Binary files a/htdocs/theme/eldy/img/statut3.png and b/htdocs/theme/eldy/img/statut3.png differ diff --git a/htdocs/theme/eldy/img/statut3_40x40.png b/htdocs/theme/eldy/img/statut3_40x40.png index f71ef4eb962..48314ccb183 100644 Binary files a/htdocs/theme/eldy/img/statut3_40x40.png and b/htdocs/theme/eldy/img/statut3_40x40.png differ diff --git a/htdocs/theme/eldy/img/statut4.png b/htdocs/theme/eldy/img/statut4.png index d0df7e40aef..616f10de496 100644 Binary files a/htdocs/theme/eldy/img/statut4.png and b/htdocs/theme/eldy/img/statut4.png differ diff --git a/htdocs/theme/eldy/img/statut4_40x40.png b/htdocs/theme/eldy/img/statut4_40x40.png index 2da24b66484..879f48739f6 100644 Binary files a/htdocs/theme/eldy/img/statut4_40x40.png and b/htdocs/theme/eldy/img/statut4_40x40.png differ diff --git a/htdocs/theme/eldy/img/title_accountancy.png b/htdocs/theme/eldy/img/title_accountancy.png index 6e7c2a412c6..fba1c91e05b 100644 Binary files a/htdocs/theme/eldy/img/title_accountancy.png and b/htdocs/theme/eldy/img/title_accountancy.png differ diff --git a/htdocs/theme/eldy/img/title_agenda.png b/htdocs/theme/eldy/img/title_agenda.png index eb4c8d2bea2..93c5a814bc3 100644 Binary files a/htdocs/theme/eldy/img/title_agenda.png and b/htdocs/theme/eldy/img/title_agenda.png differ diff --git a/htdocs/theme/eldy/img/title_bank.png b/htdocs/theme/eldy/img/title_bank.png index 034a8d0c5e4..c916e89d8f6 100644 Binary files a/htdocs/theme/eldy/img/title_bank.png and b/htdocs/theme/eldy/img/title_bank.png differ diff --git a/htdocs/theme/eldy/img/title_commercial.png b/htdocs/theme/eldy/img/title_commercial.png index 46394177698..6671810c5de 100644 Binary files a/htdocs/theme/eldy/img/title_commercial.png and b/htdocs/theme/eldy/img/title_commercial.png differ diff --git a/htdocs/theme/eldy/img/title_companies.png b/htdocs/theme/eldy/img/title_companies.png index b2539dba849..ca172c460ac 100644 Binary files a/htdocs/theme/eldy/img/title_companies.png and b/htdocs/theme/eldy/img/title_companies.png differ diff --git a/htdocs/theme/eldy/img/title_generic.png b/htdocs/theme/eldy/img/title_generic.png index ae224327549..a44830798aa 100644 Binary files a/htdocs/theme/eldy/img/title_generic.png and b/htdocs/theme/eldy/img/title_generic.png differ diff --git a/htdocs/theme/eldy/img/title_home.png b/htdocs/theme/eldy/img/title_home.png index e9273e727f5..505d18ab403 100644 Binary files a/htdocs/theme/eldy/img/title_home.png and b/htdocs/theme/eldy/img/title_home.png differ diff --git a/htdocs/theme/eldy/img/title_products.png b/htdocs/theme/eldy/img/title_products.png index d3c5b125bbe..100edf445f1 100644 Binary files a/htdocs/theme/eldy/img/title_products.png and b/htdocs/theme/eldy/img/title_products.png differ diff --git a/htdocs/theme/eldy/img/title_project.png b/htdocs/theme/eldy/img/title_project.png index 05d8ea630b8..bec7144c109 100644 Binary files a/htdocs/theme/eldy/img/title_project.png and b/htdocs/theme/eldy/img/title_project.png differ diff --git a/htdocs/theme/eldy/img/title_setup.png b/htdocs/theme/eldy/img/title_setup.png index d7548d28709..fa4ff3aded1 100644 Binary files a/htdocs/theme/eldy/img/title_setup.png and b/htdocs/theme/eldy/img/title_setup.png differ diff --git a/htdocs/theme/eldy/img/title_ticketsup.png b/htdocs/theme/eldy/img/title_ticketsup.png index 3ec332075e6..b1cf5df0e75 100644 Binary files a/htdocs/theme/eldy/img/title_ticketsup.png and b/htdocs/theme/eldy/img/title_ticketsup.png differ diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b69d9b88048..8eb6f0b98c8 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -44,8 +44,8 @@ $colorbacktabcard1='255,255,255'; // card $colorbacktabactive='234,234,234'; $colorbacklineimpair1='255,255,255'; // line impair $colorbacklineimpair2='255,255,255'; // line impair -$colorbacklinepair1='248,248,248'; // line pair -$colorbacklinepair2='248,248,248'; // line pair +$colorbacklinepair1='246,246,246'; // line pair +$colorbacklinepair2='246,246,246'; // line pair $colorbacklinepairhover='238,246,252'; // line pair $colorbacklinebreak='214,218,220'; // line break $colorbackbody='255,255,255'; @@ -53,12 +53,12 @@ $colortexttitlenotab='100,60,20'; $colortexttitle='0,0,0'; $colortext='0,0,0'; $colortextlink='0,0,100'; -$fontsize='13'; -$fontsizesmaller='12'; +$fontsize='0.85em'; +$fontsizesmaller='0.75em'; if (defined('THEME_ONLY_CONSTANT')) return; -session_cache_limiter(FALSE); +session_cache_limiter(false); require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -117,8 +117,8 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_BACKTABCARD1='255,255,255'; // card $conf->global->THEME_ELDY_BACKTABACTIVE='234,234,234'; $conf->global->THEME_ELDY_TEXT='0,0,0'; - $conf->global->THEME_ELDY_FONT_SIZE1='13'; - $conf->global->THEME_ELDY_FONT_SIZE2='12'; + $conf->global->THEME_ELDY_FONT_SIZE1='0.85em'; + $conf->global->THEME_ELDY_FONT_SIZE2='0.75em'; } // Case of option availables only if THEME_ELDY_ENABLE_PERSONALIZED is on @@ -199,6 +199,15 @@ $colortextlink=join(',',colorStringToArray($colortextlink)); $nbtopmenuentries=$menumanager->showmenu('topnb'); + +$minwidthtmenu=66; /* minimum width for one top menu entry */ +$heightmenu=46; /* height of top menu, part with image */ +$heightmenu2=48; /* height of top menu, part with login */ +$disableimages = 0; +$maxwidthloginblock = 130; +if (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; } + + print '/*'."\n"; print 'colorbackbody='.$colorbackbody."\n"; print 'colorbackvmenu1='.$colorbackvmenu1."\n"; @@ -239,7 +248,7 @@ body { background: rgb(); color: rgb(); - font-size: px; + font-size: ; line-height: 1.4; font-family: ; margin-top: 0; @@ -249,7 +258,7 @@ body { trans("DIRECTION").";\n"; ?> } -.thumbstat, a.tab { color: rgb() !important; font-weight: bold !important; } +.thumbstat, a.tab { font-weight: bold !important; } th a { font-weight: !important; } a.tab { font-weight: bold !important; } @@ -713,6 +722,9 @@ select.flat.selectlimit { .marginleftonly { margin-left: 10px !important; } +.nomarginleft { + margin-left: 0px !important; +} .selectlimit, .selectlimit:focus { border-left: none !important; border-top: none !important; @@ -873,7 +885,7 @@ select.selectarrowonleft option { .hideobject { display: none; } .minwidth50 { min-width: 50px; } /* rule for not too small screen only */ -@media only screen and (min-width: px) +@media only screen and (min-width: px) { .width25 { width: 25px; } .width50 { width: 50px; } @@ -960,10 +972,10 @@ select.selectarrowonleft option { @media only screen and (max-width: 767px) { body { - font-size: px; + font-size: ; } div.refidno { - font-size: px !important; + font-size: !important; } } @@ -971,10 +983,10 @@ select.selectarrowonleft option { @media only screen and (max-width: 570px) { body { - font-size: px; + font-size: ; } div.refidno { - font-size: px !important; + font-size: !important; } .divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; } @@ -985,9 +997,6 @@ select.selectarrowonleft option { text-overflow: ellipsis; white-space: nowrap; } - div.fiche { - margin-top: px !important; - } div.titre { /* margin-top: 12px; */ /* line-height: 2em; */ @@ -1002,11 +1011,11 @@ select.selectarrowonleft option { select { padding-top: 4px; - padding-bottom: 5px; + padding-bottom: 4px; } input, input[type=text], input[type=password], select, textarea { min-width: 20px; - font-size: px; + font-size: ; /* min-height: 1.4em; */ /* line-height: 1.4em; */ /* padding: .4em .1em; */ @@ -1220,8 +1229,8 @@ div.fiche { div.fiche { margin-: dol_optimize_smallscreen)?'25':'6')); ?>px; margin-: dol_optimize_smallscreen)?'24':'6')); ?>px; - dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?> - dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?> + + } body.onlinepaymentbody div.fiche { /* For online payment page */ margin: 20px !important; @@ -1271,7 +1280,6 @@ div.secondcolumn div.box { div.fiche { margin-: px; margin-: px; - dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?> } div.fichecenter { width: 100%; @@ -1402,6 +1410,7 @@ div.statusref img { padding-left: 8px; padding-right: 9px; vertical-align: text-bottom; + width: 18px; } div.statusrefbis { padding-left: 8px; @@ -1453,15 +1462,6 @@ img.photorefnoborder { /* Menu top et 1ere ligne tableau */ /* ============================================================================== */ -global->THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; } -?> - div#id-top { display:none; @@ -1571,7 +1571,6 @@ div.tmenuleft margin-top: 0px; dol_optimize_smallscreen)) { ?> width: 5px; - /* background: url() 0 -6px no-repeat; */ height: 26px; @@ -1591,13 +1590,6 @@ div.tmenucenter height: px; width: 100%; - /* - max-width: px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - color: #; - */ } #menu_titre_logo { padding-top: 0; @@ -1625,85 +1617,91 @@ div.mainmenu { min-width: 40px; } -/* Do not load menu img if hidden to save bandwidth */ +/* For mainmenu, we always load the img */ + +div.mainmenu.menu { + background-image: url(); + +} +#mainmenutd_menu a.tmenuimage { + display: unset; +} + +/* Do not load menu img for other if hidden to save bandwidth */ + div.mainmenu.home{ - background-image: url(); + background-image: url(); background-position-x: center; } div.mainmenu.billing { - background-image: url(); + background-image: url(); } div.mainmenu.accountancy { - background-image: url(); + background-image: url(); } div.mainmenu.agenda { - background-image: url(); + background-image: url(); } div.mainmenu.bank { - background-image: url(); + background-image: url(); } div.mainmenu.cashdesk { - background-image: url(); + background-image: url(); } div.mainmenu.companies { - background-image: url(); + background-image: url(); } div.mainmenu.commercial { - background-image: url(); + background-image: url(); } div.mainmenu.ecm { - background-image: url(); + background-image: url(); } div.mainmenu.externalsite { - background-image: url(); + background-image: url(); } div.mainmenu.ftp { - background-image: url(); + background-image: url(); } div.mainmenu.hrm { - background-image: url(); + background-image: url(); } div.mainmenu.members { - background-image: url(); -} - -div.mainmenu.menu { - background-image: url(); - top: 7px; + background-image: url(); } div.mainmenu.products { - background-image: url(); + background-image: url(); } div.mainmenu.project { - background-image: url(); + background-image: url(); } div.mainmenu.ticketsup { - background-image: url(); + background-image: url(); } div.mainmenu.tools { - background-image: url(); + background-image: url(); } div.mainmenu.website { - background-image: url(); + background-image: url(); } file->dol_document_root as $dirroot) { - if (file_exists($dirroot."/".$val."/img/".$val.".png")) + if (file_exists($dirroot."/".$val."/img/".$val."_over.png")) { - $url=dol_buildpath('/'.$val.'/img/'.$val.'.png', 1); + $url=dol_buildpath('/'.$val.'/img/'.$val.'_over.png', 1); $found=1; break; } @@ -1750,7 +1748,7 @@ foreach($mainmenuusedarray as $val) // Img file not found if (! $found) { - $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.$generic.".png",1); + $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.$generic."_over.png",1); $found=1; if ($generic < 4) $generic++; print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n"; @@ -1817,8 +1815,13 @@ form#login { padding-top:16px; padding-bottom:12px; max-width: 560px; - - background-color: #FFFFFF; +global->MAIN_LOGIN_BACKGROUND)) { + print ' background-color: rgba(255, 255, 255, 0.9);'; +} else { + print ' background-color: #FFFFFF;'; +} +?> -webkit-box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); @@ -1895,7 +1898,7 @@ div.login_block { : 0; top: ; font-weight: bold; - max-width: px; + display: none; @@ -1927,7 +1930,7 @@ div.login_block_user { } div.login_block_other { display: inline-block; - clear: both; + clear: ; } div.login_block_other { padding-top: 3px; text-align: right; } .login_block_elem { @@ -1952,7 +1955,6 @@ div.login_block_other { padding-top: 3px; text-align: right; } } .alogin, .alogin:hover { font-weight: normal !important; - font-size: px !important; padding-top: 2px; } .alogin:hover, .atoplogin:hover { @@ -2041,17 +2043,17 @@ input.vmenusearchselectcombo[type=text] { .companylogo { } .searchform { padding-top: 10px; } -a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu { white-space: nowrap; font-size:px; font-family: ; text-align: ; font-weight: bold; } -font.vmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: bold; color: #aaa; margin-left: 4px; } +a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu { white-space: nowrap; font-family: ; text-align: ; font-weight: bold; } +font.vmenudisabled { font-family: ; text-align: ; font-weight: bold; color: #aaa; margin-left: 4px; } a.vmenu:link, a.vmenu:visited { color: #; } -a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 6px; } -font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #aaa; } +a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 6px; } +font.vsmenudisabled { font-family: ; text-align: ; font-weight: normal; color: #aaa; } a.vsmenu:link, a.vsmenu:visited { color: #; white-space: nowrap; } font.vsmenudisabledmargin { margin: 1px 1px 1px 6px; } li a.vsmenudisabled, li.vsmenudisabled { color: #aaa !important; } -a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #aaa; text-decoration: none; } +a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:; font-family: ; text-align: ; font-weight: normal; color: #aaa; text-decoration: none; } .vmenu div.blockvmenufirst, .vmenu div.blockvmenulogo, .vmenu div.blockvmenusearchphone, .vmenu div.blockvmenubookmarks { @@ -2301,7 +2303,7 @@ a.tabunactive { } a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { font-family: ; - padding: 12px 9px 12px; + padding: 12px 9px 13px; margin: 0em 0.2em; text-decoration: none; white-space: nowrap; @@ -2376,36 +2378,58 @@ span.butAction, span.butActionDelete { cursor: pointer; } -.butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { +.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { text-decoration: none; margin: 0em em !important; padding: 0.6em em; font-family: ; font-weight: normal; - border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); display: inline-block; text-align: center; cursor: pointer; - color: #fff; - background: rgb(); - border: 1px solid rgb(); + /* color: #fff; */ + /* background: rgb(); */ + color: #000; + /* text-transform: uppercase; */ + border: 1px solid #aaa; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; } +.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active { + text-decoration: none; + margin: 0em 0.3em 0 0.3em !important; + padding: 0.2em em 0.3em; + font-family: ; + font-weight: normal; + border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); + display: inline-block; + text-align: center; + cursor: pointer; + /*color: #fff !important; + background: rgb(); + border: 1px solid rgb();*/ -.butAction:hover { + border-top-right-radius: 0 !important; + border-bottom-right-radius: 0 !important; + border-top-left-radius: 0 !important; + border-bottom-left-radius: 0 !important; +} +a.butActionNew>span.fa-plus-circle, a.butActionNew>span.fa-plus-circle:hover { padding-left: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; } +a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover { padding-left: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; } + +.butAction:hover, .butActionNew:hover { -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); } .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete { - background: #633; + /* background: #633; */ border: 1px solid #633; - color: #FFF; + color: #633; } .butActionDelete:hover { @@ -2427,6 +2451,22 @@ span.butAction, span.butActionDelete { color: #999 !important; border: 1px solid #bbb; } +.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active { + text-decoration: none !important; + white-space: nowrap !important; + cursor: not-allowed !important; + margin: 0em em; + padding: 0.2em em; + font-family: !important; + font-weight: normal !important; + display: inline-block; + text-align: center; + cursor: pointer; + color: #999 !important; + padding-top: 0.2em; + box-shadow: none !important; + -webkit-box-shadow: none !important; +} .butActionTransparent { color: #222 ! important; @@ -2434,7 +2474,7 @@ span.butAction, span.butActionDelete { } global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin)) { ?> -.butActionRefused { +.butActionRefused, .butActionNewRefused { display: none; } @@ -2679,13 +2719,13 @@ div.refidpadding { div.refid { font-weight: bold; color: #625; - font-size: 160%; + font-size: 1.2em; } div.refidno { padding-top: 3px; font-weight: normal; color: #444; - font-size: px; + font-size: ; line-height: 21px; } div.refidno form { @@ -2698,6 +2738,12 @@ div.pagination { div.pagination a { font-weight: normal; } +/*div.pagination a.butAction, div.fichehalfright a.butAction { + margin-right: 0px !important; +} +div.tabsAction a.butActionDelete:last-child, div.tabsAction a.butAction:last-child { + margin-right: 0px !important; +}*/ div.pagination ul { list-style: none; @@ -2765,13 +2811,13 @@ div.pagination li span { div.pagination li:first-child a, div.pagination li:first-child span { margin-left: 0; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; + /*border-top-left-radius: 4px; + border-bottom-left-radius: 4px;*/ } div.pagination li:last-child a, div.pagination li:last-child span { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; + /*border-top-right-radius: 4px; + border-bottom-right-radius: 4px;*/ } div.pagination li a:hover, div.pagination li span:hover, @@ -2779,7 +2825,6 @@ div.pagination li a:focus, div.pagination li span:focus { -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); - padding-top: 8px; } div.pagination li .active a, div.pagination li .active span, @@ -3176,6 +3221,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { span.boxstatstext { opacity: 0.8; line-height: 18px; + color: #000; } span.boxstatstext img, a.dashboardlineindicatorlate img { border: 0; @@ -3183,6 +3229,9 @@ span.boxstatstext img, a.dashboardlineindicatorlate img { a img { border: 0; } +.boxstatsindicator.thumbstat150 { /* If we remove this, box position is ko on ipad */ + display: inline-flex; +} span.boxstatsindicator { font-size: 130%; font-weight: normal; @@ -3460,7 +3509,7 @@ div.titre { padding-bottom: 5px; } -#dolpaymenttable { min-width: 300px; font-size: 16px; } /* Width must have min to make stripe input area visible */ +#dolpaymenttable { min-width: 320px; font-size: 16px; } /* Width must have min to make stripe input area visible. Lower than 320 makes input area crazy for credit card that need zip code */ #tablepublicpayment { border: 1px solid #CCCCCC !important; width: 100%; padding: 20px; } #tablepublicpayment .CTableRow1 { background-color: #F0F0F0 !important; } #tablepublicpayment tr.liste_total { border-bottom: 1px solid #CCCCCC !important; } @@ -3526,7 +3575,6 @@ div#card-errors { .ui-dialog-titlebar { } .ui-dialog-content { - font-size: px !important; } @@ -3674,7 +3722,7 @@ table.dp { border-style:none; background-color:transparent; padding:0px; - font-size:9px; + font-size: 0.85em; border-width:0px; color:#0B63A2; vertical-align:middle; @@ -4035,7 +4083,6 @@ A.none, A.none:active, A.none:visited, A.none:hover { } .ui-widget { font-family:; - font-size:px; } /* .ui-button { margin-left: -2px; browser->name)?'padding-top: 1px;':''); ?> } */ .ui-button { margin-left: -2px; } @@ -4803,6 +4850,9 @@ dl.dropdown { display:inline-block; padding: 0 3px 2px 0; } +.dropdown span.value { + display:none; +} .dropdown dd ul { background-color: #FFF; border: 1px solid #888; @@ -4815,13 +4865,12 @@ dl.dropdown { max-height: 264px; overflow: auto; } -.dropdown span.value { - display:none; -} .dropdown dd ul li { white-space: nowrap; font-weight: normal; padding: 2px; + /* color: rgb(); */ + color: #000; } .dropdown dd ul li input[type="checkbox"] { margin-: 3px; @@ -4872,7 +4921,7 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i min-width: .4em; padding-left: 6px; padding-right: 6px; - font-size: px; + font-size: ; /* white-space: normal; */ /* Warning, enable this break the truncate feature */ } .ui-btn-icon-right .ui-btn-inner { @@ -5455,20 +5504,19 @@ div.tabsElem a.tab { } } -/* nboftopmenuentries = , fontsize= */ +/* nboftopmenuentries = , fontsize= */ /* rule to reduce top menu - 1st reduction */ -@media only screen and (max-width: px) /* reduction 1 */ +@media only screen and (max-width: px) /* reduction 1 */ { div.tmenucenter { - width: px; /* size of viewport */ + width: px; /* size of viewport */ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #; } .mainmenuaspan { - /*display: none;*/ - font-size: 10px; + font-size: 0.9em; padding-right: 0; } .topmenuimage { @@ -5491,20 +5539,20 @@ div.tabsElem a.tab { } } /* rule to reduce top menu - 2nd reduction */ -@media only screen and (max-width: px) /* reduction 2 */ +@media only screen and (max-width: px) /* reduction 2 */ { div.mainmenu { height: 23px; } div.tmenucenter { - max-width: px; /* size of viewport */ + max-width: px; /* size of viewport */ text-overflow: clip; } span.mainmenuaspan { margin-left: 1px; } .mainmenuaspan { - font-size: 10px; + font-size: 0.9em; padding-left: 0; padding-right: 0; } @@ -5515,7 +5563,7 @@ div.tabsElem a.tab { } } /* rule to reduce top menu - 3rd reduction */ -@media only screen and (max-width: px) /* reduction 3 */ +@media only screen and (max-width: px) /* reduction 3 */ { .side-nav { z-index: 200; diff --git a/htdocs/theme/md/img/statut3.png b/htdocs/theme/md/img/statut3.png index 158c640bb60..77476349d6d 100644 Binary files a/htdocs/theme/md/img/statut3.png and b/htdocs/theme/md/img/statut3.png differ diff --git a/htdocs/theme/md/img/statut3_40x40.png b/htdocs/theme/md/img/statut3_40x40.png index f71ef4eb962..48314ccb183 100644 Binary files a/htdocs/theme/md/img/statut3_40x40.png and b/htdocs/theme/md/img/statut3_40x40.png differ diff --git a/htdocs/theme/md/img/statut4.png b/htdocs/theme/md/img/statut4.png index d0df7e40aef..616f10de496 100644 Binary files a/htdocs/theme/md/img/statut4.png and b/htdocs/theme/md/img/statut4.png differ diff --git a/htdocs/theme/md/img/statut4_40x40.png b/htdocs/theme/md/img/statut4_40x40.png index 2da24b66484..879f48739f6 100644 Binary files a/htdocs/theme/md/img/statut4_40x40.png and b/htdocs/theme/md/img/statut4_40x40.png differ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 929f95c1d0f..2188a5bff9c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -45,8 +45,8 @@ $colorbacktabcard1='255,255,255'; // card $colorbacktabactive='234,234,234'; $colorbacklineimpair1='255,255,255'; // line impair $colorbacklineimpair2='255,255,255'; // line impair -$colorbacklinepair1='250,250,250'; // line pair -$colorbacklinepair2='248,248,248'; // line pair +$colorbacklinepair1='248,248,248'; // line pair +$colorbacklinepair2='246,246,246'; // line pair $colorbacklinepairhover='244,244,244'; // line pair $colorbacklinebreak='214,218,220'; $colorbackbody='248,248,248'; @@ -59,7 +59,7 @@ $fontsizesmaller='11'; if (defined('THEME_ONLY_CONSTANT')) return; -session_cache_limiter(FALSE); +session_cache_limiter(false); require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -251,7 +251,7 @@ body { trans("DIRECTION").";\n"; ?> } -th a, .thumbstat, a.tab { color: rgb() !important; font-weight: bold !important; } +th a, .thumbstat, a.tab { font-weight: bold !important; } a.tab { font-weight: bold !important; } a:link, a:visited, a:hover, a:active { font-family: ; font-weight: normal; color: rgb(); text-decoration: none; } @@ -716,6 +716,9 @@ select.flat.selectlimit { .marginleftonly { margin-left: 10px !important; } +.nomarginleft { + margin-left: 0px !important; +} .selectlimit, .selectlimit:focus { border-left: none !important; border-top: none !important; @@ -1234,7 +1237,7 @@ div.fiche { div.fiche { margin-: dol_optimize_smallscreen)?'24':'6')); ?>px; margin-: dol_optimize_smallscreen)?'22':'6')); ?>px; - dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?> + margin-bottom: 15px; } body.onlinepaymentbody div.fiche { /* For online payment page */ @@ -1363,7 +1366,7 @@ table.noborder tr.liste_titre td { .fiche .arearef img.pictoedit, .fiche .arearef span.pictoedit, .fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit, .tagtdnote span.pictoedit { - opacity: 0.9; + opacity: 0.6; } img.hideonsmartphone.pictoactionview { vertical-align: bottom; @@ -1413,6 +1416,7 @@ div.statusref img { padding-left: 8px; padding-right: 9px; vertical-align: text-bottom; + width: 18px; } div.statusrefbis { padding-left: 8px; @@ -1580,20 +1584,12 @@ li.tmenu, li.tmenusel { margin: 0px 0px 0px 0px; font-weight: normal; } -li.tmenusel, li.tmenu:hover { -/* - background-image: -o-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; - background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.5) 0%, rgba(250,250,250,0) 100%) !important; - background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0) 100%) !important; - background-image: -ms-linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; - background-image: linear-gradient(bottom, rgba(250,250,250,0.3) 0%, rgba(0,0,0,0.3) 100%) !important; - background: rgb(); -*/ - /* background: url() 50% 0 repeat-x !important; Nicer but problem when menu wrap on 2 lines */ -} -li.tmenusel, li.tmenu:hover { +li.tmenu:hover { opacity: .50; /* show only a slight shadow */ } +li.tmenusel { + text-decoration: underline; +} .tmenuend .tmenuleft { width: 0px; } .tmenuend { display: none; } @@ -1606,7 +1602,6 @@ div.tmenuleft height: px; - /* background: url() 0 -6px no-repeat; */ } div.tmenucenter @@ -2356,8 +2351,7 @@ span.butAction, span.butActionDelete { } -.button, .butAction, .butActionDelete, .butActionRefused { - border-color: #c5c5c5; +.button, .butAction, .butActionDelete, .butActionRefused, .butActionNewRefused { border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); display: inline-block; padding: 0.4em em; @@ -2385,6 +2379,32 @@ span.butAction, span.butActionDelete { -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); } +.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active { + text-decoration: none; + /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */ + display: inline-block; + padding: 0.2em em; + margin: 0em em; + line-height: 20px; + text-align: center; + vertical-align: middle; + cursor: pointer; + /* color: #ffffff !important; */ + /* text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); */ + -webkit-border-radius: 2px; + border-radius: 2px; + /* -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); */ + /* background-color: #006dcc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(to bottom, #0088cc, #0044cc); + background-repeat: repeat-x; */ +} +a.butActionNew>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; } +a.butActionNewRefused>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; } .button, .butAction { color: #ffffff !important; @@ -2431,7 +2451,7 @@ a.butAction:link, a.butAction:visited, a.butAction:hover, a.butAction:active { color: #FFFFFF; } -.butActionRefused { +.butActionRefused, .butActionNewRefused { color: #AAAAAA !important; cursor: not-allowed !important; } @@ -2439,7 +2459,11 @@ a.butAction:link, a.butAction:visited, a.butAction:hover, a.butAction:active { a.butAction:hover, a.butActionDelete:hover, a.butActionRefused:hover { text-decoration: none; } -a.butAction:hover, a.butActionDelete:hover { +a.butActionNewRefused:hover { + border-color: unset !important; + border: 1px solid #bbbbbb; +} +a.butAction:hover, a.butActionNew:hover, a.butActionDelete:hover { opacity: 0.9; } @@ -2449,7 +2473,7 @@ a.butAction:hover, a.butActionDelete:hover { } global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> -.butActionRefused { +.butActionRefused, .butActionNewRefused { display: none; } @@ -2515,15 +2539,16 @@ table.border, table.bordernooddeven, table.dataTable, .table-border, .table-bord table.borderplus { border: 1px solid #BBB; } + .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { - height: 22px; + height: 26px; } tr.liste_titre.box_titre td table td, .bordernooddeven tr td { - height: 22px; + height: 26px; } -table.border td, div.border div div.tagtd { - padding: 2px 2px 2px 2px; +table.border td, table.bordernooddeven td, div.border div div.tagtd { + padding: 2px 4px 2px 4px; border: 1px solid #f0f0f0; border-collapse: collapse; } @@ -2751,10 +2776,6 @@ div.pagination li.noborder a:hover { border: none; background-color: transparent; } -div.pagination li a, -div.pagination li span { - background-color: #fff; -} div.pagination li:first-child a, div.pagination li:first-child span { margin-left: 0; @@ -3169,8 +3190,12 @@ div .tdtop { } span.boxstatstext { line-height: 18px; + color: #000; /* opacity: 0.7; */ /* a bug if browser make z-index infintie when opacity is set so we disable it */ } +.boxstatsindicator.thumbstat150 { /* If we remove this, box position is ko on ipad */ + display: inline-flex; +} span.boxstatsindicator { font-size: 110%; font-weight: normal; @@ -3437,7 +3462,7 @@ div.titre { dol_optimize_smallscreen)?'':'margin-top: 4px;'); ?> } -#dolpaymenttable { min-width: 300px; font-size: 16px; } /* Width must have min to make stripe input area visible */ +#dolpaymenttable { min-width: 320px; font-size: 16px; } /* Width must have min to make stripe input area visible. Lower than 320 makes input area crazy for credit card that need zip code */ #tablepublicpayment { border: 1px solid #CCCCCC !important; width: 100%; padding: 20px; } #tablepublicpayment .CTableRow1 { background-color: #F0F0F0 !important; } #tablepublicpayment tr.liste_total { border-bottom: 1px solid #CCCCCC !important; } @@ -3640,7 +3665,7 @@ table.dp { border-style:none; background-color:transparent; padding:0px; - font-size:9px; + font-size: 0.85em; border-width:0px; color: #eee; vertical-align:middle; @@ -4723,6 +4748,9 @@ dl.dropdown { display:inline-block; padding: 0 3px 2px 0; } +.dropdown span.value { + display:none; +} .dropdown dd ul { background-color: #FFF; border: 1px solid #888; @@ -4735,13 +4763,11 @@ dl.dropdown { max-height: 264px; overflow: auto; } -.dropdown span.value { - display:none; -} .dropdown dd ul li { white-space: nowrap; font-weight: normal; padding: 2px; + color: #000; } .dropdown dd ul li input[type="checkbox"] { margin-right: 3px; diff --git a/htdocs/ticketsup/README.md b/htdocs/ticketsup/README.md new file mode 100644 index 00000000000..e4c9b49f6b3 --- /dev/null +++ b/htdocs/ticketsup/README.md @@ -0,0 +1,10 @@ +Ticket module +============= + + +An issue tracker that provides a delicate balance between simplicity and power and complete integration with the other modules. +Offer your customers an easy to use interface to report and follow status of their issue. Manage your issues from +your backoffice. + + +(c) The development of this module has been initiated by the company Libr&thic and is now part of Dolibarr ERP CRM core. diff --git a/htdocs/ticketsup/card.php b/htdocs/ticketsup/card.php index 6d33a5cd9be..4b186867302 100644 --- a/htdocs/ticketsup/card.php +++ b/htdocs/ticketsup/card.php @@ -45,11 +45,11 @@ if (!empty($conf->contrat->enabled)) { $langs->loadLangs(array("companies","other","ticketsup")); // Get parameters -$id = GETPOST('id', 'int'); -$track_id = GETPOST('track_id', 'alpha', 3); -$ref = GETPOST('ref', 'alpha'); +$id = GETPOST('id', 'int'); +$track_id = GETPOST('track_id', 'alpha', 3); +$ref = GETPOST('ref', 'alpha'); $projectid = GETPOST('projectid', 'int'); -$action = GETPOST('action', 'alpha', 3); +$action = GETPOST('action', 'alpha', 3); // Initialize technical object to manage hooks of ticketsup. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('ticketsupcard','globalcard')); @@ -63,7 +63,7 @@ if (!$action) { $action = 'view'; } //Select mail models is same action as add_message -if (GETPOST('modelselected')) { +if (GETPOST('modelselected','alpha')) { $action = 'add_message'; } @@ -121,6 +121,25 @@ if ($action == "update_extras" && ! empty($permissiontoadd)) } } +if ($action == "change_property" && GETPOST('btn_update_ticket_prop','alpha') && $user->rights->ticketsup->write) +{ + $object->fetch(GETPOST('id','int'), '', GETPOST('track_id','alpha')); + + $object->type_code = GETPOST('update_value_type','az09'); + $object->category_code = GETPOST('update_value_category','az09'); + $object->severity_code = GETPOST('update_value_severity','az09'); + + $ret = $object->update($user); + if ($ret > 0) { + $log_action = $langs->trans('TicketLogPropertyChanged', $oldvalue_label, $newvalue_label); + $ret = $object->createTicketLog($user, $log_action); + if ($ret > 0) { + setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs'); + } + } + $action = 'view'; +} + $permissiondellink = $user->rights->ticketsup->write; include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once @@ -134,7 +153,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be inc $userstat = new User($db); $form = new Form($db); $formticket = new FormTicketsup($db); -$formproject = new FormProjets($db); + +if (! empty($conf->projet->enabled)) { + $formproject = new FormProjets($db); +} if ($action == 'view' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' || $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') @@ -468,92 +490,82 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti * Classification and actions on ticket * ***************************************************/ - /* - * Ticket properties - */ + + print '
    '; + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print '
    '; +$stringtoshow.= '"; print "\n"; - $var=True; - $bc[1]='bgcolor="#f5f5f5"'; - $bc[0]='bgcolor="#f0f0f0"'; while ($i < $num) { $objp = $db->fetch_object($resql); - print ''; if ($objp->public) { diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index ef42b4e8d56..b3438e8be02 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -81,7 +81,7 @@ function llxFooterVierge() $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; @@ -139,7 +139,6 @@ if ($result) print_liste_field_titre("Photo", $_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder,'public_'); print "\n"; - $var=True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 742b949e27c..32cb5f2e1ba 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -66,22 +66,28 @@ if (GETPOST('ajoutcomment','alpha')) $error=0; - if (! GETPOST('comment','none')) + $comment = GETPOST("comment",'none'); + $comment_user = GETPOST('commentuser','nohtml'); + + if (! $comment) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors'); } - if (! GETPOST('commentuser','nohtml')) + if (! $comment_user) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors'); } + if (! in_array($comment_user, $listofvoters)) + { + setEventMessages($langs->trans("UserMustBeSameThanUserUsedToVote"), null, 'errors'); + $error++; + } + if (! $error) { - $comment = GETPOST("comment",'none'); - $comment_user = GETPOST('commentuser','nohtml'); - $resql = $object->addComment($comment, $comment_user); if (! $resql) dol_print_error($db); @@ -729,8 +735,12 @@ if ($comments) print "
    " . $langs->trans("CommentsOfVoters") . ":
    \n"; foreach ($comments as $obj) { + // ligne d'un usager pré-authentifié + //$mod_ok = (in_array($obj->name, $listofvoters)); + print '
    '; - if (in_array($obj->usercomment, $listofvoters)) print ' '.img_picto('', 'delete.png').' '; + if (in_array($obj->usercomment, $listofvoters)) print ' '.img_picto('', 'delete.png', '', false, 0, 0, '', 'nomarginleft').' '; + //else print img_picto('', 'ellipsis-h', '', false, 0, 0, '', 'nomarginleft').' '; print dol_htmlentities($obj->usercomment).': '.dol_nl2br(dol_htmlentities($obj->comment))."
    "; } } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 389daafcd15..78cf69d8337 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -222,7 +222,7 @@ if (! empty($conf->paypal->enabled)) $TAXAMT=urldecode($resArray["TAXAMT"]); $NOTE=urldecode($resArray["NOTE"]); - $ispaymentok=True; + $ispaymentok=true; } else { diff --git a/htdocs/public/ticketsup/create_ticket.php b/htdocs/public/ticketsup/create_ticket.php index 8c8a0dd2f60..a6fc6778f96 100644 --- a/htdocs/public/ticketsup/create_ticket.php +++ b/htdocs/public/ticketsup/create_ticket.php @@ -17,32 +17,17 @@ */ /** - * Display public form to add new ticket - * - * \ingroup ticketsup + * \file htdocs/public/ticketsup/index.php + * \ingroup ticketsup + * \brief Display public form to add new ticket */ -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('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'); -define("NOLOGIN", 1); // This means this output page does not require to be logged. -define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged. +if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/actions_ticketsup.class.php'; @@ -75,7 +60,7 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); // Add file in email form if (GETPOST('addfile') && !GETPOST('add_ticket')) { - ////$res = $object->fetch('',GETPOST('track_id')); + ////$res = $object->fetch('','',GETPOST('track_id')); ////if($res > 0) ////{ include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; @@ -93,9 +78,7 @@ if (GETPOST('addfile') && !GETPOST('add_ticket')) { // Remove file if (GETPOST('removedfile') && !GETPOST('add_ticket')) { - ////$res = $object->fetch('',GETPOST('track_id')); - ////if($res > 0) - ////{ + include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; // Set tmp directory @@ -103,9 +86,8 @@ if (GETPOST('removedfile') && !GETPOST('add_ticket')) { $upload_dir_tmp = $vardir . '/temp'; // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'], 0); + dol_remove_file_process($_POST['removedfile'], 0, 0); $action = 'create_ticket'; - ////} } if ($action == 'create_ticket' && GETPOST('add_ticket')) { $error = 0; @@ -130,11 +112,11 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { } } - if (!GETPOST("subject")) { + if (!GETPOST("subject","none")) { $error++; array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject"))); $action = ''; - } elseif (!GETPOST("message")) { + } elseif (!GETPOST("message","none")) { $error++; array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("message"))); $action = ''; @@ -152,13 +134,13 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $object->track_id = generate_random_id(16); - $object->subject = GETPOST("subject"); - $object->message = GETPOST("message"); + $object->subject = GETPOST("subject","none"); + $object->message = GETPOST("message","none"); $object->origin_email = $origin_email; - $object->type_code = GETPOST("type_code"); - $object->category_code = GETPOST("category_code"); - $object->severity_code = GETPOST("severity_code"); + $object->type_code = GETPOST("type_code", 'az09'); + $object->category_code = GETPOST("category_code", 'az09'); + $object->severity_code = GETPOST("severity_code", 'az09'); if (is_array($searched_companies)) { $object->fk_soc = $searched_companies[0]->id; } @@ -175,7 +157,10 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { if (!is_object($user)) { $user = new User($db); } - $id = $object->create($user, 1); // Disable trigger for email (send by this page) + + $object->context['disableticketsupemail']=1; // Disable emails sent by ticketsup trigger when creation is done from this page, emails are already sent later + + $id = $object->create($user); if ($id <= 0) { $error++; $errors = ($object->error ? array($object->error) : $object->errors); @@ -187,9 +172,20 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { if ($usertoassign > 0) { $object->add_contact($usertoassign, "SUPPORTCLI", 'external', $notrigger = 0); } + } - $object->db->commit(); + if (! $error) + { + $object->db->commit(); + $action = "infos_success"; + } else { + $object->db->rollback(); + setEventMessage($object->errors, 'errors'); + $action = 'create_ticket'; + } + if (! $error) + { $res = $object->fetch($id); if ($res) { // Create form object @@ -208,18 +204,19 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $mimetype = $attachedfiles['mimes']; // Send email to customer + $subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubject'); $message .= ($conf->global->TICKETS_MESSAGE_MAIL_NEW ? $conf->global->TICKETS_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')) . "\n\n"; $message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket') . "\n"; - $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $object->track_id; + $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $object->track_id; $infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', '' . $object->track_id . '') . "\n"; $infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl') . "\n\n"; $message .= dol_nl2br($infos_new_ticket); $message .= $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE ? $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE : $langs->transnoentities('TicketMessageMailSignatureText'); - $sendto = GETPOST('email'); + $sendto = GETPOST('email','alpha'); $from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>'; $replyto = $from; @@ -241,79 +238,80 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; } - /* Send email to admin */ + + // Send email to TICKETS_NOTIFICATION_EMAIL_TO + $sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO; - $subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubjectAdmin'); - $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id) . "\n\n"; - $message_admin .= '
    • ' . $langs->trans('Title') . ' : ' . $object->subject . '
    • '; - $message_admin .= '
    • ' . $langs->trans('Type') . ' : ' . $object->type_label . '
    • '; - $message_admin .= '
    • ' . $langs->trans('Category') . ' : ' . $object->category_label . '
    • '; - $message_admin .= '
    • ' . $langs->trans('Severity') . ' : ' . $object->severity_label . '
    • '; - $message_admin .= '
    • ' . $langs->trans('From') . ' : ' . $object->origin_email . '
    • '; - if (is_array($extrafields->attributes[$object->table_element]['label'])) + if ($sendto) { - foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) - { - $enabled = 1; - if ($qualified && isset($extrafields->attributes[$object->table_element]['list'][$key])) - { - $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); - } - $perms = 1; - if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) - { - $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1); - } + $subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubjectAdmin'); + $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id) . "\n\n"; + $message_admin .= '
      • ' . $langs->trans('Title') . ' : ' . $object->subject . '
      • '; + $message_admin .= '
      • ' . $langs->trans('Type') . ' : ' . $object->type_label . '
      • '; + $message_admin .= '
      • ' . $langs->trans('Category') . ' : ' . $object->category_label . '
      • '; + $message_admin .= '
      • ' . $langs->trans('Severity') . ' : ' . $object->severity_label . '
      • '; + $message_admin .= '
      • ' . $langs->trans('From') . ' : ' . $object->origin_email . '
      • '; - $qualified=true; - if (empty($enabled) || $enabled == 2) $qualified = false; - if (empty($perms)) $qualified = false; - if ($qualified) $message_admin .= '
      • ' . $langs->trans($key) . ' : ' . $value . '
      • '; - } - } + if (is_array($extrafields->attributes[$object->table_element]['label'])) + { + foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) + { + $enabled = 1; + if ($qualified && isset($extrafields->attributes[$object->table_element]['list'][$key])) + { + $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); + } + $perms = 1; + if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) + { + $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1); + } - $message_admin .= '
      '; - $message_admin .= '

      ' . $langs->trans('Message') . ' :
      ' . $object->message . '

      '; - $message_admin .= '

      ' . $langs->trans('SeeThisTicketIntomanagementInterface') . '

      '; + $qualified=true; + if (empty($enabled) || $enabled == 2) $qualified = false; + if (empty($perms)) $qualified = false; + if ($qualified) $message_admin .= '
    • ' . $langs->trans($key) . ' : ' . $value . '
    • '; + } + } - $from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>'; - $replyto = $from; + $message_admin .= '
    '; + $message_admin .= '

    ' . $langs->trans('Message') . ' :
    ' . $object->message . '

    '; + $message_admin .= '

    ' . $langs->trans('SeeThisTicketIntomanagementInterface') . '

    '; - $message_admin = dol_nl2br($message_admin); + $from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>'; + $replyto = $from; - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { - $result = $mailfile->sendfile(); - } - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } + $message_admin = dol_nl2br($message_admin); - // Copy files into ticket directory - $destdir = $conf->ticketsup->dir_output . '/' . $object->track_id; - if (!dol_is_dir($destdir)) { - dol_mkdir($destdir); - } - foreach ($filename as $i => $val) { - dol_move($filepath[$i], $destdir . '/' . $filename[$i], 0, 1); - $formmail->remove_attached_files($i); + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; + $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; + } + include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); + if ($mailfile->error) { + setEventMessage($mailfile->error, 'errors'); + } else { + $result = $mailfile->sendfile(); + } + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; + } } } + // Copy files into ticket directory + $destdir = $conf->ticketsup->dir_output . '/' . $object->track_id; + if (! dol_is_dir($destdir)) { + dol_mkdir($destdir); + } + foreach ($filename as $i => $val) { + dol_move($filepath[$i], $destdir . '/' . $filename[$i], 0, 1); + $formmail->remove_attached_files($i); + } + setEventMessage($langs->trans('YourTicketSuccessfullySaved')); - $action = "infos_success"; - } else { - $object->db->rollback(); - setEventMessage($object->errors, 'errors'); - $action = 'create_ticket'; } } else { setEventMessage($object->errors, 'errors'); diff --git a/htdocs/public/ticketsup/index.php b/htdocs/public/ticketsup/index.php index 576eee32bc4..a7649576275 100644 --- a/htdocs/public/ticketsup/index.php +++ b/htdocs/public/ticketsup/index.php @@ -16,31 +16,14 @@ */ /** - * \file ticketsup/public/index.php - * \ingroup ticketsup - * \brief Public file to add and manage ticket + * \file htdocs/public/ticketsup/index.php + * \ingroup ticketsup + * \brief Public file to add and manage ticket */ -//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'); -} -// Do not check anti CSRF attack test -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//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 -//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 (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/actions_ticketsup.class.php'; diff --git a/htdocs/public/ticketsup/list.php b/htdocs/public/ticketsup/list.php index d4d8b16a743..9a930bc78b0 100644 --- a/htdocs/public/ticketsup/list.php +++ b/htdocs/public/ticketsup/list.php @@ -16,9 +16,9 @@ */ /** - * \file ticketsup/public/index.php - * \ingroup ticketsup - * \brief Public file to add and manage ticket + * \file htdocs/public/ticketsup/list.php + * \ingroup ticketsup + * \brief Public file to add and manage ticket */ if (!defined('NOCSRFCHECK')) { @@ -60,6 +60,13 @@ if (isset($_SESSION['email_customer'])) { $object = new ActionsTicketsup($db); + + + +/* + * Actions + */ + if ($action == "view_ticketlist") { $error = 0; $display_ticket_list = false; @@ -82,7 +89,8 @@ if ($action == "view_ticketlist") { } if (!$error) { - $ret = $object->fetch('', $track_id); + $ret = $object->fetch('', '', $track_id); + if ($ret && $object->dao->id > 0) { // vérifie si l'adresse email est bien dans les contacts du ticket $contacts = $object->dao->liste_contact(-1, 'external'); @@ -118,6 +126,7 @@ if ($action == "view_ticketlist") { $action = ''; } } + $object->doActions($action); @@ -143,11 +152,13 @@ if (!$conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) { print '
    '; -if ($action == "view_ticketlist") { +if ($action == "view_ticketlist") +{ + if ($display_ticket_list) { // Filters $search_fk_status = GETPOST("search_fk_status", 'alpha'); - $search_subject = GETPOST("search_subject"); + $search_subject = GETPOST("search_subject", 'alpha'); $search_type = GETPOST("search_type", 'alpha'); $search_category = GETPOST("search_category", 'alpha'); $search_severity = GETPOST("search_severity", 'alpha'); @@ -155,7 +166,7 @@ if ($action == "view_ticketlist") { $search_fk_user_assign = GETPOST("search_fk_user_assign", 'int'); // Store current page url - $url_page_current = dol_buildpath('/ticketsup/public/list.php', 1); + $url_page_current = dol_buildpath('/public/ticketsup/list.php', 1); // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x")) { @@ -263,15 +274,13 @@ if ($action == "view_ticketlist") { $limit = $conf->liste_limit; $page = GETPOST("page", 'int'); - if ($page == -1) { - $page = 0; - } + if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; // Request SQL - $sql = "SELECT"; + $sql = "SELECT DISTINCT"; $sql .= " t.rowid,"; $sql .= " t.ref,"; $sql .= " t.track_id,"; @@ -313,12 +322,12 @@ if ($action == "view_ticketlist") { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "ticketsup_extrafields as ef on (t.rowid = ef.fk_object)"; } $sql .= " WHERE t.entity IN (" . getEntity('ticketsup') . ")"; - $sql .= " AND tc.source = 'external'"; - $sql .= " AND tc.element='" . $object->dao->element . "'"; - $sql .= " AND tc.active=1"; - $sql .= " AND (sp.email='" . $db->escape($_SESSION['email_customer']) . "'"; + $sql .= " AND ((tc.source = 'external'"; + $sql .= " AND tc.element='" . $db->escape($object->dao->element) . "'"; + $sql .= " AND tc.active=1)"; + $sql .= " OR (sp.email='" . $db->escape($_SESSION['email_customer']) . "'"; $sql .= " OR s.email='" . $db->escape($_SESSION['email_customer']) . "'"; - $sql .= " OR t.origin_email='" . $db->escape($_SESSION['email_customer']) . "')"; + $sql .= " OR t.origin_email='" . $db->escape($_SESSION['email_customer']) . "'))"; // Manage filter if (!empty($filter)) { foreach ($filter as $key => $value) { @@ -337,7 +346,7 @@ if ($action == "view_ticketlist") { } } } - $sql .= " GROUP BY t.track_id"; + //$sql .= " GROUP BY t.track_id"; $sql .= " ORDER BY " . $sortfield . ' ' . $sortorder; $resql = $db->query($sql); @@ -350,7 +359,7 @@ if ($action == "view_ticketlist") { $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - print_barre_liste($langs->trans('TicketList'), $page, 'public/list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticketsup-32@ticketsup'); + print_barre_liste($langs->trans('TicketList'), $page, 'public/list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticketsup'); /* * Search bar @@ -442,9 +451,9 @@ if ($action == "view_ticketlist") { // Status if (!empty($arrayfields['t.fk_statut']['checked'])) { - print '
    '; } @@ -497,16 +506,15 @@ if ($action == "view_ticketlist") { } } - print ''; print ''; - $var = true; - while ($obj = $db->fetch_object($resql)) { - $var = !$var; - print ""; + while ($obj = $db->fetch_object($resql)) + { + print ''; // Date ticket if (!empty($arrayfields['t.datec']['checked'])) { @@ -582,11 +590,11 @@ if ($action == "view_ticketlist") { // Message author if (!empty($arrayfields['t.fk_user_create']['checked'])) { print '
    '; if ($mesg) { print $mesg; } else { $stringtoshow.= $px1->show(); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index e61d3ceb8ce..0f2ec5f9fcd 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -3,6 +3,7 @@ * Copyright (C) 2006-2018 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -419,16 +420,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) { if ($projectstatic->public || $userWrite > 0) { - $linktocreatetime = ''.$langs->trans('AddTimeSpent').''; + $linktocreatetime = ''.$langs->trans('AddTimeSpent').''; } else { - $linktocreatetime = ''.$langs->trans('AddTime').''; + $linktocreatetime = ''.$langs->trans('AddTime').''; } } else { - $linktocreatetime = ''.$langs->trans('AddTime').''; + $linktocreatetime = ''.$langs->trans('AddTime').''; } //} } @@ -919,7 +920,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; */ // Hook fields - $parameters=array('arrayfields'=>$arrayfields); + $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center" width="80"',$sortfield,$sortorder,'maxwidthsearch '); @@ -948,7 +949,11 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) { - print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1); + if (empty($task_time->task_date_withhour)) + { + print $form->select_date(($date2?$date2:$date1),'timeline',3,3,2,"timespent_date",1,0,1); + } + else print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1); } else { @@ -1085,7 +1090,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print $hookmanager->resPrint; // Action column - print ''; + print ''; if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { print ''; diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index c8f7f05ff23..72f1a6b9242 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -28,18 +28,15 @@ * &id=..., &idfrom=..., &idto=... */ -//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('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'); -define("NOLOGIN",1); // This means this output page does not require to be logged. -define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. +if (! defined('NOCSRFCHECK')) define("NOCSRFCHECK",1); // We accept to go on this page from external web site. // C'est un wrapper, donc header vierge + /** * Header function * diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 36b21c514e9..b11bf4cc42f 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -27,9 +27,7 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -if (! defined('NOLOGIN')) define('NOLOGIN','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOLOGIN')) define('NOLOGIN','1'); // For MultiCompany module. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index 3780481e23c..3d8057cbe85 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -73,14 +73,10 @@ if ($resql) print "".$langs->trans("Amount")."
    '; + print ''; $selected = ($search_fk_status != "non_closed" ? $search_fk_status : ''); - $object->printSelectStatus($selected); + //$object->printSelectStatus($selected); print ''; + print ''; print ''; print ''; print '
    '; - if ($obj->fk_user_create) { + if ($obj->fk_user_create > 0) { $user_create->firstname = (!empty($obj->user_create_firstname) ? $obj->user_create_firstname : ''); $user_create->name = (!empty($obj->user_create_lastname) ? $obj->user_create_lastname : ''); $user_create->id = (!empty($obj->fk_user_create) ? $obj->fk_user_create : ''); - print $user_create->getFullName(); + print $user_create->getFullName($langs); } else { print $langs->trans('Email'); } @@ -596,11 +604,11 @@ if ($action == "view_ticketlist") { // Assigned author if (!empty($arrayfields['t.fk_user_assign']['checked'])) { print ''; - if ($obj->fk_user_assign) { + if ($obj->fk_user_assig > 0) { $user_assign->firstname = (!empty($obj->user_assign_firstname) ? $obj->user_assign_firstname : ''); $user_assign->lastname = (!empty($obj->user_assign_lastname) ? $obj->user_assign_lastname : ''); $user_assign->id = (!empty($obj->fk_user_assign) ? $obj->fk_user_assign : ''); - print $user_assign->getFullName(); + print $user_assign->getFullName($langs); } else { print $langs->trans('None'); } @@ -635,7 +643,7 @@ if ($action == "view_ticketlist") { print '
    '; print ''; - print '
     
    '; +print $langs->trans("STRIPE_MINIMAL_3DSECURE").''; +print ''.$langs->getCurrencySymbol($conf->currency).'
    '.$langs->trans("Required").' 
    ".$extrafields->attribute_pos[$key]."".$extrafields->attribute_label[$key]."'.$langs->trans("Required").' 
    ".$extrafields->attribute_label[$key]."".$key."
    '; - print ''; + print ''; print ''; - print ''; + print ''; print ''; //print $langs->trans('Month').': '; - print ''; + print ''; //print ' '.$langs->trans('Year').': '; $syearvalid = $yearvalid; $formother->select_year($syearvalid,'yearvalid',1, 20, 5); @@ -518,7 +525,7 @@ if ($resql) { print ''; //print $langs->trans('Month').': '; - print ''; + print ''; //print ' '.$langs->trans('Year').': '; $syear = $year; $formother->select_year($syear,'year',1, 20, 5); @@ -529,28 +536,28 @@ if ($resql) { // Amount print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
    '; print ''; - print ''; + print ''; print ''; - if (GETPOST('set') == 'properties' && $user->rights->ticketsup->write) { - /* - * Form to change ticket properties - */ - $j = 0; - $ticketprop[$j] = array( - 'dict' => 'type', - 'list_function' => 'selectTypesTickets', - 'label' => 'TicketChangeType', - ); - $j++; - $ticketprop[$j] = array( - 'dict' => 'category', - 'list_function' => 'selectCategoriesTickets', - 'label' => 'TicketChangeCategory', - ); - $j++; - $ticketprop[$j] = array( - 'dict' => 'severity', - 'list_function' => 'selectSeveritiesTickets', - 'label' => 'TicketChangeSeverity', - ); - foreach ($ticketprop as $property) { - print ''; - print ''; - print ''; - } + if (GETPOST('set','alpha') == 'properties' && $user->rights->ticketsup->write) { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; } else { // Type - print ''; // Category print ''; // Severity print ''; } print '
    '; + print ''; print $langs->trans('Properties'); print ''; + if (GETPOST('set','alpha') == 'properties' && $user->rights->ticketsup->write) { + print ''; + } + else { + // Button to edit Properties + if ($object->fk_statut < 5 && $user->rights->ticketsup->write) { + print '' . img_edit($langs->trans('Modify')) . ''; + } + } + print '
    '; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
    '; - print ' '; - print ''; - print $formticket->{$property['list_function']}($object->type_code, 'update_value', '', 0); - print ''; - print ' '; - print '
    '; - print ''; - - print '
    '; + print $langs->trans('TicketChangeType'); + print ''; + print $formticket->selectTypesTickets($object->type_code, 'update_value_type', '', 2); + print '
    '; + print $langs->trans('TicketChangeCategory'); + print ''; + print $formticket->selectCategoriesTickets($object->category_code, 'update_value_category', '', 2); + print '
    '; + print $langs->trans('TicketChangeSeverity'); + print ''; + print $formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2); + print '
    ' . $langs->trans("Type") . ''; - print $object->type_label; + print '
    ' . $langs->trans("Type") . ''; + print $langs->getLabelFromKey($db, $object->type_code, 'c_ticketsup_type', 'code', 'label'); /*if ($user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); }*/ - print '
    ' . $langs->trans("Category") . ''; - print $object->category_label; + print $langs->getLabelFromKey($db, $object->category_code, 'c_ticketsup_category', 'code', 'label'); /*if ($user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); }*/ - print '
    ' . $langs->trans("TicketSeverity") . ''; - print $object->severity_label; + print $langs->getLabelFromKey($db, $object->severity_code, 'c_ticketsup_severity', 'code', 'label'); /*if ($user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); }*/ - print '
    '; // End table actions - print '
    '; + + print ''; + print '
    '; // Display navbar with links to change ticket status print ''; @@ -631,15 +643,15 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti print '
    '; - print dol_print_phone($tab[$i]['phone'], '', '', '', AC_TEL).'
    '; + print dol_print_phone($tab[$i]['phone'], '', '', '', 'AC_TEL').'
    '; if (! empty($tab[$i]['phone_perso'])) { //print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' '; - print '
    '.dol_print_phone($tab[$i]['phone_perso'], '', '', '', AC_TEL).'
    '; + print '
    '.dol_print_phone($tab[$i]['phone_perso'], '', '', '', 'AC_TEL').'
    '; } if (! empty($tab[$i]['phone_mobile'])) { //print img_picto($langs->trans('PhoneMobile'),'object_phoning.png','',0,0,0).' '; - print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', AC_TEL).'
    '; + print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', 'AC_TEL').'
    '; } print '
    '; @@ -715,11 +727,6 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti print ''; } - // Button to edit Properties - if ($object->fk_statut < 5 && $user->rights->ticketsup->write) { - print ''; - } - // Button to link to a contract if ($user->rights->ticketsup->write && $object->fk_statut < 5 && $user->rights->contrat->creer) { print ''; diff --git a/htdocs/ticketsup/class/actions_ticketsup.class.php b/htdocs/ticketsup/class/actions_ticketsup.class.php index b5a93b50256..a3fda3ac543 100644 --- a/htdocs/ticketsup/class/actions_ticketsup.class.php +++ b/htdocs/ticketsup/class/actions_ticketsup.class.php @@ -383,31 +383,6 @@ class ActionsTicketsup $action = 'view'; } - if ($action == "change_property" && GETPOST('btn_update_ticket_prop') && $user->rights->ticketsup->write) { - $this->fetch('', '', GETPOST('track_id','alpha')); - - $fieldtomodify = GETPOST('property') . '_code'; - $fieldtomodify_label = GETPOST('property') . '_label'; - - $oldvalue_code = $object->$fieldtomodify; - $newvalue_code = $object->getValueFrom('c_ticketsup_' . GETPOST('property'), GETPOST('update_value'), 'code'); - - $oldvalue_label = $object->$fieldtomodify_label; - $newvalue_label = $object->getValueFrom('c_ticketsup_' . GETPOST('property'), GETPOST('update_value'), 'label'); - - $object->$fieldtomodify = $newvalue_code; - - $ret = $object->update($user); - if ($ret > 0) { - $log_action = $langs->trans('TicketLogPropertyChanged', $oldvalue_label, $newvalue_label); - $ret = $object->createTicketLog($user, $log_action); - if ($ret > 0) { - setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs'); - } - } - $action = 'view'; - } - if ($action == "new_message" && GETPOST('btn_add_message') && $user->rights->ticketsup->read) { $ret = $this->newMessage($user, $action); if ($ret) { @@ -759,7 +734,7 @@ class ActionsTicketsup $url_public_ticket = (!empty($conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) ? (!empty($conf->global->TICKETS_URL_PUBLIC_INTERFACE) ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' : - dol_buildpath('/ticketsup/public/view.php', 2) + dol_buildpath('/public/ticketsup/view.php', 2) ) : dol_buildpath('/ticketsup/card.php', 2) ) . '?track_id=' . $object->track_id; @@ -928,7 +903,7 @@ class ActionsTicketsup $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . "\n" : ''); } - $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $object->track_id; + $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $object->track_id; $message .= "\n\n" . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . $url_public_ticket . "\n"; // Add signature @@ -1152,16 +1127,16 @@ class ActionsTicketsup print '
    '; print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; - print ''; print ''; - - print ''; - print $htmllogobar; - $htmllogobar = ''; print ''; } + // Supplier code + if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) { + print ''; + print ''; + } + print '
    '; - print '' . $langs->trans("InitialMessage") . ' '; + print '
    '; + print $langs->trans("InitialMessage"); + print ''; if ($user->rights->ticketsup->manage) { - print '' . img_edit($langs->trans('Modify')) . ' ' . $langs->trans('Modify') . ''; + print '' . img_edit($langs->trans('Modify')) . ''; } print '
    '; + print ''; if (!empty($user->rights->ticketsup->manage) && $action == 'edit_message_init') { // MESSAGE $msg = GETPOST('message_initial', 'alpha') ? GETPOST('message_initial', 'alpha') : $object->message; @@ -1470,7 +1445,7 @@ class ActionsTicketsup global $langs; print '
    '; - print '
    '; + print '
    '; print '
    '; print '
    '; print '' . $langs->trans('TicketChangeStatus') . ''; diff --git a/htdocs/ticketsup/class/api_dictionaryticketsupcategories.class.php b/htdocs/ticketsup/class/api_dictionaryticketsupcategories.class.php deleted file mode 100644 index d33f96db881..00000000000 --- a/htdocs/ticketsup/class/api_dictionaryticketsupcategories.class.php +++ /dev/null @@ -1,98 +0,0 @@ - - * Copyright (C) 2016 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 . - */ - -use Luracast\Restler\RestException; - -require_once DOL_DOCUMENT_ROOT.'/main.inc.php'; - -/** - * API class for ticketsup types - * - * @access protected - * @class DolibarrApiAccess {@requires user,external} - */ -class DictionaryTicketsupCategories extends DolibarrApi -{ - /** - * Constructor - */ - function __construct() - { - global $db; - $this->db = $db; - } - - /** - * Get the list of ticketsup types. - * - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Number of items per page - * @param int $page Page number (starting from zero) - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" - * @return List of events types - * - * @throws RestException - */ - function index($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') - { - $list = array(); - - $sql = "SELECT rowid, code, pos, label, use_default, description"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_ticketsup_category as t"; - $sql.= " WHERE t.active = 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.= $this->db->order($sortfield, $sortorder); - - if ($limit) { - if ($page < 0) { - $page = 0; - } - $offset = $limit * $page; - - $sql .= $this->db->plimit($limit, $offset); - } - - $result = $this->db->query($sql); - - if ($result) { - $num = $this->db->num_rows($result); - $min = min($num, ($limit <= 0 ? $num : $limit)); - for ($i = 0; $i < $min; $i++) { - $list[] = $this->db->fetch_object($result); - } - } else { - throw new RestException(503, 'Error when retrieving list of ticketsup categories : '.$this->db->lasterror()); - } - - return $list; - } - - -} diff --git a/htdocs/ticketsup/class/api_dictionaryticketsupseverities.class.php b/htdocs/ticketsup/class/api_dictionaryticketsupseverities.class.php deleted file mode 100644 index 892563ad426..00000000000 --- a/htdocs/ticketsup/class/api_dictionaryticketsupseverities.class.php +++ /dev/null @@ -1,98 +0,0 @@ - - * Copyright (C) 2016 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 . - */ - -use Luracast\Restler\RestException; - -require_once DOL_DOCUMENT_ROOT.'/main.inc.php'; - -/** - * API class for ticketsup severities - * - * @access protected - * @class DolibarrApiAccess {@requires user,external} - */ -class DictionaryTicketsupSeverities extends DolibarrApi -{ - /** - * Constructor - */ - function __construct() - { - global $db; - $this->db = $db; - } - - /** - * Get the list of ticketsup types. - * - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Number of items per page - * @param int $page Page number (starting from zero) - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" - * @return List of events types - * - * @throws RestException - */ - function index($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') - { - $list = array(); - - $sql = "SELECT rowid, code, pos, label, use_default, color, description"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_ticketsup_severity as t"; - $sql.= " WHERE t.active = 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.= $this->db->order($sortfield, $sortorder); - - if ($limit) { - if ($page < 0) { - $page = 0; - } - $offset = $limit * $page; - - $sql .= $this->db->plimit($limit, $offset); - } - - $result = $this->db->query($sql); - - if ($result) { - $num = $this->db->num_rows($result); - $min = min($num, ($limit <= 0 ? $num : $limit)); - for ($i = 0; $i < $min; $i++) { - $list[] = $this->db->fetch_object($result); - } - } else { - throw new RestException(503, 'Error when retrieving list of ticketsup severities : '.$this->db->lasterror()); - } - - return $list; - } - - -} diff --git a/htdocs/ticketsup/class/api_dictionaryticketsuptypes.class.php b/htdocs/ticketsup/class/api_dictionaryticketsuptypes.class.php deleted file mode 100644 index 90b8d4f6bbc..00000000000 --- a/htdocs/ticketsup/class/api_dictionaryticketsuptypes.class.php +++ /dev/null @@ -1,100 +0,0 @@ - - * Copyright (C) 2016 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 . - */ - -use Luracast\Restler\RestException; - -require_once DOL_DOCUMENT_ROOT.'/main.inc.php'; - -/** - * API class for ticketsup types - * - * @access protected - * @class DolibarrApiAccess {@requires user,external} - */ -class DictionaryTicketsupTypes extends DolibarrApi -{ - /** - * Constructor - */ - function __construct() - { - global $db; - $this->db = $db; - } - - /** - * Get the list of ticketsup types. - * - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Number of items per page - * @param int $page Page number (starting from zero) - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" - * @return List of events types - * - * @throws RestException - */ - function index($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') - { - $list = array(); - - $sql = "SELECT rowid, code, pos, label, use_default, description"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_ticketsup_type as t"; - $sql.= " WHERE t.active = 1"; - if ($type) $sql.=" AND t.type LIKE '%" . $this->db->escape($type) . "%'"; - if ($module) $sql.=" AND t.module LIKE '%" . $this->db->escape($module) . "%'"; - // 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.= $this->db->order($sortfield, $sortorder); - - if ($limit) { - if ($page < 0) { - $page = 0; - } - $offset = $limit * $page; - - $sql .= $this->db->plimit($limit, $offset); - } - - $result = $this->db->query($sql); - - if ($result) { - $num = $this->db->num_rows($result); - $min = min($num, ($limit <= 0 ? $num : $limit)); - for ($i = 0; $i < $min; $i++) { - $list[] = $this->db->fetch_object($result); - } - } else { - throw new RestException(503, 'Error when retrieving list of ticketsup types : '.$this->db->lasterror()); - } - - return $list; - } - - -} diff --git a/htdocs/ticketsup/class/api_ticketsups.class.php b/htdocs/ticketsup/class/api_tickets.class.php similarity index 67% rename from htdocs/ticketsup/class/api_ticketsups.class.php rename to htdocs/ticketsup/class/api_tickets.class.php index ee696b34505..d0cd018648c 100644 --- a/htdocs/ticketsup/class/api_ticketsups.class.php +++ b/htdocs/ticketsup/class/api_tickets.class.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/ticketsup.lib.php'; * * */ -class Ticketsups extends DolibarrApi +class Tickets extends DolibarrApi { /** * @var array $FIELDS Mandatory fields, checked when create and update object @@ -53,36 +53,93 @@ class Ticketsups extends DolibarrApi /** * Constructor - * - * @url GET ticketsup/ - * */ public function __construct() { - global $db; - $this->db = $db; + global $db; + $this->db = $db; $this->ticketsup = new Ticketsup($this->db); } /** - * Get properties of a ticketsup object - * - * Return an array with ticketsup informations - * - * @param int $id ID of ticketsup - * @param string $track_id Tracking ID of ticket - * @param string $ref Reference for ticket - * @return array|mixed data without useless information - * - * @url GET track_id/{track_id} - * @url GET ref/{ref} - * @url GET {id} - * @throws RestException - */ - public function get($id = 0, $track_id = '', $ref = '') + * Get properties of a Ticket object. + * + * Return an array with ticket informations + * + * @param int $id ID of ticketsup + * @return array|mixed Data without useless information + * + * @throws 401 + * @throws 403 + * @throws 404 + */ + function get($id) + { + return $this->getCommon($id, '', ''); + } + + /** + * Get properties of a Ticket object from track id + * + * Return an array with ticket informations + * + * @param string $track_id Tracking ID of ticket + * @return array|mixed Data without useless information + * + * @url GET track_id/{track_id} + * + * @throws 401 + * @throws 403 + * @throws 404 + */ + public function getByTrackId($track_id) + { + return $this->getCommon(0, $track_id, ''); + } + + /** + * Get properties of a Ticket object from ref + * + * Return an array with ticket informations + * + * @param string $ref Reference for ticket + * @return array|mixed Data without useless information + * + * @url GET ref/{ref} + * + * @throws 401 + * @throws 403 + * @throws 404 + */ + public function getByRef($ref) + { + try { + return $this->getCommon(0, '', $ref); + } + catch(Exception $e) + { + throw $e; + } + } + + /** + * Get properties of a Ticket object + * + * Return an array with ticket informations + * + * @param int $id ID of ticketsup + * @param string $track_id Tracking ID of ticket + * @param string $ref Reference for ticket + * @return array|mixed Data without useless information + * + * @throws 401 + * @throws 403 + * @throws 404 + */ + public function getCommon($id = 0, $track_id = '', $ref = '') { if (! DolibarrApiAccess::$user->rights->ticketsup->read) { - throw new RestException(401); + throw new RestException(403); } // Check parameters @@ -258,16 +315,15 @@ class Ticketsups extends DolibarrApi if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); - } - - if ($limit) { - if ($page < 0) { - $page = 0; + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; } - $offset = $limit * $page; - - $sql.= $db->plimit($limit + 1, $offset); } + + $sql.= $db->plimit($limit + 1, $offset); + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -422,6 +478,190 @@ class Ticketsups extends DolibarrApi ); } + + /** + * Get the list of tickets categories. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return List of events types + * + * @url GET setup/dictionary/categories + * + * @throws RestException + */ + function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') + { + $list = array(); + + $sql = "SELECT rowid, code, pos, label, use_default, description"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_ticketsup_category as t"; + $sql.= " WHERE t.active = 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.= $this->db->order($sortfield, $sortorder); + + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + + $sql .= $this->db->plimit($limit, $offset); + } + + $result = $this->db->query($sql); + + if ($result) { + $num = $this->db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + for ($i = 0; $i < $min; $i++) { + $list[] = $this->db->fetch_object($result); + } + } else { + throw new RestException(503, 'Error when retrieving list of ticketsup categories : '.$this->db->lasterror()); + } + + return $list; + } + + /** + * Get the list of tickets severity. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return List of events types + * + * @url GET setup/dictionary/severities + * + * @throws RestException + */ + function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') + { + $list = array(); + + $sql = "SELECT rowid, code, pos, label, use_default, color, description"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_ticketsup_severity as t"; + $sql.= " WHERE t.active = 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.= $this->db->order($sortfield, $sortorder); + + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + + $sql .= $this->db->plimit($limit, $offset); + } + + $result = $this->db->query($sql); + + if ($result) { + $num = $this->db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + for ($i = 0; $i < $min; $i++) { + $list[] = $this->db->fetch_object($result); + } + } else { + throw new RestException(503, 'Error when retrieving list of ticketsup severities : '.$this->db->lasterror()); + } + + return $list; + } + + /** + * Get the list of tickets types. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return List of events types + * + * @url GET setup/dictionary/types + * + * @throws RestException + */ + function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') + { + $list = array(); + + $sql = "SELECT rowid, code, pos, label, use_default, description"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_ticketsup_type as t"; + $sql.= " WHERE t.active = 1"; + if ($type) $sql.=" AND t.type LIKE '%" . $this->db->escape($type) . "%'"; + if ($module) $sql.=" AND t.module LIKE '%" . $this->db->escape($module) . "%'"; + // 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.= $this->db->order($sortfield, $sortorder); + + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + + $sql .= $this->db->plimit($limit, $offset); + } + + $result = $this->db->query($sql); + + if ($result) { + $num = $this->db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + for ($i = 0; $i < $min; $i++) { + $list[] = $this->db->fetch_object($result); + } + } else { + throw new RestException(503, 'Error when retrieving list of ticketsup types : '.$this->db->lasterror()); + } + + return $list; + } + + + + + /** * Validate fields before create or update object * @@ -475,9 +715,9 @@ class Ticketsups extends DolibarrApi function _cleanObjectDatas($object) { - // Remove $db object property for object - unset($object->db); + $object = parent::_cleanObjectDatas($object); + // Other attributes to clean $attr2clean = array( "contact", "contact_id", @@ -516,7 +756,9 @@ class Ticketsups extends DolibarrApi "firstname", "civility_id", "cache_msgs_ticket", - "cache_logs_ticket" + "cache_logs_ticket", + "statuts_short", + "statuts" ); foreach ($attr2clean as $toclean) { unset($object->$toclean); diff --git a/htdocs/ticketsup/class/ticketsup.class.php b/htdocs/ticketsup/class/ticketsup.class.php index 5a4f71e81e3..61e5f5dd04a 100644 --- a/htdocs/ticketsup/class/ticketsup.class.php +++ b/htdocs/ticketsup/class/ticketsup.class.php @@ -181,7 +181,7 @@ class Ticketsup extends CommonObject 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>1, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>""), 'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth100'), - 'category_code' => array('type'=>'varchar(32)', 'label'=>'Category', 'visible'=>1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'searchall'=>1, 'help'=>""), + 'category_code' => array('type'=>'varchar(32)', 'label'=>'Category', 'visible'=>1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth100'), 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth100'), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty"), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-2, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1), @@ -489,7 +489,8 @@ class Ticketsup extends CommonObject dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - if ($this->db->num_rows($resql)) { + if ($this->db->num_rows($resql)) + { $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; @@ -529,10 +530,14 @@ class Ticketsup extends CommonObject $this->tms = $this->db->jdate($obj->tms); $this->fetch_optionals(); - } - $this->db->free($resql); - return 1; + $this->db->free($resql); + return 1; + } + else + { + return 0; + } } else { $this->error = "Error " . $this->db->lasterror(); dol_syslog(get_class($this) . "::fetch " . $this->error, LOG_ERR); @@ -810,12 +815,10 @@ class Ticketsup extends CommonObject $sql .= " datec=" . (dol_strlen($this->datec) != 0 ? "'" . $this->db->idate($this->datec) . "'" : 'null') . ","; $sql .= " date_read=" . (dol_strlen($this->date_read) != 0 ? "'" . $this->db->idate($this->date_read) . "'" : 'null') . ","; $sql .= " date_close=" . (dol_strlen($this->date_close) != 0 ? "'" . $this->db->idate($this->date_close) . "'" : 'null') . ""; - $sql .= " WHERE rowid=" . $this->id; $this->db->begin(); - dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -1588,7 +1591,7 @@ class Ticketsup extends CommonObject $url_internal_ticket = dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $this->track_id; $message .= "\n" . $langs->transnoentities('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . '' . $this->track_id . '' . "\n"; } else { - $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $this->track_id; + $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $this->track_id; $message .= "\n" . $langs->transnoentities('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . '' . $this->track_id . '' . "\n"; } @@ -1639,7 +1642,7 @@ class Ticketsup extends CommonObject { global $langs; - if (count($this->cache_logs_ticket)) { + if (is_array($this->cache_logs_ticket) && count($this->cache_logs_ticket)) { return 0; } // Cache deja charge @@ -1751,7 +1754,7 @@ class Ticketsup extends CommonObject { global $langs; - if (count($this->cache_msgs_ticket)) { + if (is_array($this->cache_msgs_ticket) && count($this->cache_msgs_ticket)) { return 0; } // Cache deja charge @@ -1934,7 +1937,7 @@ class Ticketsup extends CommonObject // Generation requete recherche $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "socpeople"; - $sql .= " WHERE entity IN (" . getEntity('ticketsup', 1) . ")"; + $sql .= " WHERE entity IN (" . getEntity('socpeople') . ")"; if (!empty($socid)) { $sql .= " AND fk_soc='" . $this->db->escape($socid) . "'"; } diff --git a/htdocs/ticketsup/css/styles.css.php b/htdocs/ticketsup/css/styles.css.php index aed9b79cbc9..d52739d9dc0 100644 --- a/htdocs/ticketsup/css/styles.css.php +++ b/htdocs/ticketsup/css/styles.css.php @@ -31,7 +31,7 @@ if (! defined('NOLOGIN')) define('NOLOGIN',1); // File must be if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -session_cache_limiter(FALSE); +session_cache_limiter(false); require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/ticketsup/img/ticketsup.png b/htdocs/ticketsup/img/ticketsup.png index ce4b71ca624..b1cf5df0e75 100644 Binary files a/htdocs/ticketsup/img/ticketsup.png and b/htdocs/ticketsup/img/ticketsup.png differ diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php index 4f7cd955852..d2127fd875f 100644 --- a/htdocs/ticketsup/list.php +++ b/htdocs/ticketsup/list.php @@ -1,6 +1,7 @@ - * Copyright (C) 2016 Christophe Battarel +/* Copyright (C) 2013-2018 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel + * Copyright (C) 2018 Regis Houssin * * 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 @@ -160,7 +161,7 @@ if (empty($reshook)) { $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation } - + // Mass actions $objectclass='Ticketsup'; $objectlabel='Ticketsup'; @@ -254,12 +255,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); -} -// if total resultset is smaller then paging size (filtering), goto and load page 0 -if (($page * $limit) > $nbtotalofrecords) -{ - $page = 0; - $offset = 0; + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } // if total resultset is smaller the limit, no need to do paging. if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) @@ -316,17 +316,28 @@ if ($socid && !$projectid && $user->rights->societe->lire) { // Customer code if ($socstat->client && !empty($socstat->code_client)) { print '
    '; - print $langs->trans('CustomerCode') . ''; + print $langs->trans('CustomerCode') . ''; print $socstat->code_client; if ($socstat->check_codeclient() != 0) { print ' (' . $langs->trans("WrongCustomerCode") . ')'; } print '
    '; + print $langs->trans('SupplierCode') . ''; + print $socstat->code_fournisseur; + if ($socstat->check_codefournisseur() != 0) { + print ' (' . $langs->trans("WrongSupplierCode") . ')'; + } + + print '
    '; print '
    '; dol_fiche_end(); @@ -437,9 +448,15 @@ print ''; if ($socid) print ''; if ($projectid) print ''; -$buttontocreate = '' . $langs->trans('NewTicket') . ''; +$newcardbutton=''; +if ($user->rights->ticketsup->write) +{ + $newcardbutton = '' . $langs->trans('NewTicket'); + $newcardbutton.= ''; + $newcardbutton.= ''; +} -print_barre_liste($langs->trans('TicketList'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_ticketsup', 0, $buttontocreate, '', $limit); +print_barre_liste($langs->trans('TicketList'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_ticketsup', 0, $newcardbutton, '', $limit); if ($mode == 'my_assign') { print '
    ' . $langs->trans('TicketAssignedToMeInfos') . '

    '; @@ -563,12 +580,13 @@ print '
    '; if ($caneditfield) { - print ''; + print ''; } else { - print ''; - print $object->accountancy_code; + print ''; + print $object->accountancy_code; } print '