Skip to content

Commit

Permalink
Merge pull request #5 from Dolibarr/develop
Browse files Browse the repository at this point in the history
Merge pull request #5 from Dolibarr/develop
  • Loading branch information
andrelec1 committed Nov 17, 2014
2 parents e37741c + 3800f22 commit dcb0d47
Show file tree
Hide file tree
Showing 345 changed files with 8,863 additions and 3,409 deletions.
32 changes: 31 additions & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,38 @@ tools:
- 'htdocs/includes/*'
paths: { }

php_changetracking:
enabled: false
bug_patterns:
- '\bfix(?:es|ed)?\b'
feature_patterns:
- '\badd(?:s|ed)?\b'
- '\bimplement(?:s|ed)?\b'
filter:
excluded_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'
paths: { }

# Coding-Style / Bug Detection
js_hint: false
js_hint:
enabled: false
use_native_config: true
extensions:
- js
filter:
excluded_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'
paths: { }
config: { }
path_configs: { }


before_commands: { }
Expand Down
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ before_script:
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo Mysql version
- mysql --version
- echo Init database
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.4.0.sql; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
- echo Create config file htdocs/conf/conf.php
- echo '<?php ' > htdocs/conf/conf.php
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
Expand Down Expand Up @@ -88,12 +90,12 @@ before_script:
script:
- cd htdocs/install
- date
- php upgrade.php 3.4.0 3.5.0 > upgrade.log
- php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
# - php upgrade.php 3.4.0 3.5.0 > upgrade.log
# - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
- php upgrade.php 3.5.0 3.6.0 >> upgrade.log
- php upgrade2.php 3.5.0 3.6.0 >> upgrade2.log
- php upgrade.php 3.6.0 3.7.0 >> upgrade.log
# - cat upgrade.log
# - cat upgrade360370.log
- php upgrade2.php 3.6.0 3.7.0 >> upgrade2.log
# - cat upgrade2.log
- cd ../..
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ TCPDF 6.0.093 LGPL-3+ Yes
JS libraries:
jQuery 1.8.2 MIT License Yes JS library
jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI
jQuery multiple-select 1.1.0 MIT License Yes JS library plugin for sexier multiselect
jQuery select2 3.5.2 GPL and Apache License Yes JS library plugin for sexier multiselect
jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors
jQuery DataTables 1.9.4 BSD Yes JS library for tables output
Expand Down
18 changes: 13 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ English Dolibarr ChangeLog

***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
- New: Match other auth system: Login can be done entering login or user
email (this open the road for SSO).
- New: Agenda export by project #1967.
- New: Increase length of thirdparty to 128 chars.
- New: "Is Order shippable" icon #1975.
Expand Down Expand Up @@ -99,6 +101,7 @@ For users:
- Fix: [ bug #1506, #1507 ] ECM trigger error problem
- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
- Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown

For users, new experimental module (need to set feature level of instance to experimental to see them):
- New: Module Accounting Expert to manage accountancy
Expand Down Expand Up @@ -163,18 +166,20 @@ Dolibarr better:


***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice
- Fix: bug 1588 : relative discount
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
- Fix: bug 1588 : relative discount.
- Fix: label of input method not tranlated.
- Fix: box of customer and propsects were not correctly disabled.
- Fix: right and error management #1961
- Fix: Fix Error when trying to clone an Order #1943
- Fix: [ bug #1618 ] PHP Error thrown when saving a barcode
- Fix: Civility & birthdate wasn't save into adherent module.
- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref
- Fix: Chars - is no more allowed into value for code for extra fields.
( Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache

***** ChangeLog for 3.6.1 compared to 3.6.* *****
For users:
- Fix: Can upload files on services.
- Fix: sql errors on updat fichinter.
- Fix: sql errors on update fichinter.
- Fix: debian script syntax error.
- Fix: error "menu param is not inside list" into pos module.
- Fix: Salary payments are not reflected on the reporting sheets.
Expand Down Expand Up @@ -310,6 +315,9 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
- Remove add_photo_web() that is ot used anymore by core code.


***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973

***** ChangeLog for 3.5.5 compared to 3.5.4 *****
Fix: Holiday module was broken. Initializaion of amount of holidays failed.
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
Expand Down
1 change: 1 addition & 0 deletions build/makepack-dolibarr.pl
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
Expand Down
2 changes: 1 addition & 1 deletion dev/codesniffer/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="80" />
<property name="absoluteComplexity" value="200" />
<property name="absoluteComplexity" value="250" />
</properties>
</rule>
<rule ref="Generic.Metrics.NestingLevel">
Expand Down
25 changes: 13 additions & 12 deletions dev/skeletons/skeleton_class.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -79,7 +80,7 @@ function create($user, $notrigger=0)
// Put here code to add control on parameters values

// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mytable(";
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."(";
$sql.= " field1,";
$sql.= " field2";
//...
Expand All @@ -91,13 +92,13 @@ function create($user, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::create", LOG_DEBUG);
dol_syslog(__METHOD__, LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

if (! $error)
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."mytable");
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);

if (! $notrigger)
{
Expand All @@ -116,7 +117,7 @@ function create($user, $notrigger=0)
{
foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
Expand Down Expand Up @@ -145,7 +146,7 @@ function fetch($id,$ref='')
$sql.= " t.field1,";
$sql.= " t.field2";
//...
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
if ($ref) $sql.= " WHERE t.ref = '".$ref."'";
else $sql.= " WHERE t.rowid = ".$id;

Expand Down Expand Up @@ -181,7 +182,7 @@ function fetch($id,$ref='')
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
function update($user=0, $notrigger=0)
function update($user, $notrigger=0)
{
global $conf, $langs;
$error=0;
Expand All @@ -195,15 +196,15 @@ function update($user=0, $notrigger=0)
// Put here code to add a control on parameters values

// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."mytable SET";
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
$sql.= " field1=".(isset($this->field1)?"'".$this->db->escape($this->field1)."'":"null").",";
$sql.= " field2=".(isset($this->field2)?"'".$this->db->escape($this->field2)."'":"null")."";
//...
$sql.= " WHERE rowid=".$this->id;

$this->db->begin();

dol_syslog(get_class($this)."::update");
dol_syslog(__METHOD__);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

Expand All @@ -226,7 +227,7 @@ function update($user=0, $notrigger=0)
{
foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
Expand Down Expand Up @@ -270,10 +271,10 @@ function delete($user, $notrigger=0)

if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mytable";
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " WHERE rowid=".$this->id;

dol_syslog(get_class($this)."::delete");
dol_syslog(__METHOD__);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
}
Expand All @@ -283,7 +284,7 @@ function delete($user, $notrigger=0)
{
foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
Expand Down
58 changes: 38 additions & 20 deletions htdocs/accountancy/admin/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
$action = GETPOST('action');
$id = GETPOST('id', 'int');
$rowid = GETPOST('rowid', 'int');
$search_account = GETPOST("search_account");
$search_label = GETPOST("search_label");
$search_accountparent = GETPOST("search_accountparent");
$search_pcgtype = GETPOST("search_pcgtype");
$search_pcgsubtype = GETPOST("search_pcgsubtype");

// Security check
if (!$user->admin)
Expand Down Expand Up @@ -83,6 +88,15 @@
}
}

if (GETPOST("button_removefilter"))
{
$search_account="";
$search_label="";
$search_accountparent="";
$search_pcgtype="";
$search_pcgsubtype="";
}

/*
* View
*
Expand All @@ -96,20 +110,20 @@
$sql .= " WHERE aa.fk_pcg_version = asy.pcg_version";
$sql .= " AND asy.rowid = " . $pcgver;

if (strlen(trim($_GET["search_account"]))) {
$sql .= " AND aa.account_number like '%" . $_GET["search_account"] . "%'";
if (strlen(trim($search_account))) {
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
}
if (strlen(trim($_GET["search_label"]))) {
$sql .= " AND aa.label like '%" . $_GET["search_label"] . "%'";
if (strlen(trim($search_label))) {
$sql .= " AND aa.label like '%" . $search_label . "%'";
}
if (strlen(trim($_GET["search_accountparent"]))) {
$sql .= " AND aa.account_parent like '%" . $_GET["search_accountparent"] . "%'";
if (strlen(trim($search_accountparent))) {
$sql .= " AND aa.account_parent like '%" . $search_accountparent . "%'";
}
if (strlen(trim($_GET["search_pcgtype"]))) {
$sql .= " AND aa.pcg_type like '%" . $_GET["search_pcgtype"] . "%'";
if (strlen(trim($search_pcgtype))) {
$sql .= " AND aa.pcg_type like '%" . $search_pcgtype . "%'";
}
if (strlen(trim($_GET["search_pcgsubtype"]))) {
$sql .= " AND aa.pcg_subtype like '%" . $_GET["search_pcgsubtype"] . "%'";
if (strlen(trim($search_pcgsubtype))) {
$sql .= " AND aa.pcg_subtype like '%" . $search_pcgsubtype . "%'";
}

$sql .= $db->order($sortfield, $sortorder);
Expand Down Expand Up @@ -141,18 +155,20 @@
print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Active"), $_SERVER["PHP_SELF"], "aa.active", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("&nbsp;");
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
print '</tr>';

print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . GETPOST("search_account") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . GETPOST("search_label") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_accountparent" value="' . GETPOST("search_accountparent") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgtype" value="' . GETPOST("search_pcgtype") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgsubtype" value="' . GETPOST("search_pcgsubtype") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_accountparent" value="' . $search_accountparent . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
print '<td align="right" colspan="2" class="liste_titre">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '&nbsp;';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
print '</tr>';

Expand Down Expand Up @@ -180,11 +196,13 @@
}
print '</td>';

print '<td>';
// Action
print '<td align="center">';
if ($user->admin) {
print '<a href="./card.php?action=update&id=' . $obj->rowid . '">';
print img_edit();
print '</a>&nbsp;';
print '</a>';
print '&nbsp;';
print '<a href="./card.php?action=delete&id=' . $obj->rowid . '">';
print img_delete();
print '</a>';
Expand Down
5 changes: 0 additions & 5 deletions htdocs/accountancy/admin/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,6 @@

if ($action == 'update')
{
// WYSIWYG Editor
$htmlacc = new FormVentilation($db);

require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';

$soc = new Societe($db);
if ($object->socid) {
$soc->fetch($object->socid);
Expand Down
Loading

0 comments on commit dcb0d47

Please sign in to comment.