Merge remote-tracking branch 'upstream/develop' into 3.7-webservices-fix

This commit is contained in:
Arnaud Aujon 2015-05-26 10:54:30 +02:00
commit 23936827a8
72 changed files with 838 additions and 1092 deletions

View File

@ -8,6 +8,7 @@
* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -31,6 +32,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
/** /**
@ -1584,7 +1586,8 @@ class Adherent extends CommonObject
} }
if ($option == 'category') if ($option == 'category')
{ {
$link = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3'.$linkclose; $type = Categorie::TYPE_MEMBER;
$link = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type='.$type.$linkclose;
$linkend='</a>'; $linkend='</a>';
} }

View File

@ -157,7 +157,7 @@ print "</table></form>";
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
print '<tr '.$bc[0].'><td align="center" colspan="2">'; print '<tr '.$bc[0].'><td align="center" colspan="2">';

View File

@ -1,8 +1,8 @@
<?php <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -209,8 +209,9 @@ if ($resql)
$moreforfilter=''; $moreforfilter='';
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(3,$search_categ,'search_categ',1); $moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
} }
if ($moreforfilter) if ($moreforfilter)

View File

@ -283,7 +283,7 @@ if ($action == 'edit') // Edit
{ {
// Show bugtrack link // Show bugtrack link
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>'; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1); print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
print '</td>'; print '</td>';
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
@ -469,7 +469,7 @@ else // Show
{ {
// Show bugtrack link // Show bugtrack link
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>'; print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>"; print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print "</tr>"; print "</tr>";

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -50,14 +51,14 @@ $parent=GETPOST('parent');
if ($origin) if ($origin)
{ {
if ($type == 0) $idProdOrigin = $origin; if ($type == Categorie::TYPE_PRODUCT) $idProdOrigin = $origin;
if ($type == 1) $idSupplierOrigin = $origin; if ($type == Categorie::TYPE_SUPPLIER) $idSupplierOrigin = $origin;
if ($type == 2) $idCompanyOrigin = $origin; if ($type == Categorie::TYPE_CUSTOMER) $idCompanyOrigin = $origin;
if ($type == 3) $idMemberOrigin = $origin; if ($type == Categorie::TYPE_MEMBER) $idMemberOrigin = $origin;
if ($type == 4) $idContactOrigin = $origin; if ($type == Categorie::TYPE_CONTACT) $idContactOrigin = $origin;
} }
if ($catorigin && $type == 0) $idCatOrigin = $catorigin; if ($catorigin && $type == Categorie::TYPE_PRODUCT) $idCatOrigin = $catorigin;
$object = new Categorie($db); $object = new Categorie($db);

View File

@ -6,6 +6,7 @@
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -46,40 +47,40 @@ $dbtablename = '';
// For categories on third parties // For categories on third parties
if (! empty($socid)) $id = $socid; if (! empty($socid)) $id = $socid;
if (! isset($type)) $type = 0; if (! isset($type)) $type = Categorie::TYPE_PRODUCT;
if ($type == 1 || $type == 2) $socid = $id; if ($type == Categorie::TYPE_SUPPLIER || $type == Categorie::TYPE_CUSTOMER) $socid = $id;
if ($id || $ref) if ($id || $ref)
{ {
if ($type == 0) { if ($type == Categorie::TYPE_PRODUCT) {
$elementtype = 'product'; $elementtype = 'product';
$objecttype = 'produit|service&categorie'; $objecttype = 'produit|service&categorie';
$objectid = isset($id)?$id:(isset($ref)?$ref:''); $objectid = isset($id)?$id:(isset($ref)?$ref:'');
$dbtablename = 'product'; $dbtablename = 'product';
$fieldid = isset($ref)?'ref':'rowid'; $fieldid = isset($ref)?'ref':'rowid';
} }
elseif ($type == 1) { elseif ($type == Categorie::TYPE_SUPPLIER) {
$elementtype = 'fournisseur'; $elementtype = 'fournisseur';
$objecttype = 'societe&categorie'; $objecttype = 'societe&categorie';
$objectid = isset($id)?$id:(isset($socid)?$socid:''); $objectid = isset($id)?$id:(isset($socid)?$socid:'');
$dbtablename = '&societe'; $dbtablename = '&societe';
$fieldid = 'rowid'; $fieldid = 'rowid';
} }
elseif ($type == 2) { elseif ($type == Categorie::TYPE_CUSTOMER) {
$elementtype = 'societe'; $elementtype = 'societe';
$objecttype = 'societe&categorie'; $objecttype = 'societe&categorie';
$objectid = isset($id)?$id:(isset($socid)?$socid:''); $objectid = isset($id)?$id:(isset($socid)?$socid:'');
$dbtablename = '&societe'; $dbtablename = '&societe';
$fieldid = 'rowid'; $fieldid = 'rowid';
} }
elseif ($type == 3) { elseif ($type == Categorie::TYPE_MEMBER) {
$elementtype = 'member'; $elementtype = 'member';
$objecttype = 'adherent&categorie'; $objecttype = 'adherent&categorie';
$objectid = isset($id)?$id:(isset($ref)?$ref:''); $objectid = isset($id)?$id:(isset($ref)?$ref:'');
$dbtablename = 'adherent'; $dbtablename = 'adherent';
$fieldid = ! empty($ref)?'ref':'rowid'; $fieldid = ! empty($ref)?'ref':'rowid';
} }
elseif ($type == 4) { elseif ($type == Categorie::TYPE_CONTACT) {
$elementtype = 'societe'; $elementtype = 'societe';
$objecttype = 'contact'; $objecttype = 'contact';
$objectid = isset($id)?$id:(isset($ref)?$ref:''); $objectid = isset($id)?$id:(isset($ref)?$ref:'');
@ -109,34 +110,34 @@ if (empty($reshook))
// Remove element from category // Remove element from category
if ($removecat > 0) if ($removecat > 0)
{ {
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
{ {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$object = new Product($db); $object = new Product($db);
$result = $object->fetch($id, $ref); $result = $object->fetch($id, $ref);
$elementtype = 'product'; $elementtype = 'product';
} }
if ($type==1 && $user->rights->societe->creer) if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
{ {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
$object = new Fournisseur($db); $object = new Fournisseur($db);
$result = $object->fetch($objectid); $result = $object->fetch($objectid);
$elementtype = 'fournisseur'; $elementtype = 'fournisseur';
} }
if ($type==2 && $user->rights->societe->creer) if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
{ {
$object = new Societe($db); $object = new Societe($db);
$result = $object->fetch($objectid); $result = $object->fetch($objectid);
$elementtype = 'societe'; $elementtype = 'societe';
} }
if ($type == 3 && $user->rights->adherent->creer) if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
{ {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$object = new Adherent($db); $object = new Adherent($db);
$result = $object->fetch($objectid); $result = $object->fetch($objectid);
$elementtype = 'member'; $elementtype = 'member';
} }
if ($type == 4 && $user->rights->societe->creer) if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer)
{ {
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$object = new Contact($db); $object = new Contact($db);
@ -157,34 +158,34 @@ if (empty($reshook))
// Add object into a category // Add object into a category
if ($parent > 0) if ($parent > 0)
{ {
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
{ {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$object = new Product($db); $object = new Product($db);
$result = $object->fetch($id, $ref); $result = $object->fetch($id, $ref);
$elementtype = 'product'; $elementtype = 'product';
} }
if ($type==1 && $user->rights->societe->creer) if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
{ {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
$object = new Fournisseur($db); $object = new Fournisseur($db);
$result = $object->fetch($objectid); $result = $object->fetch($objectid);
$elementtype = 'fournisseur'; $elementtype = 'fournisseur';
} }
if ($type==2 && $user->rights->societe->creer) if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
{ {
$object = new Societe($db); $object = new Societe($db);
$result = $object->fetch($objectid); $result = $object->fetch($objectid);
$elementtype = 'societe'; $elementtype = 'societe';
} }
if ($type==3 && $user->rights->adherent->creer) if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
{ {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$object = new Adherent($db); $object = new Adherent($db);
$result = $object->fetch($objectid); $result = $object->fetch($objectid);
$elementtype = 'member'; $elementtype = 'member';
} }
if ($type == 4 && $user->rights->societe->creer) if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer)
{ {
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$object = new Contact($db); $object = new Contact($db);
@ -324,7 +325,7 @@ if ($socid)
} }
else if ($id || $ref) else if ($id || $ref)
{ {
if ($type == 0) if ($type == Categorie::TYPE_PRODUCT)
{ {
$langs->load("products"); $langs->load("products");
@ -377,7 +378,7 @@ else if ($id || $ref)
formCategory($db,$product,0,$socid,($user->rights->produit->creer || $user->rights->service->creer)); formCategory($db,$product,0,$socid,($user->rights->produit->creer || $user->rights->service->creer));
} }
if ($type == 3) if ($type == Categorie::TYPE_MEMBER)
{ {
$langs->load("members"); $langs->load("members");
@ -455,7 +456,7 @@ else if ($id || $ref)
formCategory($db,$member,3,0,$user->rights->adherent->creer); formCategory($db,$member,3,0,$user->rights->adherent->creer);
} }
if ($type == 4) if ($type == Categorie::TYPE_CONTACT)
{ {
$langs->load("contact"); $langs->load("contact");
@ -618,16 +619,16 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
{ {
global $user,$langs,$form,$bc; global $user,$langs,$form,$bc;
if ($typeid == 0) $title = $langs->trans("ProductsCategoriesShort"); if ($typeid == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoriesShort");
if ($typeid == 1) $title = $langs->trans("SuppliersCategoriesShort"); if ($typeid == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoriesShort");
if ($typeid == 2) $title = $langs->trans("CustomersProspectsCategoriesShort"); if ($typeid == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersProspectsCategoriesShort");
if ($typeid == 3) $title = $langs->trans("MembersCategoriesShort"); if ($typeid == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoriesShort");
if ($typeid == 4) $title = $langs->trans("ContactCategoriesShort"); if ($typeid == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort");
$linktocreate=''; $linktocreate='';
if ($showclassifyform && $user->rights->categorie->creer) if ($showclassifyform && $user->rights->categorie->creer)
{ {
$linktocreate='<a href="'.DOL_URL_ROOT.'/categories/card.php?action=create&amp;origin='.$object->id.'&type='.$typeid.'&urlfrom='.urlencode($_SERVER["PHP_SELF"].'?'.(($typeid==1||$typeid==2)?'socid':'id').'='.$object->id.'&type='.$typeid).'">'; $linktocreate='<a href="'.DOL_URL_ROOT.'/categories/card.php?action=create&amp;origin='.$object->id.'&type='.$typeid.'&urlfrom='.urlencode($_SERVER["PHP_SELF"].'?'.(($typeid==Categorie::TYPE_SUPPLIER||$typeid==Categorie::TYPE_CUSTOMER)?'socid':'id').'='.$object->id.'&type='.$typeid).'">';
$linktocreate.=$langs->trans("CreateCat").' '; $linktocreate.=$langs->trans("CreateCat").' ';
$linktocreate.=img_picto($langs->trans("Create"),'filenew'); $linktocreate.=img_picto($langs->trans("Create"),'filenew');
$linktocreate.="</a>"; $linktocreate.="</a>";
@ -662,11 +663,11 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
if (count($cats) > 0) if (count($cats) > 0)
{ {
if ($typeid == 0) $title=$langs->trans("ProductIsInCategories"); if ($typeid == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductIsInCategories");
if ($typeid == 1) $title=$langs->trans("CompanyIsInSuppliersCategories"); if ($typeid == Categorie::TYPE_SUPPLIER) $title=$langs->trans("CompanyIsInSuppliersCategories");
if ($typeid == 2) $title=$langs->trans("CompanyIsInCustomersCategories"); if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyIsInCustomersCategories");
if ($typeid == 3) $title=$langs->trans("MemberIsInCategories"); if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberIsInCategories");
if ($typeid == 4) $title=$langs->trans("ContactIsInCategories"); if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactIsInCategories");
print "\n"; print "\n";
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$title.':</td></tr>'; print '<tr class="liste_titre"><td colspan="2">'.$title.':</td></tr>';
@ -687,11 +688,11 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
// Link to delete from category // Link to delete from category
print '<td align="right">'; print '<td align="right">';
$permission=0; $permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($typeid == 4) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
if ($permission) if ($permission)
{ {
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removecat=".$cat->id."'>"; print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removecat=".$cat->id."'>";
@ -715,18 +716,17 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
} }
else else
{ {
if ($typeid == 0) $title=$langs->trans("ProductHasNoCategory"); if ($typeid == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductHasNoCategory");
if ($typeid == 1) $title=$langs->trans("CompanyHasNoCategory"); if ($typeid == Categorie::TYPE_SUPPLIER) $title=$langs->trans("CompanyHasNoCategory");
if ($typeid == 2) $title=$langs->trans("CompanyHasNoCategory"); if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyHasNoCategory");
if ($typeid == 3) $title=$langs->trans("MemberHasNoCategory"); if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberHasNoCategory");
if ($typeid == 4) $title=$langs->trans("ContactHasNoCategory"); if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactHasNoCategory");
print $title; print $title;
print "<br/>"; print "<br/>";
} }
return 0; return 0;
} }
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -1,13 +1,14 @@
<?php <?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005 Davoleau Brice <brice.davoleau@gmail.com> * Copyright (C) 2005 Davoleau Brice <brice.davoleau@gmail.com>
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -40,6 +41,13 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
*/ */
class Categorie extends CommonObject class Categorie extends CommonObject
{ {
// Categories types
const TYPE_PRODUCT = 0;
const TYPE_SUPPLIER = 1;
const TYPE_CUSTOMER = 2;
const TYPE_MEMBER = 3;
const TYPE_CONTACT = 4;
public $element='category'; public $element='category';
public $table_element='categories'; public $table_element='categories';
@ -472,7 +480,7 @@ class Categorie extends CommonObject
* Link an object to the category * Link an object to the category
* *
* @param Object $obj Object to link to category * @param Object $obj Object to link to category
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact') * @param string $type Type of category ('societe', 'member', 'product', 'contact', 'fournisseur)
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked * @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
*/ */
function add_type($obj,$type) function add_type($obj,$type)
@ -485,12 +493,22 @@ class Categorie extends CommonObject
// For backward compatibility // For backward compatibility
if ($type == 'company') $type='societe'; if ($type == 'company') $type='societe';
if ($type == 'customer') $type='societe'; elseif ($type == 'customer') $type='societe';
if ($type == 'supplier') $type='fournisseur'; elseif ($type == 'supplier') $type='fournisseur';
$column_name=$type; /**
if ($type=='contact') $column_name='socpeople'; * llx_categorie_contact => fk_socpeople
if ($type=='fournisseur') $column_name='societe'; * llx_categorie_fournisseur, llx_categorie_societe => fk_soc
* llx_categorie_member => fk_member
* llx_categorie_product => fk_product
*/
if ($type == 'contact') {
$column_name = 'socpeople';
} elseif ($type == 'fournisseur' || ($type == 'societe')) {
$column_name = 'soc';
} else {
$column_name = $type;
}
$this->db->begin(); $this->db->begin();
@ -1166,11 +1184,17 @@ class Categorie extends CommonObject
$cats = array(); $cats = array();
$typeid=-1; $table=''; $typeid=-1; $table='';
if ($type == '0' || $type == 'product') { $typeid=0; $table='product'; $type='product'; } if ($type == '0' || $type == 'product') {
else if ($type == '1' || $type == 'supplier') { $typeid=1; $table='soc'; $type='fournisseur'; } $typeid=self::TYPE_PRODUCT; $table='product'; $type='product';
else if ($type == '2' || $type == 'customer') { $typeid=2; $table='soc'; $type='societe'; } } else if ($type == '1' || $type == 'supplier') {
else if ($type == '3' || $type == 'member') { $typeid=3; $table='member'; $type='member'; } $typeid=self::TYPE_SUPPLIER; $table='soc'; $type='fournisseur';
else if ($type == '4' || $type == 'contact') { $typeid=4; $table='socpeople'; $type='contact'; } } else if ($type == '2' || $type == 'customer') {
$typeid=self::TYPE_CUSTOMER; $table='soc'; $type='societe';
} else if ($type == '3' || $type == 'member') {
$typeid=self::TYPE_MEMBER; $table='member'; $type='member';
} else if ($type == '4' || $type == 'contact') {
$typeid=self::TYPE_CONTACT; $table='socpeople'; $type='contact';
}
$sql = "SELECT ct.fk_categorie, c.label"; $sql = "SELECT ct.fk_categorie, c.label";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c";
@ -1220,11 +1244,11 @@ class Categorie extends CommonObject
$cats = array(); $cats = array();
$typeid=-1; $typeid=-1;
if ($type == 0 || $type == 'product') { $typeid=0; } if ($type == 0 || $type == 'product') { $typeid=self::TYPE_PRODUCT; }
else if ($type == 1 || $type == 'supplier') { $typeid=1; } else if ($type == 1 || $type == 'supplier') { $typeid=self::TYPE_SUPPLIER; }
else if ($type == 2 || $type == 'customer') { $typeid=2; } else if ($type == 2 || $type == 'customer') { $typeid=self::TYPE_CUSTOMER; }
else if ($type == 3 || $type == 'member') { $typeid=3; } else if ($type == 3 || $type == 'member') { $typeid=self::TYPE_MEMBER; }
else if ($type == 4 || $type == 'contact') { $typeid=4; } else if ($type == 4 || $type == 'contact') { $typeid=self::TYPE_CONTACT; }
// Generation requete recherche // Generation requete recherche
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
@ -1550,7 +1574,7 @@ class Categorie extends CommonObject
$this->specimen=1; $this->specimen=1;
$this->description = 'This is a description'; $this->description = 'This is a description';
$this->socid = 1; $this->socid = 1;
$this->type = 0; $this->type = self::TYPE_PRODUCT;
} }
/** /**

View File

@ -1,9 +1,10 @@
<?php <?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -35,7 +36,7 @@ $langs->load("categories");
if (! $user->rights->categorie->lire) accessforbidden(); if (! $user->rights->categorie->lire) accessforbidden();
$id=GETPOST('id','int'); $id=GETPOST('id','int');
$type=(GETPOST('type') ? GETPOST('type') : 0); $type=(GETPOST('type') ? GETPOST('type') : Categorie::TYPE_PRODUCT);
$catname=GETPOST('catname','alpha'); $catname=GETPOST('catname','alpha');
$section=(GETPOST('section')?GETPOST('section'):0); $section=(GETPOST('section')?GETPOST('section'):0);
@ -47,12 +48,12 @@ $section=(GETPOST('section')?GETPOST('section'):0);
$categstatic = new Categorie($db); $categstatic = new Categorie($db);
$form = new Form($db); $form = new Form($db);
if ($type == 0) $title=$langs->trans("ProductsCategoriesArea"); if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoriesArea");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoriesArea"); elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoriesArea");
elseif ($type == 2) $title=$langs->trans("CustomersCategoriesArea"); elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoriesArea");
elseif ($type == 3) $title=$langs->trans("MembersCategoriesArea"); elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoriesArea");
elseif ($type == 4) $title=$langs->trans("ContactsCategoriesArea"); elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactsCategoriesArea");
else $title=$langs->trans("CategoriesArea"); else $title=$langs->trans("CategoriesArea");
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');

View File

@ -1,9 +1,10 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -93,11 +94,11 @@ $form = new Form($db);
if ($object->id) if ($object->id)
{ {
$title=$langs->trans("ProductsCategoryShort"); $title=$langs->trans("ProductsCategoryShort");
if ($type == 0) $title=$langs->trans("ProductsCategoryShort"); if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort"); elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort"); elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
$head = categories_prepare_head($object,$type); $head = categories_prepare_head($object,$type);
dol_fiche_head($head, 'photos', $title, 0, 'category'); dol_fiche_head($head, 'photos', $title, 0, 'category');

View File

@ -1,7 +1,8 @@
<?php <?php
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> /* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net> * Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -143,12 +144,12 @@ llxHeader("","",$langs->trans("Translation"));
$form = new Form($db); $form = new Form($db);
$formadmin=new FormAdmin($db); $formadmin=new FormAdmin($db);
if ($type == 0) $title=$langs->trans("ProductsCategoryShort"); if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort"); elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort"); elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
else $title=$langs->trans("Category"); else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type); $head = categories_prepare_head($object,$type);
dol_fiche_head($head, 'translation', $title, 0, 'category'); dol_fiche_head($head, 'translation', $title, 0, 'category');

View File

@ -1,8 +1,9 @@
<?php <?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -70,33 +71,33 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Remove element from category // Remove element from category
if ($id > 0 && $removeelem > 0) if ($id > 0 && $removeelem > 0)
{ {
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
{ {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$tmpobject = new Product($db); $tmpobject = new Product($db);
$result = $tmpobject->fetch($removeelem); $result = $tmpobject->fetch($removeelem);
$elementtype = 'product'; $elementtype = 'product';
} }
else if ($type==1 && $user->rights->societe->creer) else if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
{ {
$tmpobject = new Societe($db); $tmpobject = new Societe($db);
$result = $tmpobject->fetch($removeelem); $result = $tmpobject->fetch($removeelem);
$elementtype = 'fournisseur'; $elementtype = 'fournisseur';
} }
else if ($type==2 && $user->rights->societe->creer) else if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
{ {
$tmpobject = new Societe($db); $tmpobject = new Societe($db);
$result = $tmpobject->fetch($removeelem); $result = $tmpobject->fetch($removeelem);
$elementtype = 'societe'; $elementtype = 'societe';
} }
else if ($type == 3 && $user->rights->adherent->creer) else if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
{ {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$tmpobject = new Adherent($db); $tmpobject = new Adherent($db);
$result = $tmpobject->fetch($removeelem); $result = $tmpobject->fetch($removeelem);
$elementtype = 'member'; $elementtype = 'member';
} }
else if ($type == 4 && $user->rights->societe->creer) { else if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$tmpobject = new Contact($db); $tmpobject = new Contact($db);
@ -121,7 +122,7 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi
} }
} }
if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer)) if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer))
{ {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$newobject = new Product($db); $newobject = new Product($db);
@ -158,12 +159,12 @@ $form = new Form($db);
llxHeader("","",$langs->trans("Categories")); llxHeader("","",$langs->trans("Categories"));
if ($type == 0) $title=$langs->trans("ProductsCategoryShort"); if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort"); elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort"); elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
else $title=$langs->trans("Category"); else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type); $head = categories_prepare_head($object,$type);
@ -283,7 +284,7 @@ else
} }
// List of products or services (type is type of category) // List of products or services (type is type of category)
if ($object->type == 0) if ($object->type == Categorie::TYPE_PRODUCT)
{ {
$prods = $object->getObjectsInCateg("product"); $prods = $object->getObjectsInCateg("product");
if ($prods < 0) if ($prods < 0)
@ -292,7 +293,7 @@ if ($object->type == 0)
} }
else else
{ {
$showclassifyform=1; $typeid=0; $showclassifyform=1; $typeid=Categorie::TYPE_PRODUCT;
// Form to add record into a category // Form to add record into a category
if ($showclassifyform) if ($showclassifyform)
@ -334,10 +335,10 @@ if ($object->type == 0)
print '<td align="right">'; print '<td align="right">';
$typeid=$object->type; $typeid=$object->type;
$permission=0; $permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($permission) if ($permission)
{ {
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$prod->id."'>"; print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$prod->id."'>";
@ -356,7 +357,7 @@ if ($object->type == 0)
} }
} }
if ($object->type == 1) if ($object->type == Categorie::TYPE_SUPPLIER)
{ {
$socs = $object->getObjectsInCateg("supplier"); $socs = $object->getObjectsInCateg("supplier");
if ($socs < 0) if ($socs < 0)
@ -384,10 +385,10 @@ if ($object->type == 1)
print '<td align="right">'; print '<td align="right">';
$typeid=$object->type; $typeid=$object->type;
$permission=0; $permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($permission) if ($permission)
{ {
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$soc->id."'>"; print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$soc->id."'>";
@ -407,7 +408,7 @@ if ($object->type == 1)
} }
} }
if($object->type == 2) if($object->type == Categorie::TYPE_CUSTOMER)
{ {
$socs = $object->getObjectsInCateg("customer"); $socs = $object->getObjectsInCateg("customer");
if ($socs < 0) if ($socs < 0)
@ -438,10 +439,10 @@ if($object->type == 2)
print '<td align="right">'; print '<td align="right">';
$typeid=$object->type; $typeid=$object->type;
$permission=0; $permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($permission) if ($permission)
{ {
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$soc->id."'>"; print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$soc->id."'>";
@ -461,7 +462,7 @@ if($object->type == 2)
} }
// List of members // List of members
if ($object->type == 3) if ($object->type == Categorie::TYPE_MEMBER)
{ {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
@ -493,10 +494,10 @@ if ($object->type == 3)
print '<td align="right">'; print '<td align="right">';
$typeid=$object->type; $typeid=$object->type;
$permission=0; $permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($permission) if ($permission)
{ {
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$member->id."'>"; print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$member->id."'>";
@ -515,7 +516,7 @@ if ($object->type == 3)
} }
//Categorie contact //Categorie contact
if($object->type == 4) if($object->type == Categorie::TYPE_CONTACT)
{ {
$contacts = $object->getObjectsInCateg("contact"); $contacts = $object->getObjectsInCateg("contact");
if ($contacts < 0) if ($contacts < 0)
@ -544,11 +545,11 @@ if($object->type == 4)
print '<td align="right">'; print '<td align="right">';
$typeid=$object->type; $typeid=$object->type;
$permission=0; $permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($typeid == 4) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
if ($permission) if ($permission)
{ {
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$contact->id."'>"; print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$contact->id."'>";

View File

@ -6,6 +6,7 @@
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -609,6 +610,8 @@ if ($action == 'create')
if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous")); if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous"));
else print_fiche_titre($langs->trans("AddAnAction")); else print_fiche_titre($langs->trans("AddAnAction"));
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Type of event // Type of event
@ -784,7 +787,9 @@ if ($action == 'create')
print '</table>'; print '</table>';
print '<br><div class="center">'; dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';

View File

@ -675,6 +675,8 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewMailing")); print_fiche_titre($langs->trans("NewMailing"));
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>'; print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>';
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>'; print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
@ -706,12 +708,14 @@ if ($action == 'create')
print '<td>'; print '<td>';
// Editeur wysiwyg // Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('body',$_POST['body'],'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,70); $doleditor=new DolEditor('body',$_POST['body'],'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%');
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></div>'; dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></div>';
print '</form>'; print '</form>';
} }

View File

@ -115,7 +115,7 @@ if ($resql)
} }
$db->free($resql); $db->free($resql);
print '<table class="noborder" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td></tr>'."\n"; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td></tr>'."\n";
$var=true; $var=true;
$listofstatus=array(0,1,2,3,4); $listofstatus=array(0,1,2,3,4);

View File

@ -1,11 +1,12 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -219,34 +220,23 @@ $sql.= " AND s.client IN (2, 3)";
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; $sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
if ($socid) $sql.= " AND s.rowid = " .$socid; if ($socid) $sql.= " AND s.rowid = " .$socid;
if ($search_stcomm != '') $sql.= " AND s.fk_stcomm=".$search_stcomm; if ($search_stcomm != '') $sql.= natural_search("s.fk_stcomm",$search_stcomm,2);
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_nom) { if ($search_nom) $sql .= natural_search('s.nom', $search_nom);
$sql .= natural_search('s.nom', $search_nom);
}
if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'"; if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'";
if ($search_town) { if ($search_town) $sql .= natural_search('s.town', $search_town);
$sql .= natural_search('s.town', $search_town); if ($search_state) $sql .= natural_search('d.nom', $search_state);
} if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
if ($search_state) {
$sql .= natural_search('d.nom', $search_state);
}
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status);
// Insert levels filters // Insert levels filters
if ($search_levels) if ($search_levels) $sql .= " AND s.fk_prospectlevel IN (".$search_levels.')';
{
$sql .= " AND s.fk_prospectlevel IN (".$search_levels.')';
}
// Insert sale filter // Insert sale filter
if ($search_sale > 0) if ($search_sale > 0) $sql .= " AND sc.fk_user = ".$db->escape($search_sale);
if ($socname)
{ {
$sql .= " AND sc.fk_user = ".$db->escape($search_sale);
}
if ($socname) {
$sql .= natural_search('s.nom', $search_nom); $sql .= natural_search('s.nom', $search_nom);
$sortfield = "s.nom"; $sortfield = "s.nom";
$sortorder = "ASC"; $sortorder = "ASC";
@ -309,8 +299,9 @@ if ($resql)
$moreforfilter=''; $moreforfilter='';
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1); $moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
} }
// If the user can view prospects other than his' // If the user can view prospects other than his'
@ -362,22 +353,17 @@ if ($resql)
print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">'; print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">';
print '</td>'; print '</td>';
// Added by Matelli // Prospect levelt
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
// Generate in $options_from the list of each option sorted $options_from = '<option value="">&nbsp;</option>'; // Generate in $options_from the list of each option sorted
$options_from = '<option value="">&nbsp;</option>';
foreach ($tab_level as $tab_level_sortorder => $tab_level_label) foreach ($tab_level as $tab_level_sortorder => $tab_level_label)
{ {
$options_from .= '<option value="'.$tab_level_sortorder.'"'.($search_level_from == $tab_level_sortorder ? ' selected':'').'>'; $options_from .= '<option value="'.$tab_level_sortorder.'"'.($search_level_from == $tab_level_sortorder ? ' selected':'').'>';
$options_from .= $langs->trans($tab_level_label); $options_from .= $langs->trans($tab_level_label);
$options_from .= '</option>'; $options_from .= '</option>';
} }
array_reverse($tab_level, true); // Reverse the list
// Reverse the list $options_to = '<option value="">&nbsp;</option>'; // Generate in $options_to the list of each option sorted in the reversed order
array_reverse($tab_level, true);
// Generate in $options_to the list of each option sorted in the reversed order
$options_to = '<option value="">&nbsp;</option>';
foreach ($tab_level as $tab_level_sortorder => $tab_level_label) foreach ($tab_level as $tab_level_sortorder => $tab_level_label)
{ {
$options_to .= '<option value="'.$tab_level_sortorder.'"'.($search_level_to == $tab_level_sortorder ? ' selected':'').'>'; $options_to .= '<option value="'.$tab_level_sortorder.'"'.($search_level_to == $tab_level_sortorder ? ' selected':'').'>';
@ -392,8 +378,11 @@ if ($resql)
print '</td>'; print '</td>';
// Prospect status
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
print '&nbsp;'; // TODO Add here a list of prospect status
//print $form->selectarray($htmlname, $array, $search_stcomm);
//print '&nbsp;';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';

View File

@ -115,7 +115,7 @@ if ($resql)
$i++; $i++;
} }
$db->free($resql); $db->free($resql);
print '<table class="noborder" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</td></tr>'."\n"; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</td></tr>'."\n";
$listofstatus=array(0,1,2,3,3,-1); $listofstatus=array(0,1,2,3,3,-1);
$bool=false; $bool=false;

View File

@ -7,6 +7,7 @@
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2011-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -68,6 +69,15 @@ $req_desc=GETPOST("req_desc",'',3);
$req_debit=GETPOST("req_debit",'',3); $req_debit=GETPOST("req_debit",'',3);
$req_credit=GETPOST("req_credit",'',3); $req_credit=GETPOST("req_credit",'',3);
$req_stdtmonth=GETPOST('req_stdtmonth', 'int');
$req_stdtday=GETPOST('req_stdtday', 'int');
$req_stdtyear=GETPOST('req_stdtyear', 'int');
$req_stdt = dol_mktime(0, 0, 0, $req_stdtmonth, $req_stdtday, $req_stdtyear);
$req_enddtmonth=GETPOST('req_enddtmonth', 'int');
$req_enddtday=GETPOST('req_enddtday', 'int');
$req_enddtyear=GETPOST('req_enddtyear', 'int');
$req_enddt = dol_mktime(23, 59, 59, $req_enddtmonth, $req_enddtday, $req_enddtyear);
$vline=GETPOST("vline"); $vline=GETPOST("vline");
$page=GETPOST('page','int'); $page=GETPOST('page','int');
$negpage=GETPOST('negpage','int'); $negpage=GETPOST('negpage','int');
@ -87,6 +97,14 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$req_desc=""; $req_desc="";
$req_debit=""; $req_debit="";
$req_credit=""; $req_credit="";
$req_stdtmonth="";
$req_stdtday="";
$req_stdtyear="";
$req_stdt = "";
$req_enddtmonth="";
$req_enddtday="";
$req_enddtyear="";
$req_enddt = "";
} }
/* /*
@ -158,7 +176,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->m
* View * View
*/ */
llxHeader(); llxHeader('',$langs->trans("FinancialAccount").'-'.$langs->trans("Transactions"));
$societestatic=new Societe($db); $societestatic=new Societe($db);
$userstatic=new User($db); $userstatic=new User($db);
@ -254,6 +272,27 @@ if ($id > 0 || ! empty($ref))
$mode_search = 1; $mode_search = 1;
} }
if ($req_stdt && $req_enddt)
{
$sql_rech.=" AND (b.datev BETWEEN '".$db->escape($db->idate($req_stdt))."' AND '".$db->escape($db->idate($req_enddt))."')";
$param.='&amp;req_stdtmonth='.$req_stdtmonth.'&amp;req_stdtyear='.$req_stdtyear.'&amp;req_stdtday='.$req_stdtday;
$param.='&amp;req_enddtmonth='.$req_enddtmonth.'&amp;req_enddtday='.$req_enddtday.'&amp;req_enddtyear='.$req_enddtyear;
$mode_search = 1;
}
elseif ($req_stdt)
{
$sql_rech.=" AND b.datev >= '".$db->escape($db->idate($req_stdt))."'";
$param.='&amp;req_stdtmonth='.$req_stdtmonth.'&amp;req_stdtyear='.$req_stdtyear.'&amp;req_stdtday='.$req_stdtday;
$mode_search = 1;
}
elseif ($req_enddt)
{
$sql_rech.=" AND b.datev <= '".$db->escape($db->idate($req_enddt))."'";
$param.='&amp;req_enddtmonth='.$req_enddtmonth.'&amp;req_enddtday='.$req_enddtday.'&amp;req_enddtyear='.$req_enddtyear;
$mode_search = 1;
}
$sql = "SELECT count(*) as total"; $sql = "SELECT count(*) as total";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ", ".MAIN_DB_PREFIX."bank as b"; $sql.= ", ".MAIN_DB_PREFIX."bank as b";
@ -398,6 +437,12 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="thirdparty" value="'.$thirdparty.'">'; print '<input type="hidden" name="thirdparty" value="'.$thirdparty.'">';
print '<input type="hidden" name="nbpage" value="'.$totalPages.'">'; print '<input type="hidden" name="nbpage" value="'.$totalPages.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="req_stdtmonth" value="'.$req_stdtmonth.'">';
print '<input type="hidden" name="req_stdtyear" value="'.$req_stdtyear.'">';
print '<input type="hidden" name="req_stdtday" value="'.$req_stdtday.'">';
print '<input type="hidden" name="req_enddtmonth" value="'.$req_enddtmonth.'">';
print '<input type="hidden" name="req_enddtday" value="'.$req_enddtday.'">';
print '<input type="hidden" name="req_enddtyear" value="'.$req_enddtyear.'">';
$navig ='<div data-role="fieldcontain">'; $navig ='<div data-role="fieldcontain">';
if ($limitsql > $viewline) $navig.='<a href="account.php?'.$param.'&amp;page='.($page+1).'">'.img_previous().'</a>'; if ($limitsql > $viewline) $navig.='<a href="account.php?'.$param.'&amp;page='.($page+1).'">'.img_previous().'</a>';
@ -489,9 +534,12 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="action" value="search">'; print '<input type="hidden" name="action" value="search">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; 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);
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>'; print '<td>'.$period_filter.'</td>';
print '<td>'; print '<td>';
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...) //$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
$filtertype=''; $filtertype='';
@ -576,7 +624,7 @@ if ($id > 0 || ! empty($ref))
$var=true; $var=true;
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $total = 0; $sep = -1; $i = 0; $total = 0; $sep = -1; $total_deb=0; $total_cred=0;
while ($i < $num) while ($i < $num)
{ {
@ -811,10 +859,12 @@ if ($id > 0 || ! empty($ref))
if ($objp->amount < 0) if ($objp->amount < 0)
{ {
print '<td align="right" class="nowrap">'.price($objp->amount * -1).'</td><td>&nbsp;</td>'."\n"; print '<td align="right" class="nowrap">'.price($objp->amount * -1).'</td><td>&nbsp;</td>'."\n";
$total_deb +=$objp->amount;
} }
else else
{ {
print '<td>&nbsp;</td><td align="right" class="nowrap">&nbsp;'.price($objp->amount).'</td>'."\n"; print '<td>&nbsp;</td><td align="right" class="nowrap">&nbsp;'.price($objp->amount).'</td>'."\n";
$total_cred +=$objp->amount;
} }
// Balance // Balance
@ -886,11 +936,23 @@ if ($id > 0 || ! empty($ref))
// Show total // Show total
if ($page == 0 && ! $mode_search) if ($page == 0 && ! $mode_search)
{ {
//Real account situation
print '<tr class="liste_total"><td align="left" colspan="8">'; print '<tr class="liste_total"><td align="left" colspan="8">';
if ($sep > 0) print '&nbsp;'; // If we had at least one line in future if ($sep > 0) print '&nbsp;'; // If we had at least one line in future
else print $langs->trans("CurrentBalance"); else print $langs->trans("CurrentBalance");
print ' '.$object->currency_code.'</td>'; print ' '.$object->currency_code.'</td>';
print '<td align="right" class="nowrap"><b>'.price($total, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>'; print '<td align="right" class="nowrap"><b>'.price($solde, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
print '<td>&nbsp;</td>';
print '</tr>';
} else {
// Only total according row displays
print '<tr class="liste_total"><td align="left" colspan="6">';
if ($sep > 0) print '&nbsp;'; // If we had at least one line in future
else print $langs->trans("Total");
print ' '.$object->currency_code.'</td>';
print '<td align="right" class="nowrap"><b>'.price($total_deb*-1, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
print '<td align="right" class="nowrap"><b>'.price($total_cred, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
print '<td align="right" class="nowrap"><b>'.price($total_cred-($total_deb*-1), 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -4,6 +4,7 @@
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -347,7 +348,9 @@ if ($action == 'new')
print '<form class="nocellnopadd" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form class="nocellnopadd" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="action" value="new">'; print '<input type="hidden" name="action" value="new">';
//print '<fieldset><legend>aaa</legend>';
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
//print '<tr><td width="30%">'.$langs->trans('Date').'</td><td width="70%">'.dol_print_date($now,'day').'</td></tr>'; //print '<tr><td width="30%">'.$langs->trans('Date').'</td><td width="70%">'.dol_print_date($now,'day').'</td></tr>';
// Filter // Filter
@ -358,6 +361,9 @@ if ($action == 'new')
$form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1); $form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1);
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
dol_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="filter" value="'.dol_escape_htmltag($langs->trans("ToFilter")).'">'; print '<input type="submit" class="button" name="filter" value="'.dol_escape_htmltag($langs->trans("ToFilter")).'">';
if ($filterdate || $filteraccountid > 0) if ($filterdate || $filteraccountid > 0)
@ -366,8 +372,7 @@ if ($action == 'new')
print '<input type="submit" class="button" name="removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '<input type="submit" class="button" name="removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
} }
print '</div>'; print '</div>';
//print '</fieldset>'; print '</form>';
print '</form>';
print '<br>'; print '<br>';
$sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as chqid, "; $sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as chqid, ";

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr> /* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -26,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$langs->load("products"); $langs->load("products");
$langs->load("categories"); $langs->load("categories");
@ -245,7 +247,7 @@ if ($modecompta == 'CREANCES-DETTES')
// Category filter // Category filter
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'; print '<td>';
print $langs->trans("Category") . ': ' . $formother->select_categories(0, $selected_cat, 'search_categ', true); print $langs->trans("Category") . ': ' . $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', true);
print ' '; print ' ';
print $langs->trans("SubCats") . '? '; print $langs->trans("SubCats") . '? ';
print '<input type="checkbox" name="subcat" value="yes"'; print '<input type="checkbox" name="subcat" value="yes"';

View File

@ -1,9 +1,10 @@
<?php <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr> * Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -29,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("categories"); $langs->load("categories");
@ -313,7 +315,7 @@ print "<table class=\"noborder\" width=\"100%\">";
// Category filter // Category filter
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'; print '<td>';
print $langs->trans("Category") . ': ' . $formother->select_categories(2, $selected_cat, 'search_categ', true); print $langs->trans("Category") . ': ' . $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', true);
print ' '; print ' ';
print $langs->trans("SubCats") . '? '; print $langs->trans("SubCats") . '? ';
print '<input type="checkbox" name="subcat" value="yes"'; print '<input type="checkbox" name="subcat" value="yes"';

View File

@ -812,7 +812,7 @@ else
// Statut // Statut
print '<tr><td>'.$langs->trans("Status").'</td>'; print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td>'; print '<td>';
print $object->getLibStatut(5); print $object->getLibStatut(4);
print '</td></tr>'; print '</td></tr>';
// Other attributes // Other attributes
@ -1036,7 +1036,7 @@ else
// Statut // Statut
print '<tr><td>'.$langs->trans("Status").'</td>'; print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td>'; print '<td>';
print $object->getLibStatut(5); print $object->getLibStatut(4);
print '</td>'; print '</td>';
print '</tr>'."\n"; print '</tr>'."\n";
// Other attributes // Other attributes

View File

@ -970,7 +970,7 @@ class Contact extends CommonObject
} }
elseif ($mode == 4) elseif ($mode == 4)
{ {
if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('StatusContactDraft'); if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
} }
elseif ($mode == 5) elseif ($mode == 5)

View File

@ -1,12 +1,12 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com> * Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -275,8 +275,9 @@ if ($result)
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(4,$search_categ,'search_categ',1); $moreforfilter.=$formother->select_categories(Categorie::TYPE_CONTACT,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
} }
if ($moreforfilter) if ($moreforfilter)

View File

@ -177,7 +177,7 @@ else
} }
print '<table class="noborder" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Services").'</td></tr>'."\n"; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Services").'</td></tr>'."\n";
$var=true; $var=true;
$listofstatus=array(0,4,4,5); $bool=false; $listofstatus=array(0,4,4,5); $bool=false;

View File

@ -418,7 +418,7 @@ abstract class CommonObject
/** /**
* Get array of all contacts for an object * Get array of all contacts for an object
* *
* @param int $statut Status of lines to get (-1=all) * @param int $statut Status of links to get (-1=all)
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user) * @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id * @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @return array Array of contacts * @return array Array of contacts
@ -429,9 +429,9 @@ abstract class CommonObject
$tab=array(); $tab=array();
$sql = "SELECT ec.rowid, ec.statut, ec.fk_socpeople as id, ec.fk_c_type_contact"; // This field contains id of llx_socpeople or id of llx_user $sql = "SELECT ec.rowid, ec.statut as statuslink, ec.fk_socpeople as id, ec.fk_c_type_contact"; // This field contains id of llx_socpeople or id of llx_user
if ($source == 'internal') $sql.=", '-1' as socid"; if ($source == 'internal') $sql.=", '-1' as socid, t.statut as statuscontact";
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid"; if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid, t.statut as statuscontact";
$sql.= ", t.civility as civility, t.lastname as lastname, t.firstname, t.email"; $sql.= ", t.civility as civility, t.lastname as lastname, t.firstname, t.email";
$sql.= ", tc.source, tc.element, tc.code, tc.libelle"; $sql.= ", tc.source, tc.element, tc.code, tc.libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc"; $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
@ -463,8 +463,8 @@ abstract class CommonObject
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle); $libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id, $tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,
'nom'=>$obj->lastname, // For backward compatibility 'nom'=>$obj->lastname, // For backward compatibility
'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email, 'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email, 'statuscontact'=>$obj->statuscontact,
'rowid'=>$obj->rowid,'code'=>$obj->code,'libelle'=>$libelle_type,'status'=>$obj->statut, 'fk_c_type_contact' => $obj->fk_c_type_contact); 'rowid'=>$obj->rowid, 'code'=>$obj->code, 'libelle'=>$libelle_type, 'status'=>$obj->statuslink, 'fk_c_type_contact'=>$obj->fk_c_type_contact);
} }
else else
{ {

View File

@ -923,7 +923,12 @@ class ExtraFields
} }
elseif ($type == 'chkbxlst') elseif ($type == 'chkbxlst')
{ {
$value_arr = explode(',', $value); if (is_array($value)) {
$value_arr = $value;
}
else {
$value_arr = explode(',', $value);
}
if (is_array($param['options'])) { if (is_array($param['options'])) {
$param_list = array_keys($param['options']); $param_list = array_keys($param['options']);

View File

@ -1,21 +1,21 @@
<?php <?php
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com> * Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com> * Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -4304,36 +4304,40 @@ class Form
/** /**
* Return a HTML select string, built from an array of key+value. * Return a HTML select string, built from an array of key+value.
* Note: Do not use returned string into a langs->trans function, content may be entity encoded twice. * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice.
* *
* @param string $htmlname Name of html select area * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
* @param array $array Array with key+value * @param array $array Array with key+value
* @param string $id Preselected key * @param string|string[] $id Preselected key or preselected keys for multiselect
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or '&nbsp;'). * @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or '&nbsp;').
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
* @param int $value_as_key 1 to use value as key * @param int $value_as_key 1 to use value as key
* @param string $moreparam Add more parameters onto the select tag * @param string $moreparam Add more parameters onto the select tag
* @param int $translate Translate and encode value * @param int $translate Translate and encode value
* @param int $maxlen Length maximum for labels * @param int $maxlen Length maximum for labels
* @param int $disabled Html select box is disabled * @param int $disabled Html select box is disabled
* @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort * @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort
* @param string $morecss Add more class to css styles * @param string $morecss Add more class to css styles
* @param int $addjscombo Add js combo * @param int $addjscombo Add js combo
* @return string HTML select string. * @return string HTML select string.
* @see multiselectarray * @see multiselectarray
*/ */
static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0) static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0)
{ {
global $conf, $langs; global $conf, $langs;
// Do we want a multiselect ?
$multiselect = 0;
if (preg_match('/^multi/',$htmlname)) $multiselect = 1;
if ($value_as_key) $array=array_combine($array, $array); if ($value_as_key) $array=array_combine($array, $array);
$out=''; $out='';
// Add code for jquery to use multiselect // Add code for jquery to use multiselect
if ($addjscombo && empty($conf->dol_use_jmobile) && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) if ($addjscombo && empty($conf->dol_use_jmobile) && $multiselect)
{ {
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT; $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT')?constant('REQUIRE_JQUERY_MULTISELECT'):'select2':$conf->global->MAIN_USE_JQUERY_MULTISELECT;
$out.='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> $out.='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
@ -4393,12 +4397,11 @@ class Form
/** /**
* Return a HTML select string, built from an array of key+value. * Return a HTML select string, built from an array of key+value but content returned into select come from an Ajax call of an URL.
* Note: Do not use returned string into a langs->trans function, content may be entity encoded twice. * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice.
* *
* @param string $url Url
* @param string $htmlname Name of html select area * @param string $htmlname Name of html select area
* @param array $array Array with key+value * @param string $url Url
* @param string $id Preselected key * @param string $id Preselected key
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or '&nbsp;'). * @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or '&nbsp;').
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
@ -4412,7 +4415,7 @@ class Form
* @param int $addjscombo Add js combo * @param int $addjscombo Add js combo
* @return string HTML select string. * @return string HTML select string.
*/ */
static function selectArrayAjax($url, $htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0) static function selectArrayAjax($htmlname, $url, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0)
{ {
$out = ''; $out = '';
@ -4455,7 +4458,7 @@ class Form
} }
else else
{ {
// TODO get values from ajax page to use a standard already completed array // TODO get all values from $url into $array
} }
@ -4590,7 +4593,7 @@ class Form
if ($rendermode == 0) if ($rendermode == 0)
{ {
$cate_arbo = $this->select_all_categories(0, '', 'parent', 64, 0, 1); $cate_arbo = $this->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
foreach($categories as $c) { foreach($categories as $c) {
$arrayselected[] = $c->id; $arrayselected[] = $c->id;
} }

View File

@ -384,7 +384,7 @@ class FormOther
} }
// Select each sales and print them in a select input // Select each sales and print them in a select input
$out.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>'; $out.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
if ($showempty) $out.='<option value="-1">&nbsp;</option>'; if ($showempty) $out.='<option value="0">&nbsp;</option>';
// Get list of users allowed to be viewed // Get list of users allowed to be viewed
$sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login"; $sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login";

View File

@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/db/DoliDB.class.php';
/** /**
* Class to manage Dolibarr database access for a MySQL database using the mysql extension * Class to manage Dolibarr database access for a MySQL database using the mysql extension
*
* @deprecated Use DoliDBMysqli
*/ */
class DoliDBMysql extends DoliDB class DoliDBMysql extends DoliDB
{ {

View File

@ -1,13 +1,14 @@
<?php <?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr> * Copyright (C) 2013 Christophe Battarel <contact@altairis.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -83,8 +84,9 @@ function societe_prepare_head(Societe $object)
//show categorie tab //show categorie tab
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{ {
$type = 2; require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
if ($object->fournisseur) $type = 1; $type = Categorie::TYPE_CUSTOMER;
if ($object->fournisseur) $type = Categorie::TYPE_SUPPLIER;
$head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$object->id."&type=".$type; $head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$object->id."&type=".$type;
$head[$h][1] = $langs->trans('Categories'); $head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category'; $head[$h][2] = 'category';

View File

@ -1,7 +1,8 @@
<?php <?php
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -88,7 +89,8 @@ function contact_prepare_head(Contact $object)
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{ {
$type = 4; require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_CONTACT;
$head[$tab][0] = DOL_URL_ROOT.'/categories/categorie.php?id='.$object->id."&type=".$type; $head[$tab][0] = DOL_URL_ROOT.'/categories/categorie.php?id='.$object->id."&type=".$type;
$head[$tab][1] = $langs->trans('Categories'); $head[$tab][1] = $langs->trans('Categories');
$head[$tab][2] = 'category'; $head[$tab][2] = 'category';

View File

@ -789,14 +789,15 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
if ($displaytab > $limittoshow) if ($displaytab > $limittoshow)
{ {
$out.='<div id="moretabs" class="inline-block tabsElem">'; $tabsname=str_replace ("@", "", $picto);
$out.='<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">';
$out.='<a href="" data-role="button" style="background-color: #f0f0f0;" class="tab inline-block">'.$langs->trans("More").'...</a>'; $out.='<a href="" data-role="button" style="background-color: #f0f0f0;" class="tab inline-block">'.$langs->trans("More").'...</a>';
$out.='<div id="moretabsList" style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div>'; $out.='<div id="moretabsList'.$tabsname.'" style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div>';
$out.="</div>\n"; $out.="</div>\n";
$out.="<script>"; $out.="<script>";
$out.="$('#moretabs').mouseenter( function() { $('#moretabsList').css('left','auto');});"; $out.="$('#moretabs".$tabsname.").mouseenter( function() { $('#moretabsList".$tabsname.").css('left','auto');});";
$out.="$('#moretabs').mouseleave( function() { $('#moretabsList').css('left','-999em');});"; $out.="$('#moretabs".$tabsname.").mouseleave( function() { $('#moretabsList".$tabsname.").css('left','-999em');});";
$out.="</script>"; $out.="</script>";
} }
@ -4974,21 +4975,22 @@ function dol_getmypid()
/** /**
* Generate natural SQL search string * Generate natural SQL search string for a criteria (this criteria can be tested on one or several fields)
* *
* @param string|string[] $fields String or array of strings, filled with the name of fields in the SQL query * @param string|string[] $fields String or array of strings, filled with the name of all fields in the SQL query we must check (combined with a OR)
* @param string $value The value to look for. * @param string $value The value to look for.
* If param $numeric is 0, can contains several keywords separated with a space, like "keyword1 keyword2" = We want record field like keyword1 and field like keyword2 * If param $mode is 0, can contains several keywords separated with a space, like "keyword1 keyword2" = We want record field like keyword1 and field like keyword2
* If param $numeric is 1, can contains an operator <>= like "<10" or ">=100.5 < 1000" * If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
* @param integer $numeric 0=value is list of keywords, 1=value is a numeric test * If param $mode is 2, can contains a list of id separated by comma like "1,3,4"
* @param integer $mode 0=value is list of keywords, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
* @param integer $nofinaland 1=Do now output the final 'AND' * @param integer $nofinaland 1=Do now output the final 'AND'
* @return string $res The statement to append to the SQL query * @return string $res The statement to append to the SQL query
*/ */
function natural_search($fields, $value, $numeric=0, $nofinaland=0) function natural_search($fields, $value, $mode=0, $nofinaland=0)
{ {
global $db,$langs; global $db,$langs;
if ($numeric) if ($mode == 1)
{ {
$value=preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do $value=preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
} }
@ -5005,7 +5007,7 @@ function natural_search($fields, $value, $numeric=0, $nofinaland=0)
$newres = ''; $newres = '';
foreach ($fields as $field) foreach ($fields as $field)
{ {
if ($numeric) if ($mode == 1)
{ {
$operator='='; $operator='=';
$newcrit = preg_replace('/([<>=]+)/','',trim($crit)); $newcrit = preg_replace('/([<>=]+)/','',trim($crit));
@ -5029,8 +5031,13 @@ function natural_search($fields, $value, $numeric=0, $nofinaland=0)
$i2++; // a criteria was added to string $i2++; // a criteria was added to string
} }
} }
else else if ($mode == 2)
{ {
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $db->escape(trim($crit)) . ")";
$i2++; // a criteria was added to string
}
else
{
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . " LIKE '%" . $db->escape(trim($crit)) . "%'"; $newres .= ($i2 > 0 ? ' OR ' : '') . $field . " LIKE '%" . $db->escape(trim($crit)) . "%'";
$i2++; // a criteria was added to string $i2++; // a criteria was added to string
} }

View File

@ -637,10 +637,21 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
//$date=dol_mktime(12, 0, 0, 1, 1, 1900); //$date=dol_mktime(12, 0, 0, 1, 1, 1900);
//$date=dol_stringtotime('20130101'); //$date=dol_stringtotime('20130101');
$hasglobalcounter=false;
// Extract value for mask counter, mask raz and mask offset // Extract value for mask counter, mask raz and mask offset
if (! preg_match('/\{(0+)([@\+][0-9\-\+\=]+)?([@\+][0-9\-\+\=]+)?\}/i',$mask,$reg)) return 'ErrorBadMask'; if (preg_match('/\{(0+)([@\+][0-9\-\+\=]+)?([@\+][0-9\-\+\=]+)?\}/i',$mask,$reg))
$masktri=$reg[1].(! empty($reg[2])?$reg[2]:'').(! empty($reg[3])?$reg[3]:''); {
$maskcounter=$reg[1]; $masktri=$reg[1].(! empty($reg[2])?$reg[2]:'').(! empty($reg[3])?$reg[3]:'');
$maskcounter=$reg[1];
$hasglobalcounter=true;
}
else
{
// setting some defaults so the rest of the code won't fail if there is a third party counter
$masktri='00000';
$maskcounter='00000';
}
$maskraz=-1; $maskraz=-1;
$maskoffset=0; $maskoffset=0;
$resetEveryMonth=false; $resetEveryMonth=false;
@ -660,6 +671,12 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
} }
else $maskrefclient=''; else $maskrefclient='';
// fail if there is neither a global nor a third party counter
if (! $hasglobalcounter && ($maskrefclient_maskcounter == ''))
{
return 'ErrorBadMask';
}
// Extract value for third party type // Extract value for third party type
if (preg_match('/\{(t+)\}/i',$mask,$regType)) if (preg_match('/\{(t+)\}/i',$mask,$regType))
{ {
@ -993,10 +1010,21 @@ function check_value($mask,$value)
{ {
$result=0; $result=0;
$hasglobalcounter=false;
// Extract value for mask counter, mask raz and mask offset // Extract value for mask counter, mask raz and mask offset
if (! preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$mask,$reg)) return 'ErrorBadMask'; if (preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$mask,$reg))
$masktri=$reg[1].(isset($reg[2])?$reg[2]:'').(isset($reg[3])?$reg[3]:''); {
$maskcounter=$reg[1]; $masktri=$reg[1].(isset($reg[2])?$reg[2]:'').(isset($reg[3])?$reg[3]:'');
$maskcounter=$reg[1];
$hasglobalcounter=true;
}
else
{
// setting some defaults so the rest of the code won't fail if there is a third party counter
$masktri='00000';
$maskcounter='00000';
}
$maskraz=-1; $maskraz=-1;
$maskoffset=0; $maskoffset=0;
if (dol_strlen($maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits'; if (dol_strlen($maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits';
@ -1015,6 +1043,12 @@ function check_value($mask,$value)
} }
else $maskrefclient=''; else $maskrefclient='';
// fail if there is neither a global nor a third party counter
if (! $hasglobalcounter && ($maskrefclient_maskcounter == ''))
{
return 'ErrorBadMask';
}
$maskwithonlyymcode=$mask; $maskwithonlyymcode=$mask;
$maskwithonlyymcode=preg_replace('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$maskcounter,$maskwithonlyymcode); $maskwithonlyymcode=preg_replace('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$maskcounter,$maskwithonlyymcode);
$maskwithonlyymcode=preg_replace('/\{dd\}/i','dd',$maskwithonlyymcode); $maskwithonlyymcode=preg_replace('/\{dd\}/i','dd',$maskwithonlyymcode);

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -70,7 +71,9 @@ function member_prepare_head(Adherent $object)
// Show category tab // Show category tab
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{ {
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=3'; require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_MEMBER;
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
$head[$h][1] = $langs->trans('Categories'); $head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category'; $head[$h][2] = 'category';
$h++; $h++;

View File

@ -6,7 +6,7 @@
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* *
@ -1099,7 +1099,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categstatic=new Categorie($db); $categstatic=new Categorie($db);
// recovering the list of all the categories linked to product // recovering the list of all the categories linked to product
$tblcateg=$categstatic->containing($idprod,0); $tblcateg=$categstatic->containing($idprod, Categorie::TYPE_PRODUCT);
foreach ($tblcateg as $cate) foreach ($tblcateg as $cate)
{ {
// Adding the descriptions if they are filled // Adding the descriptions if they are filled

View File

@ -1,7 +1,8 @@
<?php <?php
/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -60,7 +61,9 @@ function product_prepare_head($object)
/* No more required. Replaced with new multiselect component /* No more required. Replaced with new multiselect component
if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire)
{ {
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=0'; require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_PRODUCT;
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
$head[$h][1] = $langs->trans('Categories'); $head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category'; $head[$h][2] = 'category';
$h++; $h++;

View File

@ -583,11 +583,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$langs->load("commercial"); $langs->load("commercial");
$newmenu->add("/comm/prospect/list.php?leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); $newmenu->add("/comm/prospect/list.php?leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects');
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire); if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire);
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire); if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire);
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire); if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;search_stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire);
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire); if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire);
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire); if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&amp;sortorder=desc&amp;begin=&amp;search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire);
$newmenu->add("/societe/soc.php?leftmenu=prospects&amp;action=create&amp;type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer); $newmenu->add("/societe/soc.php?leftmenu=prospects&amp;action=create&amp;type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer);
//$newmenu->add("/contact/list.php?leftmenu=customers&amp;type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); //$newmenu->add("/contact/list.php?leftmenu=customers&amp;type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire);

View File

@ -6,6 +6,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2009-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2009-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr> * Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -90,6 +91,7 @@ class modAgenda extends DolibarrModules
$this->const[12] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE","chaine","1"); $this->const[12] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE","chaine","1");
$this->const[13] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL","chaine","1"); $this->const[13] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL","chaine","1");
$this->const[14] = array("MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE","chaine","1"); $this->const[14] = array("MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE","chaine","1");
$this->const[15] = array("MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_UNVALIDATE","chaine","1");
// New pages on tabs // New pages on tabs
// ----------------- // -----------------

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> /* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -164,6 +164,8 @@ $userstatic=new User($db);
</div> </div>
<div class="tagtd"> <div class="tagtd">
<?php <?php
$statusofcontact = $tab[$i]['status'];
if ($tab[$i]['source']=='internal') if ($tab[$i]['source']=='internal')
{ {
$userstatic->id=$tab[$i]['id']; $userstatic->id=$tab[$i]['id'];
@ -182,24 +184,24 @@ $userstatic=new User($db);
</div> </div>
<div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div> <div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div>
<div class="tagtd" align="center"> <div class="tagtd" align="center">
<?php if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; ?> <?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; ?>
<?php <?php
if ($tab[$i]['source']=='internal') if ($tab[$i]['source']=='internal')
{ {
$userstatic->id=$tab[$i]['id']; $userstatic->id=$tab[$i]['id'];
$userstatic->lastname=$tab[$i]['lastname']; $userstatic->lastname=$tab[$i]['lastname'];
$userstatic->firstname=$tab[$i]['firstname']; $userstatic->firstname=$tab[$i]['firstname'];
//echo $userstatic->LibStatut($tab[$i]['status'],3); echo $userstatic->LibStatut($tab[$i]['statuscontact'],3);
} }
if ($tab[$i]['source']=='external') if ($tab[$i]['source']=='external')
{ {
$contactstatic->id=$tab[$i]['id']; $contactstatic->id=$tab[$i]['id'];
$contactstatic->lastname=$tab[$i]['lastname']; $contactstatic->lastname=$tab[$i]['lastname'];
$contactstatic->firstname=$tab[$i]['firstname']; $contactstatic->firstname=$tab[$i]['firstname'];
echo $contactstatic->LibStatut($tab[$i]['status'],3); echo $contactstatic->LibStatut($tab[$i]['statuscontact'],3);
} }
?> ?>
<?php if ($object->statut >= 0) echo '</a>'; ?> <?php //if ($object->statut >= 0) echo '</a>'; ?>
</div> </div>
<div class="tagtd nowrap" align="right"> <div class="tagtd nowrap" align="right">
<?php if ($permission) { ?> <?php if ($permission) { ?>

View File

@ -4,6 +4,7 @@
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cedric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -493,6 +494,18 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref)); $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
}
elseif ($action == 'BILL_SUPPLIER_UNVALIDATE')
{
$langs->load("other");
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0; $object->sendtoid=0;
} }
elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL') elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL')

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -197,6 +198,7 @@ class InterfaceDemo extends DolibarrTriggers
case 'BILL_SUPPLIER_PAYED': case 'BILL_SUPPLIER_PAYED':
case 'BILL_SUPPLIER_UNPAYED': case 'BILL_SUPPLIER_UNPAYED':
case 'BILL_SUPPLIER_VALIDATE': case 'BILL_SUPPLIER_VALIDATE':
case 'BILL_SUPPLIER_UNVALIDATE':
case 'LINEBILL_SUPPLIER_CREATE': case 'LINEBILL_SUPPLIER_CREATE':
case 'LINEBILL_SUPPLIER_UPDATE': case 'LINEBILL_SUPPLIER_UPDATE':
case 'LINEBILL_SUPPLIER_DELETE': case 'LINEBILL_SUPPLIER_DELETE':

View File

@ -85,7 +85,7 @@ print '<table width="100%" class="notopnoleftnoright">';
print '<tr><td class="notopnoleft" width="30%" valign="top">'; print '<tr><td class="notopnoleft" width="30%" valign="top">';
print '<table class="noborder" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4">'.$langs->trans("Statistics").'</td>'; print '<td colspan="4">'.$langs->trans("Statistics").'</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -20,7 +21,6 @@
* \file htdocs/ecm/docdir.php * \file htdocs/ecm/docdir.php
* \ingroup ecm * \ingroup ecm
* \brief Main page for ECM section area * \brief Main page for ECM section area
* \author Laurent Destailleur
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -155,6 +155,8 @@ if ($action == 'create')
$title=$langs->trans("ECMNewSection"); $title=$langs->trans("ECMNewSection");
print_fiche_titre($title); print_fiche_titre($title);
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Label // Label
@ -175,6 +177,8 @@ if ($action == 'create')
print '</table><br>'; print '</table><br>';
dol_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="create" value="'.$langs->trans("Create").'">'; print '<input type="submit" class="button" name="create" value="'.$langs->trans("Create").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';

View File

@ -8,6 +8,7 @@
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -1073,7 +1074,14 @@ class FactureFournisseur extends CommonInvoice
} }
} }
} }
// Triggers call
if (! $error && empty($notrigger))
{
// Call trigger
$result=$this->call_trigger('BILL_SUPPLIER_VALIDATE',$user);
if ($result < 0) $error++;
// End call triggers
}
if ($error == 0) if ($error == 0)
{ {
$this->db->commit(); $this->db->commit();

View File

@ -114,7 +114,7 @@ if ($resql)
} }
$db->free($resql); $db->free($resql);
print '<table class="noborder" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'</td></tr>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'</td></tr>';
print "</tr>\n"; print "</tr>\n";
foreach (array(0,1,2,3,4,5,6) as $statut) foreach (array(0,1,2,3,4,5,6) as $statut)

View File

@ -1,9 +1,10 @@
<?php <?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -167,8 +168,9 @@ if ($resql)
$moreforfilter=''; $moreforfilter='';
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(1,$search_categ,'search_categ',1); $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_SUPPLIER,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
} }
if ($moreforfilter) if ($moreforfilter)

View File

@ -1,175 +0,0 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/fourn/product/categorie.php
* \ingroup product
* \brief Page of products categories
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("categories");
$mesg = '';
if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden();
/*
* Creation de l'objet produit correspondant a l'id
*/
if ($_GET["id"])
{
$product = new Product($db);
$result = $product->fetch($_GET["id"]);
}
llxHeader("","",$langs->trans("CardProduct0"));
/*
* Fiche produit
*/
if ($_GET["id"])
{
//on veut supprimer une cat<61>gorie
if ($_REQUEST["cat"])
{
$cat = new Categorie($db);
$cat->del_product($product);
}
//on veut ajouter une cat<61>gorie
if (isset($_REQUEST["add_cat"]) && $_REQUEST["add_cat"]>=0)
{
$cat = new Categorie($db);
$cat->add_product($product);
}
if ( $result )
{
/*
* En mode visu
*/
$h=0;
$head[$h][0] = DOL_URL_ROOT."/fourn/product/card.php?id=".$product->id;
$head[$h][1] = $langs->trans("Card");
$h++;
if (! empty($conf->stock->enabled))
{
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id;
$head[$h][1] = $langs->trans("Stock");
$h++;
}
if (! empty($conf->fournisseur->enabled))
{
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id;
$head[$h][1] = $langs->trans("Suppliers");
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id;
$head[$h][1] = $langs->trans("Photos");
$h++;
$head[$h][0] = DOL_URL_ROOT."/product/stats/card.php?id=".$product->id;
$head[$h][1] = $langs->trans('Statistics');
$h++;
//affichage onglet cat<61>gorie
if (! empty($conf->categorie->enabled)){
$head[$h][0] = DOL_URL_ROOT."/fourn/product/categorie.php?id=".$product->id;
$head[$h][1] = $langs->trans('Categories');
$hselected = $h;
$h++;
}
dol_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
print($mesg);
print '<table class="border" width="100%">';
print "<tr>";
print '<td>'.$langs->trans("Ref").'</td><td>'.$product->ref.'</td>';
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->label.'</td>';
print "</table><br>\n";
$c = new Categorie($db);
$cats = $c->containing($_REQUEST['id'],0);
if (count($cats) > 0)
{
print "Vous avez stock<63> le produit dans les cat<61>gorie suivantes:<br/><br/>";
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("AllWays").'</td></tr>';
foreach ($cats as $cat)
{
$ways = $cat->print_all_ways();
foreach ($ways as $way)
{
$i = !$i;
print "<tr ".$bc[$i]."><td>".$way."</td>";
print "<td><a href= '".DOL_URL_ROOT."/fourn/product/categorie.php?id=".$product->id."&amp;cat=".$cat->id."'>".$langs->trans("DeleteFromCat")."</a></td></tr>\n";
}
}
print "</table><br/><br/>\n";
}
else if($cats < 0)
{
print $langs->trans("ErrorUnknown");
}
else
{
print $langs->trans("NoCat")."<br/><br/>";
}
}
print $langs->trans("AddProductToCat")."<br/><br/>";
print '<table class="border" width="100%">';
print '<form method="POST" action="'.DOL_URL_ROOT.'/fourn/product/categorie.php?id='.$product->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<tr><td><select name='add_cat'><option value='-1'>".$langs->trans("Choose")."</option>";
$cat = new Categorie($db);
foreach ($cat->get_all_categories() as $categorie)
{
print "<option value='".$categorie->id."'>".$categorie->label."</option>\n";
}
print "</select></td><td><input type='submit' value='".$langs->trans("Select")."'></td></tr>";
print "</form></table><br/>";
}
$db->close();
llxFooter();

View File

@ -1,153 +0,0 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/product/index.php
* \ingroup product
* \brief Page accueil des produits et services
*/
require '../../main.inc.php';
// Security check
if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden();
/*
* View
*/
llxHeader("","",$langs->trans("ProductsAndServices"));
print_fiche_titre($langs->trans("ProductsAndServicesArea"));
print '<table border="0" width="100%">';
print '<tr><td valign="top" width="30%">';
/*
* Zone recherche produit/service
*/
print '<form method="post" action="list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">';
print "<tr class=\"liste_titre\">\n";
print '<td colspan="3">'.$langs->trans("Search").'</td></tr>';
print "<tr ".$bc[false]."><td>";
print $langs->trans("Ref").' :</td><td><input class="flat" type="text" size="20" name="sf_ref"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print "<tr ".$bc[false]."><td>";
print $langs->trans("Label").' :</td><td><input class="flat" type="text" size="20" name="snom"></td><td><input class="button" type="submit" value="'.$langs->trans("Search").'"></td></tr>';
print "</table></form><br>\n";
/*
* Nombre de produits et/ou services
*/
$prodser = array();
$sql = "SELECT count(*), p.fk_product_type";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " GROUP BY p.fk_product_type";
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$row = $db->fetch_row($resql);
$prodser[$row[1]] = $row[0];
$i++;
}
$db->free($resql);
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
if (! empty($conf->product->enabled))
{
print "<tr $bc[0]>";
print '<td><a href="list.php?type=0">'.$langs->trans("Products").'</a></td><td>'.round($prodser[0]).'</td>';
print "</tr>";
}
if (! empty($conf->service->enabled))
{
print "<tr $bc[1]>";
print '<td><a href="list.php?type=1">'.$langs->trans("Services").'</a></td><td>'.round($prodser[1]).'</td>';
print "</tr>";
}
print '</table>';
print '</td><td valign="top" width="70%">';
/*
* Derniers produits en vente
*/
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.type";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p ";
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " AND p.fk_product_type <> 1";
$sql.= " ORDER BY p.datec DESC ";
$sql.= $db->plimit(15, 0);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
if ($num > 0)
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("LastProducts").'</td></tr>';
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td><a href=\"card.php?id=$objp->rowid\">";
if ($objp->fk_product_type==1) print img_object($langs->trans("ShowService"),"service");
else print img_object($langs->trans("ShowProduct"),"product");
print "</a> <a href=\"card.php?id=$objp->rowid\">$objp->ref</a></td>\n";
print "<td>$objp->label</td>";
print "<td>";
if ($objp->fk_product_type==1) print $langs->trans('ShowService');
else print $langs->trans('ShowProduct');
print "</td></tr>\n";
$i++;
}
$db->free($resql);
print "</table>";
}
}
else
{
dol_print_error();
}
print '</td></tr></table>';
$db->close();
llxFooter();

View File

@ -1,215 +0,0 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/fourn/product/photos.php
* \ingroup product
* \brief Page de la fiche produit
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$id = GETPOST('id', 'int');
if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden();
$object = new Product($db);
/*
* View
*/
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($id)
{
$result = $object->fetch($id);
$object->add_photo($conf->product->multidir_output[$object->entity], $_FILES['photofile']);
}
}
/*
*
*/
llxHeader("","",$langs->trans("CardProduct0"));
/*
* Fiche produit
*/
if ($id)
{
$result = $object->fetch($id);
if ( $result )
{
/*
* En mode visu
*/
$h=0;
$head[$h][0] = DOL_URL_ROOT."/fourn/product/card.php?id=".$object->id;
$head[$h][1] = $langs->trans("Card");
$h++;
if (! empty($conf->stock->enabled))
{
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id;
$head[$h][1] = $langs->trans("Stock");
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/fourn/product/photos.php?id=".$object->id;
$head[$h][1] = $langs->trans("Photos");
$hselected = $h;
$h++;
//Affichage onglet Categories
if (! empty($conf->categorie->enabled)){
$head[$h][0] = DOL_URL_ROOT."/fourn/product/categorie.php?id=".$object->id;
$head[$h][1] = $langs->trans('Categories');
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/product/card.php?id=".$object->id;
$head[$h][1] = $langs->trans("CommercialCard");
$h++;
dol_fiche_head($head, $hselected, $langs->trans("CardProduct".$object->type).' : '.$object->ref);
print($mesg);
print '<table class="border" width="100%">';
print "<tr>";
print '<td>'.$langs->trans("Ref").'</td><td>'.$object->ref.'</td>';
print '<td colspan="2">';
print $object->getLibStatut(2);
print '</td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td>';
print '<td>'.$langs->trans("SellingPrice").'</td><td>'.price($object->price).'</td></tr>';
print "</table><br>\n";
/*
* Ajouter une photo
*
*/
if ($action == 'ajout_photo' && ($user->rights->produit->creer || $user->rights->service->creer) && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
print_titre($langs->trans("AddPhoto"));
print '<form name="userfile" action="photos.php?id='.$object->id.'" enctype="multipart/form-data" METHOD="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<table class="border" width="100%"><tr>';
print '<td>'.$langs->trans("File").'</td>';
print '<td><input type="file" name="photofile"></td></tr>';
print '<tr><td colspan="4" align="center">';
print '<input type="submit" name="sendit" value="'.$langs->trans("Save").'">&nbsp;';
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
print '</table>';
print '</form><br>';
}
// Affiche photos
if ($action != 'ajout_photo')
{
$nbphoto=0;
$nbbyrow=5;
$pdir = get_exdir($object->id,2,0,0,$object,'product') . $object->id ."/photos/";
$dir = $conf->product->multidir_output[$object->entity] . '/'. $pdir;
print '<br><table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';
foreach ($object->liste_photos($dir) as $obj)
{
$nbphoto++;
// if ($nbbyrow && $nbphoto == 1) print '<table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';
if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print '<tr align=center valign=middle border=1>';
if ($nbbyrow) print '<td width="'.ceil(100/$nbbyrow).'%" class="photo">';
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.urlencode($pdir.$obj['photo']).'" alt="Taille origine" target="_blank">';
// Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine
if ($obj['photo_vignette']) $filename=$obj['photo_vignette'];
else $filename=$obj['photo'];
print '<img border="0" height="120" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.urlencode($pdir.$filename).'">';
print '</a>';
print '<br>'.$langs->trans("File").': '.dol_trunc($filename,16);
if ($user->rights->produit->creer || $user->rights->service->creer)
{
print '<br><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete&amp;file='.urlencode($pdir.$filename).'">'.img_delete().'</a>';
}
if ($nbbyrow) print '</td>';
if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print '</tr>';
}
// Ferme tableau
while ($nbphoto % $nbbyrow)
{
print '<td width="'.ceil(100/$nbbyrow).'%">&nbsp;</td>';
$nbphoto++;
}
if ($nbphoto < 1)
{
print '<tr align=center valign=middle border=1><td class="photo">';
print "<br>".$langs->trans("NoPhotoYet")."<br><br>";
print '</td></tr></table>';
}
print '</table>';
}
print "</div>\n";
}
print "\n<div class=\"tabsAction\">\n";
if ($action == '')
{
if (($user->rights->produit->creer || $user->rights->service->creer) && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=ajout_photo&amp;id='.$object->id.'">';
print $langs->trans("AddPhoto").'</a>';
}
}
print "\n</div>\n";
}
else
{
print $langs->trans("ErrorUnknown");
}
llxFooter();
$db->close();

View File

@ -154,7 +154,7 @@ table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }
margin: 0 3px; margin: 0 3px;
cursor: pointer; cursor: pointer;
*cursor: hand; *cursor: hand;
color: #333 !important; /* DOL_LDR CHANGE color: #333 !important; */
} }
.paging_full_numbers a.paginate_button { .paging_full_numbers a.paginate_button {

View File

@ -328,8 +328,9 @@ if (! empty($force_install_message))
$option.='>'; $option.='>';
$option.=$type.'&nbsp; &nbsp;'; $option.=$type.'&nbsp; &nbsp;';
if ($note) $option.=' '.$note; if ($note) $option.=' '.$note;
// Experimental // Deprecated and experimental
if ($type=='mssql') $option.=' '.$langs->trans("Experimental"); if ($type=='mysql') $option.=' ' . $langs->trans("Deprecated");
elseif ($type=='mssql') $option.=' '.$langs->trans("Experimental");
elseif ($type=='sqlite') $option.=' '.$langs->trans("Experimental"); elseif ($type=='sqlite') $option.=' '.$langs->trans("Experimental");
elseif ($type=='sqlite3') $option.=' '.$langs->trans("Experimental"); elseif ($type=='sqlite3') $option.=' '.$langs->trans("Experimental");
// No available // No available

View File

@ -8,6 +8,7 @@
-- Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> -- Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
-- Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr> -- Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
-- Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> -- Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
-- Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -74,3 +75,4 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',35); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',35);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',36); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',36);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_UNVALIDATE', 'Supplier invoice unvalidated', 'Executed when a supplier invoice status is set back to draft', 'invoice_supplier',15);

View File

@ -625,17 +625,24 @@ ALTER TABLE llx_user ADD gender VARCHAR(10);
ALTER TABLE llx_user ADD api_key VARCHAR(128) DEFAULT NULL AFTER pass_temp; ALTER TABLE llx_user ADD api_key VARCHAR(128) DEFAULT NULL AFTER pass_temp;
ALTER TABLE llx_user ADD INDEX idx_user_api_key (api_key); ALTER TABLE llx_user ADD INDEX idx_user_api_key (api_key);
-- Deprecated fields
ALTER TABLE llx_actioncomm DROP COLUMN datea;
ALTER TABLE llx_actioncomm DROP INDEX idx_actioncomm_datea;
ALTER TABLE llx_actioncomm DROP COLUMN datea2;
-- Email tracking
ALTER TABLE llx_actioncomm ADD COLUMN email_msgid varchar(256); ALTER TABLE llx_actioncomm ADD COLUMN email_msgid varchar(256);
ALTER TABLE llx_actioncomm ADD COLUMN email_from varchar(256); ALTER TABLE llx_actioncomm ADD COLUMN email_from varchar(256);
ALTER TABLE llx_actioncomm ADD COLUMN email_sender varchar(256); ALTER TABLE llx_actioncomm ADD COLUMN email_sender varchar(256);
ALTER TABLE llx_actioncomm ADD COLUMN email_to varchar(256); ALTER TABLE llx_actioncomm ADD COLUMN email_to varchar(256);
ALTER TABLE llx_actioncomm ADD COLUMN errors_to varchar(256); ALTER TABLE llx_actioncomm ADD COLUMN errors_to varchar(256);
-- Recuring events
ALTER TABLE llx_actioncomm ADD COLUMN recurid varchar(128); ALTER TABLE llx_actioncomm ADD COLUMN recurid varchar(128);
ALTER TABLE llx_actioncomm ADD COLUMN recurrule varchar(128); ALTER TABLE llx_actioncomm ADD COLUMN recurrule varchar(128);
ALTER TABLE llx_actioncomm ADD COLUMN ecurdateend datetime; ALTER TABLE llx_actioncomm ADD COLUMN recurdateend datetime;
ALTER TABLE llx_stcomm ADD COLUMN picto varchar(128); ALTER TABLE llx_stcomm ADD COLUMN picto varchar(128);
-- New trigger for Supplier invoice unvalidation
INSERT INTO llx_c_action_trigger (code, label, description, elementtype, rang) VALUES ('BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15);

View File

@ -18,7 +18,6 @@
-- =========================================================================== -- ===========================================================================
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_datea (datea);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_soc (fk_soc); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_soc (fk_soc);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_contact (fk_contact); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_contact (fk_contact);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_code (code); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_code (code);

View File

@ -946,7 +946,7 @@ DoNotSuggestPaymentMode=Do not suggest
NoActiveBankAccountDefined=No active bank account defined NoActiveBankAccountDefined=No active bank account defined
OwnerOfBankAccount=Owner of bank account %s OwnerOfBankAccount=Owner of bank account %s
BankModuleNotActive=Bank accounts module not enabled BankModuleNotActive=Bank accounts module not enabled
ShowBugTrackLink=Show link "Report a bug" ShowBugTrackLink=Show link "<strong>%s</strong>"
ShowWorkBoard=Show "workbench" on homepage ShowWorkBoard=Show "workbench" on homepage
Alerts=Alerts Alerts=Alerts
Delays=Delays Delays=Delays

View File

@ -64,6 +64,7 @@ DatabaseSuperUserAccess=Database server - Superuser access
CheckToCreateDatabase=Check box if database does not exist and must be created.<br>In this case, you must fill the login/password for superuser account at the bottom of this page. CheckToCreateDatabase=Check box if database does not exist and must be created.<br>In this case, you must fill the login/password for superuser account at the bottom of this page.
CheckToCreateUser=Check box if database owner does not exist and must be created.<br>In this case, you must choose its login and password and also fill the login/password for the superuser account at the bottom of this page. If this box is unchecked, owner database and its passwords must exists. CheckToCreateUser=Check box if database owner does not exist and must be created.<br>In this case, you must choose its login and password and also fill the login/password for the superuser account at the bottom of this page. If this box is unchecked, owner database and its passwords must exists.
Experimental=(experimental) Experimental=(experimental)
Deprecated=(deprecated)
DatabaseRootLoginDescription=Login of the user allowed to create new databases or new users, mandatory if your database or its owner does not already exists. DatabaseRootLoginDescription=Login of the user allowed to create new databases or new users, mandatory if your database or its owner does not already exists.
KeepEmptyIfNoPassword=Leave empty if user has no password (avoid this) KeepEmptyIfNoPassword=Leave empty if user has no password (avoid this)
SaveConfigurationFile=Save values SaveConfigurationFile=Save values

View File

@ -1004,39 +1004,38 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<!-- Includes CSS for JQuery (Ajax library) -->'."\n"; print '<!-- Includes CSS for JQuery (Ajax library) -->'."\n";
$jquerytheme = 'smoothness'; $jquerytheme = 'smoothness';
if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext?'?'.$ext:'').'" />'."\n"; // JQuery if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext?'?'.$ext:'').'">'."\n"; // JQuery
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css'.($ext?'?'.$ext:'').'" />'."\n"; // JQuery else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css'.($ext?'?'.$ext:'').'">'."\n"; // JQuery
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/tipTip.css'.($ext?'?'.$ext:'').'" />'."\n"; // Tooltip print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/tipTip.css'.($ext?'?'.$ext:'').'">'."\n"; // Tooltip
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css'.($ext?'?'.$ext:'').'" />'."\n"; // JNotify print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css'.($ext?'?'.$ext:'').'">'."\n"; // JNotify
/*if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || (defined('REQUIRE_JQUERY_FILEUPLOAD') && constant('REQUIRE_JQUERY_FILEUPLOAD'))) // jQuery fileupload /*if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || (defined('REQUIRE_JQUERY_FILEUPLOAD') && constant('REQUIRE_JQUERY_FILEUPLOAD'))) // jQuery fileupload
{ {
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/css/jquery.fileupload-ui.css'.($ext?'?'.$ext:'').'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/css/jquery.fileupload-ui.css'.($ext?'?'.$ext:'').'">'."\n";
}*/ }*/
if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || (defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES'))) // jQuery datatables if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || (defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES'))) // jQuery datatables
{ {
//print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/css/jquery.dataTables.css'.($ext?'?'.$ext:'').'" />'."\n"; //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/css/jquery.dataTables.css'.($ext?'?'.$ext:'').'">'."\n";
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/css/jquery.dataTables_jui.css'.($ext?'?'.$ext:'').'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/css/jquery.dataTables_jui.css'.($ext?'?'.$ext:'').'">'."\n";
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColReorder/css/ColReorder.css'.($ext?'?'.$ext:'').'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColReorder/css/ColReorder.css'.($ext?'?'.$ext:'').'">'."\n";
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColVis/css/ColVis.css'.($ext?'?'.$ext:'').'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColVis/css/ColVis.css'.($ext?'?'.$ext:'').'">'."\n";
//print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColVis/css/ColVisAlt.css'.($ext?'?'.$ext:'').'" />'."\n"; //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColVis/css/ColVisAlt.css'.($ext?'?'.$ext:'').'">'."\n";
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/TableTools/css/TableTools.css'.($ext?'?'.$ext:'').'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/TableTools/css/TableTools.css'.($ext?'?'.$ext:'').'">'."\n";
} }
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) // jQuery plugin "mutiselect", "multiple-select", "select2"... if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) // jQuery plugin "mutiselect", "multiple-select", "select2"...
{ {
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT; $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/'.$tmpplugin.'.css'.($ext?'?'.$ext:'').'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/'.$tmpplugin.'.css'.($ext?'?'.$ext:'').'">'."\n";
} }
// jQuery Timepicker // jQuery Timepicker
if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER'))
{ {
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.css'.($ext?'?'.$ext:'').'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.css'.($ext?'?'.$ext:'').'">'."\n";
} }
// jQuery jMobile // jQuery jMobile
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile)) if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile))
{ {
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css'.($ext?'?'.$ext:'').'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css'.($ext?'?'.$ext:'').'">'."\n";
} }
} }
print '<!-- Includes CSS for Dolibarr theme -->'."\n"; print '<!-- Includes CSS for Dolibarr theme -->'."\n";
@ -1065,7 +1064,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
if (GETPOST('dol_no_mouse_hover')) { $themeparam.='&dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover','int'); } if (GETPOST('dol_no_mouse_hover')) { $themeparam.='&dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover','int'); }
if (GETPOST('dol_use_jmobile')) { $themeparam.='&dol_use_jmobile='.GETPOST('dol_use_jmobile','int'); $conf->dol_use_jmobile=GETPOST('dol_use_jmobile','int'); } if (GETPOST('dol_use_jmobile')) { $themeparam.='&dol_use_jmobile='.GETPOST('dol_use_jmobile','int'); $conf->dol_use_jmobile=GETPOST('dol_use_jmobile','int'); }
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit; //print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n"; print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n";
if (! empty($conf->global->MAIN_FIX_FLASH_ON_CHROME)) print '<!-- Includes CSS that does not exists as workaround of flash bug of chrome -->'."\n".'<link rel="stylesheet" type="text/css" href="filethatdoesnotexiststosolvechromeflashbug">'."\n";
// CSS forced by modules (relative url starting with /) // CSS forced by modules (relative url starting with /)
if (! empty($conf->modules_parts['css'])) if (! empty($conf->modules_parts['css']))
@ -1078,7 +1078,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
{ {
if (empty($cssfile)) dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING); if (empty($cssfile)) dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING);
// cssfile is a relative path // cssfile is a relative path
print '<!-- Includes CSS added by module '.$modcss. ' -->'."\n".'<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1); print '<!-- Includes CSS added by module '.$modcss. ' -->'."\n".'<link rel="stylesheet" type="text/css" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used. // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam; if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '">'."\n"; print '">'."\n";

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -135,6 +136,8 @@ print_fiche_titre($langs->trans("CreatePoll").' (1 / 2)');
//debut du formulaire //debut du formulaire
print '<form name="formulaire" action="" method="POST">'."\n"; print '<form name="formulaire" action="" method="POST">'."\n";
dol_fiche_head();
//Affichage des différents champs textes a remplir //Affichage des différents champs textes a remplir
print '<table class="border" width="100%">'."\n"; print '<table class="border" width="100%">'."\n";
@ -158,6 +161,8 @@ print $form->select_date($champdatefin?$champdatefin:-1,'champdatefin','','','',
print '</tr>'."\n"; print '</tr>'."\n";
print '</table>'."\n"; print '</table>'."\n";
dol_fiche_end();
//focus javascript sur le premier champ //focus javascript sur le premier champ
print '<script type="text/javascript">'."\n"; print '<script type="text/javascript">'."\n";
print 'document.formulaire.titre.focus();'."\n"; print 'document.formulaire.titre.focus();'."\n";

View File

@ -11,7 +11,8 @@
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -974,7 +975,7 @@ else
// Categories // Categories
print '<tr><td valign="top">'.$langs->trans("Categories").'</td><td colspan="3">'; print '<tr><td valign="top">'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(0, '', 'parent', 64, 0, 1); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, 250); print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, 250);
print "</td></tr>"; print "</td></tr>";
@ -1265,9 +1266,9 @@ else
// Categories // Categories
print '<tr><td valign="top">'.$langs->trans("Categories").'</td><td colspan="3">'; print '<tr><td valign="top">'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(0, '', 'parent', 64, 0, 1); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
$c = new Categorie($db); $c = new Categorie($db);
$cats = $c->containing($object->id,0); $cats = $c->containing($object->id,Categorie::TYPE_PRODUCT);
foreach($cats as $cat) { foreach($cats as $cat) {
$arrayselected[] = $cat->id; $arrayselected[] = $cat->id;
} }

View File

@ -1,10 +1,11 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -326,106 +327,120 @@ if ($id > 0 || ! empty($ref))
$class='pair'; $class='pair';
foreach($prods_arbo as $value) if (count($prods_arbo))
{ {
$productstatic->id=$value['id']; foreach($prods_arbo as $value)
$productstatic->type=$value['type'];
$productstatic->label=$value['label'];
if ($value['level'] <= 1)
{ {
$class=($class=='impair')?'pair':'impair'; $productstatic->id=$value['id'];
print '<tr class="'.$class.'">'; $productstatic->type=$value['type'];
$productstatic->label=$value['label'];
$notdefined=0; if ($value['level'] <= 1)
$productstatic->ref=$value['ref'];
$nb_of_subproduct = $value['nb'];
print '<td>'.$productstatic->getNomUrl(1,'composition').'</td>';
print '<td>'.$productstatic->label.'</td>';
// Best buying price
print '<td align="right">';
if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0)
{ {
print ' &nbsp; '.$langs->trans("BuyingPriceMinShort").': '; $class=($class=='impair')?'pair':'impair';
if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(0,0); print '<tr class="'.$class.'">';
else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; }
$notdefined=0;
$productstatic->ref=$value['ref'];
$nb_of_subproduct = $value['nb'];
print '<td>'.$productstatic->getNomUrl(1,'composition').'</td>';
print '<td>'.$productstatic->label.'</td>';
// Best buying price
print '<td align="right">';
if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0)
{
print ' &nbsp; '.$langs->trans("BuyingPriceMinShort").': ';
if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(0,0);
else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; }
}
print '</td>';
$totalline=price2num($value['nb'] * $product_fourn->fourn_unitprice, 'MT');
$total+=$totalline;
print '<td align="right">';
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency));
print '</td>';
// Stock
if (! empty($conf->stock->enabled)) print '<td align="right">'.$value['stock'].'</td>'; // Real stock
// Qty + IncDec
if ($user->rights->produit->creer || $user->rights->service->creer)
{
print '<td align="center"><input type="text" value="'.$nb_of_subproduct.'" name="TProduct['.$productstatic->id.'][qty]" size="4" /></td>';
print '<td align="center"><input type="checkbox" name="TProduct['.$productstatic->id.'][incdec]" value="1" '.($value['incdec']==1?'checked':'' ).' /></td>';
}
else{
print '<td>'.$nb_of_subproduct.'</td>';
print '<td>'.($value['incdec']==1?'x':'' ).'</td>';
}
print '</tr>'."\n";
} }
print '</td>'; else // By default, we do not show this. It makes screen very difficult to understand
$totalline=price2num($value['nb'] * $product_fourn->fourn_unitprice, 'MT');
$total+=$totalline;
print '<td align="right">';
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency));
print '</td>';
// Stock
if (! empty($conf->stock->enabled)) print '<td align="right">'.$value['stock'].'</td>'; // Real stock
// Qty + IncDec
if ($user->rights->produit->creer || $user->rights->service->creer)
{ {
print '<td align="center"><input type="text" value="'.$nb_of_subproduct.'" name="TProduct['.$productstatic->id.'][qty]" size="4" /></td>'; $hide='';
print '<td align="center"><input type="checkbox" name="TProduct['.$productstatic->id.'][incdec]" value="1" '.($value['incdec']==1?'checked':'' ).' /></td>'; if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) $hide=' hideobject';
} $class=($class=='impair')?'pair':'impair';
else{ print '<tr class="'.$class.$hide.'" id="sub-'.$value['id_parent'].'">';
print '<td>'.$nb_of_subproduct.'</td>';
print '<td>'.($value['incdec']==1?'x':'' ).'</td>';
}
print '</tr>'."\n"; //$productstatic->ref=$value['label'];
$productstatic->ref=$value['ref'];
print '<td>';
for ($i=0; $i < $value['level']; $i++) print ' &nbsp; &nbsp; '; // Add indentation
print $productstatic->getNomUrl(1,'composition').'</td>';
print '<td>'.$productstatic->label.'</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
if (! empty($conf->stock->enabled)) print '<td></td>'; // Real stock
print '<td align="center">'.$value['nb'].'</td>';
print '<td>&nbsp;</td>';
print '</tr>'."\n";
}
} }
else // By default, we do not show this. It makes screen very difficult to understand
print '<tr class="liste_total">';
print '<td class="liste_total"></td>';
print '<td class="liste_total"></td>';
// Minimum buying price
print '<td class="liste_total" align="right">';
print $langs->trans("TotalBuyingPriceMin");
print '</td>';
print '<td class="liste_total" align="right">';
if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
print ($atleastonenotdefined?'':price($total,'','',0,0,-1,$conf->currency));
print '</td>';
// Stock
if (! empty($conf->stock->enabled)) print '<td class="liste_total" align="right">&nbsp;</td>';
print '<td align="right" colspan="2">';
if ($user->rights->produit->creer || $user->rights->service->creer)
{ {
$hide=''; print '<input type="submit" class="button" value="'.$langs->trans('Save').'">';
if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) $hide=' hideobject';
$class=($class=='impair')?'pair':'impair';
print '<tr class="'.$class.$hide.'" id="sub-'.$value['id_parent'].'">';
//$productstatic->ref=$value['label'];
$productstatic->ref=$value['ref'];
print '<td>';
for ($i=0; $i < $value['level']; $i++) print ' &nbsp; &nbsp; '; // Add indentation
print $productstatic->getNomUrl(1,'composition').'</td>';
print '<td>'.$productstatic->label.'</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
if (! empty($conf->stock->enabled)) print '<td></td>'; // Real stock
print '<td align="center">'.$value['nb'].'</td>';
print '<td>&nbsp;</td>';
print '</tr>'."\n";
} }
print '</td>';
print '</tr>'."\n";
} }
print '<tr class="liste_total">'; else
print '<td class="liste_total"></td>';
print '<td class="liste_total"></td>';
// Minimum buying price
print '<td class="liste_total" align="right">';
print $langs->trans("TotalBuyingPriceMin");
print '</td>';
print '<td class="liste_total" align="right">';
if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
print ($atleastonenotdefined?'':price($total,'','',0,0,-1,$conf->currency));
print '</td>';
// Stock
if (! empty($conf->stock->enabled)) print '<td class="liste_total" align="right">&nbsp;</td>';
print '<td align="right" colspan="2">';
if ($user->rights->produit->creer || $user->rights->service->creer)
{ {
print '<input type="submit" class="button" value="'.$langs->trans('Save').'">'; $colspan=6;
if (! empty($conf->stock->enabled)) $colspan++;
print '<tr>';
print '<td colspan="'.$colspan.'">'.$langs->trans("None").'</td>';
print '</tr>';
} }
print '</td>';
print '</tr>'."\n";
print '</table>'; print '</table>';
/*if($user->rights->produit->creer || $user->rights->service->creer) { /*if($user->rights->produit->creer || $user->rights->service->creer) {
@ -458,8 +473,9 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
print '<tr><td>'.$langs->trans("CategoryFilter").' &nbsp; </td>'; print '<tr><td>'.$langs->trans("CategoryFilter").' &nbsp; </td>';
print '<td class="maxwidthonsmartphone">'.$form->select_all_categories(0, $parent).'</td></tr>'; print '<td class="maxwidthonsmartphone">'.$form->select_all_categories(Categorie::TYPE_PRODUCT, $parent).'</td></tr>';
} }
print '</table>'; print '</table>';
print '</form>'; print '</form>';

View File

@ -1,15 +1,15 @@
<?php <?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2013 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Adolfo segura <adolfo.segura@gmail.com> * Copyright (C) 2013 Adolfo segura <adolfo.segura@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -292,7 +292,7 @@ else
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(0,$search_categ,'search_categ',1); $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
} }
if ($moreforfilter) if ($moreforfilter)

View File

@ -1,8 +1,9 @@
<?php <?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -221,7 +222,7 @@ if ($resql)
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(0,$search_categ,'search_categ'); $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ');
$moreforfilter.=' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
} }
$moreforfilter.=$langs->trans("StockTooLow").' <input type="checkbox" name="toolowstock" value="1"'.($toolowstock?' checked':'').'>'; $moreforfilter.=$langs->trans("StockTooLow").' <input type="checkbox" name="toolowstock" value="1"'.($toolowstock?' checked':'').'>';

View File

@ -1,8 +1,9 @@
<?php <?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -233,7 +234,7 @@ if ($resql)
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(0,$search_categ,'search_categ'); $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ');
$moreforfilter.=' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
} }
//$moreforfilter.=$langs->trans("StockTooLow").' <input type="checkbox" name="toolowstock" value="1"'.($toolowstock?' checked':'').'>'; //$moreforfilter.=$langs->trans("StockTooLow").' <input type="checkbox" name="toolowstock" value="1"'.($toolowstock?' checked':'').'>';

View File

@ -66,8 +66,8 @@ else
<h1> <h1>
This page is a sample of page using tables. It is designed to make test with<br> This page is a sample of page using tables. It is designed to make test with<br>
- css (add parameter &theme=newtheme to test another theme or edit css of current theme)<br> - css (add parameter &theme=newtheme to test another theme or edit css of current theme)<br>
- jmobile (add parameter dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)<br> - jmobile (add parameter <a href="<?php echo $_SERVER["PHP_SELF"].'?dol_use_jmobile=1&dol_optimize_smallscreen=1'; ?>">dol_use_jmobile=1&dol_optimize_smallscreen=1</a> to enable view with jmobile)<br>
- no javascript / usage for bind people (add parameter nojs=1 to force disable javascript)<br> - no javascript / usage for bind people (add parameter <a href="<?php echo $_SERVER["PHP_SELF"].'?nojs=1'; ?>">nojs=1</a> to force disable javascript)<br>
- dataTables<br> - dataTables<br>
- tablednd<br> - tablednd<br>
</h1> </h1>

View File

@ -51,7 +51,7 @@ print "Test 4c: a select with ajax refresh<br>\n";
//$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz'); //$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz');
$array=array(); $array=array();
$selected=-1; $selected=-1;
print $form->selectArrayAjax(DOL_URL_ROOT.'/core/ajax/selecsearchbox.php', 'testselectc', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selecsearchbox.php', $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1);
*/ */
print '<br><br>'."\n"; print '<br><br>'."\n";

View File

@ -1,16 +1,17 @@
<?php <?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org> * Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net> * Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr> * Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-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 * 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 * it under the terms of the GNU General Public License as published by
@ -1334,11 +1335,11 @@ class Societe extends CommonObject
// Fill $toute_categs array with an array of (type => array of ("Categorie" instance)) // Fill $toute_categs array with an array of (type => array of ("Categorie" instance))
if ($this->client || $this->prospect) if ($this->client || $this->prospect)
{ {
$toute_categs ['societe'] = $static_cat->containing($this->id,2); $toute_categs ['societe'] = $static_cat->containing($this->id,Categorie::TYPE_CUSTOMER);
} }
if ($this->fournisseur) if ($this->fournisseur)
{ {
$toute_categs ['fournisseur'] = $static_cat->containing($this->id,1); $toute_categs ['fournisseur'] = $static_cat->containing($this->id,Categorie::TYPE_SUPPLIER);
} }
// Remove each "Categorie" // Remove each "Categorie"
@ -2747,7 +2748,7 @@ class Societe extends CommonObject
$this->SupplierCategories = array(); $this->SupplierCategories = array();
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie";
$sql.= " WHERE type = 1"; $sql.= " WHERE type = ".Categorie::TYPE_SUPPLIER;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)

View File

@ -1,9 +1,9 @@
<?php <?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Charles-Fr Benke <charles.fr@benke.fr> * Copyright (C) 2014 Charles-Fr Benke <charles.fr@benke.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -135,7 +135,7 @@ if ($result)
} }
else dol_print_error($db); else dol_print_error($db);
print '<table class="noborder" width="100%">'."\n"; print '<table class="noborder nohover" width="100%">'."\n";
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(round($third['customer'])?1:0)+(round($third['supplier'])?1:0)+(round($third['other'])?1:0) >= 2)) if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(round($third['customer'])?1:0)+(round($third['supplier'])?1:0)+(round($third['other'])?1:0) >= 2))
{ {

View File

@ -1012,7 +1012,7 @@ else
// Address // Address
print '<tr><td valign="top"><label for="address">'.$langs->trans('Address').'</label></td>'; print '<tr><td valign="top"><label for="address">'.$langs->trans('Address').'</label></td>';
print '<td colspan="3"><textarea name="address" id="address" cols="40" rows="3" wrap="soft">'; print '<td colspan="3"><textarea name="address" id="address" cols="80" rows="'._ROWS_2.'" wrap="soft">';
print $object->address; print $object->address;
print '</textarea></td></tr>'; print '</textarea></td></tr>';

View File

@ -1,9 +1,9 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -311,7 +311,7 @@ if ($resql)
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(2,$search_categ,'search_categ'); $moreforfilter.=$htmlother->select_categories(Categories::TYPE_CUSTOMER,$search_categ,'search_categ');
$moreforfilter.=' &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
} }
// If the user can view prospects other than his' // If the user can view prospects other than his'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 130 B

View File

@ -261,6 +261,11 @@ input, textarea, select {
margin-bottom:1px; margin-bottom:1px;
margin-top:1px; margin-top:1px;
} }
input.removedassigned {
padding: 2px !important;
vertical-align: text-bottom;
margin-bottom: -3px;
}
<?php } ?> <?php } ?>
select.flat, form.flat select { select.flat, form.flat select {
@ -1037,8 +1042,8 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks
border-right: 1px solid #BBB; border-right: 1px solid #BBB;
border-bottom: 1px solid #BBB; border-bottom: 1px solid #BBB;
border-top: 1px solid #BBB; border-top: 1px solid #BBB;
border-radius: 5px; border-radius: 4px;
-moz-border-radius: 5px; -moz-border-radius: 4px;
-moz-box-shadow: 3px 3px 4px #DDD; -moz-box-shadow: 3px 3px 4px #DDD;
-webkit-box-shadow: 3px 3px 4px #DDD; -webkit-box-shadow: 3px 3px 4px #DDD;
box-shadow: 3px 3px 4px #DDD; box-shadow: 3px 3px 4px #DDD;
@ -1061,8 +1066,8 @@ div.blockvmenusearch
border-right: 1px solid #CCC; border-right: 1px solid #CCC;
border-bottom: 1px solid #CCC; border-bottom: 1px solid #CCC;
border-top: 1px solid #CCC; border-top: 1px solid #CCC;
border-radius: 5px; border-radius: 4px;
-moz-border-radius: 5px; -moz-border-radius: 4px;
-moz-box-shadow: 3px 3px 4px #DDD; -moz-box-shadow: 3px 3px 4px #DDD;
-webkit-box-shadow: 3px 3px 4px #DDD; -webkit-box-shadow: 3px 3px 4px #DDD;
box-shadow: 3px 3px 4px #DDD; box-shadow: 3px 3px 4px #DDD;
@ -1142,9 +1147,9 @@ td.photo {
background-repeat: repeat-x !important; background-repeat: repeat-x !important;
border: 1px solid #CCC !important; border: 1px solid #CCC !important;
-moz-border-radius: 5px 5px 5px 5px !important; -moz-border-radius: 4px 4px 4px 4px !important;
-webkit-border-radius: 5px 5px 5px 5px !important; -webkit-border-radius: 4px 4px 4px 4px !important;
border-radius: 5px 5px 5px 5px !important; border-radius: 4px 4px 4px 4px !important;
-moz-box-shadow: 2px 2px 4px #DDD; -moz-box-shadow: 2px 2px 4px #DDD;
-webkit-box-shadow: 2px 2px 4px #DDD; -webkit-box-shadow: 2px 2px 4px #DDD;
box-shadow: 2px 2px 4px #DDD; box-shadow: 2px 2px 4px #DDD;
@ -1377,9 +1382,9 @@ div.tabBar {
padding-right: <?php echo ($dol_optimize_smallscreen?'4':'14'); ?>px; padding-right: <?php echo ($dol_optimize_smallscreen?'4':'14'); ?>px;
padding-bottom: <?php echo ($dol_optimize_smallscreen?'4':'12'); ?>px; padding-bottom: <?php echo ($dol_optimize_smallscreen?'4':'12'); ?>px;
margin: 0px 0px 14px 0px; margin: 0px 0px 14px 0px;
-moz-border-radius:6px; -moz-border-radius:4px;
-webkit-border-radius: 6px; -webkit-border-radius: 4px;
border-radius: 6px; border-radius: 4px;
border-right: 1px solid #AAA; border-right: 1px solid #AAA;
border-bottom: 1px solid #AAA; border-bottom: 1px solid #AAA;
border-left: 1px solid #AAA; border-left: 1px solid #AAA;
@ -1434,6 +1439,13 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
border-top: 1px solid #CCC; border-top: 1px solid #CCC;
*/ */
border-right: 1px solid transparent;
border-left: 1px solid transparent;
border-top: 1px solid transparent;
-moz-border-radius:4px 4px 0 0;
-webkit-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
background-image: none !important; background-image: none !important;
} }
@ -1447,6 +1459,9 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
border-right: 1px solid #AAA !important; border-right: 1px solid #AAA !important;
border-left: 1px solid #AAA !important; border-left: 1px solid #AAA !important;
border-top: 1px solid #BBB !important; border-top: 1px solid #BBB !important;
-moz-border-radius:4px 4px 0 0;
-webkit-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
} }
a.tab:hover a.tab:hover
{ {
@ -1475,9 +1490,9 @@ span.tabspan {
margin: 0em 0.2em; margin: 0em 0.2em;
text-decoration: none; text-decoration: none;
white-space: nowrap; white-space: nowrap;
-moz-border-radius:6px 6px 0px 0px; -moz-border-radius:4px 4px 0px 0px;
-webkit-border-radius:6px 6px 0px 0px; -webkit-border-radius:4px 4px 0px 0px;
border-radius:6px 6px 0px 0px; border-radius:4px 4px 0px 0px;
border-<?php print $right; ?>: 1px solid #555555; border-<?php print $right; ?>: 1px solid #555555;
border-<?php print $left; ?>: 1px solid #D8D8D8; border-<?php print $left; ?>: 1px solid #D8D8D8;
@ -1960,6 +1975,9 @@ div.pagination li.pagination span {
color: #000; color: #000;
text-decoration: none; text-decoration: none;
} }
div.pagination li.pagination span.inactive {
cursor: default;
}
<?php if (empty($conf->dol_use_jmobile)) { ?> <?php if (empty($conf->dol_use_jmobile)) { ?>
div.pagination li a, div.pagination li a,
div.pagination li span { div.pagination li span {
@ -2043,7 +2061,7 @@ div.pagination li.paginationafterarrows {
} }
*/ */
/* Set the color for hover lines */
.odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover
{ {
<?php if ($colorbacklinepairhover) { if ($colorbacklinepairhover > 0) { ?> <?php if ($colorbacklinepairhover) { if ($colorbacklinepairhover > 0) { ?>
@ -2055,7 +2073,6 @@ div.pagination li.paginationafterarrows {
.odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover { .odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover {
font-family: <?php print $fontlist ?>; font-family: <?php print $fontlist ?>;
border: 0px;
margin-bottom: 1px; margin-bottom: 1px;
color: #202020; color: #202020;
min-height: 18px; /* seems to not be used */ min-height: 18px; /* seems to not be used */
@ -2068,15 +2085,21 @@ div.pagination li.paginationafterarrows {
.even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover { .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
font-family: <?php print $fontlist ?>; font-family: <?php print $fontlist ?>;
border: 0px;
margin-bottom: 1px; margin-bottom: 1px;
color: #202020; color: #202020;
background-color: #f9f9f9; background-color: #f9f9f9;
} }
table.dataTable tr.odd { table.dataTable tr.odd {
background-color: #f9f9f9 !important; background-color: #f9f9f9 !important;
} }
/* For no hover style */
table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td {
background-color: #ffffff !important;
}
table.dataTable td { table.dataTable td {
padding: 5px 2px 5px 3px !important; padding: 5px 2px 5px 3px !important;
} }
@ -2220,7 +2243,7 @@ div.tabBar .noborder {
margin-bottom: 8px !important;*/ margin-bottom: 8px !important;*/
border: 1px solid #AAA; border: 1px solid #AAA;
text-align: center; text-align: center;
border-radius: 5px; border-radius: 4px;
} }
.boxtable { .boxtable {
@ -2317,9 +2340,9 @@ div.warning {
padding: 0.3em 0.3em 0.3em 0.3em; padding: 0.3em 0.3em 0.3em 0.3em;
margin: 0.5em 0em 0.5em 0em; margin: 0.5em 0em 0.5em 0em;
border: 1px solid #e0d0b0; border: 1px solid #e0d0b0;
-moz-border-radius:6px; -moz-border-radius: 4px;
-webkit-border-radius: 6px; -webkit-border-radius: 4px;
border-radius: 6px; border-radius: 4px;
background: #EFDF9A; background: #EFDF9A;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
} }
@ -2329,9 +2352,9 @@ div.error {
padding: 0.3em 0.3em 0.3em 0.3em; padding: 0.3em 0.3em 0.3em 0.3em;
margin: 0.5em 0em 0.5em 0em; margin: 0.5em 0em 0.5em 0em;
border: 1px solid #DC9CAB; border: 1px solid #DC9CAB;
-moz-border-radius:6px; -moz-border-radius: 4px;
-webkit-border-radius: 6px; -webkit-border-radius: 4px;
border-radius: 6px; border-radius: 4px;
background: #EFCFCF; background: #EFCFCF;
} }
@ -2341,9 +2364,9 @@ div.info {
padding: 0.4em 0.4em 0.4em 0.4em; padding: 0.4em 0.4em 0.4em 0.4em;
margin: 0.5em 0em 0.5em 0em; margin: 0.5em 0em 0.5em 0em;
border: 1px solid #DFBF9A; border: 1px solid #DFBF9A;
-moz-border-radius:6px; -moz-border-radius: 4px;
-webkit-border-radius: 6px; -webkit-border-radius: 4px;
border-radius:6px; border-radius: 4px;
background: #EFCFAA; background: #EFCFAA;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
} }
@ -2506,9 +2529,9 @@ table.valid {
z-index: 3000; z-index: 3000;
background-color: #FFF; background-color: #FFF;
opacity: 1; opacity: 1;
-moz-border-radius:6px; -moz-border-radius: 4px;
-webkit-border-radius: 6px; -webkit-border-radius: 4px;
border-radius: 6px; border-radius: 4px;
} }
#tiptip_content { #tiptip_content {
background-color: rgb(255,255,255); background-color: rgb(255,255,255);
@ -3131,6 +3154,7 @@ div.dolEventError h1, div.dolEventError h2 {
/* ============================================================================== */ /* ============================================================================== */
/* Datatable */ /* Datatable */
/* ============================================================================== */ /* ============================================================================== */
table.dataTable tr.odd td.sorting_1, table.dataTable tr.even td.sorting_1 { table.dataTable tr.odd td.sorting_1, table.dataTable tr.even td.sorting_1 {
background: none !important; background: none !important;
} }
@ -3138,6 +3162,14 @@ table.dataTable tr.odd td.sorting_1, table.dataTable tr.even td.sorting_1 {
.sorting_desc { background: url('<?php echo dol_buildpath('/theme/'.$theme.'/img/sort_desc.png',1); ?>') no-repeat center right !important; } .sorting_desc { background: url('<?php echo dol_buildpath('/theme/'.$theme.'/img/sort_desc.png',1); ?>') no-repeat center right !important; }
.sorting_asc_disabled { background: url('<?php echo dol_buildpath('/theme/'.$theme.'/img/sort_asc_disabled.png',1); ?>') no-repeat center right !important; } .sorting_asc_disabled { background: url('<?php echo dol_buildpath('/theme/'.$theme.'/img/sort_asc_disabled.png',1); ?>') no-repeat center right !important; }
.sorting_desc_disabled { background: url('<?php echo dol_buildpath('/theme/'.$theme.'/img/sort_desc_disabled.png',1); ?>') no-repeat center right !important; } .sorting_desc_disabled { background: url('<?php echo dol_buildpath('/theme/'.$theme.'/img/sort_desc_disabled.png',1); ?>') no-repeat center right !important; }
.dataTables_paginate {
margin-top: 8px;
}
.paginate_button_disabled {
opacity: 1 !important;
color: #888 !important;
cursor: default !important;
}
.paginate_disabled_previous:hover, .paginate_enabled_previous:hover, .paginate_disabled_next:hover, .paginate_enabled_next:hover .paginate_disabled_previous:hover, .paginate_enabled_previous:hover, .paginate_disabled_next:hover, .paginate_enabled_next:hover
{ {
font-weight: normal; font-weight: normal;
@ -3146,10 +3178,36 @@ table.dataTable tr.odd td.sorting_1, table.dataTable tr.even td.sorting_1 {
{ {
text-decoration: underline !important; text-decoration: underline !important;
} }
.paginate_active
{
text-decoration: underline !important;
}
.paginate_button .paginate_button
{ {
font-weight: normal !important; font-weight: normal !important;
text-decoration: none !important;
} }
.paging_full_numbers {
height: inherit !important;
}
.paging_full_numbers a.paginate_active:hover, .paging_full_numbers a.paginate_button:hover {
background-color: #DDD !important;
}
.paging_full_numbers, .paging_full_numbers a.paginate_active, .paging_full_numbers a.paginate_button {
background-color: #FFF !important;
border-radius: inherit !important;
}
.paging_full_numbers a.paginate_button_disabled:hover {
background-color: #FFF !important;
}
.paginate_button, .paginate_active {
border: 1px solid #ddd !important;
padding: 6px 12px !important;
margin-left: -1px !important;
line-height: 1.42857143 !important;
margin: 0 0 !important;
}
/* For jquery plugin combobox */ /* For jquery plugin combobox */
/* Disable this. It breaks wrapping of boxes /* Disable this. It breaks wrapping of boxes
.ui-corner-all { white-space: nowrap; } */ .ui-corner-all { white-space: nowrap; } */

View File

@ -1474,7 +1474,6 @@ else
else else
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a></div>';
print '<div class="inline-block divButAction"><button class="btn btn-primary" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</button></div>';
} }
} }
elseif ($caneditpassword && ! $object->ldap_sid && elseif ($caneditpassword && ! $object->ldap_sid &&