Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2013-01-16 12:30:53 +01:00
commit 3ed4a7494f
69 changed files with 1406 additions and 1033 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 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>
*
* This program is free software; you can redistribute it and/or modify
@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("admin");
$langs->load("boxes");
if (! $user->admin) accessforbidden();
@ -211,8 +212,6 @@ if ($action == 'switch')
*/
$form=new Form($db);
$emptyuser=new User($db);
//$infobox=new InfoBox($db);
llxHeader('',$langs->trans("Boxes"));
@ -316,7 +315,7 @@ if ($resql)
// Available boxes
$boxtoadd=InfoBox::listBoxes($db,'available',-1,$emptyuser,$actives);
$boxtoadd=InfoBox::listBoxes($db,'available',-1,null,$actives);
print "<br>\n";
print_titre($langs->trans("BoxesAvailable"));
@ -346,8 +345,15 @@ foreach($boxtoadd as $box)
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].'>';
print '<td>'.img_object("",$logo).' '.$box->boxlabel.'</td>';
print '<td>' . ($box->note?$box->note:'&nbsp;') . '</td>';
print '<td>'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel).'</td>';
print '<td>';
if ($box->note == '(WarningUsingThisBoxSlowDown)')
{
$langs->load("errors");
print $langs->trans("WarningUsingThisBoxSlowDown");
}
else print ($box->note?$box->note:'&nbsp;');
print '</td>';
print '<td>' . $box->sourcefile . '</td>';
// Pour chaque position possible, on affiche un lien d'activation si boite non deja active pour cette position
@ -366,7 +372,7 @@ print '</table>';
// Activated boxes
$boxactivated=InfoBox::listBoxes($db,'activated',-1,$emptyuser);
$boxactivated=InfoBox::listBoxes($db,'activated',-1,null);
print "<br>\n\n";
print_titre($langs->trans("BoxesActivated"));
@ -398,8 +404,15 @@ foreach($boxactivated as $key => $box)
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
print '<tr '.$bc[$var].'>';
print '<td>'.img_object("",$logo).' '.$box->boxlabel.'</td>';
print '<td>' . ($box->note?$box->note:'&nbsp;') . '</td>';
print '<td>'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel).'</td>';
print '<td>';
if ($box->note == '(WarningUsingThisBoxSlowDown)')
{
$langs->load("errors");
print img_warning('',0).' '.$langs->trans("WarningUsingThisBoxSlowDown");
}
else print ($box->note?$box->note:'&nbsp;');
print '</td>';
print '<td align="center">' . (isset($pos_name[$box->position])?$pos_name[$box->position]:'') . '</td>';
$hasnext=($key < (count($boxactivated)-1));
$hasprevious=($key != 0);

View File

@ -55,12 +55,13 @@ print $langs->trans("SetupDescription2")."<br><br>";
print '<br>';
//print '<hr style="color: #DDDDDD;">';
print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home');
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_PAYS))
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_PAYS)) $setupcompanynotcomplete=1;
print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'));
if (! empty($setupcompanynotcomplete))
{
$langs->load("errors");
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit').'">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
}
print '<br>';
print '<br>';

View File

@ -37,7 +37,7 @@ $action = GETPOST("action");
$syslogModules = array();
$activeModules = array();
if (defined('SYSLOG_HANDLERS')) $activeModules = json_decode(SYSLOG_HANDLERS);
if (defined('SYSLOG_HANDLERS')) $activeModules = json_decode(constant('SYSLOG_HANDLERS'));
$dir = dol_buildpath('/core/modules/syslog/');

View File

@ -49,6 +49,11 @@ print "<br>";
print info_admin($langs->trans("SystemAreaForAdminOnly")).'<br>';
print '<br><br>';
// Show logo
print '<center><div class="logo_setup"></div></center>';
llxFooter();
$db->close();

View File

@ -32,7 +32,7 @@ class box_actions extends ModeleBoxes
{
var $boxcode="lastactions";
var $boximg="object_action";
var $boxlabel;
var $boxlabel="BoxLastActions";
var $depends = array("agenda");
var $db;
@ -42,17 +42,6 @@ class box_actions extends ModeleBoxes
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastActions");
}
/**
* Load data for box to show them later
*

View File

@ -1,5 +1,7 @@
<?php
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2005-2013 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 2 of the License, or
@ -29,28 +31,27 @@ class box_activity extends ModeleBoxes
{
var $boxcode="activity";
var $boximg="object_bill";
var $boxlabel;
var $boxlabel='BoxGlobalActivity';
var $depends = array("facture");
var $db;
var $param;
var $enabled = 1;
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
function __construct($db)
{
global $langs;
$langs->load("boxes");
$langs->load("bills");
$langs->load("projects");
$langs->load("orders");
$this->boxlabel = $langs->transnoentitiesnoconv("BoxGlobalActivity");
$this->db = $db;
$this->enabled = 1;
// FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software.
// FIXME: Removed number_format (not compatible with all languages)
// FIXME: Pb into some status
}
/**
@ -66,13 +67,7 @@ class box_activity extends ModeleBoxes
$totalMnt = 0;
$totalnb = 0;
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$facturestatic=new Facture($db);
$propalstatic=new Propal($db);
$commandestatic=new Commande($db);
$nbofyears=2;
if (! empty($conf->global->MAIN_BOX_ACTIVITY_DURATION)) $nbofyears=$conf->global->MAIN_BOX_ACTIVITY_DURATION;
@ -80,12 +75,15 @@ class box_activity extends ModeleBoxes
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
// compute the year limit to show
$tmpdate= dol_time_plus_duree(time(), -1*$nbofyears, "y");
$tmpdate= dol_time_plus_duree(dol_now(), -1*$nbofyears, "y");
// list the summary of the bills
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$sql = "SELECT f.paye, f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")";
@ -94,7 +92,7 @@ class box_activity extends ModeleBoxes
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1";
$sql.= " GROUP BY f.paye, f.fk_statut ";
$sql.= " GROUP BY f.fk_statut";
$sql.= " ORDER BY f.fk_statut DESC";
$result = $db->query($sql);
@ -107,7 +105,7 @@ class box_activity extends ModeleBoxes
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => 'bill');
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut($objp->paye,$objp->fk_statut,0)." ".$objp->annee);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(1,$objp->fk_statut,0)." ".$objp->annee);
$billurl="viewstatut=2&paye=1&year=".$objp->annee;
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
@ -123,19 +121,19 @@ class box_activity extends ModeleBoxes
$totalnb += $objp->nb;
$totalMnt += $objp->Mnttot;
}
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3) );
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut(1,$objp->fk_statut,3) );
$i++;
}
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices"));
}
else dol_print_error($db);
$sql = "SELECT f.paye, f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND paye=0";
$sql.= " GROUP BY f.paye, f.fk_statut ";
$sql.= " GROUP BY f.fk_statut";
$sql.= " ORDER BY f.fk_statut DESC";
$result = $db->query($sql);
@ -151,7 +149,7 @@ class box_activity extends ModeleBoxes
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut($objp->paye,$objp->fk_statut,0));
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(0,$objp->fk_statut,0));
$billurl="viewstatut=".$objp->fk_statut."&paye=0";
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
@ -163,7 +161,7 @@ class box_activity extends ModeleBoxes
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)
'text' => $facturestatic->LibStatut(0,$objp->fk_statut,3)
);
$i++;
}
@ -176,7 +174,10 @@ class box_activity extends ModeleBoxes
// list the summary of the orders
if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{
$sql = "SELECT c.fk_statut,c.facture, sum(c.total_ttc) as Mnttot, count(*) as nb";
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db);
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")";
@ -200,7 +201,7 @@ class box_activity extends ModeleBoxes
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' =>$langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($objp->fk_statut,$objp->facture,0)
'text' =>$langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($objp->fk_statut,0,0)
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
@ -213,7 +214,7 @@ class box_activity extends ModeleBoxes
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)."&nbsp;".getCurrencySymbol($conf->currency)
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,$objp->facture,3));
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,0,3));
$i++;
}
@ -224,7 +225,10 @@ class box_activity extends ModeleBoxes
// list the summary of the propals
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$sql = "SELECT p.fk_statut, sum(p.total) as Mnttot, count(*) as nb";
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic=new Propal($db);
$sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")";

View File

@ -29,7 +29,7 @@ class box_bookmarks extends ModeleBoxes
{
var $boxcode="bookmarks";
var $boximg="object_bookmark";
var $boxlabel;
var $boxlabel="BoxMyLastBookmarks";
var $depends = array("bookmark");
var $db;
@ -38,16 +38,6 @@ class box_bookmarks extends ModeleBoxes
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxMyLastBookmarks");
}
/**
* Load data for box to show them later

View File

@ -33,7 +33,7 @@ class box_clients extends ModeleBoxes
{
var $boxcode="lastcustomers";
var $boximg="object_company";
var $boxlabel;
var $boxlabel="BoxLastCustomers";
var $depends = array("societe");
var $db;
@ -42,16 +42,6 @@ class box_clients extends ModeleBoxes
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastCustomers");
}
/**
* Load data for box to show them later
@ -83,8 +73,8 @@ class box_clients extends ModeleBoxes
$sql.= " ORDER BY s.tms DESC";
$sql.= $db->plimit($max, 0);
dol_syslog(get_class($this)."::loadBox sql=".$sql,LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);

View File

@ -33,7 +33,7 @@ class box_commandes extends ModeleBoxes
{
var $boxcode="lastcustomerorders";
var $boximg="object_order";
var $boxlabel;
var $boxlabel="BoxLastCustomerOrders";
var $depends = array("commande");
var $db;
@ -42,16 +42,6 @@ class box_commandes extends ModeleBoxes
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastCustomerOrders");
}
/**
* Load data for box to show them later

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2005 Christophe
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
@ -33,25 +33,29 @@ class box_comptes extends ModeleBoxes
{
var $boxcode="currentaccounts";
var $boximg="object_bill";
var $boxlabel;
var $boxlabel="BoxCurrentAccounts";
var $depends = array("banque"); // Box active if module banque active
var $db;
var $param;
var $enabled = 1;
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
function __construct($db)
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv('BoxCurrentAccounts');
global $conf, $user;
$this->db = $db;
// disable module for such cases
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users
}
/**

View File

@ -34,7 +34,7 @@ class box_contacts extends ModeleBoxes
{
var $boxcode="lastcontacts";
var $boximg="object_contact";
var $boxlabel;
var $boxlabel="BoxLastContacts";
var $depends = array("societe");
var $db;
@ -43,16 +43,6 @@ class box_contacts extends ModeleBoxes
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastContacts");
}
/**
* Load data into info_box_contents array to show array later.
@ -78,12 +68,11 @@ class box_contacts extends ModeleBoxes
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND sp.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($user->societe_id) $sql.= " AND sp.rowid = $user->societe_id";
if ($user->societe_id) $sql.= " AND sp.fk_soc = $user->societe_id";
$sql.= " ORDER BY sp.tms DESC";
$sql.= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);

View File

@ -31,7 +31,7 @@ class box_contracts extends ModeleBoxes
{
var $boxcode="lastcontracts";
var $boximg="object_contract";
var $boxlabel;
var $boxlabel="BoxLastContracts";
var $depends = array("contrat"); // conf->contrat->enabled
var $db;
@ -41,18 +41,6 @@ class box_contracts extends ModeleBoxes
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastContracts");
}
/**
* Load data for box to show them later
*

View File

@ -35,7 +35,7 @@ class box_external_rss extends ModeleBoxes
{
var $boxcode="lastrssinfos";
var $boximg="object_rss";
var $boxlabel;
var $boxlabel="BoxLastRssInfos";
var $depends = array("externalrss");
var $db;
@ -52,13 +52,8 @@ class box_external_rss extends ModeleBoxes
*/
function __construct($db,$param)
{
global $langs;
$langs->load("boxes");
$this->db=$db;
$this->param=$param;
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastRssInfos");
}
/**

View File

@ -32,7 +32,7 @@ class box_factures extends ModeleBoxes
{
var $boxcode="lastcustomerbills";
var $boximg="object_bill";
var $boxlabel;
var $boxlabel="BoxLastCustomerBills";
var $depends = array("facture");
var $db;
@ -41,16 +41,6 @@ class box_factures extends ModeleBoxes
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastCustomerBills");
}
/**
* Load data into info_box_contents array to show array later.

View File

@ -32,7 +32,7 @@ class box_factures_fourn extends ModeleBoxes
{
var $boxcode="lastsupplierbills";
var $boximg="object_bill";
var $boxlabel;
var $boxlabel="BoxLastSupplierBills";
var $depends = array("facture","fournisseur");
var $db;
@ -41,16 +41,6 @@ class box_factures_fourn extends ModeleBoxes
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastSupplierBills");
}
/**
* Load data into info_box_contents array to show array later.

View File

@ -31,7 +31,7 @@ class box_factures_fourn_imp extends ModeleBoxes
{
var $boxcode="oldestunpaidsupplierbills";
var $boximg="object_bill";
var $boxlabel;
var $boxlabel="BoxOldestUnpaidSupplierBills";
var $depends = array("facture","fournisseur");
var $db;
@ -41,17 +41,6 @@ class box_factures_fourn_imp extends ModeleBoxes
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxOldestUnpaidSupplierBills");
}
/**
* Load data into info_box_contents array to show array later.
*

View File

@ -34,7 +34,7 @@ class box_factures_imp extends ModeleBoxes
{
var $boxcode="oldestunpaidcustomerbills";
var $boximg="object_bill";
var $boxlabel;
var $boxlabel="BoxOldestUnpaidCustomerBills";
var $depends = array("facture");
var $db;
@ -44,17 +44,6 @@ class box_factures_imp extends ModeleBoxes
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxOldestUnpaidCustomerBills");
}
/**
* Load data into info_box_contents array to show array later.
*

View File

@ -32,7 +32,7 @@ class box_fournisseurs extends ModeleBoxes
{
var $boxcode="lastsuppliers";
var $boximg="object_company";
var $boxlabel;
var $boxlabel="BoxLastSuppliers";
var $depends = array("fournisseur");
var $db;
@ -41,16 +41,6 @@ class box_fournisseurs extends ModeleBoxes
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastSuppliers");
}
/**
* Load data into info_box_contents array to show array later.

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 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>
*
* This program is free software; you can redistribute it and/or modify
@ -19,8 +19,8 @@
/**
* \file htdocs/core/boxes/box_members.php
* \ingroup societes
* \brief Module de generation de l'affichage de la box clients
* \ingroup adherent
* \brief Module to show box of members
*/
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
@ -33,24 +33,29 @@ class box_members extends ModeleBoxes
{
var $boxcode="lastmembers";
var $boximg="object_user";
var $boxlabel;
var $boxlabel="BoxLastMembers";
var $depends = array("adherent");
var $db;
var $param;
var $enabled = 1;
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
function __construct($db)
{
global $langs;
$langs->load("boxes");
global $conf, $user;
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastMembers");
$this->db = $db;
// disable module for such cases
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users
}
/**

View File

@ -32,7 +32,7 @@ class box_osc_clients extends ModeleBoxes
{
var $boxcode="nbofcustomers";
var $boximg="object_company";
var $boxlabel;
var $boxlabel="BoxNbOfCustomers";
var $depends = array("boutique");
var $db;
@ -41,16 +41,6 @@ class box_osc_clients extends ModeleBoxes
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxNbOfCustomers");
}
/**
* Load data into info_box_contents array to show array later.

View File

@ -34,7 +34,7 @@ class box_produits extends ModeleBoxes
{
var $boxcode="lastproducts";
var $boximg="object_product";
var $boxlabel;
var $boxlabel="BoxLastProducts";
var $depends = array("produit");
var $db;
@ -44,17 +44,6 @@ class box_produits extends ModeleBoxes
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastProducts");
}
/**
* Load data into info_box_contents array to show array later.
*

View File

@ -35,7 +35,7 @@ class box_produits_alerte_stock extends ModeleBoxes
{
var $boxcode="productsalertstock";
var $boximg="object_product";
var $boxlabel;
var $boxlabel="BoxProductsAlertStock";
var $depends = array("produit");
var $db;
@ -45,17 +45,6 @@ class box_produits_alerte_stock extends ModeleBoxes
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxProductsAlertStock");
}
/**
* Load data into info_box_contents array to show array later.
*

View File

@ -33,7 +33,7 @@ class box_propales extends ModeleBoxes
{
var $boxcode="lastpropals";
var $boximg="object_propal";
var $boxlabel;
var $boxlabel="BoxLastProposals";
var $depends = array("propal"); // conf->propal->enabled
var $db;
@ -43,17 +43,6 @@ class box_propales extends ModeleBoxes
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastProposals");
}
/**
* Load data into info_box_contents array to show array later.
*

View File

@ -35,7 +35,7 @@ class box_prospect extends ModeleBoxes
{
var $boxcode="lastprospects";
var $boximg="object_company";
var $boxlabel;
var $boxlabel="BoxLastProspects";
var $depends = array("societe");
var $db;
@ -44,21 +44,6 @@ class box_prospect extends ModeleBoxes
var $info_box_contents = array();
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
global $langs;
$langs->load("boxes");
$this->db=$db;
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastProspects");
}
/**
* Load data into info_box_contents array to show array later.
*
@ -88,7 +73,7 @@ class box_prospect extends ModeleBoxes
$sql.= " ORDER BY s.tms DESC";
$sql.= $db->plimit($max, 0);
dol_syslog("box_prospect::loadBox sql=".$sql,LOG_DEBUG);
dol_syslog(get_class($this)."::loadBox sql=".$sql,LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{

View File

@ -33,7 +33,7 @@ class box_services_contracts extends ModeleBoxes
{
var $boxcode="lastproductsincontract";
var $boximg="object_product";
var $boxlabel;
var $boxlabel="BoxLastProductsInContract";
var $depends = array("service","contrat");
var $db;
@ -42,17 +42,7 @@ class box_services_contracts extends ModeleBoxes
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastProductsInContract");
}
/**
* Load data into info_box_contents array to show array later.
*

View File

@ -32,7 +32,7 @@ class box_services_expired extends ModeleBoxes
var $boxcode="expiredservices"; // id of box
var $boximg="object_contract";
var $boxlabel;
var $boxlabel="BoxOldestExpiredServices";
var $depends = array("contrat"); // conf->propal->enabled
var $db;
@ -42,18 +42,6 @@ class box_services_expired extends ModeleBoxes
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("contracts");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxOldestExpiredServices");
}
/**
* Load data for box to show them later
*

View File

@ -33,23 +33,14 @@ class box_supplier_orders extends ModeleBoxes
var $boxcode = "latestsupplierorders";
var $boximg = "object_order";
var $boxlabel;
var $boxlabel="BoxLatestSupplierOrders";
var $depends = array("fournisseur");
var $db;
var $param;
var $info_box_head = array();
var $info_box_contents = array();
/**
* Constructor
*/
function __construct()
{
global $langs;
$langs->load("boxes");
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLatestSupplierOrders");
}
/**
* Load data into info_box_contents array to show array later.

View File

@ -32,7 +32,8 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
var $db;
var $error='';
var $max=5;
var $enabled=1;
var $rowid;
var $id;
var $position;
@ -46,7 +47,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
/**
* Constructor
*
* @param DoliDB $db Database hanlder
* @param DoliDB $db Database handler
*/
function __construct($db)
{
@ -122,7 +123,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
$bcx[1] = 'class="box_impair"';
$var = false;
dol_syslog(get_Class($this));
dol_syslog(get_class($this).'::showBox');
// Define nbcol and nblines of the box to show
$nbcol=0;

View File

@ -2135,7 +2135,10 @@ abstract class CommonObject
$this->array_options[$key] = null;
}
break;
}
case 'price':
$this->array_options[$key] = price2num($this->array_options[$key]);
break;
}
}
$this->db->begin();

View File

@ -147,7 +147,7 @@ class Conf
$value=$objp->value;
if ($key)
{
if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_FILE_ON and SYSLOG_FILE during install)
if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install)
$this->global->$key=$value;
if ($value && preg_match('/^MAIN_MODULE_/',$key))
@ -397,7 +397,7 @@ class Conf
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024);
// Define list of limited modules
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='facture,commande,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later.
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='facture,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later.
// Timeouts
if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10;

View File

@ -53,7 +53,10 @@ class ExtraFields
'double'=>'Float',
'date'=>'Date',
'datetime'=>'DateAndTime',
'boolean'=>'Boolean'
'boolean'=>'Boolean',
'price'=>'ExtrafieldPrice',
'phone'=>'ExtrafieldPhone',
'mail'=>'ExtrafieldMail'
);
/**
@ -139,6 +142,15 @@ class ExtraFields
if ($type=='boolean') {
$typedb='int';
$lengthdb='1';
} elseif($type=='price') {
$typedb='double';
$lengthdb='24,8';
} elseif($type=='phone') {
$typedb='varchar';
$lengthdb='20';
}elseif($type=='mail') {
$typedb='varchar';
$lengthdb='128';
} else {
$typedb=$type;
$lengthdb=$length;
@ -312,9 +324,18 @@ class ExtraFields
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
{
if ($type=='boolean') {
if ($type=='boolean') {
$typedb='int';
$lengthdb='1';
} elseif($type=='price') {
$typedb='double';
$lengthdb='24,8';
} elseif($type=='phone') {
$typedb='varchar';
$lengthdb='20';
}elseif($type=='mail') {
$typedb='varchar';
$lengthdb='128';
} else {
$typedb=$type;
$lengthdb=$length;
@ -446,16 +467,17 @@ class ExtraFields
* Load array this->attribute_label
*
* @param string $elementtype Type of element
* @param boolean $forcecheck override test of MAIN_EXTRAFIELDS_DISABLED
* @return array Array of attributes for all extra fields
*/
function fetch_name_optionals_label($elementtype='member')
function fetch_name_optionals_label($elementtype='member',$forcecheck=false)
{
global $conf;
$array_name_label=array();
// For avoid conflicts with external modules
if (! empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && !$forcecheck)
return $array_name_label;
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired";
@ -533,23 +555,23 @@ class ExtraFields
$newsize=$tmp[0];
$out='<input type="text" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
}
else if (in_array($type,array('int','double')))
elseif (in_array($type,array('int','double')))
{
$tmp=explode(',',$size);
$newsize=$tmp[0];
$out='<input type="text" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
}
else if ($type == 'varchar')
elseif ($type == 'varchar')
{
$out='<input type="text" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$size.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
}
else if ($type == 'text')
elseif ($type == 'text')
{
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('options_'.$key,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100);
$out=$doleditor->Create(1);
}
else if ($type == 'boolean')
elseif ($type == 'boolean')
{
$checked='';
if (!empty($value)) {
@ -559,6 +581,18 @@ class ExtraFields
}
$out='<input type="checkbox" name="options_'.$key.'" '.$checked.' '.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'mail')
{
$out='<input type="text" name="options_'.$key.'" size="32" value="'.$value.'">';
}
elseif ($type == 'phone')
{
$out='<input type="text" name="options_'.$key.'" size="20" value="'.$value.'">';
}
elseif ($type == 'price')
{
$out='<input type="text" name="options_'.$key.'" size="6" value="'.price($value).'"> '.getCurrencySymbol($conf->currency);
}
// Add comments
if ($type == 'date') $out.=' (YYYY-MM-DD)';
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
@ -575,7 +609,8 @@ class ExtraFields
*/
function showOutputField($key,$value,$moreparam='')
{
global $conf;
$label=$this->attribute_label[$key];
$type=$this->attribute_type[$key];
$size=$this->attribute_size[$key];
@ -601,6 +636,18 @@ class ExtraFields
$checked=' checked="checked" ';
}
$value='<input type="checkbox" '.$checked.' '.($moreparam?$moreparam:'').' readonly="readonly">';
}
elseif ($type == 'mail')
{
$value=dol_print_email($value);
}
elseif ($type == 'phone')
{
$value=dol_print_phone($value);
}
elseif ($type == 'price')
{
$value=price($value).' '.getCurrencySymbol($conf->currency);
}
else
{

View File

@ -808,24 +808,28 @@ class FormOther
include_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
//$infobox=new InfoBox($db);
$boxactivated=InfoBox::listBoxes($db,'activated',$areacode,$user);
$arrayboxactivatedid=array();
foreach($boxactivated as $box) $arrayboxactivatedid[$box->id]=$box->id;
$selectboxlist='';
if (! empty($conf->use_javascript_ajax))
$confuserzone='MAIN_BOXES_'.$areacode;
$boxactivated=InfoBox::listBoxes($db,'activated',$areacode,(empty($user->conf->$confuserzone)?null:$user)); // Search boxes of user (or everybody if user has no specific setup)
$boxidactivatedforuser=array();
foreach($boxactivated as $box)
{
$emptyuser=new User($db);
$boxavailable=InfoBox::listBoxes($db,'activated',$areacode,$emptyuser,$arrayboxactivatedid); // Get list of box available for empty user (minus already activated for user)
$arrayboxtoactivatelabel=array();
foreach($boxavailable as $box)
{
$arrayboxtoactivatelabel[$box->id]=$box->boxlabel;
}
$form=new Form($db);
if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id]=$box->id; // We keep only boxes to show for user
}
$selectboxlist='';
$arrayboxtoactivatelabel=array();
if (! empty($user->conf->$confuserzone))
{
$langs->load("boxes");
foreach($boxactivated as $box)
{
if (! empty($boxidactivatedforuser[$box->id])) continue; // Already visible for user
$arrayboxtoactivatelabel[$box->id]=$langs->transnoentitiesnoconv($box->boxlabel); // We keep only boxes not shown for user, to show into combo list
}
$form=new Form($db);
$selectboxlist=$form->selectarray('boxcombo', $arrayboxtoactivatelabel,'',1);
}
@ -852,12 +856,14 @@ class FormOther
</script>';
}
$nbboxactivated=count($boxactivated);
$nbboxactivated=count($boxidactivatedforuser);
print load_fiche_titre(($nbboxactivated?$langs->trans("OtherInformationsBoxes"):''),$selectboxlist,'','','otherboxes');
if ($nbboxactivated)
{
$emptybox=new ModeleBoxes($db);
print '<table width="100%" class="notopnoleftnoright">';
print '<tr><td class="notopnoleftnoright">'."\n";
@ -873,6 +879,7 @@ class FormOther
$ii=0;
foreach ($boxactivated as $key => $box)
{
if ((! empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue;
if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='A'.sprintf("%02d",($ii+1)); // When box_order was not yet set to Axx or Bxx and is still 0
if (preg_match('/^A/i',$box->box_order)) // column A
{
@ -885,7 +892,6 @@ class FormOther
}
}
$emptybox=new ModeleBoxes($db);
$emptybox->box_id='A';
$emptybox->info_box_head=array();
$emptybox->info_box_contents=array();
@ -902,7 +908,8 @@ class FormOther
$ii=0;
foreach ($boxactivated as $key => $box)
{
if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='B'.sprintf("%02d",($ii+1)); // When box_order was not yet set to Axx or Bxx and is still 0
if ((! empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue;
if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='B'.sprintf("%02d",($ii+1)); // When box_order was not yet set to Axx or Bxx and is still 0
if (preg_match('/^B/i',$box->box_order)) // colonne B
{
$ii++;
@ -914,7 +921,6 @@ class FormOther
}
}
$emptybox=new ModeleBoxes($db);
$emptybox->box_id='B';
$emptybox->info_box_head=array();
$emptybox->info_box_contents=array();

View File

@ -33,7 +33,7 @@ class InfoBox
* @param DoliDB $db Database handler
* @param string $mode 'available' or 'activated'
* @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for xxx, ...)
* @param User $user Objet user to filter (used only if $zone >= 0)
* @param User $user Objet user to filter
* @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude
* @return array Array of boxes
*/
@ -50,9 +50,9 @@ class InfoBox
$sql.= " d.rowid as box_id, d.file, d.note, d.tms";
$sql.= " FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d";
$sql.= " WHERE b.box_id = d.rowid";
$sql.= " AND b.entity = ".$conf->entity;
$sql.= " AND b.entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
if ($zone >= 0) $sql.= " AND b.position = ".$zone;
if ($user->id && ! empty($user->conf->$confuserzone)) $sql.= " AND b.fk_user = ".$user->id;
if (is_object($user)) $sql.= " AND b.fk_user IN (0,".$user->id.")";
else $sql.= " AND b.fk_user = 0";
$sql.= " ORDER BY b.box_order";
}
@ -71,7 +71,7 @@ class InfoBox
}
}
dol_syslog(get_class()."::listBoxes get default box list sql=".$sql, LOG_DEBUG);
dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user)?$user->id:'')." sql=".$sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
@ -101,13 +101,13 @@ class InfoBox
$box=new $boxname($db,$obj->note);
// box properties
$box->rowid = (! empty($obj->rowid) ? $obj->rowid : '');
$box->id = (! empty($obj->box_id) ? $obj->box_id : '');
$box->position = (! empty($obj->position) ? $obj->position : '');
$box->box_order = (! empty($obj->box_order) ? $obj->box_order : '');
$box->fk_user = (! empty($obj->fk_user) ? $obj->fk_user : '');
$box->rowid = (empty($obj->rowid) ? '' : $obj->rowid);
$box->id = (empty($obj->box_id) ? '' : $obj->box_id);
$box->position = (empty($obj->position) ? '' : $obj->position);
$box->box_order = (empty($obj->box_order) ? '' : $obj->box_order);
$box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user);
$box->sourcefile=$relsourcefile;
if ($mode == 'activated' && (! $user->id || empty($user->conf->$confuserzone))) // List of activated box was not yet personalized into database
if ($mode == 'activated' && ! is_object($user)) // List of activated box was not yet personalized into database
{
if (is_numeric($box->box_order))
{
@ -116,18 +116,20 @@ class InfoBox
}
}
// box_def properties
$box->box_id = (! empty($obj->box_id) ? $obj->box_id : '');
$box->note = (! empty($obj->note) ? $obj->note : '');
$box->box_id = (empty($obj->box_id) ? '' : $obj->box_id);
$box->note = (empty($obj->note) ? '' : $obj->note);
$enabled=true;
$enabled=$box->enabled;
if (isset($box->depends) && count($box->depends) > 0)
{
foreach($box->depends as $module)
{
//print $boxname.'-'.$module.'<br>';
if (empty($conf->$module->enabled)) $enabled=false;
if (empty($conf->$module->enabled)) $enabled=0;
}
}
//print 'xx module='.$module.' enabled='.$enabled;
if ($enabled) $boxes[]=$box;
}
}
@ -137,9 +139,8 @@ class InfoBox
else
{
//dol_print_error($db);
$error=$db->error();
$error=$db->lasterror();
dol_syslog(get_class()."::listBoxes Error ".$error, LOG_ERR);
return array();
}
return $boxes;

View File

@ -59,13 +59,11 @@ class Menubase
*
* @param DoliDB $db Database handler
* @param string $menu_handler Menu handler
* @param string $type Type
*/
function __construct($db,$menu_handler='',$type='')
function __construct($db,$menu_handler='')
{
$this->db = $db;
$this->menu_handler = $menu_handler;
$this->type = $type;
return 1;
}
@ -434,7 +432,7 @@ class Menubase
$this->newmenu = $newmenu;
// Load datas from database into $tabMenu, later we will complete this->newmenu with values into $tabMenu
if (count($tabMenu) == 0)
if (count($tabMenu) == 0) // To avoid to read into database a second time
{
$this->menuLoad($mainmenu, $leftmenu, $type_user, $menu_handler, $tabMenu);
}
@ -535,7 +533,7 @@ class Menubase
// If type_user == 2, no test required
$sql.= " ORDER BY m.position, m.rowid";
dol_syslog(get_class($this)."::menuLeftCharger sql=".$sql);
dol_syslog(get_class($this)."::menuLoad mymainmenu=".$mymainmenu." myleftmenu=".$myleftmenu." type_user=".$type_user." menu_handler=".$menu_handler." tabMenu size=".count($tabMenu)." sql=".$sql);
$resql = $this->db->query($sql);
if ($resql)
{

View File

@ -169,7 +169,7 @@ class Translate
}
if ($this->defaultlang == 'none_NONE') return 0; // Special language code to not translate keys
//dol_syslog("Translate::Load Start domain=".$domain." alt=".$alt." forcelangdir=".$forcelangdir." this->defaultlang=".$this->defaultlang);
dol_syslog("Translate::Load Start domain=".$domain." alt=".$alt." forcelangdir=".$forcelangdir." this->defaultlang=".$this->defaultlang);
$newdomain = $domain;
$modulename = '';

View File

@ -473,8 +473,8 @@ function dol_strtoupper($utf8_string)
/**
* Write log message into outputs. Possible outputs can be:
* A file if SYSLOG_FILE_ON defined: file name is then defined by SYSLOG_FILE
* Syslog if SYSLOG_SYSLOG_ON defined: facility is then defined by SYSLOG_FACILITY
* SYSLOG_HANDLERS = ["mod_syslog_file"] file name is then defined by SYSLOG_FILE
* SYSLOG_HANDLERS = ["mod_syslog_syslog"] facility is then defined by SYSLOG_FACILITY
* Warning, syslog functions are bugged on Windows, generating memory protection faults. To solve
* this, use logging to files instead of syslog (see setup of module).
* Note: If SYSLOG_FILE_NO_ERROR defined, we never output any error message when writing to log fails.

View File

@ -1250,7 +1250,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
$sql = "SELECT nom as id, nom as lib, libelle as label, description as description";
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
$sql.= " WHERE type = '".$type."'";
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
$resql = $db->query($sql);
if ($resql)

View File

@ -0,0 +1,262 @@
#!/usr/bin/php
<?php
/*
* Copyright (C) 2009-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 2 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/core/lib/invoice2.lib.php
* \ingroup facture
* \brief Function to rebuild PDF and merge PDF files into one
*/
require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
/**
* Function to build a compiled PDF
*
* @param DoliDB $db Database handler
* @param Translate $langs Object langs
* @param Conf $conf Object conf
* @param string $diroutputpdf Dir to output file
* @param string $newlangid Lang id
* @param array $filter Array with filters
* @param date $dateafterdate Invoice after date
* @param date $datebeforedate Invoice before date
* @param date $paymentdateafter Payment after date
* @param date $paymentdatebefore Payment before date
* @param int $usestdout Add information onto standard output
* @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template,
* @return int Error code
*/
function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0)
{
$sql = "SELECT DISTINCT f.rowid, f.facnumber";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sqlwhere='';
$sqlorder='';
if (in_array('all',$filter))
{
$sqlorder = " ORDER BY f.facnumber ASC";
}
if (in_array('date',$filter))
{
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.= " f.fk_statut > 0";
$sqlwhere.= " AND f.datef >= '".$db->idate($dateafterdate)."'";
$sqlwhere.= " AND f.datef <= '".$db->idate($datebeforedate)."'";
$sqlorder = " ORDER BY f.datef ASC";
}
if (in_array('nopayment',$filter))
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture";
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.= " f.fk_statut > 0";
$sqlwhere.= " AND pf.fk_paiement IS NULL";
}
if (in_array('payments',$filter))
{
$sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf,";
$sql.= " ".MAIN_DB_PREFIX."paiement as p";
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.= " f.fk_statut > 0";
$sqlwhere.= " AND f.rowid = pf.fk_facture";
$sqlwhere.= " AND pf.fk_paiement = p.rowid";
$sqlwhere.= " AND p.datep >= '".$db->idate($paymentdateafter)."'";
$sqlwhere.= " AND p.datep <= '".$db->idate($paymentdatebefore)."'";
$sqlorder = " ORDER BY p.datep ASC";
}
if (in_array('nodeposit',$filter))
{
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.=' type <> 3';
}
if (in_array('noreplacement',$filter))
{
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.=' type <> 1';
}
if (in_array('nocreditnote',$filter))
{
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.=' type <> 2';
}
if ($sqlwhere) $sql.=$sqlwhere;
if ($sqlorder) $sql.=$sqlorder;
//print $sql; exit;
dol_syslog("scripts/invoices/rebuild_merge.php: sql=".$sql);
if ($usestdout) print '--- start'."\n";
// Start of transaction
//$db->begin();
$error = 0;
$result = 0;
$files = array() ; // liste les fichiers
dol_syslog("scripts/invoices/rebuild_merge.php sql=".$sql);
if ( $resql=$db->query($sql) )
{
$num = $db->num_rows($resql);
$cpt = 0;
$oldemail = '';
$message = '';
$total = '';
if ($num)
{
// First loop on each resultset to build PDF
// -----------------------------------------
while ($cpt < $num)
{
$obj = $db->fetch_object($resql);
$fac = new Facture($db);
$result=$fac->fetch($obj->rowid);
if ($result > 0)
{
$outputlangs = $langs;
if (! empty($newlangid))
{
if ($outputlangs->defaultlang != $newlangid)
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlangid);
}
}
$filename=$conf->facture->dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf';
if ($regenerate || ! dol_is_file($filename))
{
if ($usestdout) print "Build PDF for invoice ".$obj->facnumber." - Lang = ".$outputlangs->defaultlang."\n";
$result=facture_pdf_create($db, $fac, $regenerate?$regenerate:$fac->modelpdf, $outputlangs);
}
else {
if ($usestdout) print "PDF for invoice ".$obj->facnumber." already exists\n";
}
// Add file into files array
$files[] = $filename;
}
if ($result <= 0)
{
$error++;
if ($usestdout) print "Error: Failed to build PDF for invoice ".$fac->ref."\n";
else dol_syslog("Failed to build PDF for invoice ".$fac->ref, LOG_ERR);
}
$cpt++;
}
// Define format of output PDF
$formatarray=pdf_getFormat();
$page_largeur = $formatarray['width'];
$page_hauteur = $formatarray['height'];
$format = array($page_largeur,$page_hauteur);
if ($usestdout) print "Using output PDF format ".join('x',$format)."\n";
else dol_syslog("Using output PDF format ".join('x',$format), LOG_ERR);
// Now, build a merged files with all files in $files array
//---------------------------------------------------------
// Create empty PDF
$pdf=pdf_getInstance($format);
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
//$pdf->SetCompression(false);
//$pdf->Open();
//$pdf->AddPage();
//$title=$langs->trans("BillsCustomersUnpaid");
//if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid");
//$pdf->MultiCell(100, 3, $title, 0, 'J');
// Add all others
foreach($files as $file)
{
if ($usestdout) print "Merge PDF file for invoice ".$file."\n";
else dol_syslog("Merge PDF file for invoice ".$file);
// Charge un document PDF depuis un fichier.
$pagecount = $pdf->setSourceFile($file);
for ($i = 1; $i <= $pagecount; $i++)
{
$tplidx = $pdf->importPage($i);
$s = $pdf->getTemplatesize($tplidx);
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
$pdf->useTemplate($tplidx);
}
}
// Create output dir if not exists
dol_mkdir($diroutputpdf);
// Save merged file
$filename='mergedpdf';
if (! empty($option)) $filename.='_'.$option;
if ($pagecount)
{
$file=$diroutputpdf.'/'.$filename.'.pdf';
$pdf->Output($file,'F');
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
}
if ($usestdout) print "Merged PDF has been built in ".$file."\n";
$result = 1;
}
else
{
if ($usestdout) print "No invoices found for criteria.\n";
else dol_syslog("No invoices found for criteria");
$result = 0;
}
}
else
{
dol_print_error($db);
dol_syslog("scripts/invoices/rebuild_merge.php: Error");
$error++;
}
if ($error) return -1;
else return $result;
}
?>

View File

@ -42,8 +42,8 @@ function print_smartphone_menu($db,$atarget,$type_user,$limitmenuto)
$tabMenu=array();
$menutop = new Menubase($db,'smartphone','top');
$menuleft = new Menubase($db,'smartphone','left');
$menutop = new Menubase($db,'smartphone');
$menuleft = new Menubase($db,'smartphone');
$newTabMenu = $menutop->menuTopCharger('', '', $type_user, 'smartphone',$tabMenu);
$numTabMenu = count($newTabMenu);

View File

@ -46,7 +46,7 @@ function print_auguria_menu($db,$atarget,$type_user)
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
$tabMenu=array();
$menuArbo = new Menubase($db,'auguria','top');
$menuArbo = new Menubase($db,'auguria');
$newTabMenu = $menuArbo->menuTopCharger('', '', $type_user, 'auguria',$tabMenu);
print_start_menu_array_auguria();
@ -259,7 +259,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after)
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
$tabMenu=array();
$menuArbo = new Menubase($db,'auguria','left');
$menuArbo = new Menubase($db,'auguria');
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
//var_dump($newmenu);
}

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2013 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
@ -31,78 +31,49 @@
/**
* Classe permettant la gestion du menu du haut Auguria
*/
class MenuTop
class MenuManager
{
var $db;
var $require_left=array("auguria_backoffice"); // Si doit etre en phase avec un gestionnaire de menu gauche particulier
var $type_user=0; // Put 0 for internal users, 1 for external users
var $atarget=""; // Valeur du target a utiliser dans les liens
var $menu_array;
var $menu_array_after;
/**
/**
* Constructor
*
* @param DoliDb $db Database handler
*/
function __construct($db)
{
$this->db=$db;
}
/**
* Show menu
*
* @return void
*/
function showmenu()
{
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php';
print_auguria_menu($this->db,$this->atarget,$this->type_user);
}
}
/**
* Classe permettant la gestion du menu du gauche Auguria
*/
class MenuLeft
{
var $db;
var $menu_array;
var $menu_array_after;
/**
* Constructor
*
* @param DoliDB $db Database handler
* @param array &$menu_array Table of menu entries to show before entries of menu handler
* @param array &$menu_array_after Table of menu entries to show after entries of menu handler
*/
function __construct($db,&$menu_array,&$menu_array_after)
function __construct($db, &$menu_array, &$menu_array_after)
{
$this->db=$db;
$this->menu_array=$menu_array;
$this->menu_array_after=$menu_array_after;
}
/**
* Show menu
* Show menu
*
* @return int Number of menu entries shown
* @param string $mode 'top' or 'left'
* @return int Number of menu entries shown
*/
function showmenu()
function showmenu($mode)
{
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php';
$res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after);
$res='ErrorBadParameterForMode';
if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user);
if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after);
return $res;
}
}
}
?>

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2013 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
@ -31,7 +31,7 @@
/**
* Classe permettant la gestion du menu du haut Auguria
*/
class MenuTop
class MenuManager
{
var $db;
var $require_left=array("auguria_backoffice"); // Si doit etre en phase avec un gestionnaire de menu gauche particulier
@ -39,43 +39,10 @@ class MenuTop
var $atarget=""; // Valeur du target a utiliser dans les liens
/**
* Constructor
*
* @param DoliDb $db Database handler
*/
function __construct($db)
{
$this->db=$db;
}
/**
* Show menu
*
* @return void
*/
function showmenu()
{
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php';
print_auguria_menu($this->db,$this->atarget,$this->type_user);
}
}
/**
* Classe permettant la gestion du menu du gauche Auguria
*/
class MenuLeft
{
var $db;
var $menu_array;
var $menu_array_after;
var $menu_array;
var $menu_array_after;
/**
* Constructor
*
@ -83,27 +50,32 @@ class MenuLeft
* @param array &$menu_array Table of menu entries to show before entries of menu handler
* @param array &$menu_array_after Table of menu entries to show after entries of menu handler
*/
function __construct($db,&$menu_array,&$menu_array_after)
function __construct($db, &$menu_array, &$menu_array_after)
{
$this->db=$db;
$this->menu_array=$menu_array;
$this->menu_array_after=$menu_array_after;
}
/**
* Show menu
*
* @return int Number of menu entries shown
*/
function showmenu()
{
* @param string $mode 'top' or 'left'
* @return int Number of menu entries shown
*/
function showmenu($mode)
{
global $conf;
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php';
$res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after);
$conf->global->MAIN_SEARCHFORM_SOCIETE=0;
$conf->global->MAIN_SEARCHFORM_CONTACT=0;
$res='ErrorBadParameterForMode';
if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user);
if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after);
return $res;
}

View File

@ -443,8 +443,8 @@ function print_eldy_menu($db,$atarget,$type_user)
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
$tabMenu=array();
$menuArbo = new Menubase($db,'eldy','top');
$newTabMenu = $menuArbo->menuTopCharger('','',$type_user,'eldy',$tabMenu);
$menuArbo = new Menubase($db,'eldy');
$newTabMenu = $menuArbo->menuTopCharger('','',$type_user,'eldy',$tabMenu); // Return tabMenu with only top entries
$num = count($newTabMenu);
for($i = 0; $i < $num; $i++)
@ -1362,7 +1362,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
$tabMenu=array();
$menuArbo = new Menubase($db,'eldy','left');
$menuArbo = new Menubase($db,'eldy');
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,(empty($user->societe_id)?0:1),'eldy',$tabMenu);
}

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
@ -28,49 +28,15 @@
/**
* Class to manage top menu Eldy (for internal users)
* Classe to manage menu Eldy
*/
class MenuTop
class MenuManager
{
var $db;
var $require_left=array("eldy_backoffice"); // Si doit etre en phase avec un gestionnaire de menu gauche particulier
var $type_user=0; // Put 0 for internal users, 1 for external users
var $atarget=""; // Valeur du target a utiliser dans les liens
/**
* Constructor
*
* @param DoliDb $db Database handler
*/
function __construct($db)
{
$this->db=$db;
}
/**
* Show menu
*
* @return void
*/
function showmenu()
{
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php';
print_eldy_menu($this->db,$this->atarget,$this->type_user);
}
}
/**
* \class MenuLeft
* \brief Classe permettant la gestion du menu du gauche Eldy
*/
class MenuLeft
{
var $db;
var $menu_array;
var $menu_array_after;
@ -82,7 +48,7 @@ class MenuLeft
* @param array &$menu_array Table of menu entries to show before entries of menu handler
* @param array &$menu_array_after Table of menu entries to show after entries of menu handler
*/
function __construct($db,&$menu_array,&$menu_array_after)
function __construct($db, &$menu_array, &$menu_array_after)
{
$this->db=$db;
$this->menu_array=$menu_array;
@ -93,13 +59,16 @@ class MenuLeft
/**
* Show menu
*
* @return int Number of menu entries shown
* @param string $mode 'top' or 'left'
* @return int Number of menu entries shown
*/
function showmenu()
function showmenu($mode)
{
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php';
$res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after);
$res='ErrorBadParameterForMode';
if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user);
if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after);
return $res;
}

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2009 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
@ -28,48 +28,15 @@
/**
* Class to manage top menu Eldy (for external users)
* Class to manage menu Eldy (for external users)
*/
class MenuTop
class MenuManager
{
var $db;
var $require_left=array("eldy_frontoffice"); // Si doit etre en phase avec un gestionnaire de menu gauche particulier
var $type_user=1; // Put 0 for internal users, 1 for external users
var $atarget=""; // Valeur du target a utiliser dans les liens
/**
* Constructor
*
* @param DoliDb $db Database handler
*/
function __construct($db)
{
$this->db=$db;
}
/**
* Show menu
*
* @return void
*/
function showmenu()
{
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php';
print_eldy_menu($this->db,$this->atarget,$this->type_user);
}
}
/**
* Classe permettant la gestion du menu du gauche Eldy
*/
class MenuLeft
{
var $db;
var $menu_array;
var $menu_array_after;
@ -92,17 +59,22 @@ class MenuLeft
/**
* Show menu
*
* @param string $mode 'top' or 'left'
* @return int Number of menu entries shown
*/
function showmenu()
function showmenu($mode)
{
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php';
global $conf;
$res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after);
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php';
$conf->global->MAIN_SEARCHFORM_SOCIETE=0;
$conf->global->MAIN_SEARCHFORM_CONTACT=0;
$res='ErrorBadParameterForMode';
if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user);
if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after);
return $res;
}

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2013 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
@ -21,56 +21,156 @@
*/
/**
* \class MenuTop
* \brief Class for top empty menu
* Class to manage empty menu
*/
class MenuTop
class MenuManager
{
var $db;
var $require_left=array("empty"); // If this top menu handler must be used with a particular left menu handler
var $require_left=array("empty"); // If this top menu handler must be used with a particular left menu handler
var $type_user=0; // Put 0 for internal users, 1 for external users
var $atarget=""; // To store arget to use in menu links
var $atarget=""; // To store arget to use in menu links
var $menu_array;
var $menu_array_after;
/**
* Constructor
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
$this->db=$db;
}
* @param DoliDB $db Database handler
* @param array &$menu_array Table of menu entries to show before entries of menu handler
* @param array &$menu_array_after Table of menu entries to show after entries of menu handler
*/
function __construct($db, &$menu_array, &$menu_array_after)
{
$this->db=$db;
$this->menu_array=$menu_array;
$this->menu_array_after=$menu_array_after;
}
/**
* Show menu
*
* @return void
*/
function showmenu()
{
global $user,$conf,$langs,$dolibarr_main_db_name;
/**
* Show menu
*
* @param string $mode 'top' or 'left'
* @return void
*/
function showmenu($mode)
{
global $user,$conf,$langs,$dolibarr_main_db_name;
print_start_menu_array_empty();
if ($mode == 'top')
{
print_start_menu_array_empty();
$idsel='home';
$classname='class="tmenu"';
$idsel='home';
$classname='class="tmenu"';
print_start_menu_entry_empty($idsel);
print '<a class="tmenuimage" href="'.dol_buildpath('/index.php',1).'?mainmenu=home&amp;leftmenu="'.($this->atarget?' target="'.$this->atarget.'"':'').'>';
print '<div class="mainmenu '.$idsel.'"><span class="mainmenu_'.$idsel.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>';
print '</a>';
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'"'.($this->atarget?' target="'.$this->atarget.'"':'').'>';
print_text_menu_entry_empty($langs->trans("Home"));
print '</a>';
print_end_menu_entry_empty();
print_start_menu_entry_empty($idsel);
print '<a class="tmenuimage" href="'.dol_buildpath('/index.php',1).'?mainmenu=home&amp;leftmenu="'.($this->atarget?' target="'.$this->atarget.'"':'').'>';
print '<div class="mainmenu '.$idsel.'"><span class="mainmenu_'.$idsel.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>';
print '</a>';
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'"'.($this->atarget?' target="'.$this->atarget.'"':'').'>';
print_text_menu_entry_empty($langs->trans("Home"));
print '</a>';
print_end_menu_entry_empty();
print_end_menu_array_empty();
}
print_end_menu_array_empty();
}
if ($mode == 'left')
{
$newmenu = new Menu();
// Put here left menu entries
// ***** START *****
$langs->load("admin"); // Load translation file admin.lang
$newmenu->add("/admin/index.php?leftmenu=setup", $langs->trans("Setup"),0);
$newmenu->add("/admin/company.php", $langs->trans("MenuCompanySetup"),1);
$newmenu->add("/admin/modules.php", $langs->trans("Modules"),1);
$newmenu->add("/admin/menus.php", $langs->trans("Menus"),1);
$newmenu->add("/admin/ihm.php", $langs->trans("GUISetup"),1);
$newmenu->add("/admin/boxes.php", $langs->trans("Boxes"),1);
$newmenu->add("/admin/delais.php",$langs->trans("Alerts"),1);
$newmenu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"),1);
$newmenu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"),1);
$newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"),1);
$newmenu->add("/admin/mails.php?mainmenu=home", $langs->trans("Emails"),1);
$newmenu->add("/admin/sms.php?mainmenu=home", $langs->trans("SMS"),1);
$newmenu->add("/admin/dict.php?mainmenu=home", $langs->trans("DictionnarySetup"),1);
$newmenu->add("/admin/const.php?mainmenu=home", $langs->trans("OtherSetup"),1);
// ***** END *****
// do not change code after this
// override menu_array by value array in $newmenu
$this->menu_array=$newmenu->liste;
$alt=0;
$num=count($this->menu_array);
for ($i = 0; $i < $num; $i++)
{
$alt++;
if (empty($this->menu_array[$i]['level']))
{
if (($alt%2==0))
{
print '<div class="blockvmenuimpair">'."\n";
}
else
{
print '<div class="blockvmenupair">'."\n";
}
}
// Place tabulation
$tabstring='';
$tabul=($this->menu_array[$i]['level'] - 1);
if ($tabul > 0)
{
for ($j=0; $j < $tabul; $j++)
{
$tabstring.='&nbsp; &nbsp;';
}
}
if ($this->menu_array[$i]['level'] == 0) {
if ($this->menu_array[$i]['enabled'])
{
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.dol_buildpath($this->menu_array[$i]['url'],1).'"'.($this->menu_array[$i]['target']?' target="'.$this->menu_array[$i]['target'].'"':'').'>'.$this->menu_array[$i]['titre'].'</a></div>'."\n";
}
else
{
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$this->menu_array[$i]['titre'].'</font></div>'."\n";
}
print '<div class="menu_top"></div>'."\n";
}
if ($this->menu_array[$i]['level'] > 0) {
print '<div class="menu_contenu">';
if ($this->menu_array[$i]['enabled'])
print $tabstring.'<a class="vsmenu" href="'.dol_buildpath($this->menu_array[$i]['url'],1).'">'.$this->menu_array[$i]['titre'].'</a><br>';
else
print $tabstring.'<font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
print '</div>'."\n";
}
// If next is a new block or end
if (empty($this->menu_array[$i+1]['level']))
{
print '<div class="menu_end"></div>'."\n";
print "</div>\n";
}
}
}
}
}
/**
* Output menu entry
*
@ -136,127 +236,4 @@ function print_end_menu_array_empty()
print "\n";
}
/**
* Class for left empty menu
*/
class MenuLeft
{
var $db;
var $menu_array;
var $menu_array_after;
/**
* Constructor
*
* @param DoliDB $db Database handler
* @param array &$menu_array Table of menu entries to show before entries of menu handler
* @param array &$menu_array_after Table of menu entries to show after entries of menu handler
*/
function __construct($db,&$menu_array,&$menu_array_after)
{
$this->db=$db;
$this->menu_array=$menu_array;
$this->menu_array_after=$menu_array_after;
}
/**
* Show menu
*
* @return void
*/
function showmenu()
{
global $user,$conf,$langs,$dolibarr_main_db_name;
$newmenu = new Menu();
// Put here left menu entries
// ***** START *****
$langs->load("admin"); // Load translation file admin.lang
$newmenu->add("/admin/index.php?leftmenu=setup", $langs->trans("Setup"),0);
$newmenu->add("/admin/company.php", $langs->trans("MenuCompanySetup"),1);
$newmenu->add("/admin/modules.php", $langs->trans("Modules"),1);
$newmenu->add("/admin/menus.php", $langs->trans("Menus"),1);
$newmenu->add("/admin/ihm.php", $langs->trans("GUISetup"),1);
$newmenu->add("/admin/boxes.php", $langs->trans("Boxes"),1);
$newmenu->add("/admin/delais.php",$langs->trans("Alerts"),1);
$newmenu->add("/admin/perms.php", $langs->trans("Security"),1);
$newmenu->add("/admin/mails.php", $langs->trans("EMails"),1);
$newmenu->add("/admin/limits.php", $langs->trans("Limits"),1);
$newmenu->add("/admin/dict.php", $langs->trans("DictionnarySetup"),1);
$newmenu->add("/admin/const.php", $langs->trans("OtherSetup"),1);
// ***** END *****
// do not change code after this
// override menu_array by value array in $newmenu
$this->menu_array=$newmenu->liste;
$alt=0;
$num=count($this->menu_array);
for ($i = 0; $i < $num; $i++)
{
$alt++;
if (empty($this->menu_array[$i]['level']))
{
if (($alt%2==0))
{
print '<div class="blockvmenuimpair">'."\n";
}
else
{
print '<div class="blockvmenupair">'."\n";
}
}
// Place tabulation
$tabstring='';
$tabul=($this->menu_array[$i]['level'] - 1);
if ($tabul > 0)
{
for ($j=0; $j < $tabul; $j++)
{
$tabstring.='&nbsp; &nbsp;';
}
}
if ($this->menu_array[$i]['level'] == 0) {
if ($this->menu_array[$i]['enabled'])
{
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.dol_buildpath($this->menu_array[$i]['url'],1).'"'.($this->menu_array[$i]['target']?' target="'.$this->menu_array[$i]['target'].'"':'').'>'.$this->menu_array[$i]['titre'].'</a></div>'."\n";
}
else
{
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$this->menu_array[$i]['titre'].'</font></div>'."\n";
}
print '<div class="menu_top"></div>'."\n";
}
if ($this->menu_array[$i]['level'] > 0) {
print '<div class="menu_contenu">';
if ($this->menu_array[$i]['enabled'])
print $tabstring.'<a class="vsmenu" href="'.dol_buildpath($this->menu_array[$i]['url'],1).'">'.$this->menu_array[$i]['titre'].'</a><br>';
else
print $tabstring.'<font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
print '</div>'."\n";
}
// If next is a new block or end
if (empty($this->menu_array[$i+1]['level']))
{
print '<div class="menu_end"></div>'."\n";
print "</div>\n";
}
}
}
}
?>

View File

@ -126,6 +126,7 @@ class modSociete extends DolibarrModules
$this->boxes[$r][1] = "box_contacts.php";
$r++;
$this->boxes[$r][1] = "box_activity.php";
$this->boxes[$r][2] = '(WarningUsingThisBoxSlowDown)';
$r++;
// Permissions

View File

@ -23,6 +23,8 @@
function init_typeoffields(type)
{
var size = jQuery("#size");
var unique = jQuery("#unique");
var required = jQuery("#required");
if (type == 'date') { size.val('').attr('disabled','disabled'); }
else if (type == 'datetime') { size.val('').attr('disabled','disabled'); }
else if (type == 'double') { size.val('24,8').removeAttr('disabled'); }
@ -30,6 +32,7 @@
else if (type == 'text') { size.val('2000').removeAttr('disabled'); }
else if (type == 'varchar') { size.val('255').removeAttr('disabled'); }
else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled');}
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled');}
else size.val('').attr('disabled','disabled');
}
init_typeoffields();

View File

@ -17,7 +17,7 @@
*/
?>
<!-- BEGIN PHP TEMPLATE admin_extrafields.tpl.php -->
<!-- BEGIN PHP TEMPLATE admin_extrafields_add.tpl.php -->
<script type="text/javascript">
jQuery(document).ready(function() {
function init_typeoffields(type)
@ -32,6 +32,7 @@
else if (type == 'text') { size.val('2000').removeAttr('disabled'); unique.attr('disabled','disabled').removeAttr('checked'); }
else if (type == 'varchar') { size.val('255').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); }
else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled');}
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled');}
else size.val('').attr('disabled','disabled');
}
init_typeoffields('');

View File

@ -17,7 +17,7 @@
*/
?>
<!-- BEGIN PHP TEMPLATE admin_extrafields.tpl.php -->
<!-- BEGIN PHP TEMPLATE admin_extrafields_edit.tpl.php -->
<script type="text/javascript">
jQuery(document).ready(function() {
function init_typeoffields(type)
@ -32,6 +32,7 @@
else if (type == 'text') { size.removeAttr('disabled'); unique.attr('disabled','disabled').removeAttr('checked'); }
else if (type == 'varchar') { size.removeAttr('disabled'); }
else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled');}
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled');}
else size.val('').attr('disabled','disabled');
}
init_typeoffields(jQuery("#type").val());

View File

@ -92,9 +92,9 @@ if (! empty($dolibarr_main_prod)) ini_set('display_errors','Off');
// Clean parameters
$dolibarr_main_data_root=trim($dolibarr_main_data_root);
$dolibarr_main_url_root=trim($dolibarr_main_url_root);
$dolibarr_main_url_root_alt=trim($dolibarr_main_url_root_alt);
$dolibarr_main_url_root_alt=(empty($dolibarr_main_url_root_alt)?'':trim($dolibarr_main_url_root_alt));
$dolibarr_main_document_root=trim($dolibarr_main_document_root);
$dolibarr_main_document_root_alt=trim($dolibarr_main_document_root_alt);
$dolibarr_main_document_root_alt=(empty($dolibarr_main_document_root_alt)?'':trim($dolibarr_main_document_root_alt));
if (empty($dolibarr_main_db_port)) $dolibarr_main_db_port=0; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'

View File

@ -569,6 +569,8 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
}
}
//print 'mem='.memory_get_usage().' - '.memory_get_peak_usage();
llxFooter();
$db->close();

View File

@ -303,7 +303,7 @@ function conf($dolibarr_main_document_root)
// Force usage of log file for install and upgrades
$conf->syslog->enabled=1;
$conf->global->SYSLOG_LEVEL=constant('LOG_DEBUG');
if (! defined('SYSLOG_FILE_ON')) define('SYSLOG_FILE_ON',1);
if (! defined('SYSLOG_HANDLERS')) define('SYSLOG_HANDLERS','["mod_syslog_file"]');
if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant already defined
{
if (@is_writable('/tmp')) define('SYSLOG_FILE','/tmp/dolibarr_install.log');

View File

@ -85,6 +85,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ILS'
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'JMD', '[74,36]', 1, 'Jamaica Dollar');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'JPY', '[165]', 1, 'Japan Yen');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'JEP', '[163]', 1, 'Jersey Pound');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KES', NULL, 1, 'Kenya Shilling');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KZT', '[1083,1074]', 1, 'Kazakhstan Tenge');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KPW', '[8361]', 1, 'Korea (North) Won');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KRW', '[8361]', 1, 'Korea (South) Won');

View File

@ -35,7 +35,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_N
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development',1,0);
-- Hidden and common to all entities
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_FILE_ON','1','chaine','Log to file Directory where to write log file',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_HANDLERS','["mod_syslog_file"]','chaine','Which logger to use',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_FILE','DOL_DATA_ROOT/dolibarr.log','chaine','Directory where to write log file',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_LEVEL','7','chaine','Level of debug info to show',0,0);

View File

@ -352,6 +352,9 @@ Float=Float
DateAndTime=Date and hour
Unique=Unique
Boolean=Boolean (Checkbox)
ExtrafieldPhone = Phone
ExtrafieldPrice = Price
ExtrafieldMail = Email
LibraryToBuildPDF=Library used to build PDF
WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (vat is not applied on local tax)<br>2 : local tax apply on products and services before vat (vat is calculated on amount + localtax)<br>3 : local tax apply on products without vat (vat is not applied on local tax)<br>4 : local tax apply on products before vat (vat is calculated on amount + localtax)<br>5 : local tax apply on services without vat (vat is not applied on local tax)<br>6 : local tax apply on services before vat (vat is calculated on amount + localtax)

View File

@ -129,4 +129,5 @@ WarningsOnXLines=Warnings on <b>%s</b> source lines
WarningNoDocumentModelActivated=No model, for document generation, has been activated. A model will be choosed by default until you check your module setup.
WarningLockFileDoesNotExists=Warning, once setup is finished, you must disable install/migrate tools by adding a file <b>install.lock</b> into directory <b>%s</b>. Missing this file is a security hole.
WarningUntilDirRemoved=All security warnings (visible by admin users only) will remain active as long as the vulnerability is present (or that constant MAIN_REMOVE_INSTALL_WARNING is added in Setup->Other setup).
WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution.
WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution.
WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box.

View File

@ -347,6 +347,9 @@ Int=Numérique entier
Float=Décimal
DateAndTime=Date et heure
Boolean=Booleen (Checkbox)
ExtrafieldPhone = Téléphone
ExtrafieldPrice = Prix
ExtrafieldMail = Email
LibraryToBuildPDF=Bibliothèque utilisée pour la génération des PDF
WarningUsingFPDF=Attention: Votre fichier <b>conf.php</b> contient la directive <b>dolibarr_pdf_force_fpdf=1</b>. Cela signifie que vous utilisez la librairie FPDF pour générer vos fichiers PDF. Cette librairie est ancienne et ne couvre pas de nombreuses fonctionnalitée (Unicode, transparence des images, langues cyrillic, arabes ou asiatiques...), aussi vous pouvez rencontrez des problèmes durant la génération des PDF.<br>Pour résoudre cela et avoir un support complet de PDF, vous pouvez télécharger la <a href="http://www.tcpdf.org/" target="_blank">librairie TCPDF</a> puis commenter ou supprimer la ligne <b>$dolibarr_pdf_force_fpdf=1</b>, et ajouter à la place <b>$dolibarr_lib_TCPDF_PATH='chemin_vers_TCPDF'</b>
LocalTaxDesc=Certains pays appliquent 2 voir 3 taux sur chaque ligne de facture. Si c'est le cas, choisissez le type du deuxième et troisième taux et sa valeur. Les types possibles sont:<br>1 : taxe locale sur les produits et services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>2 : taxe locale sur les produits et services avant tva (la tva est appliquée sur le montant + la taxe locale)<br>3 : taxe locale uniquement sur les produits hors tva (la tva n'est pas appliquée sur la taxe locale)<br>4 : taxe locale uniquement sur les produits avant tva (la tva est appliquée sur le montant + la taxe locale)<br>5 : taxe locale uniquement sur les services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>6 : taxe locale uniquement sur les service avant tva (la tva est appliquée sur le montant + la taxe locale)

View File

@ -130,4 +130,5 @@ WarningsOnXLines=Alertes sur <b>%s</b> lignes sources
WarningNoDocumentModelActivated=Aucun modèle, pour la génération de document, n'a été activé. Un modèle sera pris par défaut en attendant la correction de configuration du module.
WarningLockFileDoesNotExists=Attention, une fois l'installation terminée, les outils d'installation/migration doivent être désactivés en ajoutant un fichier <b>install.lock</b> dans le répertoire <b>%s</b>. L'absence de ce fichier représente une faille de sécurité.
WarningUntilDirRemoved=Les alertes de sécurité sont visibles par les administrateurs uniquement et resteront actives tant que la vulnérabilité sera avérée (ou que la constante MAIN_REMOVE_INSTALL_WARNING aura été définie dans Configuration->Divers)
WarningCloseAlways=Attention, la fermeture se fait même lorsque le montant diffère. N'activez cette fonctionnalité qu'en connaissance de cause.
WarningCloseAlways=Attention, la fermeture se fait même lorsque le montant diffère. N'activez cette fonctionnalité qu'en connaissance de cause.
WarningUsingThisBoxSlowDown=Attention, l'utilisation de cette boite provoque de sérieux ralentissement des pages affichant cette boite.

View File

@ -1271,13 +1271,13 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
if (GETPOST('menu')) $top_menu=GETPOST('menu'); // menu=eldy_backoffice.php
// Load the top menu manager (only if not already done)
if (! class_exists('MenuTop'))
if (! class_exists('MenuManager'))
{
$menufound=0;
$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']);
foreach($dirmenus as $dirmenu)
{
$menufound=dol_include_once($dirmenu."standard/".$top_menu);
$menufound=dol_include_once($dirmenu."standard/".$top_menu);
if ($menufound) break;
}
if (! $menufound) // If failed to include, we try with standard
@ -1296,9 +1296,10 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
print '<div id="tmenu_tooltip" class="tmenu">'."\n";
// Show menu
$menutop = new MenuTop($db);
$dummy1=array();$dummy2=array();
$menutop = new MenuManager($db,$dummy1,$dummy2);
$menutop->atarget=$target;
$menutop->showmenu(); // This contains a \n
$menutop->showmenu('top'); // This contains a \n
print "</div>\n";
@ -1483,8 +1484,8 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
$left_menu=empty($conf->browser->phone)?$conf->top_menu:$conf->smart_menu;
if (GETPOST('menu')) $left_menu=GETPOST('menu'); // menu=eldy_backoffice.php
// Load the top menu manager (only if not already done)
if (! class_exists('MenuLeft'))
// Load the menu manager (only if not already done)
if (! class_exists('MenuManager'))
{
$menufound=0;
$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']);
@ -1505,8 +1506,8 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
print '<div class="vmenu">'."\n";
$menuleft=new MenuLeft($db,$menu_array_before,$menu_array_after);
$menuleft->showmenu(); // output menu_array and menu found in database
$menuleft=new MenuManager($db,$menu_array_before,$menu_array_after);
$menuleft->showmenu('left'); // output menu_array and menu found in database
// Show other forms

View File

@ -56,9 +56,14 @@ if (! empty($user->societe_id)) $socid=$user->societe_id;
$object = new Product($db);
$extrafields = new ExtraFields($db);
if ($id > 0 || ! empty($ref))
{
$object = new Product($db);
$object->fetch($id, $ref);
}
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($id,$ref);
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
$canvas = !empty($object->canvas)?$object->canvas:GETPOST("canvas");
$objcanvas='';
if (! empty($canvas))
{
@ -92,7 +97,6 @@ if (empty($reshook))
// Type
if ($action == 'setfk_product_type' && $user->rights->produit->creer)
{
$object->fetch($id);
$result = $object->setValueFrom('fk_product_type', GETPOST('fk_product_type'));
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
@ -101,7 +105,6 @@ if (empty($reshook))
// Barcode type
if ($action == 'setfk_barcode_type' && $user->rights->barcode->creer)
{
$object->fetch($id);
$result = $object->setValueFrom('fk_barcode_type', GETPOST('fk_barcode_type'));
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
@ -110,7 +113,6 @@ if (empty($reshook))
// Barcode value
if ($action == 'setbarcode' && $user->rights->barcode->creer)
{
$object->fetch($id);
//Todo: ajout verification de la validite du code barre en fonction du type
$result = $object->setValueFrom('barcode', GETPOST('barcode'));
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
@ -119,23 +121,17 @@ if (empty($reshook))
if ($action == 'setaccountancy_code_buy')
{
$object->fetch($id,$ref);
$result = $object->setValueFrom('accountancy_code_buy', GETPOST('accountancy_code_buy'));
if ($result < 0)
{
$mesg=join(',',$object->errors);
}
setEventMessage(join(',',$object->errors), 'errors');
$action="";
}
if ($action == 'setaccountancy_code_sell')
{
$object->fetch($id,$ref);
$result = $object->setValueFrom('accountancy_code_sell', GETPOST('accountancy_code_sell'));
if ($result < 0)
{
$mesg=join(',',$object->errors);
}
setEventMessage(join(',',$object->errors), 'errors');
$action="";
}
@ -146,13 +142,13 @@ if (empty($reshook))
if (! GETPOST('libelle'))
{
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Label')).'</div>';
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Label')), 'errors');
$action = "create";
$error++;
}
if (empty($ref))
{
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Ref')).'</div>';
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Ref')), 'errors');
$action = "create";
$error++;
}
@ -162,10 +158,16 @@ if (empty($reshook))
$object->ref = $ref;
$object->libelle = GETPOST('libelle');
$object->price_base_type = GETPOST('price_base_type');
if ($object->price_base_type == 'TTC') $object->price_ttc = GETPOST('price');
else $object->price = GETPOST('price');
if ($object->price_base_type == 'TTC') $object->price_min_ttc = GETPOST('price_min');
else $object->price_min = GETPOST('price_min');
if ($object->price_base_type == 'TTC')
$object->price_ttc = GETPOST('price');
else
$object->price = GETPOST('price');
if ($object->price_base_type == 'TTC')
$object->price_min_ttc = GETPOST('price_min');
else
$object->price_min = GETPOST('price_min');
$object->tva_tx = str_replace('*','',GETPOST('tva_tx'));
$object->tva_npr = preg_match('/\*/',GETPOST('tva_tx'))?1:0;
@ -230,7 +232,7 @@ if (empty($reshook))
}
else
{
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
setEventMessage($langs->trans($object->error), 'errors');
$action = "create";
}
}
@ -245,7 +247,7 @@ if (empty($reshook))
}
else
{
if ($object->fetch($id,$ref))
if ($object->id > 0)
{
$object->oldcopy=dol_clone($object);
@ -289,14 +291,14 @@ if (empty($reshook))
}
else
{
setEventMessage($langs->trans($object->error), 'errors');
$action = 'edit';
$mesg = $object->error;
}
}
else
{
setEventMessage($langs->trans("ErrorProductBadRefOrLabel"), 'errors');
$action = 'edit';
$mesg = $langs->trans("ErrorProductBadRefOrLabel");
}
}
@ -309,14 +311,14 @@ if (empty($reshook))
{
if (! GETPOST('clone_content') && ! GETPOST('clone_prices') )
{
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
}
else
{
$db->begin();
$originalId = $id;
if ($object->fetch($id,$ref) > 0)
if ($object->id > 0)
{
$object->ref = GETPOST('clone_ref');
$object->status = 0;
@ -351,12 +353,13 @@ if (empty($reshook))
$mesg='<div class="error">'.$langs->trans("ErrorProductAlreadyExists",$object->ref);
$mesg.=' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$object->ref.'">'.$langs->trans("ShowCardHere").'</a>.';
$mesg.='</div>';
setEventMessage($mesg, 'errors');
//dol_print_error($object->db);
}
else
{
$db->rollback();
$mesg=$object->error;
setEventMessage($langs->trans($object->error), 'errors');
dol_print_error($db,$object->error);
}
}
@ -374,10 +377,7 @@ if (empty($reshook))
if ($action == 'confirm_delete' && $confirm != 'yes') { $action=''; }
if ($action == 'confirm_delete' && $confirm == 'yes')
{
$object = new Product($db);
$object->fetch($id,$ref);
if ( ($object->type == 0 && $user->rights->produit->supprimer) || ($object->type == 1 && $user->rights->service->supprimer) )
if (($object->type == 0 && $user->rights->produit->supprimer) || ($object->type == 1 && $user->rights->service->supprimer))
{
$result = $object->delete($object->id);
}
@ -389,7 +389,7 @@ if (empty($reshook))
}
else
{
$mesg=$object->error;
setEventMessage($langs->trans($object->error), 'errors');
$reload = 0;
$action='';
}
@ -397,7 +397,7 @@ if (empty($reshook))
// Add product into proposal
if ($action == 'addinpropal')
if ($object->id > 0 && $action == 'addinpropal')
{
$propal = new Propal($db);
$result=$propal->fetch(GETPOST('propalid'));
@ -415,35 +415,27 @@ if (empty($reshook))
exit;
}
$prod = new Product($db);
$result=$prod->fetch($id,$ref);
if ($result <= 0)
{
dol_print_error($db,$prod->error);
exit;
}
$desc = $object->description;
$desc = $prod->description;
$tva_tx = get_default_tva($mysoc, $soc, $prod->id);
$tva_tx = get_default_tva($mysoc, $soc, $object->id);
$localtax1_tx= get_localtax($tva_tx, 1, $soc);
$localtax2_tx= get_localtax($tva_tx, 2, $soc);
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_base_type = $prod->price_base_type;
$pu_ht = $object->price;
$pu_ttc = $object->price_ttc;
$price_base_type = $object->price_base_type;
// If multiprice
if ($conf->global->PRODUIT_MULTIPRICES && $soc->price_level)
{
$pu_ht = $prod->multiprices[$soc->price_level];
$pu_ttc = $prod->multiprices_ttc[$soc->price_level];
$price_base_type = $prod->multiprices_base_type[$soc->price_level];
$pu_ht = $object->multiprices[$soc->price_level];
$pu_ttc = $object->multiprices_ttc[$soc->price_level];
$price_base_type = $object->multiprices_base_type[$soc->price_level];
}
// On reevalue prix selon taux tva car taux tva transaction peut etre different
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
if ($tva_tx != $prod->tva_tx)
if ($tva_tx != $object->tva_tx)
{
if ($price_base_type != 'HT')
{
@ -463,7 +455,7 @@ if (empty($reshook))
$tva_tx,
$localtax1_tx, // localtax1
$localtax2_tx, // localtax2
$prod->id,
$object->id,
GETPOST('remise_percent'),
$price_base_type,
$pu_ttc
@ -474,11 +466,11 @@ if (empty($reshook))
return;
}
$mesg = $langs->trans("ErrorUnknown").": $result";
setEventMessage($langs->trans("ErrorUnknown").": $result", 'errors');
}
// Add product into order
if ($action == 'addincommande')
if ($object->id > 0 && $action == 'addincommande')
{
$commande = new Commande($db);
$result=$commande->fetch(GETPOST('commandeid'));
@ -496,36 +488,28 @@ if (empty($reshook))
exit;
}
$prod = new Product($db);
$result=$prod->fetch($id,$ref);
if ($result <= 0)
{
dol_print_error($db,$prod->error);
exit;
}
$desc = $object->description;
$desc = $prod->description;
$tva_tx = get_default_tva($mysoc, $soc, $prod->id);
$tva_tx = get_default_tva($mysoc, $soc, $object->id);
$localtax1_tx= get_localtax($tva_tx, 1, $soc);
$localtax2_tx= get_localtax($tva_tx, 2, $soc);
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_base_type = $prod->price_base_type;
$pu_ht = $object->price;
$pu_ttc = $object->price_ttc;
$price_base_type = $object->price_base_type;
// If multiprice
if ($conf->global->PRODUIT_MULTIPRICES && $soc->price_level)
{
$pu_ht = $prod->multiprices[$soc->price_level];
$pu_ttc = $prod->multiprices_ttc[$soc->price_level];
$price_base_type = $prod->multiprices_base_type[$soc->price_level];
$pu_ht = $object->multiprices[$soc->price_level];
$pu_ttc = $object->multiprices_ttc[$soc->price_level];
$price_base_type = $object->multiprices_base_type[$soc->price_level];
}
// On reevalue prix selon taux tva car taux tva transaction peut etre different
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
if ($tva_tx != $prod->tva_tx)
if ($tva_tx != $object->tva_tx)
{
if ($price_base_type != 'HT')
{
@ -545,7 +529,7 @@ if (empty($reshook))
$tva_tx,
$localtax1_tx, // localtax1
$localtax2_tx, // localtax2
$prod->id,
$object->id,
GETPOST('remise_percent'),
'',
'',
@ -561,7 +545,7 @@ if (empty($reshook))
}
// Add product into invoice
if ($action == 'addinfacture' && $user->rights->facture->creer)
if ($object->id > 0 && $action == 'addinfacture' && $user->rights->facture->creer)
{
$facture = New Facture($db);
$result=$facture->fetch(GETPOST('factureid'));
@ -579,35 +563,27 @@ if (empty($reshook))
exit;
}
$prod = new Product($db);
$result = $prod->fetch($id,$ref);
if ($result <= 0)
{
dol_print_error($db,$prod->error);
exit;
}
$desc = $object->description;
$desc = $prod->description;
$tva_tx = get_default_tva($mysoc, $soc, $prod->id);
$tva_tx = get_default_tva($mysoc, $soc, $object->id);
$localtax1_tx= get_localtax($tva_tx, 1, $soc);
$localtax2_tx= get_localtax($tva_tx, 2, $soc);
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_base_type = $prod->price_base_type;
$pu_ht = $object->price;
$pu_ttc = $object->price_ttc;
$price_base_type = $object->price_base_type;
// If multiprice
if ($conf->global->PRODUIT_MULTIPRICES && $soc->price_level)
{
$pu_ht = $prod->multiprices[$soc->price_level];
$pu_ttc = $prod->multiprices_ttc[$soc->price_level];
$price_base_type = $prod->multiprices_base_type[$soc->price_level];
$pu_ht = $object->multiprices[$soc->price_level];
$pu_ttc = $object->multiprices_ttc[$soc->price_level];
$price_base_type = $object->multiprices_base_type[$soc->price_level];
}
// On reevalue prix selon taux tva car taux tva transaction peut etre different
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
if ($tva_tx != $prod->tva_tx)
if ($tva_tx != $object->tva_tx)
{
if ($price_base_type != 'HT')
{
@ -627,7 +603,7 @@ if (empty($reshook))
$tva_tx,
$localtax1_tx,
$localtax2_tx,
$prod->id,
$object->id,
GETPOST('remise_percent'),
'',
'',
@ -649,7 +625,7 @@ if (empty($reshook))
if (GETPOST("cancel") == $langs->trans("Cancel"))
{
$action = '';
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
exit;
}
@ -677,15 +653,10 @@ $formproduct = new FormProduct($db);
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
{
// -----------------------------------------
// When used with CANVAS
// When used with CANVAS (more simple)
// -----------------------------------------
if (empty($object->error) && ($id || $ref))
{
$object = new Product($db);
$object->fetch($id, $ref);
}
$objcanvas->assign_values($action, $object->id, $ref); // Set value for templates
$objcanvas->display_canvas($action); // Show template
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
$objcanvas->display_canvas($action); // Show template
}
else
{
@ -717,8 +688,6 @@ else
else $title=$langs->trans("NewProduct");
print_fiche_titre($title);
dol_htmloutput_mesg($mesg);
print '<table class="border" width="100%">';
print '<tr>';
$tmpcode='';
@ -887,10 +856,8 @@ else
* Product card
*/
else if ($id || $ref)
else if ($object->id > 0)
{
$res=$object->fetch($id,$ref);
if ($res < 0) { dol_print_error($db,$object->error); exit; }
$res=$object->fetch_optionals($object->id,$extralabels);
// Fiche en mode edition
@ -903,8 +870,6 @@ else
if ($object->isservice()) $type = $langs->trans('Service');
print_fiche_titre($langs->trans('Modify').' '.$type.' : '.$object->ref, "");
dol_htmloutput_errors($mesg);
// Main official, simple, and not duplicated code
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -1066,8 +1031,6 @@ else
// Fiche en mode visu
else
{
dol_htmloutput_mesg($mesg);
$head=product_prepare_head($object, $user);
$titre=$langs->trans("CardProduct".$object->type);
$picto=($object->type==1?'service':'product');

View File

@ -2155,7 +2155,6 @@ div.tabsAction {
table.noborder {
margin-bottom: 10px;
position: relative;
float: left;
border: none;
}

View File

@ -0,0 +1,475 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="117.498"
id="Layer_1"
inkscape:version="0.45.1"
sodipodi:docbase="/Users/johnolsen/Desktop/openclipart-0.20-pre/recovered-zerobyte-files/unsorted"
sodipodi:docname="ruota_dentata_grigia_2_01r.svg"
sodipodi:version="0.32"
space="preserve"
style="overflow:visible;enable-background:new 0 0 136.676 117.498;"
version="1.1"
viewBox="0 0 136.676 117.498"
width="136.676"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<metadata
id="metadata3">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:title>Ruota dentata grigia 2</dc:title>
<dc:description />
<dc:subject>
<rdf:Bag>
<rdf:li>gears</rdf:li>
<rdf:li>machine</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:publisher>
<cc:Agent
rdf:about="http://www.openclipart.org/">
<dc:title>Open Clip Art Library</dc:title>
</cc:Agent>
</dc:publisher>
<dc:creator>
<cc:Agent>
<dc:title>Architetto Francesco Rollandin</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title>Architetto Francesco Rollandin</dc:title>
</cc:Agent>
</dc:rights>
<dc:date />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<cc:license
rdf:resource="http://web.resource.org/cc/PublicDomain" />
<dc:language>en</dc:language>
</cc:Work>
<cc:License
rdf:about="http://web.resource.org/cc/PublicDomain">
<cc:permits
rdf:resource="http://web.resource.org/cc/Reproduction" />
<cc:permits
rdf:resource="http://web.resource.org/cc/Distribution" />
<cc:permits
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs174" />
<sodipodi:namedview
bordercolor="#666666"
borderopacity="1.0"
id="base"
inkscape:current-layer="Layer_1"
inkscape:cx="68.337997"
inkscape:cy="58.749001"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:window-height="510"
inkscape:window-width="787"
inkscape:window-x="88"
inkscape:window-y="116"
inkscape:zoom="3.0638819"
pagecolor="#ffffff" />
<g
id="g3">
<g
id="g5">
<radialGradient
cx="37.127"
cy="36.9868"
gradientUnits="userSpaceOnUse"
id="XMLID_9_"
r="36.7183">
<stop
id="stop8"
offset="0"
style="stop-color:#F8F8F8" />
<stop
id="stop10"
offset="1"
style="stop-color:#7F7F7F" />
</radialGradient>
<path
d="M69.797,31.428c-2.104,0-4.208,0.024-6.31,0.103c-0.5-2.485-1.384-4.889-2.597-7.115 c-0.623-1.144-1.759-1.726-0.657-2.729c0.752-0.685,1.491-1.384,2.221-2.092c1.417-1.372,4.173-3.386,2.82-5.641 c-1.344-2.234-5.327-6.916-8.151-4.896c-1.817,1.301-3.36,3.238-4.881,4.868c-1.026,1.1-5.618-1.865-7.336-2.388 c-1.277-0.391-2.467-0.004-2.389-1.524c0.055-1.059,0.084-2.121,0.102-3.182c0.026-1.63,0.486-4.283-0.894-5.549 c-1.501-1.377-7.301-1.217-9.029-0.329c-1.62,0.829-1.397,3.083-1.39,4.584c0.007,1.119,0.022,2.237,0.05,3.356 c0.043,1.614,0.563,1.746-1.198,2.15c-2.46,0.565-4.842,1.466-7.06,2.674c-1.51,0.82-1.223,0.433-2.27-0.694 c-0.997-1.07-2.019-2.114-3.052-3.148c-3.314-3.314-6.409,0.799-8.631,3.433c-1.368,1.622-0.793,3.173,0.612,4.581 c0.866,0.864,1.74,1.725,2.623,2.574c1.674,1.616,1.38,1.43,0.244,3.397c-1.174,2.034-2.064,4.232-2.636,6.512 c-0.496,1.979-3.901,1.051-5.833,1.051c-4.508,0-3.667,4.006-3.708,7.305c-0.056,4.673,3.73,4.065,7.451,3.998 c1.683-0.032,1.907-0.562,2.45,1.193c0.378,1.229,0.85,2.429,1.411,3.586c0.557,1.15,1.2,2.259,1.92,3.316 c1.091,1.602-0.094,1.768-1.363,2.972c-1.339,1.273-3.922,3.03-4.023,5.062c-0.086,1.697,1.82,2.993,2.872,4.045 c1.053,1.053,2.349,2.963,4.049,2.877c2.228-0.117,4.309-3.217,5.72-4.699c0.622-0.649,1.234-1.304,1.836-1.971 c1.348,0.759,2.758,1.404,4.214,1.926c1.487,0.536,3.022,0.944,4.576,1.223c-0.11,1.273-0.165,2.555-0.2,3.832 c-0.052,1.889-0.733,5.346,0.867,6.813c1.339,1.23,3.947,0.664,5.584,0.699c1.421,0.029,3.431,0.254,4.303-1.172 c1.313-2.146,0.526-6.092,0.439-8.5c-0.061-1.633-0.568-1.674,1.216-2.137c1.697-0.441,3.356-1.039,4.942-1.789 c1.954-0.921,1.964-1.533,3.434,0.096c0.998,1.109,2.033,2.187,3.081,3.251c1.611,1.637,3.374,3.396,5.533,1.572 c1.5-1.268,4.249-3.416,4.817-5.361c0.682-2.34-2.762-4.652-4.17-6.005c-1.25-1.199-2.644-1.551-1.598-3.146 c0.893-1.362,1.658-2.809,2.277-4.315c0.466-1.141,0.85-2.315,1.149-3.51c1.344,0.086,2.69,0.13,4.037,0.152 c1.942,0.035,5.384,0.586,6.062-1.928C74.252,37.396,74.396,31.428,69.797,31.428 M36.605,47.284 c-5.926,0-11.263-4.704-11.263-10.779c0-6.072,5.337-10.776,11.263-10.776c5.928,0,11.263,4.704,11.263,10.776 C47.868,42.58,42.533,47.284,36.605,47.284"
id="path12"
style="fill:url(#XMLID_9_);" />
<linearGradient
gradientTransform="matrix(776.0099 550.007 550.007 -776.0099 -63461.2188 484554.125)"
gradientUnits="userSpaceOnUse"
id="XMLID_10_"
x1="-240.439"
x2="-239.5556"
y1="454.2002"
y2="454.2002">
<stop
id="stop15"
offset="0"
style="stop-color:#FFFFFF" />
<stop
id="stop17"
offset="1"
style="stop-color:#000000" />
</linearGradient>
<path
d="M36.97,1.034c1.239-0.02,2.645-0.226,3.825,0.203c1.992,0.725,1.412,3.967,1.387,5.556 c-0.016,0.854-0.626,3.784-0.18,4.479c0.454,0.705,5.155,1.509,6.166,1.97c3.843,1.753,3.048,2.409,5.915-0.563 c1.487-1.54,3.83-5.064,6.207-3.224c1.483,1.151,5.507,4.62,4.788,6.466c-0.725,1.866-2.986,3.445-4.417,4.779 c-1.63,1.519-1.878,1.044-0.76,2.876c1.291,2.119,2.266,4.428,2.875,6.833c0.337,1.334-0.045,1.582,1.135,1.562 c2.27-0.038,5.752-0.722,7.908,0.223c1.965,0.864,1.264,5.11,1.242,6.997c-0.054,4.715-6.75,3.147-9.983,2.946 c0.088,0.007-3.788,8.28-4.429,9.174c-0.306,0.426,4.104,4.214,4.673,4.762c2.757,2.655,1.575,4.089-0.843,6.521 c-3.369,3.385-4.398,3.078-7.773-0.41c-1.198-1.237-2.375-2.498-3.482-3.818c-0.292-0.351-3.354,1.548-3.901,1.774 c-0.823,0.345-4.965,1.03-5.319,1.602c-0.558,0.904,0.173,4.471,0.184,5.568c0.056,4.754-0.499,5.846-5.216,5.846 c-1.245,0-2.626,0.229-3.816-0.203c-2.23-0.813-1.407-5.029-1.36-6.791c0.024-0.836,0.656-3.572,0.241-4.268 c-0.316-0.533-4.68-1.182-5.481-1.491c-0.439-0.168-3.771-1.955-3.932-1.787c-0.85,0.888-1.702,1.774-2.554,2.661 c-1.104,1.152-3.197,4.119-4.98,4.064c-1.566-0.025-5.554-4.211-6.19-5.638c-1.558-3.503,5.617-5.236,6.128-7.786 c0.025-0.118-5.512-9.676-4.793-9.687c-2.005,0.027-4.08,0.229-6.079,0.084c-3.889,0-3.278-3.372-3.251-6.247 c-0.089-4.125,2.016-4.222,5.478-4.151c1.193,0.023,2.384,0.047,3.577,0.071c0.249,0.005,1.303-4.232,1.519-4.771 c0.747-1.854,1.73-3.583,2.871-5.22c0.244-0.353-1.078-1.31-1.337-1.562c-1.876-1.826-5.813-4.392-3.265-7.136 c1.17-1.261,3.649-4.454,5.356-4.454c2.088,0,4.67,3.768,5.952,5.108c1.693,1.774,3.542-0.61,5.654-1.409 c2.2-0.831,5.182-0.202,5.137-2.757c-0.031-1.815-0.219-3.701-0.096-5.513C31.748,0.808,34.232,0.991,36.97,1.034 M38.871,0.124 c-2.057,0-5.473-0.613-7.011,0.884c-1.738,1.723-0.946,5.989-0.909,8.187c0.034,2.009-1.685,1.569-3.439,2.15 c-0.819,0.271-5.278,2.577-5.594,2.246c-1.613-1.697-3.74-4.872-6.114-5.526c-2.324-0.643-4.227,2.122-5.673,3.612 c-3.202,3.076-2.292,4.962,0.545,7.721c0.881,0.854,1.758,1.713,2.643,2.563c-1.412,2.068-2.529,4.333-3.291,6.717 c-0.758,2.375-0.383,2.418-2.755,2.373c-1.375-0.027-2.817-0.169-4.186,0.002c-3.611,0.452-3.044,4.039-3.065,6.789 c-0.035,4.538,1.767,5.404,5.901,5.338c1.249-0.021,2.498-0.044,3.748-0.06c0.623,2.333,1.579,4.575,2.825,6.643 c0.769,1.273,1.829,1.586,0.575,2.733c-0.892,0.818-1.768,1.654-2.632,2.501C9.16,56.25,7.239,57.925,8.04,59.95 c0.657,1.654,4.427,5.427,6.082,6.083c2.585,1.025,4.936-2.428,6.465-4.018c0.76-0.791,1.516-1.587,2.284-2.372 c2.198,1.196,4.552,2.098,6.987,2.676c1.7,0.404,1.2,0.467,1.125,2.006c-0.05,1.045-0.082,2.086-0.097,3.129 c-0.033,1.932-0.516,5.109,1.625,6.188c1.726,0.867,5.33,0.545,7.303,0.395c4.595-0.355,3.293-6.627,3.187-9.797 c-0.051-1.543-0.539-1.662,1.121-2.107c1.184-0.32,2.347-0.713,3.478-1.182c1.13-0.466,2.229-1.008,3.29-1.617 c0.584,0.686,1.188,1.352,1.802,2.01c2.414,2.594,5.336,6.855,8.854,3.469c1.522-1.469,4.513-3.689,4.556-5.842 c0-2.301-3.116-4.448-4.613-5.886c-1.159-1.115-2.074-1.263-1.152-2.703c1.236-1.937,2.216-4.036,2.903-6.228 c1.062-3.392,9.775,1.873,10.625-3.728c0.302-2,0.59-7.022-0.808-8.442c-1.672-1.711-5.718-0.957-7.862-0.92 c-2.125,0.036-1.675-1.533-2.36-3.397c-0.626-1.704-3.194-4.84-1.912-6.016c3.534-3.244,7.237-5.832,2.896-9.974 c-1.449-1.497-3.346-4.25-5.678-3.615c-2.209,0.599-4.229,3.527-5.745,5.093c-1.375,1.42-2.271,0.018-3.948-0.74 c-1.472-0.666-5.549-1.219-5.477-2.725C43.158,5.786,44.273,0.124,38.871,0.124"
id="path19"
style="fill:url(#XMLID_10_);" />
<linearGradient
gradientTransform="matrix(0 -214.9991 -214.9991 0 100706.3594 -51430.5625)"
gradientUnits="userSpaceOnUse"
id="XMLID_11_"
x1="-239.7344"
x2="-238.879"
y1="468.2344"
y2="468.2344">
<stop
id="stop22"
offset="0"
style="stop-color:#FFFFFF" />
<stop
id="stop24"
offset="1"
style="stop-color:#000000" />
</linearGradient>
<path
d="M24.902,36.506c0,14.54,23.404,14.54,23.404,0C48.306,21.969,24.902,21.969,24.902,36.506 M25.787,36.506c0-13.399,21.637-13.399,21.637,0C47.424,49.907,25.787,49.907,25.787,36.506"
id="path26"
style="fill:url(#XMLID_11_);" />
<radialGradient
cx="36.6045"
cy="36.5073"
gradientUnits="userSpaceOnUse"
id="XMLID_12_"
r="19.4923">
<stop
id="stop29"
offset="0"
style="stop-color:#F3F3F3" />
<stop
id="stop31"
offset="0.4367"
style="stop-color:#F1F1F1" />
<stop
id="stop33"
offset="0.594"
style="stop-color:#EAEAEA" />
<stop
id="stop35"
offset="0.7061"
style="stop-color:#DEDEDE" />
<stop
id="stop37"
offset="0.7968"
style="stop-color:#CDCDCD" />
<stop
id="stop39"
offset="0.8745"
style="stop-color:#B7B7B7" />
<stop
id="stop41"
offset="0.9419"
style="stop-color:#9D9D9D" />
<stop
id="stop43"
offset="1"
style="stop-color:#7F7F7F" />
</radialGradient>
<path
d="M36.605,17.789c-10.363,0-20.237,7.9-20.237,18.716c0,10.821,9.87,18.721,20.237,18.721 c10.366,0,20.236-7.899,20.236-18.721C56.841,25.689,46.967,17.789,36.605,17.789 M36.605,52.347 c-8.771,0-17.129-6.681-17.129-15.842c0-9.158,8.357-15.84,17.129-15.84c8.773,0,17.129,6.682,17.129,15.84 C53.734,45.666,45.378,52.347,36.605,52.347"
id="path45"
style="fill:url(#XMLID_12_);" />
<path
d="M13.398,26.637c0.774-1.19,1.558-2.372,2.389-3.524C14.541,22.855,13.759,25.734,13.398,26.637 M60.229,10.748c-0.839-3.328-5.762,2.348-6.603,3.248c-0.255,0.272-1.703,2.232-2.158,2.098c-2.732-2.019-5.922-3.38-9.233-4.115 c-0.602,2.024,4.622,2.59,6.166,3.361c1.193,0.597,2.364,2.42,3.517,1.359c1.912-1.76,3.656-3.77,5.727-5.342 c0.5-0.378,2.845-0.592,2.686,0.169C60.296,11.267,60.261,11.009,60.229,10.748 M22.696,16.173 c1.841-1.179,3.885-2.006,6.021-2.476c1.445-0.319,3.418,0.096,2.81-1.967C29.854,12.045,22.115,13.85,22.696,16.173"
id="path47"
style="fill:#E8E8E8;" />
<path
d="M40.801,2.027c0,1.309-7.948,1.309-7.948,0C32.853,0.721,40.801,0.721,40.801,2.027"
id="path49"
style="fill:#E8E8E8;" />
<path
d="M36.827,71.629c-0.374,0-3.973-0.07-3.973,0.717c0,1.078,7.948,1.078,7.948,0 C40.802,71.559,37.201,71.629,36.827,71.629"
id="path51"
style="fill:#616161;" />
<path
d="M6.14,40.647c-0.375,0-3.974-0.072-3.974,0.715c0,1.068,7.949,1.067,7.949,0 C10.115,40.575,6.514,40.647,6.14,40.647"
id="path53"
style="fill:#616161;" />
<path
d="M67.811,40.647c-0.375,0-3.976-0.072-3.976,0.715c0,1.068,7.95,1.068,7.95,0 C71.785,40.575,68.185,40.647,67.811,40.647"
id="path55"
style="fill:#616161;" />
<path
d="M9.792,59.263c-0.722,0,1.255,2.393,1.304,2.45c0.806,0.908,2.653,3.262,4.047,3.262 c0.018,0.012-1.103-2.219-1.356-2.5C12.987,61.576,11.168,59.26,9.792,59.263"
id="path57"
style="fill:#616161;" />
<path
d="M52.626,58.38c-0.323,0,4.192,6.952,5.48,5.667C58.937,63.217,53.682,58.38,52.626,58.38"
id="path59"
style="fill:#616161;" />
<path
d="M14.876,9.294c0.585,0.587-5.19,6.364-5.776,5.777C8.515,14.485,14.29,8.711,14.876,9.294"
id="path61"
style="fill:#E8E8E8;" />
<path
d="M64.251,15.6c-1.097,0-6.256,5.22-5.692,5.805C59.587,22.434,64.273,15.6,64.251,15.6"
id="path63"
style="fill:#616161;" />
<path
d="M64.544,59.165c-1.094,0-6.242,5.253-5.693,5.806C59.941,66.006,64.536,59.165,64.544,59.165"
id="path65"
style="fill:#616161;" />
<path
d="M20.83,59.165c-1.027,0-2.57,1.904-3.196,2.531c-0.261,0.256-2.573,3.281-2.49,3.279 C16.416,65.994,20.688,59.165,20.83,59.165"
id="path67"
style="fill:#616161;" />
<path
d="M15.252,64.514c-0.038,0.152-0.076,0.305-0.116,0.457C15.519,65.352,14.916,63.666,15.252,64.514"
id="path69"
style="fill:#937342;" />
<path
d="M9.724,32.605c0,0.748-6.874-0.294-7.207,0.697c-0.206,0.604-0.272,6.191-0.686,6.148 c-0.956-0.1-0.125-5.601-0.045-6.317C1.983,31.369,9.724,32.056,9.724,32.605"
id="path71"
style="fill:#E8E8E8;" />
<path
d="M13.096,55.846c-0.202,0.2-2.556,2.647-2.968,2.237c-0.544-0.545,4.658-5.751,5.203-5.204 C15.742,53.29,13.293,55.646,13.096,55.846"
id="path73"
style="fill:#E8E8E8;" />
<path
d="M71.71,32.717c0,0.664-8.28,0.664-8.28,0S71.71,32.053,71.71,32.717"
id="path75"
style="fill:#E8E8E8;" />
<path
d="M56.397,41.417C52,54.902,33,59.984,22.625,50.052c0,2.076,4.386,4.566,5.831,5.331 c5.042,2.663,10.997,2.66,16.307,0.788C51.468,53.809,55.329,48.249,56.397,41.417 M56.655,40.31 c-0.172,0.344-0.258,0.713-0.258,1.107C56.248,41.877,56.802,40.31,56.655,40.31"
id="path77"
style="fill:#666666;" />
<path
d="M50.267,50.315c-4.632,3.794-11.138,5.484-17.048,4.649C39.243,55.904,45.597,54.271,50.267,50.315 "
id="path79"
style="fill:#7F7F7F;" />
<path
d="M19.974,33.857c0-5.145,4.561-10.122,8.929-12.107c4.752-2.158,10.031-2.196,14.745,0.06 c0.604,0.289,7.501,4.297,6.632,5.418c0.23-0.297-4.358-3.686-4.701-3.88c-4.349-2.472-9.739-2.556-14.436-1.079 C26.833,23.625,19.974,28.767,19.974,33.857"
id="path81"
style="fill:#E8E8E8;" />
<path
d="M16.298,33.73c0-6.272,6.022-12.355,11.28-14.702c5.727-2.555,12.096-2.682,17.759,0.082 c2.099,1.023,4.093,2.356,5.769,3.985c0.09,0.087,1.803,2.16,1.494,2.172c-0.362,0.014-1.202-1.281-1.415-1.514 c-1.24-1.342-2.646-2.528-4.211-3.476c-5.246-3.173-11.879-3.266-17.57-1.271c-4.594,1.615-8.39,4.837-10.785,9.065 C17.822,29.476,16.298,32.3,16.298,33.73"
id="path83"
style="fill:#E8E8E8;" />
<path
d="M53.723,36.873c0.042,0-0.991,3.65-1.078,3.864c-1.133,2.814-2.986,5.319-5.422,7.141 c-7.91,5.91-18.783,4.461-25.069-2.863c8.495,12.314,31.065,7.669,31.571-8.142"
id="path85"
style="fill:#E8E8E8;" />
<path
d="M48.96,47.479c-0.483,0.462-0.99,0.897-1.523,1.3C47.974,48.379,48.481,47.947,48.96,47.479 M21.784,44.667c-0.221,0,2.822,3.182,3.064,3.359C24.323,47.569,22.31,44.667,21.784,44.667"
id="path87"
style="fill:#E8E8E8;" />
</g>
<g
id="g89">
<radialGradient
cx="-307.792"
cy="1412.0313"
gradientTransform="matrix(0.7098 0.7044 -0.7044 0.7098 1308.764 -709.1834)"
gradientUnits="userSpaceOnUse"
id="XMLID_13_"
r="40.8459">
<stop
id="stop92"
offset="0"
style="stop-color:#F8F8F8" />
<stop
id="stop94"
offset="1"
style="stop-color:#7F7F7F" />
</radialGradient>
<path
d="M125.813,97.477c-1.662-1.65-3.341-3.279-5.064-4.865c1.552-2.354,2.737-4.941,3.524-7.652 c0.403-1.389-0.036-2.74,1.618-2.67c1.132,0.049,2.264,0.078,3.396,0.092c2.193,0.025,5.949,0.596,6.645-2.246 c0.691-2.818,1.212-9.637-2.601-10.252c-2.452-0.396-5.189-0.076-7.668,0.02c-1.67,0.064-2.975-5.875-3.92-7.637 c-0.704-1.306-1.946-1.935-0.693-3.072c0.875-0.795,1.729-1.609,2.572-2.435c1.3-1.266,3.74-3,3.643-5.081 c-0.105-2.266-4.811-6.68-6.871-7.336c-1.93-0.613-3.52,1.34-4.69,2.533c-0.871,0.887-1.737,1.784-2.589,2.688 c-1.234,1.31-0.922,1.819-2.63,0.76c-2.388-1.481-4.975-2.637-7.673-3.421c-1.835-0.534-1.305-0.615-1.248-2.326 c0.052-1.624,0.063-3.251,0.057-4.875c-0.021-5.215-5.688-4.392-9.503-4.052c-2.354,0.208-3.116,1.882-3.108,4.094 c0.006,1.362,0.022,2.725,0.053,4.088c0.06,2.586-0.028,2.209-2.467,2.873c-2.522,0.687-4.947,1.724-7.188,3.077 c-1.939,1.174-3.9-2.227-5.428-3.74c-3.56-3.532-6.034,0.288-8.65,2.863c-3.707,3.647-0.241,6.132,2.75,8.993 c1.354,1.295,1.946,1.051,0.999,2.862c-0.664,1.268-1.231,2.584-1.693,3.94c-0.462,1.344-0.824,2.723-1.083,4.119 c-0.395,2.123-1.46,1.322-3.406,1.279c-2.053-0.045-5.47-0.68-7.142,0.844c-1.399,1.273-0.908,3.791-0.901,5.443 c0.005,1.656-0.468,4.184,0.942,5.447c1.851,1.652,5.922,0.834,8.2,0.771c0.997-0.029,1.995-0.063,2.99-0.117 c0.471,1.654,1.08,3.268,1.819,4.82c0.755,1.59,1.646,3.113,2.657,4.551c-1.086,0.922-2.132,1.889-3.161,2.873 c-1.52,1.449-4.768,3.645-4.655,6.057c0.093,2.02,2.597,3.617,3.863,4.926c1.098,1.137,2.509,2.889,4.316,2.449 c2.719-0.666,5.188-4.402,7.005-6.369c1.235-1.34,0.867-1.766,2.635-0.734c1.688,0.98,3.465,1.809,5.307,2.461 c2.265,0.805,2.751,0.328,2.635,2.766c-0.08,1.66-0.107,3.32-0.113,4.98c-0.011,2.557,0.003,5.324,3.139,5.578 c2.176,0.174,6.028,0.633,8.002-0.461c2.371-1.313,1.465-5.836,1.412-8.01c-0.047-1.924-0.87-3.295,1.203-3.734 c1.773-0.373,3.511-0.918,5.181-1.625c1.26-0.531,2.485-1.158,3.655-1.869c0.995,1.121,2.025,2.211,3.068,3.285 c1.508,1.547,3.794,4.68,6.3,3.225C124.654,105.678,129.444,101.078,125.813,97.477 M87.18,83.988 c-4.68-4.643-5.208-12.541-0.448-17.336c4.759-4.795,12.658-4.328,17.338,0.316c4.681,4.643,5.208,12.539,0.449,17.334 C99.76,89.1,91.859,88.635,87.18,83.988"
id="path96"
style="fill:url(#XMLID_13_);" />
<linearGradient
gradientTransform="matrix(0.7098 0.7044 -0.7044 0.7098 1308.764 -709.1834)"
gradientUnits="userSpaceOnUse"
id="XMLID_14_"
x1="-674.2842"
x2="263.7454"
y1="1412.168"
y2="1412.168">
<stop
id="stop99"
offset="0"
style="stop-color:#FFFFFF" />
<stop
id="stop101"
offset="1"
style="stop-color:#000000" />
</linearGradient>
<path
d="M123.708,47.753c0.992,0.958,2.264,1.894,2.86,3.158c1.006,2.133-1.994,4.236-3.258,5.473 c-0.682,0.663-3.46,2.5-3.652,3.396c-0.192,0.912,2.887,5.234,3.325,6.39c1.662,4.395,0.52,4.287,5.111,4.188 c2.38-0.051,6.993-0.996,7.426,2.32c0.271,2.066,0.73,7.959-1.285,8.854c-2.036,0.906-5.058,0.381-7.231,0.313 c-2.477-0.078-2.303-0.645-2.854,1.678c-0.643,2.684-1.681,5.27-3.084,7.646c-0.778,1.32-1.276,1.215-0.329,2.123 c1.824,1.746,5.109,3.938,6.069,6.373c0.875,2.221-3.004,5.025-4.5,6.498c-3.737,3.682-7.797-2.805-10.19-5.496 c0.063,0.074-9.479,3.566-10.687,3.773c-0.576,0.094-0.062,6.543-0.04,7.422c0.096,4.256-1.961,4.461-5.775,4.486 c-5.312,0.033-5.887-1.016-5.816-6.41c0.021-1.918,0.08-3.836,0.24-5.746c0.044-0.504-3.859-1.406-4.47-1.654 c-0.92-0.375-4.728-3.08-5.456-2.902c-1.149,0.273-3.364,3.662-4.217,4.539c-3.683,3.797-4.974,4.227-8.698,0.529 c-0.983-0.973-2.255-1.875-2.854-3.152c-1.126-2.389,2.827-5.07,4.245-6.426c0.674-0.645,3.319-2.307,3.536-3.184 c0.168-0.668-2.771-4.596-3.162-5.469c-0.214-0.479-1.445-4.5-1.703-4.494c-1.366,0.037-2.734,0.068-4.102,0.102 c-1.775,0.045-5.753,0.746-7.119-0.691c-1.214-1.25-1.085-7.68-0.47-9.305c1.516-3.986,8.54,0.268,10.942-1.346 c0.111-0.074,3.228-11.96,3.805-11.403c-1.604-1.55-3.402-3.019-4.868-4.696c-3.069-3.048,0.056-5.235,2.329-7.482 c3.159-3.325,4.9-1.752,7.578,1.014c0.923,0.954,1.847,1.908,2.769,2.86c0.192,0.197,4.344-2.321,4.936-2.576 c2.043-0.879,4.173-1.474,6.358-1.876c0.468-0.084,0.175-1.876,0.169-2.279c-0.052-2.911-1.151-8.021,3.013-8.192 c1.911-0.079,6.371-0.657,7.715,0.678c1.651,1.638,0.739,6.634,0.7,8.698c-0.054,2.728,3.275,2.295,5.568,3.318 c2.391,1.067,4.252,3.901,6.221,1.849c1.396-1.459,2.724-3.096,4.243-4.428C119.761,43.485,121.576,45.574,123.708,47.753 M125.921,48.526c-1.625-1.612-3.842-4.772-6.23-4.797c-2.719,0-5.439,3.986-7.133,5.754c-1.547,1.61-2.559-0.083-4.4-1.001 c-0.858-0.428-6.186-2.1-6.176-2.609c0.058-2.604,0.862-6.778-0.497-9.155c-1.332-2.326-5.003-1.635-7.312-1.591 c-4.938-0.079-5.699,2.123-5.616,6.525c0.024,1.364,0.045,2.729,0.075,4.094c-2.735,0.524-5.39,1.439-7.861,2.725 c-2.457,1.282-2.197,1.608-4.034-0.285c-1.064-1.098-2.092-2.341-3.307-3.279c-3.204-2.471-5.567,0.805-7.741,2.96 c-3.582,3.556-2.837,5.651,0.48,8.837c1.002,0.964,2.006,1.923,3.004,2.89c-1.338,2.33-2.338,4.849-2.972,7.458 c-0.392,1.609,0.201,2.686-1.689,2.609c-1.345-0.053-2.691-0.078-4.038-0.088c-1.992-0.012-4.82-0.193-5.773,2.033 c-0.779,1.822-0.759,7.754,0.034,9.568c1.238,2.838,5.798,1.953,8.253,1.895c1.221-0.029,2.441-0.068,3.661-0.084 c0.796,2.668,1.952,5.223,3.421,7.588c1.023,1.652,0.581,1.309-0.685,2.465c-0.856,0.783-1.696,1.584-2.527,2.395 c-1.541,1.5-4.413,3.631-3.565,6.162c0.684,2.037,3.783,4.604,5.458,6.029c3.905,3.32,7.793-2.65,10.195-5.236 c1.165-1.26,0.874-1.734,2.536-0.787c1.18,0.676,2.41,1.275,3.668,1.793c1.26,0.516,2.551,0.949,3.865,1.301 c-0.074,0.998-0.121,2-0.152,2.998c-0.124,3.939-1.159,9.596,4.276,9.676c2.351,0.035,6.452,0.623,8.176-1.045 c1.801-1.814,1.022-5.951,0.968-8.26c-0.042-1.789-0.647-2.623,1.206-3.037c2.497-0.559,4.913-1.449,7.175-2.643 c3.495-1.848,6.25,9.139,11.309,5.383c1.806-1.342,5.969-5.084,5.977-7.299c0.022-2.662-3.765-5.236-5.488-6.887 c-1.702-1.639-0.119-2.523,0.801-4.533c0.84-1.836,1.271-6.324,3.203-6.248c5.335,0.207,10.286,1.068,10.104-5.605 c0.029-2.316,0.687-5.977-1.65-7.305c-2.215-1.258-6.102-0.525-8.529-0.477c-2.195,0.041-1.804-1.768-2.534-3.682 c-0.642-1.674-3.43-5.307-2.191-6.443C124.868,56.353,130.186,52.759,125.921,48.526"
id="path103"
style="fill:url(#XMLID_14_);" />
<linearGradient
gradientTransform="matrix(0.7098 0.7044 -0.7044 0.7098 1308.764 -709.1834)"
gradientUnits="userSpaceOnUse"
id="XMLID_15_"
x1="-399.0674"
x2="-178.7371"
y1="1411.4971"
y2="1411.4971">
<stop
id="stop106"
offset="0"
style="stop-color:#FFFFFF" />
<stop
id="stop108"
offset="1"
style="stop-color:#000000" />
</linearGradient>
<path
d="M86.382,66.309c-11.391,11.48,7.089,29.818,18.481,18.338 C116.253,73.168,97.772,54.83,86.382,66.309 M87.082,67.004c10.498-10.582,27.583,6.371,17.082,16.951 C93.666,94.535,76.582,77.582,87.082,67.004"
id="path110"
style="fill:url(#XMLID_15_);" />
<radialGradient
cx="-308.3735"
cy="1411.4961"
gradientTransform="matrix(0.7098 0.7044 -0.7044 0.7098 1308.764 -709.1834)"
gradientUnits="userSpaceOnUse"
id="XMLID_16_"
r="21.6832">
<stop
id="stop113"
offset="0"
style="stop-color:#F3F3F3" />
<stop
id="stop115"
offset="0.4367"
style="stop-color:#F1F1F1" />
<stop
id="stop117"
offset="0.594"
style="stop-color:#EAEAEA" />
<stop
id="stop119"
offset="0.7061"
style="stop-color:#DEDEDE" />
<stop
id="stop121"
offset="0.7968"
style="stop-color:#CDCDCD" />
<stop
id="stop123"
offset="0.8745"
style="stop-color:#B7B7B7" />
<stop
id="stop125"
offset="0.9419"
style="stop-color:#9D9D9D" />
<stop
id="stop127"
offset="1"
style="stop-color:#7F7F7F" />
</radialGradient>
<path
d="M110.291,60.699c-8.184-8.121-22.171-9.618-30.646-1.077 c-8.478,8.544-6.873,22.515,1.313,30.638c8.186,8.121,22.167,9.619,30.646,1.074C120.078,82.791,118.473,68.816,110.291,60.699 M83.213,87.986c-6.929-6.873-8.29-18.697-1.113-25.93c7.175-7.231,19.009-5.961,25.937,0.914 c6.926,6.873,8.29,18.695,1.113,25.928S90.139,94.861,83.213,87.986"
id="path129"
style="fill:url(#XMLID_16_);" />
<path
d="M85.034,49.5c1.542-0.333,3.089-0.651,4.645-0.909C88.898,47.411,86.026,49.071,85.034,49.5 M134.46,73.65c1.946-3.287-6.389-2.664-7.76-2.609c-0.413,0.016-3.091,0.428-3.345-0.035c-0.578-3.734-2.028-7.311-4.067-10.483 c-2.061,1.125,1.62,5.665,2.235,7.483c0.476,1.406-0.029,3.766,1.712,3.83c2.889,0.107,5.839-0.111,8.706,0.27 c0.691,0.094,2.712,1.762,1.989,2.236C134.107,74.111,134.283,73.879,134.46,73.65 M100.576,48.522 c2.375,0.514,4.638,1.461,6.69,2.763c1.392,0.883,2.624,2.755,3.761,0.651C109.459,50.872,101.935,46.234,100.576,48.522"
id="path131"
style="fill:#E8E8E8;" />
<path
d="M125.953,51.541c-1.024,1.031-7.301-5.198-6.278-6.229C120.7,44.28,126.977,50.509,125.953,51.541"
id="path133"
style="fill:#E8E8E8;" />
<path
d="M68.277,103.385c-0.294-0.293-3.079-3.168-3.696-2.547c-0.845,0.85,5.431,7.078,6.274,6.227 C71.475,106.445,68.575,103.68,68.277,103.385"
id="path135"
style="fill:#616161;" />
<path
d="M68.321,54.877c-0.295-0.293-3.078-3.172-3.698-2.549c-0.836,0.844,5.442,7.07,6.276,6.227 C71.518,57.934,68.618,55.172,68.321,54.877"
id="path137"
style="fill:#616161;" />
<path
d="M117.02,103.199c-0.296-0.293-3.082-3.172-3.699-2.549c-0.837,0.842,5.44,7.07,6.276,6.227 C120.214,106.254,117.313,103.492,117.02,103.199"
id="path139"
style="fill:#616161;" />
<path
d="M56.622,72.438c-0.57-0.564-0.886,2.873-0.888,2.955c-0.078,1.35-0.461,4.658,0.638,5.748 c0.006,0.025,0.867-2.611,0.889-3.035C57.331,76.77,57.711,73.514,56.622,72.438"
id="path141"
style="fill:#616161;" />
<path
d="M91.136,105.303c-0.257-0.252-2.138,8.775-0.114,8.768 C92.328,114.066,91.971,106.133,91.136,105.303"
id="path143"
style="fill:#616161;" />
<path
d="M99.786,36.964c0.004,0.923-9.081,0.958-9.087,0.035C90.699,36.081,99.782,36.045,99.786,36.964"
id="path145"
style="fill:#E8E8E8;" />
<path
d="M133.836,80.631c-0.866-0.857-9.031-0.781-9.046,0.125 C124.799,82.375,133.853,80.65,133.836,80.631"
id="path147"
style="fill:#616161;" />
<path
d="M99.934,115.262c-0.866-0.857-9.049-0.744-9.046,0.123 C90.937,117.057,99.926,115.254,99.934,115.262"
id="path149"
style="fill:#616161;" />
<path
d="M65.414,81.008c-0.813-0.805-3.523-0.51-4.507-0.506c-0.409,0-4.604,0.576-4.535,0.639 C56.578,82.943,65.301,80.898,65.414,81.008"
id="path151"
style="fill:#616161;" />
<path
d="M56.818,80.863c-0.149,0.088-0.299,0.18-0.448,0.27C56.372,81.732,57.218,79.93,56.818,80.863"
id="path153"
style="fill:#937342;" />
<path
d="M77.453,51.336c-0.585,0.589-5.194-5.62-6.236-5.098c-0.634,0.317-5.068,4.676-5.358,4.318 c-0.674-0.829,4.29-4.521,4.914-5.023C72.313,44.294,77.886,50.902,77.453,51.336"
id="path155"
style="fill:#E8E8E8;" />
<path
d="M61.907,72.328c-0.314,0.002-4.093,0.088-4.095-0.559c-0.005-0.857,8.182-0.891,8.188-0.029 C66,72.385,62.218,72.326,61.907,72.328"
id="path157"
style="fill:#E8E8E8;" />
<path
d="M126.313,99.99c-0.521,0.527-7.058-5.961-6.537-6.486C120.294,92.979,126.833,99.467,126.313,99.99 "
id="path159"
style="fill:#E8E8E8;" />
<path
d="M107.405,94.865c-14.039,7.199-33.023-3.674-33.434-19.646c-1.627,1.641-0.114,7.043,0.427,8.777 c1.895,6.057,6.598,10.719,12.26,13.402C93.805,100.787,101.209,99.42,107.405,94.865 M108.474,94.191 c-0.401,0.139-0.759,0.363-1.068,0.674C106.927,95.109,108.591,94.307,108.474,94.191"
id="path161"
style="fill:#666666;" />
<path
d="M95.592,97.086c-6.63-0.633-13.091-4.398-17.104-9.686C82.508,92.859,88.806,96.553,95.592,97.086"
id="path163"
style="fill:#7F7F7F;" />
<path
d="M84.567,60.355c4.032-4.063,11.532-4.42,16.535-2.563c5.446,2.021,9.643,6.126,11.599,11.601 c0.249,0.701,2.558,9.27,0.991,9.471c0.416-0.051-0.554-6.32-0.67-6.744c-1.499-5.359-5.688-9.65-10.556-12.164 C97.998,57.648,88.556,56.336,84.567,60.355"
id="path165"
style="fill:#E8E8E8;" />
<path
d="M81.764,57.373c4.916-4.951,14.44-5.036,20.428-2.769c6.524,2.47,11.653,7.361,13.96,13.98 c0.854,2.451,1.384,5.064,1.433,7.666c0.001,0.141-0.271,3.117-0.524,2.885c-0.296-0.271,0.055-1.951,0.068-2.303 c0.073-2.029-0.106-4.068-0.601-6.043c-1.655-6.617-6.82-11.888-12.879-14.77c-4.892-2.329-10.415-2.753-15.618-1.294 C86.303,55.211,82.886,56.244,81.764,57.373"
id="path167"
style="fill:#E8E8E8;" />
<path
d="M108.852,89.18c0.034,0.033-3.641,2.105-3.877,2.209c-3.101,1.334-6.525,1.859-9.875,1.387 c-10.878-1.529-18.327-11.193-17.553-21.9c-2.94,16.379,18.521,30.395,31.307,18.305"
id="path169"
style="fill:#E8E8E8;" />
<path
d="M96.784,93.822c-0.746-0.012-1.486-0.066-2.222-0.168C95.298,93.762,96.038,93.816,96.784,93.822 M77.528,70.309c-0.175-0.174-0.267,4.723-0.216,5.051C77.258,74.59,77.944,70.719,77.528,70.309"
id="path171"
style="fill:#E8E8E8;" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -981,7 +981,6 @@ class User extends CommonObject
$this->firstname = $member->firstname;
$this->email = $member->email;
$this->fk_member = $member->id;
if ($member->fk_soc) $sql.= ", fk_societe=".$member->fk_soc;
$this->pass = $member->pass;
if (empty($login)) $login=strtolower(substr($member->firstname, 0, 4)) . strtolower(substr($member->lastname, 0, 4));

View File

@ -777,7 +777,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
$password=$generated_password;
// Mot de passe
print '<tr><td valign="top">'.$langs->trans("Password").'</td>';
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Password").'</td>';
print '<td>';
if (! empty($ldap_sid))
{

View File

@ -220,6 +220,20 @@ $server->register(
'WS to create a actioncomm'
);
// Register WSDL
$server->register(
'updateActionComm',
// Entry values
array('authentication'=>'tns:authentication','actioncomm'=>'tns:actioncomm'),
// Exit values
array('result'=>'tns:result'),
$ns,
$ns.'#updateActionComm',
$styledoc,
$styleuse,
'WS to update a actioncomm'
);
@ -473,7 +487,104 @@ function createActionComm($authentication,$actioncomm)
return $objectresp;
}
// Return the results.
$server->service($HTTP_RAW_POST_DATA);
/**
* Create ActionComm
*
* @param array $authentication Array of authentication information
* @param ActionComm $actioncomm $actioncomm
* @return array Array result
*/
function updateActionComm($authentication,$actioncomm)
{
global $db,$conf,$langs;
?>
$now=dol_now();
dol_syslog("Function: updateActionComm login=".$authentication['login']);
if ($authentication['entity']) $conf->entity=$authentication['entity'];
// Init and check authentication
$objectresp=array();
$errorcode='';$errorlabel='';
$error=0;
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
// Check parameters
if (empty($actioncomm['id'])) {
$error++; $errorcode='KO'; $errorlabel="Actioncomm id is mandatory.";
}
if (! $error)
{
$objectfound=false;
$object=new ActionComm($db);
$result=$object->fetch($actioncomm['id']);
if (!empty($object->id)) {
$objectfound=true;
$object->datep=$actioncomm['datep'];
$object->datef=$actioncomm['datef'];
$object->type_code=$actioncomm['type_code'];
$object->societe->id=$actioncomm['socid'];
$object->fk_project=$actioncomm['projectid'];
$object->note=$actioncomm['note'];
$object->contact->id=$actioncomm['contactid'];
$object->usertodo->id=$actioncomm['usertodo'];
$object->userdone->id=$actioncomm['userdone'];
$object->label=$actioncomm['label'];
$object->percentage=$actioncomm['percentage'];
$object->priority=$actioncomm['priority'];
$object->fulldayevent=$actioncomm['fulldayevent'];
$object->location=$actioncomm['location'];
$object->fk_element=$actioncomm['fk_element'];
$object->elementtype=$actioncomm['elementtype'];
//Retreive all extrafield for actioncomm
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm');
foreach($extrafields->attribute_label as $key=>$label)
{
$key='options_'.$key;
$newobject->array_options[$key]=$actioncomm[$key];
}
$db->begin();
$result=$object->update($fuser);
if ($result <= 0) {
$error++;
}
}
if ((! $error) && ($objectfound))
{
$db->commit();
$objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''));
}
elseif ($objectfound)
{
$db->rollback();
$error++;
$errorcode='KO';
$errorlabel=$object->error;
} else {
$error++;
$errorcode='NOT_FOUND';
$errorlabel='Actioncomm id='.$actioncomm['id'].' cannot be found';
}
}
if ($error)
{
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
}
return $objectresp;
}
// Return the results.
$server->service($HTTP_RAW_POST_DATA);

View File

@ -506,7 +506,6 @@ function updateThirdParty($authentication,$thirdparty)
$error++; $errorcode='KO'; $errorlabel="Thirdparty id is mandatory.";
}
if (! $error)
{
$objectfound=false;
@ -514,9 +513,9 @@ function updateThirdParty($authentication,$thirdparty)
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$object=new Societe($db);
$result=$object->fetch($id);
$result=$object->fetch($thirdparty['id']);
if (!empty($thirdparty['id'])) {
if (!empty($object->id)) {
$objectfound=true;
@ -680,9 +679,5 @@ function getListOfThirdParties($authentication,$filterthirdparty)
return $objectresp;
}
// Return the results.
$server->service($HTTP_RAW_POST_DATA);
?>
$server->service($HTTP_RAW_POST_DATA);

View File

@ -40,8 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/cron/functions_cron.lib.php");
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
require_once(DOL_DOCUMENT_ROOT.'/core/lib/invoice2.lib.php');
// Load main language strings
@ -64,10 +63,9 @@ if (! isset($argv[1]))
}
$diroutputpdf=$conf->facture->dir_output . '/temp';
$newmodel=''; // To force a new model
$newlangid='en_EN'; // To force a new lang id
$filter=array();
$regenerate='';
$regenerate=''; // Ask regenerate (contains name of model to use)
$option='';
foreach ($argv as $key => $value)
@ -179,210 +177,23 @@ if (in_array('payments',$filter) && in_array('nopayment',$filter))
}
// Define SQL and SQL order request to select invoices
$sql = "SELECT DISTINCT f.rowid, f.facnumber";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sqlwhere='';
$sqlorder='';
if (in_array('all',$filter))
{
$sqlorder = " ORDER BY f.facnumber ASC";
}
if (in_array('date',$filter))
{
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.= " f.fk_statut > 0";
$sqlwhere.= " AND f.datef >= '".$db->idate($dateafterdate)."'";
$sqlwhere.= " AND f.datef <= '".$db->idate($datebeforedate)."'";
$sqlorder = " ORDER BY f.datef ASC";
}
if (in_array('nopayment',$filter))
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture";
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.= " f.fk_statut > 0";
$sqlwhere.= " AND pf.fk_paiement IS NULL";
}
if (in_array('payments',$filter))
{
$sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf,";
$sql.= " ".MAIN_DB_PREFIX."paiement as p";
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.= " f.fk_statut > 0";
$sqlwhere.= " AND f.rowid = pf.fk_facture";
$sqlwhere.= " AND pf.fk_paiement = p.rowid";
$sqlwhere.= " AND p.datep >= '".$db->idate($paymentdateafter)."'";
$sqlwhere.= " AND p.datep <= '".$db->idate($paymentdatebefore)."'";
$sqlorder = " ORDER BY p.datep ASC";
}
if (in_array('nodeposit',$filter))
{
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.=' type <> 3';
}
if (in_array('noreplacement',$filter))
{
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.=' type <> 1';
}
if (in_array('nocreditnote',$filter))
{
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
else $sqlwhere.=" AND";
$sqlwhere.=' type <> 2';
}
if ($sqlwhere) $sql.=$sqlwhere;
if ($sqlorder) $sql.=$sqlorder;
// Define SQL and SQL request to select invoices
// Use $filter, $dateafterdate, datebeforedate, $paymentdateafter, $paymentdatebefore
$result=rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, 1, $regenerate);
//print $sql; exit;
dol_syslog("scripts/invoices/rebuild_merge.php: sql=",$sql);
print '--- start'."\n";
// Start of transaction
//$db->begin();
$error = 0;
$files = array() ; // liste les fichiers
dol_syslog("scripts/invoices/rebuild_merge.php sql=".$sql);
if ( $resql=$db->query($sql) )
{
$num = $db->num_rows($resql);
$cpt = 0;
$oldemail = '';
$message = '';
$total = '';
if ($num)
{
// First loop on each resultset to build PDF
// -----------------------------------------
while ($cpt < $num)
{
$obj = $db->fetch_object($resql);
$fac = new Facture($db);
$result=$fac->fetch($obj->rowid);
if ($result > 0)
{
$outputlangs = $langs;
if (! empty($newlangid))
{
if ($outputlangs->defaultlang != $newlangid)
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlangid);
}
}
$filename=$conf->facture->dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf';
if ($regenerate || ! dol_is_file($filename))
{
print "Build PDF for invoice ".$obj->facnumber." - Lang = ".$outputlangs->defaultlang."\n";
$result=facture_pdf_create($db, $fac, $newmodel?$newmodel:$fac->modelpdf, $outputlangs);
}
else {
print "PDF for invoice ".$obj->facnumber." already exists\n";
}
// Add file into files array
$files[] = $filename;
}
if ($result <= 0)
{
print "Error: Failed to build PDF for invoice ".$fac->ref."\n";
}
$cpt++;
}
// Now, build a merged files with all files in $files array
//---------------------------------------------------------
// Create empty PDF
$pdf=pdf_getInstance();
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
//$pdf->SetCompression(false);
//$pdf->Open();
//$pdf->AddPage();
//$title=$langs->trans("BillsCustomersUnpaid");
//if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid");
//$pdf->MultiCell(100, 3, $title, 0, 'J');
// Add all others
foreach($files as $file)
{
print "Merge PDF file for invoice ".$file."\n";
// Charge un document PDF depuis un fichier.
$pagecount = $pdf->setSourceFile($file);
for ($i = 1; $i <= $pagecount; $i++)
{
$tplidx = $pdf->importPage($i);
$s = $pdf->getTemplatesize($tplidx);
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
$pdf->useTemplate($tplidx);
}
}
// Create output dir if not exists
dol_mkdir($diroutputpdf);
// Save merged file
$filename='mergedpdf';
if (! empty($option)) $filename.='_'.$option;
if ($pagecount)
{
$file=$diroutputpdf.'/'.$filename.'.pdf';
$pdf->Output($file,'F');
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
}
print "Merged PDF has been built in ".$file."\n";
}
else
{
print "No invoices with payments in this range.\n";
}
}
else
{
dol_print_error($db);
dol_syslog("scripts/invoices/rebuild_merge.php: Error");
}
// -------------------- END OF YOUR CODE --------------------
if (! $error)
if ($result >= 0)
{
//$db->commit();
$error=0;
print '--- end ok'."\n";
}
else
{
$error=$result;
print '--- end error code='.$error."\n";
//$db->rollback();
}
$db->close();
@ -390,6 +201,7 @@ $db->close();
return $error;
/**
* Show usage of script
*
@ -414,7 +226,7 @@ function usage()
print "To exclude deposit invoices, use filter=nodeposit\n";
print "To regenerate existing PDF, use regenerate=crabe\n";
print "\n";
print "Example: ".$script_file." filter=payments 20080101 20081231 lang=fr_FR regenerate=yes\n";
print "Example: ".$script_file." filter=payments 20080101 20081231 lang=fr_FR regenerate=crabe\n";
print "Example: ".$script_file." filter=all lang=it_IT\n";
print "\n";
print "Note that some filters can be cumulated.\n";

View File

@ -284,7 +284,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase
'%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%,%EMAIL%,%NAISS%,%PHOTO%,%LOGIN%,%PASSWORD%,%PRENOM%,'.
'%NOM%,%SOCIETE%,%ADRESSE%,%CP%,%VILLE%,%PAYS%';
$expected = DOL_MAIN_URL_ROOT.','.$localobject->id.',,New firstname,New name,New firstname New name,'.
$expected = DOL_MAIN_URL_ROOT.','.$localobject->id.',0,New firstname,New name,New firstname New name,'.
'New company,New address,New zip,New town,Belgium,newemail@newemail.com,'.dol_print_date($localobject->naiss,'day').',,'.
'newlogin,dolibspec,New firstname,New name,New company,New address,New zip,New town,Belgium';
@ -320,7 +320,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase
//We update user object
$user->fetch($user->id);
print __METHOD__." user id=".$user->id." fk_member=".$user->fk_member."\n";
$this->assertEquals($user->fk_member, $localobject->id);
//We remove association with user