Merge remote-tracking branch 'Upstream/develop' into develop-accounting

This commit is contained in:
aspangaro 2014-10-09 04:56:27 +02:00
commit 417fd13663
13 changed files with 103 additions and 43 deletions

View File

@ -5,6 +5,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
- New: Can add product into category from category card.
- New: PDF event report show project and status of event.
- New: Can filter on status on interventions.
- New: Add help info of field type into dictionary of payment types.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="dolibarr" default="hudson" basedir=".">
fdfds
<!-- Exclude/ignore paths -->
<property name="ignorepaths" value="${basedir}/htdocs/conf,${basedir}/htdocs/core/filemanagerdol,${basedir}/htdocs/includes" />
<property name="ignoreregexp" value="**/PEAR/*,**/NET/*,**/HTTP/*,**/zendgdata/*,**/reportico/*" />

View File

@ -207,8 +207,7 @@ if (empty($reshook))
}
else
{
setEventMessage($cat->error,'errors');
setEventMessage($cat->errors,'errors');
setEventMessages($cat->error,$this->errors,'errors');
}
}
}
@ -628,7 +627,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
// Form to add record into a category
if ($showclassifyform)
{
print '<form method="post" action="'.DOL_URL_ROOT.'/categories/categorie.php">';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
print '<input type="hidden" name="type" value="'.$typeid.'">';

View File

@ -38,6 +38,7 @@ $type=GETPOST('type');
$action=GETPOST('action');
$confirm=GETPOST('confirm');
$removeelem = GETPOST('removeelem','int');
$elemid=GETPOST('elemid');
if ($id == "")
{
@ -120,6 +121,33 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi
}
}
if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer))
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$newobject = new Product($db);
$result = $newobject->fetch($elemid);
$elementtype = 'product';
// TODO Add into categ
$result=$object->add_type($newobject,$elementtype);
if ($result >= 0)
{
setEventMessage($langs->trans("WasAddedSuccessfully",$newobject->ref));
}
else
{
if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings');
}
else
{
setEventMessages($object->error,$object->errors,'errors');
}
}
}
/*
@ -144,6 +172,7 @@ dol_fiche_head($head, 'card', $title, 0, 'category');
/*
* Confirmation suppression
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete');
@ -251,10 +280,9 @@ else
print "</table>\n";
}
// List of products
// List of products or services (type is type of category)
if ($object->type == 0)
{
$prods = $object->getObjectsInCateg("product");
if ($prods < 0)
{
@ -262,6 +290,29 @@ if ($object->type == 0)
}
else
{
$showclassifyform=1; $typeid=0;
// Form to add record into a category
if ($showclassifyform)
{
print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
print '<input type="hidden" name="type" value="'.$typeid.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="action" value="addintocategory">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="40%">';
print $langs->trans("AddProductServiceIntoCategory").' &nbsp;';
print $form->select_produits('','elemid','',0,0,-1,2,'',1);
print '</td><td>';
print '<input type="submit" class="button" value="'.$langs->trans("ClassifyInCategory").'"></td>';
print '</tr>';
print '</table>';
print '</form>';
}
print "<br>";
print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("ProductsAndServices")."</td></tr>\n";

View File

@ -1809,13 +1809,15 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $
}
else
{
// By default, we search $url/theme/$theme/img/$picto
// We forge fullpathpicto for image to $path/img/$picto. By default, we take DOL_URL_ROOT/theme/$conf->theme/img/$picto
$url = DOL_URL_ROOT;
$theme = $conf->theme;
$path = 'theme/'.$theme;
if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) $path = $conf->global->MAIN_OVERWRITE_THEME_RES.'/theme/'.$conf->global->MAIN_OVERWRITE_THEME_RES;
//if (! empty($conf->global->MAIN_FORCETHEMEDIR)) $path = preg_replace('/^\//', '', $conf->global->MAIN_FORCETHEMEDIR).'/'.$path; // TODO What if there is both FORCETHEMDIR and OVERWRITE_THEM_RES
if (! empty($conf->global->MAIN_OVERWRITE_THEME_PATH)) $path = $conf->global->MAIN_OVERWRITE_THEME_PATH.'/theme/'.$theme; // If the theme does not have the same name as the module
else if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) $path = $conf->global->MAIN_OVERWRITE_THEME_RES.'/theme/'.$conf->global->MAIN_OVERWRITE_THEME_RES; // To allow an external module to overwrite image resources whatever is activated theme
else if (! empty($conf->modules_parts['theme']) && array_key_exists($theme, $conf->modules_parts['theme'])) $path = $theme.'/theme/'.$theme; // If the theme have the same name as the module
// If we ask an image into $url/$mymodule/img (instead of default path)
if (preg_match('/^([^@]+)@([^@]+)$/i',$picto,$regs))
{
@ -1825,10 +1827,10 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $
// Clean parameters
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
// If alt path are defined, define url where img file is, according to physical path
foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir/htdocs", ...)
foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...)
{
if ($type == 'main') continue;
if (file_exists($dirroot.'/'.$path.'/img/'.$picto))
if (file_exists($dirroot.'/'.$path.'/img/'.$picto)) // This need a lot of time, that's why enabling alternative dir like "custom" dir is not recommanded
{
$url=DOL_URL_ROOT.$conf->file->dol_url_root[$type];
break;
@ -4145,7 +4147,11 @@ function setEventMessages($mesg, $mesgs, $style='mesgs')
{
if (! in_array((string) $style, array('mesgs','warnings','errors'))) dol_print_error('','Bad parameter for setEventMessage');
if (empty($mesgs)) setEventMessage($mesg, $style);
else setEventMessage($mesgs, $style);
else
{
if (! empty($mesg) && ! in_array($mesg, $mesgs)) setEventMessage($mesg, $style); // Add message string if not already into array
setEventMessage($mesgs, $style);
}
}
/**

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -209,7 +209,7 @@ $userstatic=new User($db);
?>
<?php if ($object->statut >= 0) echo '</a>'; ?>
</div>
<div class="tagtd nowrap" align="center">
<div class="tagtd nowrap" align="right">
<?php if ($permission) { ?>
&nbsp;<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=deletecontact&amp;lineid='.$tab[$i]['rowid']; ?>"><?php echo img_delete(); ?></a>
<?php } ?>

View File

@ -111,3 +111,4 @@ ExtraFieldsCategories=Complementary attributes
CategoriesSetup=Categories setup
CategorieRecursiv=Link with parent category automatically
CategorieRecursivHelp=If activated, product will also linked to parent category when adding into a subcategory
AddProductServiceIntoCategory=Add the following product/service

View File

@ -341,21 +341,23 @@ if ($isphoto) {
print '</tr>';
// MultiPrix
if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
if (! empty($socid)) {
if (! empty($conf->global->PRODUIT_MULTIPRICES))
{
if (! empty($socid))
{
$soc = new Societe($db);
$soc->id = $socid;
$soc->fetch($socid);
print '<tr><td>' . $langs->trans("SellingPrice") . '</td>';
if ($object->multiprices_base_type ["$soc->price_level"] == 'TTC') {
if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') {
print '<td>' . price($object->multiprices_ttc ["$soc->price_level"]);
} else {
print '<td>' . price($object->multiprices ["$soc->price_level"]);
}
if ($object->multiprices_base_type ["$soc->price_level"]) {
if ($object->multiprices_base_type["$soc->price_level"]) {
print ' ' . $langs->trans($object->multiprices_base_type ["$soc->price_level"]);
} else {
print ' ' . $langs->trans($object->price_base_type);
@ -364,15 +366,16 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
// Prix mini
print '<tr><td>' . $langs->trans("MinPrice") . '</td><td>';
if ($object->multiprices_base_type ["$soc->price_level"] == 'TTC') {
print price($object->multiprices_min_ttc ["$soc->price_level"]) . ' ' . $langs->trans($object->multiprices_base_type ["$soc->price_level"]);
if ($object->multiprices_base_type["$soc->price_level"] == 'TTC')
{
print price($object->multiprices_min_ttc["$soc->price_level"]) . ' ' . $langs->trans($object->multiprices_base_type["$soc->price_level"]);
} else {
print price($object->multiprices_min ["$soc->price_level"]) . ' ' . $langs->trans($object->multiprices_base_type ["$soc->price_level"]);
print price($object->multiprices_min["$soc->price_level"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$soc->price_level"])?'HT':$object->multiprices_base_type["$soc->price_level"]);
}
print '</td></tr>';
// TVA
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->multiprices_tva_tx ["$soc->price_level"], true) . '</td></tr>';
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . '</td></tr>';
}
else
{
@ -393,12 +396,12 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
print '</td>';
if ($object->multiprices_base_type ["$i"] == 'TTC') {
print '<td>' . price($object->multiprices_ttc ["$i"]);
print '<td>' . price($object->multiprices_ttc["$i"]);
} else {
print '<td>' . price($object->multiprices ["$i"]);
print '<td>' . price($object->multiprices["$i"]);
}
if ($object->multiprices_base_type ["$i"]) {
if ($object->multiprices_base_type["$i"]) {
print ' ' . $langs->trans($object->multiprices_base_type ["$i"]);
} else {
print ' ' . $langs->trans($object->price_base_type);
@ -408,9 +411,9 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
// Prix mini
print '<tr><td>' . $langs->trans("MinPrice") . ' ' . $i . '</td><td>';
if ($object->multiprices_base_type ["$i"] == 'TTC') {
print price($object->multiprices_min_ttc ["$i"]) . ' ' . $langs->trans($object->multiprices_base_type ["$i"]);
print price($object->multiprices_min_ttc["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]);
} else {
print price($object->multiprices_min ["$i"]) . ' ' . $langs->trans($object->multiprices_base_type ["$i"]);
print price($object->multiprices_min["$i"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$i"])?'HT':$object->multiprices_base_type["$i"]);
}
print '</td></tr>';

View File

@ -285,8 +285,8 @@ class Task extends CommonObject
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
$sql.= " duration_effective=".(isset($this->duration_effective)?$this->duration_effective:"null").",";
$sql.= " planned_workload=".(isset($this->planned_workload)?$this->planned_workload:"0").",";
$sql.= " dateo=".($this->date_start!=''?$this->db->idate($this->date_start):'null').",";
$sql.= " datee=".($this->date_end!=''?$this->db->idate($this->date_end):'null').",";
$sql.= " dateo=".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null').",";
$sql.= " datee=".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null').",";
$sql.= " progress=".$this->progress.",";
$sql.= " rang=".((!empty($this->rang))?$this->rang:"0");
$sql.= " WHERE rowid=".$this->id;

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2014 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify

View File

@ -58,9 +58,11 @@ $projectstatic = new Project($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
/*
* Actions
*/
*/
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
{
@ -91,11 +93,10 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
$result=$object->update($user);
if ($result < 0)
{
setEventMessage($object->error,'errors');
setEventMessage($object->errors,'errors');
setEventMessages($object->error,$object->errors,'errors');
}
}
else
@ -121,8 +122,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->s
}
else
{
$langs->load("errors");
setEventMessage($langs->trans($object->error), 'errors');
setEventMessages($object->error,$object->errors,'errors');
$action='';
}
}

View File

@ -105,7 +105,7 @@ $colorbacklineimpairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+roun
$colorbacklinepair1='255,255,255'; // line pair
$colorbacklinepair2='255,255,255'; // line pair
$colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9));
$colorbackbody='#fcfcfc';
$colorbackbody='#f9f9f9';
$colortext='40,40,40';
$fontsize='12';
$fontsizesmaller='11';
@ -123,8 +123,7 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
$conf->global->THEME_ELDY_BACKTABCARD2='210,210,210'; // card
$conf->global->THEME_ELDY_BACKTABCARD1='234,234,234';
$conf->global->THEME_ELDY_BACKTABACTIVE='234,234,234';
//$conf->global->THEME_ELDY_BACKBODY='#ffffff url('.$img_head.') 0 0 no-repeat;';
$conf->global->THEME_ELDY_BACKBODY='#fcfcfc;';
$conf->global->THEME_ELDY_BACKBODY='#f9f9f9;';
$conf->global->THEME_ELDY_LINEPAIR1='242,242,242';
$conf->global->THEME_ELDY_LINEPAIR2='248,248,248';
$conf->global->THEME_ELDY_LINEPAIRHOVER='238,246,252';
@ -820,7 +819,7 @@ foreach($mainmenuusedarray as $val)
.bodylogin
{
background: #f9f9f9;
background: #f0f0f0;
}
.login_vertical_align {
padding: 10px;