Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into
Browse files Browse the repository at this point in the history
develop_dict

Conflicts:
	htdocs/install/mysql/tables/llx_c_payment_term.sql
  • Loading branch information
hregis committed Sep 18, 2017
2 parents cbd8cb8 + 291a0d4 commit a03ef95
Show file tree
Hide file tree
Showing 153 changed files with 3,011 additions and 3,053 deletions.
5 changes: 3 additions & 2 deletions ChangeLog
Expand Up @@ -11,9 +11,10 @@ NEW: complete_head_from_modules() in ldap_prepare_head()

WARNING:

Following changes may create regression for some external modules, but were necessary to make Dolibarr better:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* The methode "cloture" on contact were renamed into "closeAll".

* The substitution key for reference of object is now __REF__ whatever is the object (it replaces __ORDERREF__,
__PROPALREF__, ...)


***** ChangeLog for 6.0.0 compared to 5.0.* *****
Expand Down
16 changes: 14 additions & 2 deletions build/makepack-dolibarrmodule.pl
Expand Up @@ -3,6 +3,7 @@
# \file build/makepack-dolibarrmodule.pl
# \brief Package builder (tgz, zip, rpm, deb, exe)
# \author (c)2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
# \contributor (c)2017 Nicolas ZABOURI <info@inovea-conseil.com>
#----------------------------------------------------------------------------

use Cwd;
Expand Down Expand Up @@ -134,7 +135,15 @@
# Get version $MAJOR, $MINOR and $BUILD
print "Version detected for module ".$PROJECT.": ";
$result=open(IN,"<".$SOURCE."/htdocs/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php");
if (! $result) { die "Error: Can't open descriptor file ".$SOURCE."/htdocs/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php for reading.\n"; }
$custom=false;
if (! $result) {
$result=open(IN,"<".$SOURCE."/htdocs/custom/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php");
if (! $result) {
die "Error: Can't open descriptor file ".$SOURCE."/htdocs/(or /htdocs/custom/)".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php for reading.\n";
}else{
$custom = true;
}
}
while(<IN>)
{
if ($_ =~ /this->version\s*=\s*'([\d\.]+)'/) { $PROJVERSION=$1; break; }
Expand Down Expand Up @@ -294,8 +303,11 @@
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.old`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.postgres`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf*sav*`;
if($custom){
$ret=`cp -r $BUILDROOT/$PROJECTLC/htdocs/custom/* $BUILDROOT/$PROJECTLC/htdocs/.`;
}
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom2`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom2`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/test`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/Thumbs.db $BUILDROOT/$PROJECTLC/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/*/*/Thumbs.db`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/CVS* $BUILDROOT/$PROJECTLC/*/CVS* $BUILDROOT/$PROJECTLC/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/*/*/CVS*`;
Expand Down
11 changes: 1 addition & 10 deletions htdocs/accountancy/admin/accountmodel.php
Expand Up @@ -289,7 +289,7 @@
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{
$ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/
}
if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2))
Expand Down Expand Up @@ -740,15 +740,6 @@
print '</td>';
print "</tr>";

if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates')
{
print '<tr><td colspan="8">* '.$langs->trans("AvailableVariables").": ";
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$tmp=FormMail::getAvailableSubstitKey('formemail');
print implode(', ', $tmp);
print '</td></tr>';
}

$colspan=count($fieldlist)+3;
if ($id == 4) $colspan++;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/categories_list.php
Expand Up @@ -185,7 +185,7 @@
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{
$ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/
}
if (isset($_POST["country"]) && ($_POST["country"] <= 0))
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/journals_list.php
Expand Up @@ -174,7 +174,7 @@
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{
$ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/
}

Expand Down
4 changes: 2 additions & 2 deletions htdocs/accountancy/bookkeeping/listbyaccount.php
Expand Up @@ -209,7 +209,7 @@

$viewflat = ' <a class="nohover" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php">' . $langs->trans("ViewFlatList") . '</a>';

print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords,'title_accountancy',0,$viewflat,'',$limit);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords,'title_accountancy',0,$viewflat,'', $limit);

// Reverse sort order
if ( preg_match('/^asc/i', $sortorder) )
Expand Down Expand Up @@ -315,7 +315,7 @@

// Affiche un lien vers la facture client/fournisseur
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>' . $line->label_operation . '</td>' : '<td>' . $line->label_operation . '<br /><span style="font-size:0.8em">(' . length_accounta($line->subledger_account) . ')</span></td>';
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>' . $line->label_operation . '</td>' : '<td>' . $line->label_operation . '<br><span style="font-size:0.8em">(' . length_accounta($line->subledger_account) . ')</span></td>';


print '<td align="right">' . ($line->debit ? price($line->debit) :''). '</td>';
Expand Down
10 changes: 5 additions & 5 deletions htdocs/accountancy/expensereport/list.php
Expand Up @@ -114,11 +114,11 @@
}

// Mass actions
$objectclass='Skeleton';
$objectlabel='Skeleton';
$permtoread = $user->rights->accounting->read;
$permtodelete = $user->rights->accounting->delete;
$uploaddir = $conf->accounting->dir_output;
$objectclass='ExpenseReport';
$objectlabel='ExpenseReport';
$permtoread = $user->rights->expensereport->read;
$permtodelete = $user->rights->expensereport->delete;
$uploaddir = $conf->expensereport->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';

if ($massaction == 'ventil') {
Expand Down
3 changes: 2 additions & 1 deletion htdocs/adherents/cartes/carte.php
Expand Up @@ -68,6 +68,7 @@
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = c.rowid";
$sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
$sql.= " AND d.entity IN (".getEntity('adherent').")";
if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid;
if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'";
$sql.= " ORDER BY d.rowid ASC";
Expand Down Expand Up @@ -123,7 +124,7 @@
{
$nb = $_Avery_Labels[$model]['NX'] * $_Avery_Labels[$model]['NY'];
if ($nb <= 0) $nb=1; // Protection to avoid empty page

for($j=0;$j<$nb;$j++)
{
$arrayofmembers[]=array(
Expand Down
2 changes: 2 additions & 0 deletions htdocs/admin/agenda.php
Expand Up @@ -165,6 +165,8 @@
if ($module == 'shipping') $module = 'expedition_bon';
if ($module == 'member') $module = 'adherent';
if ($module == 'project') $module = 'projet';
if ($module == 'proposal_supplier') $module = 'supplier_proposal';

//print 'module='.$module.'<br>';
if (! empty($conf->$module->enabled))
{
Expand Down
3 changes: 2 additions & 1 deletion htdocs/admin/agenda_other.php
Expand Up @@ -373,11 +373,12 @@
print '</td></tr>'."\n";

// AGENDA_DEFAULT_FILTER_STATUS
// TODO Remove to use the default generic feature
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n";
$formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2);
$formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100');
print '</td></tr>'."\n";

// AGENDA_DEFAULT_VIEW
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/bank.php
Expand Up @@ -399,7 +399,7 @@



print '<br /><br />';
print '<br><br>';


/*
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/compta.php
Expand Up @@ -162,7 +162,7 @@

print "</table>\n";

print '<br /><br /><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
print '<br><br><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
print '</form>';

llxFooter();
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/dict.php
Expand Up @@ -663,7 +663,7 @@
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{
$ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/
}
if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2))
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
Expand Up @@ -286,7 +286,7 @@ public function add($options)
* $xml = $ws->get(array('resource' => 'orders', 'id' => 1));
* // Here in $xml, a SimpleXMLElement object you can parse
* foreach ($xml->children()->children() as $attName => $attValue)
* echo $attName.' = '.$attValue.'<br />';
* echo $attName.' = '.$attValue.'<br>';
* }
* catch (PrestaShopWebserviceException $ex)
* {
Expand Down
54 changes: 36 additions & 18 deletions htdocs/admin/dolistore/class/dolistore.class.php
Expand Up @@ -40,41 +40,52 @@ class Dolistore

/**
* Constructor
*
* @param array $options Options
*/
function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0))
function __construct()
{
global $conf, $langs;

$this->start = $options['start'];
$this->end = $options['end'];
$this->per_page = $options['per_page'];
$this->categorie = $options['categorie'];
$this->search = $options['search'];

$this->url = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace';
$this->shop_url = 'https://www.dolistore.com/index.php?controller=product&id_product=';
$this->vat_rate = 1.2; // 20% de TVA
$this->debug_api = false;

if ($this->end == 0) {
$this->end = $this->per_page;
}

$langtmp = explode('_', $langs->defaultlang);
$lang = $langtmp[0];
$lang_array = array('fr'=>1, 'en'=>2, 'es'=>3, 'it'=>4, 'de'=>5);
$lang_array = array('en'=>0, 'fr'=>1, 'es'=>2, 'it'=>3, 'de'=>4); // Into table ps_lang of Prestashop - 1
if (! in_array($lang, array_keys($lang_array))) $lang = 'en';
$this->lang = $lang_array[$lang]; // 1=fr 2=en ...
$this->lang = $lang_array[$lang];
}

/**
* Load data from remote Dolistore market place.
* This fills ->categories
*
* @param array $options Options
* @return void
*/
function getRemoteData($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0))
{
global $conf, $langs;

$this->start = $options['start'];
$this->end = $options['end'];
$this->per_page = $options['per_page'];
$this->categorie = $options['categorie'];
$this->search = $options['search'];

try {
if ($this->end == 0) {
$this->end = $this->per_page;
}

try {
$this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV,
$conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);

// Here we set the option array for the Webservice : we want products resources
$opt = array();
$opt['resource'] = 'products';

// make a search to limit the id returned.
if ($this->search != '') {
$opt2 = array();
Expand Down Expand Up @@ -102,7 +113,9 @@ function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 5
$opt['sort'] = 'id_desc';
$opt['filter[active]'] = '[1]';
$opt['limit'] = "$this->start,$this->end";
// Call
// $opt['filter[id]'] contais list of product id that are result of search

// Call API to get the detail
$xml = $this->api->get($opt);
$this->products = $xml->products->children();

Expand All @@ -124,7 +137,12 @@ function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 5
}
}


/**
* Return tree of Dolistore categories. $this->categories must have been loaded before.
*
* @param int $parent Id of parent category
* @return string
*/
function get_categories($parent = 0)
{
if (!isset($this->categories)) die('not possible');
Expand Down
8 changes: 4 additions & 4 deletions htdocs/admin/loan.php
Expand Up @@ -23,7 +23,7 @@
*/

require '../main.inc.php';

// Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
Expand All @@ -47,7 +47,7 @@
/*
* Actions
*/

if ($action == 'update')
{
$error = 0;
Expand Down Expand Up @@ -99,7 +99,7 @@
print '<tr class="oddeven value">';

// Param
$label = $langs->trans($key);
$label = $langs->trans($key);
print '<td><label for="'.$key.'">'.$label.'</label></td>';

// Value
Expand All @@ -120,7 +120,7 @@
print '</form>';
print "</table>\n";

print '<br /><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
print '<br><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';

llxFooter();
$db->close();
6 changes: 5 additions & 1 deletion htdocs/admin/modules.php
Expand Up @@ -55,7 +55,7 @@
$options['start'] = ((GETPOST('start', 'int')?GETPOST('start', 'int'):0) + 0);
$options['end'] = ((GETPOST('end', 'int')?GETPOST('end', 'int'):0) + 0);
$options['search'] = GETPOST('search_keyword', 'alpha');
$dolistore = new Dolistore($options);
$dolistore = new Dolistore();


if (! $user->admin)
Expand Down Expand Up @@ -832,6 +832,10 @@

if (empty($conf->global->MAIN_DISABLE_DOLISTORE_SEARCH) && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
// $options is array with filter criterias
//var_dump($options);
$dolistore->getRemoteData($options);

print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';

$previouslink = $dolistore->get_previous_link();
Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/multicurrency.php
Expand Up @@ -235,7 +235,7 @@
*/

print '</table>';
print '<br />';
print '<br>';

if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
{
Expand Down Expand Up @@ -293,7 +293,7 @@
print '</td></tr>';

print '</table>';
print '<br />';
print '<br>';
}


Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/payment.php
Expand Up @@ -233,7 +233,7 @@

print '</table>';

print "<br />";
print "<br>";

print load_fiche_titre($langs->trans("OtherOptions"),'','');

Expand Down

0 comments on commit a03ef95

Please sign in to comment.