Skip to content
Snippets Groups Projects
Commit 3315978f authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge remote-tracking branch 'origin/3.8' into develop

parents 1e3bc9f8 643ce1f2
No related branches found
No related tags found
No related merge requests found
......@@ -528,11 +528,11 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="id" value="'.$object->id.'">';
$period_filter .= $langs->trans('From').'&nbsp;'.$form->select_date($req_stdt,'req_stdt',0,0,1,null,1,1,1);
$period_filter .= '<BR>'. $langs->trans('to').'&nbsp;'.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1);
$period_filter .= '&nbsp;';
$period_filter .= $langs->trans('to').'&nbsp;'.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1);
print '<tr class="liste_titre">';
print '<td>&nbsp;</td>';
print '<td>'.$period_filter.'</td>';
print '<td colspan="2">'.$period_filter.'</td>';
print '<td>';
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
$filtertype='';
......
......@@ -4,8 +4,9 @@
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2014 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
......@@ -262,6 +263,12 @@ if ($object->id > 0)
print "</td>";
print '</tr>';
// Categories
print '<tr><td>' . $langs->trans("Categories") . '</td>';
print '<td colspan="3">';
print $form->showCategories($object->id, 'supplier', 1);
print "</td></tr>";
// Other attributes
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
......
......@@ -204,7 +204,7 @@ if ($id > 0 || ! empty($ref))
print '</tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->libelle.'</td>';
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td>';
print '</tr>';
// Nature
......
......@@ -345,7 +345,7 @@ $langs->load("proposals");
$langs->load("margins");
//print load_fiche_titre($langs->trans("Profit"),'','title_accountancy');
print '<div class="center">'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'</div><br>';
print '<div class="left">'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'</div><br>';
print '<table class="noborder">';
print '<tr class="liste_titre">';
......
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
......@@ -411,7 +412,7 @@ if (empty($reshook))
}
}
// Categories association
// Customer categories association
$custcats = GETPOST( 'custcats', 'array' );
if (!empty( $custcats )) {
$cat = new Categorie( $db );
......@@ -421,6 +422,16 @@ if (empty($reshook))
}
}
// Supplier categories association
$suppcats = GETPOST('suppcats', 'array');
if (!empty($suppcats)) {
$cat = new Categorie($db);
foreach ($suppcats as $id_category) {
$cat->fetch($id_category);
$cat->add_type($object, 'supplier');
}
}
// Logo/Photo save
$dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/";
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
......@@ -525,7 +536,7 @@ if (empty($reshook))
$error = $object->error; $errors = $object->errors;
}
// Categories association
// Customer categories association
// First we delete all categories association
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_societe';
$sql .= ' WHERE fk_soc = ' . $object->id;
......@@ -541,6 +552,22 @@ if (empty($reshook))
}
}
// Supplier categories association
// First we delete all categories association
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_fournisseur';
$sql .= ' WHERE fk_soc = ' . $object->id;
$db->query($sql);
// Then we add the associated categories
$categories = GETPOST('suppcats', 'array');
if (!empty($categories)) {
$cat = new Categorie($db);
foreach ($categories as $id_category) {
$cat->fetch($id_category);
$cat->add_type($object, 'supplier');
}
}
// Logo/Photo save
$dir = $conf->societe->multidir_output[$object->entity]."/".$object->id."/logos";
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
......@@ -1245,13 +1272,26 @@ else
}
// Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td class="toptd">'.fieldLabel('Categories','custcats').'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%");
print "</td></tr>";
}
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
// Customer
if ($object->prospect || $object->client) {
print '<tr><td class="toptd">' . fieldLabel('CustomersCategoriesShort', 'custcats') . '</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null,
null, "90%");
print "</td></tr>";
}
// Supplier
if ($object->fournisseur) {
print '<tr><td class="toptd">' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . '</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1);
print $form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null,
null, "90%");
print "</td></tr>";
}
}
// Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
......@@ -1761,19 +1801,36 @@ else
}
// Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td>'.fieldLabel('Categories', 'custcats').'</td>';
print '<td colspan="3">';
$cate_arbo = $form->select_all_categories( Categorie::TYPE_CUSTOMER, null, null, null, null, 1);
$c = new Categorie( $db );
$cats = $c->containing( $object->id, Categorie::TYPE_CUSTOMER );
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
// Customer
if ($object->prospect || $object->client) {
print '<tr><td>' . fieldLabel('CustomersCategoriesShort', 'custcats') . '</td>';
print '<td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, null, null, null, 1);
$c = new Categorie($db);
$cats = $c->containing($object->id, Categorie::TYPE_CUSTOMER);
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
print $form->multiselectarray('custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
print "</td></tr>";
}
print $form->multiselectarray( 'custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
print "</td></tr>";
}
// Supplier
if ($object->fournisseur) {
print '<tr><td>' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . '</td>';
print '<td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1);
$c = new Categorie($db);
$cats = $c->containing($object->id, Categorie::TYPE_SUPPLIER);
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
print $form->multiselectarray('suppcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
print "</td></tr>";
}
}
// Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
......@@ -2207,13 +2264,24 @@ else
}
// Tags / categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>';
print '<td colspan="3">';
print $form->showCategories( $object->id, 'customer', 1 );
print "</td></tr>";
}
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
// Customer
if ($object->prospect || $object->client) {
print '<tr><td>' . $langs->trans("CustomersCategoriesShort") . '</td>';
print '<td colspan="3">';
print $form->showCategories($object->id, 'customer', 1);
print "</td></tr>";
}
// Supplier
if ($object->fournisseur) {
print '<tr><td>' . $langs->trans("SuppliersCategoriesShort") . '</td>';
print '<td colspan="3">';
print $form->showCategories($object->id, 'supplier', 1);
print "</td></tr>";
}
}
// Incoterms
if (!empty($conf->incoterm->enabled))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment