Merge remote-tracking branch 'Upstream/3.7' into 3.7-accountancy

This commit is contained in:
aspangaro
2015-11-25 20:23:41 +01:00
3 changed files with 43 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@@ -179,6 +180,7 @@ if (($action == 'create' || $action == 'add') && !$error)
$object->origin_id = $orders_id[$ii];
$object->linked_objects = $orders_id;
$id = $object->create($user);
$object->fetch_thirdparty();
if ($id>0)
{

View File

@@ -95,7 +95,7 @@ class box_project extends ModeleBoxes
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->ref,
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid);
'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
'text' => $objp->title
@@ -104,7 +104,7 @@ class box_project extends ModeleBoxes
$sql ="SELECT count(*) as nb, sum(progress) as totprogress";
$sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid";
$sql.=" WHERE p.entity = ".$conf->entity;
$sql.=" AND p.rowid = ".$objp->rowid;
$resultTask = $db->query($sql);
if ($resultTask)
{

View File

@@ -228,6 +228,45 @@ class modCategorie extends DolibarrModules
'p.note_private' => 'contact',
'p.note_public' => 'contact'
); // We define here only fields that use another picto
// Add extra fields
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople'";
$resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example)
{
while ($obj=$this->db->fetch_object($resql))
{
$fieldname='extra.'.$obj->name;
$fieldlabel=ucfirst($obj->label);
$typeFilter="Text";
switch($obj->type)
{
case 'int':
case 'double':
case 'price':
$typeFilter="Numeric";
break;
case 'date':
case 'datetime':
$typeFilter="Date";
break;
case 'boolean':
$typeFilter="Boolean";
break;
case 'sellist':
$typeFilter="List:".$obj->param;
break;
case 'select':
$typeFilter="Select:".$obj->param;
break;
}
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
$this->export_entities_array[$r][$fieldname]='contact';
}
}
// End add axtra fields
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p';
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_country as country ON p.fk_pays = country.rowid';