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

This commit is contained in:
Laurent Destailleur 2013-04-16 15:01:07 +02:00
commit 4fe49b6736
106 changed files with 1143 additions and 1450 deletions

View File

@ -9,37 +9,39 @@ More information: http://www.gnu.org/licenses/gpl-3.0.txt
Dolibarr uses some external libraries released under different licences. This is compatibility summary: Dolibarr uses some external libraries released under different licences. This is compatibility summary:
Composant Version License Compatible GPL Usage Composant Version License Compatible GPL Usage
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
PHP libraries: PHP libraries:
AdoDb-Date 0.21 Modified BSD License Yes Date convertion (not into rpm package) AdoDb-Date 0.21 Modified BSD License Yes Date convertion (not into rpm package)
CKEditor 3.6.4 LGPL-2.1+ Yes Editor WYSIWYG CKEditor 3.6.4 LGPL-2.1+ Yes Editor WYSIWYG
FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management (with FPDF_TPL 1.2) FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management (with FPDF_TPL 1.2)
GeoIP 2004 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) GeoIP 2004 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
OdtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files OdtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files
PHPExcel 1.7.6 LGPL-2.1+ Yes Read/Write XLS files, read ODS files PHPExcel 1.7.6 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
TCPDF 5.9.180 LGPL-3+ Yes PDF generation TCPDF 5.9.180 LGPL-3+ Yes PDF generation
JS libraries: JS libraries:
jQuery 1.8.2 MIT Licence Yes JS library jQuery 1.8.2 MIT Licence Yes JS library
jQuery UI 1.9.1 GPL and MIT Licence Yes JS library plugin UI jQuery UI 1.9.1 GPL and MIT Licence Yes JS library plugin UI
jQuery Timepicker 1.1.0 GPL and MIT Licence Yes JS library Timepicker addon for Datepicker jQuery blockUI 2.43 GPL and MIT Licence Yes JS library plugin blockUI (to use ajax popups)
jQuery Colorpicker 1.1 MIT Licence Yes JS library for color picker for a defined list of colors jQuery Colorpicker 1.1 MIT Licence Yes JS library for color picker for a defined list of colors
jQuery DataTables 1.9.4 BSD Yes JS library for tables output jQuery DataTables 1.9.4 BSD Yes JS library for tables output
jQuery Flot 0.7 MIT Licence Yes JS library to build graph jQuery FileUpload 5.0.3 GPL and MIT Licence Yes JS library to upload files
jQuery FileUpload 5.0.3 GPL and MIT Licence Yes JS library to upload files jQuery Flot 0.7 MIT Licence Yes JS library to build graph
jQuery JCrop 0.9.8 GPL and MIT Licence Yes JS library plugin Crop (to crop images) jQuery JCrop 0.9.8 GPL and MIT Licence Yes JS library plugin Crop (to crop images)
jQuery jeditable 1.7.1 GPL and MIT Licence Yes JS library plugin jeditable (to edit in place) jQuery jeditable 1.7.1 GPL and MIT Licence Yes JS library plugin jeditable (to edit in place)
jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups) jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups)
jQuery blockUI 2.43 GPL and MIT Licence Yes JS library plugin blockUI (to use ajax popups) jQuery jPicker 1.1.00 GPL and MIT Licence Yes JS library for color picker with not defined list of colors
jQuery jPicker 1.1.00 GPL and MIT Licence Yes JS library for color picker with not defined list of colors jQuery jqueryFileTree 1.0.1 GPL and MIT Licence Yes JS library for color picker with not defined list of colors
jQuery Layout 1.3.0 GPL and MIT Licence Yes JS library plugin Layout (RC-29.15) jQuery jquerytreeview 1.4.1 MIT Licence Yes JS library for color picker with not defined list of colors
jQuery TableDnD 0.5 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows) jQuery Layout 1.3.0 GPL and MIT Licence Yes JS library plugin Layout (RC-29.15)
jQuery Mobile 1.3 GPL and MIT Licence Yes JS library for smartphone (not used) jQuery Mobile 1.3 GPL and MIT Licence Yes JS library for smartphone (not used)
jQuery Tiptip 1.3 GPL and MIT Licence Yes JS library for tooltips jQuery TableDnD 0.5 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows)
JSGantt 1.2 BSD Licence Yes JS library (to build Gantt reports) jQuery Timepicker 1.1.0 GPL and MIT Licence Yes JS library Timepicker addon for Datepicker
jQuery Tiptip 1.3 GPL and MIT Licence Yes JS library for tooltips
JSGantt 1.2 BSD Licence Yes JS library (to build Gantt reports)
For licenses compatibility informations: For licenses compatibility informations:
http://www.fsf.org/licensing/licenses/index_html http://www.fsf.org/licensing/licenses/index_html

View File

@ -81,7 +81,10 @@ WARNING: If you used external modules, some of them may need to be upgraded due
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes - Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes - Fix: [ bug #816 ] Sales journal does not reflect localtaxes
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: Orderstoinvoice didn't act as expected when no order was checked - Fix: Orderstoinvoice didn't act as expected when no order was checked
- Fix: Bad link to all proposals into Third party card if customer is prospect
- Fix: [ bug #789 ] VAT not being calculated in POS

View File

@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("errors"); $langs->load("errors");
$langs->load('other'); $langs->load('other');
$langs->load('propal');
if (! $user->admin) accessforbidden(); if (! $user->admin) accessforbidden();
@ -250,12 +251,11 @@ print_fiche_titre($langs->trans("PropalSetup"),$linkback,'setup');
$head = propal_admin_prepare_head(null); $head = propal_admin_prepare_head(null);
dol_fiche_head($head, 'general', $langs->trans("Propales"), 0, 'propal'); dol_fiche_head($head, 'general', $langs->trans("Proposals"), 0, 'propal');
/* /*
* Module numerotation * Module numerotation
*/ */
print "<br>";
print_titre($langs->trans("ProposalsNumberingModules")); print_titre($langs->trans("ProposalsNumberingModules"));
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -118,7 +118,7 @@ class Facturation
} }
// Define part of HT, VAT, TTC // Define part of HT, VAT, TTC
$resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',$product->type,0); $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',0,$product->type,0);
// Calcul du total ht sans remise // Calcul du total ht sans remise
$total_ht = $resultarray[0]; $total_ht = $resultarray[0];

View File

@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("admin"); $langs->load("admin");
$langs->load('propal');
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$form = new Form($db); $form = new Form($db);
@ -58,7 +59,7 @@ require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
* View * View
*/ */
$textobject=$langs->transnoentitiesnoconv("Propales"); $textobject=$langs->transnoentitiesnoconv("Proposals");
llxHeader('',$langs->trans("PropalSetup")); llxHeader('',$langs->trans("PropalSetup"));
@ -70,7 +71,7 @@ print_fiche_titre($langs->trans("PropalSetup"),$linkback,'setup');
$head = propal_admin_prepare_head(null); $head = propal_admin_prepare_head(null);
dol_fiche_head($head, 'attributes', $langs->trans("Propal"), 0, 'propal'); dol_fiche_head($head, 'attributes', $langs->trans("Proposals"), 0, 'propal');
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n"; print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";

View File

@ -1,34 +1,34 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* \file htdocs/comm/propal.php * \file htdocs/comm/propal.php
* \ingroup propale * \ingroup propale
* \brief Page of commercial proposals card and list * \brief Page of commercial proposals card and list
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
@ -54,7 +54,7 @@ $langs->load('orders');
$langs->load('products'); $langs->load('products');
$langs->load("deliveries"); $langs->load("deliveries");
if (! empty($conf->margin->enabled)) if (! empty($conf->margin->enabled))
$langs->load('margins'); $langs->load('margins');
$error=0; $error=0;
@ -100,7 +100,7 @@ $hookmanager->initHooks(array('propalcard'));
/* /*
* Actions * Actions
*/ */
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@ -201,19 +201,19 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr
else if ($action == 'setdate' && $user->rights->propal->creer) else if ($action == 'setdate' && $user->rights->propal->creer)
{ {
$datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datep)) if (empty($datep))
{ {
$error++; $error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors');
} }
if (! $error) if (! $error)
{ {
$result=$object->set_date($user,$datep); $result=$object->set_date($user,$datep);
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
} }
else if ($action == 'setecheance' && $user->rights->propal->creer) else if ($action == 'setecheance' && $user->rights->propal->creer)
{ {
@ -257,7 +257,7 @@ else if ($action == 'add' && $user->rights->propal->creer)
if (empty($datep)) if (empty($datep))
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors');
$action='create'; $action='create';
$error++; $error++;
} }
if (empty($duration)) if (empty($duration))
@ -276,123 +276,123 @@ else if ($action == 'add' && $user->rights->propal->creer)
if (! $error) if (! $error)
{ {
$db->begin(); $db->begin();
// Si on a selectionne une propal a copier, on realise la copie // Si on a selectionne une propal a copier, on realise la copie
if (GETPOST('createmode')=='copy' && GETPOST('copie_propal')) if (GETPOST('createmode')=='copy' && GETPOST('copie_propal'))
{ {
if ($object->fetch(GETPOST('copie_propal')) > 0) if ($object->fetch(GETPOST('copie_propal')) > 0)
{ {
$object->ref = GETPOST('ref'); $object->ref = GETPOST('ref');
$object->datep = $datep; $object->datep = $datep;
$object->date_livraison = $date_delivery; $object->date_livraison = $date_delivery;
$object->availability_id = GETPOST('availability_id'); $object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id'); $object->demand_reason_id = GETPOST('demand_reason_id');
$object->fk_delivery_address = GETPOST('fk_address'); $object->fk_delivery_address = GETPOST('fk_address');
$object->duree_validite = $duration; $object->duree_validite = $duration;
$object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->cond_reglement_id = GETPOST('cond_reglement_id');
$object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->remise_percent = GETPOST('remise_percent'); $object->remise_percent = GETPOST('remise_percent');
$object->remise_absolue = GETPOST('remise_absolue'); $object->remise_absolue = GETPOST('remise_absolue');
$object->socid = GETPOST('socid'); $object->socid = GETPOST('socid');
$object->contactid = GETPOST('contactidp'); $object->contactid = GETPOST('contactidp');
$object->fk_project = GETPOST('projectid'); $object->fk_project = GETPOST('projectid');
$object->modelpdf = GETPOST('model'); $object->modelpdf = GETPOST('model');
$object->author = $user->id; // deprecated $object->author = $user->id; // deprecated
$object->note = GETPOST('note'); $object->note = GETPOST('note');
$object->statut = 0; $object->statut = 0;
$id = $object->create_from($user); $id = $object->create_from($user);
} }
else else
{ {
setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors'); setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors');
} }
} }
else else
{ {
$object->ref = GETPOST('ref'); $object->ref = GETPOST('ref');
$object->ref_client = GETPOST('ref_client'); $object->ref_client = GETPOST('ref_client');
$object->datep = $datep; $object->datep = $datep;
$object->date_livraison = $date_delivery; $object->date_livraison = $date_delivery;
$object->availability_id = GETPOST('availability_id'); $object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id'); $object->demand_reason_id = GETPOST('demand_reason_id');
$object->fk_delivery_address = GETPOST('fk_address'); $object->fk_delivery_address = GETPOST('fk_address');
$object->duree_validite = GETPOST('duree_validite'); $object->duree_validite = GETPOST('duree_validite');
$object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->cond_reglement_id = GETPOST('cond_reglement_id');
$object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->contactid = GETPOST('contactidp'); $object->contactid = GETPOST('contactidp');
$object->fk_project = GETPOST('projectid'); $object->fk_project = GETPOST('projectid');
$object->modelpdf = GETPOST('model'); $object->modelpdf = GETPOST('model');
$object->author = $user->id; // deprecated $object->author = $user->id; // deprecated
$object->note = GETPOST('note'); $object->note = GETPOST('note');
$object->origin = GETPOST('origin'); $object->origin = GETPOST('origin');
$object->origin_id = GETPOST('originid'); $object->origin_id = GETPOST('originid');
for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++)
{ {
if ($_POST['idprod'.$i]) if ($_POST['idprod'.$i])
{ {
$xid = 'idprod'.$i; $xid = 'idprod'.$i;
$xqty = 'qty'.$i; $xqty = 'qty'.$i;
$xremise = 'remise'.$i; $xremise = 'remise'.$i;
$object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]);
} }
} }
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
$id = $object->create($user); $id = $object->create($user);
} }
if ($id > 0) if ($id > 0)
{ {
// Insertion contact par defaut si defini // Insertion contact par defaut si defini
if (GETPOST('contactidp')) if (GETPOST('contactidp'))
{ {
$result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external');
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors');
} }
} }
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) if (! empty($conf->global->MAIN_MULTILANGS))
{ {
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret=$object->fetch($id); // Reload to get new records $ret=$object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit; exit;
} }
else else
{ {
$db->rollback(); $db->rollback();
} }
} }
else else
{ {
dol_print_error($db,$object->error); dol_print_error($db,$object->error);
$db->rollback(); $db->rollback();
exit; exit;
} }
} }
} }
@ -432,7 +432,7 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST(
/* /*
* Add file in email form * Add file in email form
*/ */
if (GETPOST('addfile')) if (GETPOST('addfile'))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -447,7 +447,7 @@ if (GETPOST('addfile'))
/* /*
* Remove file in email form * Remove file in email form
*/ */
if (GETPOST('removedfile')) if (GETPOST('removedfile'))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -463,7 +463,7 @@ if (GETPOST('removedfile'))
/* /*
* Send mail * Send mail
*/ */
if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel'))
{ {
$langs->load('mails'); $langs->load('mails');
@ -738,18 +738,18 @@ else if ($action == "addline" && $user->rights->propal->creer)
$desc = $prod->description; $desc = $prod->description;
} }
$desc=dol_concatdesc($desc,$product_desc); $desc=dol_concatdesc($desc,$product_desc);
// Add custom code and origin country into description // Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{ {
$tmptxt='('; $tmptxt='(';
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - '; if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0); if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
$tmptxt.=')'; $tmptxt.=')';
$desc= dol_concatdesc($desc, $tmptxt); $desc= dol_concatdesc($desc, $tmptxt);
} }
} }
$type = $prod->type; $type = $prod->type;
@ -769,6 +769,9 @@ else if ($action == "addline" && $user->rights->propal->creer)
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
$date_start=dol_mktime(0, 0, 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
$date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
// Local Taxes // Local Taxes
$localtax1_tx= get_localtax($tva_tx, 1, $object->client); $localtax1_tx= get_localtax($tva_tx, 1, $object->client);
$localtax2_tx= get_localtax($tva_tx, 2, $object->client); $localtax2_tx= get_localtax($tva_tx, 2, $object->client);
@ -803,7 +806,9 @@ else if ($action == "addline" && $user->rights->propal->creer)
GETPOST('fk_parent_line'), GETPOST('fk_parent_line'),
$fournprice, $fournprice,
$buyingprice, $buyingprice,
$label $label,
$date_start,
$date_end
); );
if ($result > 0) if ($result > 0)
@ -868,6 +873,9 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
$date_start=dol_mktime(0, 0, 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
$date_end=dol_mktime(0, 0, 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
// Define special_code for special lines // Define special_code for special lines
$special_code=0; $special_code=0;
if (! GETPOST('qty')) $special_code=3; if (! GETPOST('qty')) $special_code=3;
@ -924,7 +932,9 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$fournprice, $fournprice,
$buyingprice, $buyingprice,
$label, $label,
$type $type,
$date_start,
$date_end
); );
if ($result >= 0) if ($result >= 0)
@ -1058,7 +1068,7 @@ else if ($action == 'setmode' && $user->rights->propal->creer)
/* /*
* Ordonnancement des lignes * Ordonnancement des lignes
*/ */
else if ($action == 'up' && $user->rights->propal->creer) else if ($action == 'up' && $user->rights->propal->creer)
{ {
@ -1192,7 +1202,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->
/* /*
* View * View
*/ */
llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
@ -1455,7 +1465,7 @@ else
{ {
/* /*
* Show object in view mode * Show object in view mode
*/ */
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($object->socid); $soc->fetch($object->socid);
@ -1500,7 +1510,7 @@ else
// Confirm validate proposal // Confirm validate proposal
else if ($action == 'validate') else if ($action == 'validate')
{ {
$error=0; $error=0;
// on verifie si l'objet est en numerotation provisoire // on verifie si l'objet est en numerotation provisoire
$ref = substr($object->ref, 1, 4); $ref = substr($object->ref, 1, 4);
@ -1509,8 +1519,8 @@ else
$numref = $object->getNextNumRef($soc); $numref = $object->getNextNumRef($soc);
if (empty($numref)) if (empty($numref))
{ {
$error++; $error++;
dol_htmloutput_errors($object->error); dol_htmloutput_errors($object->error);
} }
} }
else else
@ -1532,8 +1542,8 @@ else
if (! $formconfirm) if (! $formconfirm)
{ {
$parameters=array('lineid'=>$lineid); $parameters=array('lineid'=>$lineid);
$formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
} }
// Print form confirm // Print form confirm
@ -1681,11 +1691,11 @@ else
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($action == 'editconditions') if ($action == 'editconditions')
{ {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id');
} }
else else
{ {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'none'); $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'none');
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -1834,54 +1844,54 @@ else
} }
// TODO : use showOptionals($extrafields) function // TODO : use showOptionals($extrafields) function
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
if ($extrafields->attribute_type[$key] == 'separate') if ($extrafields->attribute_type[$key] == 'separate')
{ {
print $extrafields->showSeparator($key); print $extrafields->showSeparator($key);
} }
else else
{ {
print '<tr><td'; print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"'; if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">'; print '>'.$label.'</td><td colspan="3">';
// Convert date into timestamp format // Convert date into timestamp format
if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
{ {
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key]; $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key];
} }
if ($action == 'edit_extras' && $user->rights->propal->creer) if ($action == 'edit_extras' && $user->rights->propal->creer)
{ {
print $extrafields->showInputField($key,$value); print $extrafields->showInputField($key,$value);
} }
else else
{ {
print $extrafields->showOutputField($key,$value); print $extrafields->showOutputField($key,$value);
} }
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
} }
if(count($extrafields->attribute_label) > 0) { if(count($extrafields->attribute_label) > 0) {
if ($action == 'edit_extras' && $user->rights->propal->creer) if ($action == 'edit_extras' && $user->rights->propal->creer)
{ {
print '<tr><td></td><td>'; print '<tr><td></td><td>';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
print '</td></tr>'; print '</td></tr>';
} }
else { else {
if ($object->statut == 0 && $user->rights->propal->creer) if ($object->statut == 0 && $user->rights->propal->creer)
{ {
print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>'; print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>';
} }
} }
} }
} }
// Amount HT // Amount HT
@ -1891,9 +1901,9 @@ else
// Margin Infos // Margin Infos
if (! empty($conf->margin->enabled)) { if (! empty($conf->margin->enabled)) {
print '<td valign="top" width="50%" rowspan="4">'; print '<td valign="top" width="50%" rowspan="4">';
$object->displayMarginInfos(); $object->displayMarginInfos();
print '</td>'; print '</td>';
} }
print '</tr>'; print '</tr>';
@ -1943,7 +1953,7 @@ else
/* /*
* Lines * Lines
*/ */
if (! empty($conf->use_javascript_ajax) && $object->statut == 0) if (! empty($conf->use_javascript_ajax) && $object->statut == 0)
{ {
@ -1967,18 +1977,18 @@ else
if ($conf->global->MAIN_FEATURES_LEVEL > 1) if ($conf->global->MAIN_FEATURES_LEVEL > 1)
{ {
// Add free or predefined products/services // Add free or predefined products/services
$object->formAddObjectLine(0,$mysoc,$soc); $object->formAddObjectLine(1,$mysoc,$soc);
} }
else else
{ {
// Add free products/services // Add free products/services
$object->formAddFreeProduct(0,$mysoc,$soc); $object->formAddFreeProduct(1,$mysoc,$soc);
// Add predefined products/services // Add predefined products/services
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{ {
$var=!$var; $var=!$var;
$object->formAddPredefinedProduct(0,$mysoc,$soc); $object->formAddPredefinedProduct(1,$mysoc,$soc);
} }
} }
@ -1996,18 +2006,18 @@ else
{ {
/* /*
* Formulaire cloture (signe ou non) * Formulaire cloture (signe ou non)
*/ */
$form_close = '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; $form_close = '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
$form_close.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $form_close.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$form_close.= '<table class="border" width="100%">'; $form_close.= '<table class="border" width="100%">';
$form_close.= '<tr><td width="150" align="left">'.$langs->trans("CloseAs").'</td><td align="left">'; $form_close.= '<tr><td width="150" align="left">'.$langs->trans("CloseAs").'</td><td align="left">';
$form_close.= '<input type="hidden" name="action" value="setstatut">'; $form_close.= '<input type="hidden" name="action" value="setstatut">';
$form_close.= '<select id="statut" name="statut" class="flat">'; $form_close.= '<select id="statut" name="statut" class="flat">';
$form_close.= '<option value="0">&nbsp;</option>'; $form_close.= '<option value="0">&nbsp;</option>';
$form_close.= '<option value="2">'.$object->labelstatut[2].'</option>'; $form_close.= '<option value="2">'.$object->labelstatut[2].'</option>';
$form_close.= '<option value="3">'.$object->labelstatut[3].'</option>'; $form_close.= '<option value="3">'.$object->labelstatut[3].'</option>';
$form_close.= '</select>'; $form_close.= '</select>';
$form_close.= '</td></tr>'; $form_close.= '</td></tr>';
$form_close.= '<tr><td width="150" align="left">'.$langs->trans('Note').'</td><td align="left"><textarea cols="70" rows="'.ROWS_3.'" wrap="soft" name="note">'; $form_close.= '<tr><td width="150" align="left">'.$langs->trans('Note').'</td><td align="left"><textarea cols="70" rows="'.ROWS_3.'" wrap="soft" name="note">';
$form_close.= $object->note; $form_close.= $object->note;
$form_close.= '</textarea></td></tr>'; $form_close.= '</textarea></td></tr>';
@ -2024,7 +2034,7 @@ else
/* /*
* Boutons Actions * Boutons Actions
*/ */
if ($action != 'presend') if ($action != 'presend')
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
@ -2034,8 +2044,8 @@ else
// Validate // Validate
if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider)
{ {
if (count($object->lines) > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=validate">'.$langs->trans('Validate').'</a></div>'; if (count($object->lines) > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=validate">'.$langs->trans('Validate').'</a></div>';
//else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>'; //else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>';
} }
// Edit // Edit
@ -2054,34 +2064,34 @@ else
// Send // Send
if ($object->statut == 1 || $object->statut == 2) if ($object->statut == 1 || $object->statut == 2)
{ {
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendByMail').'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendByMail').'</a></div>';
} }
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a></div>'; else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a></div>';
} }
// Create an order // Create an order
if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0) if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0)
{ {
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddOrder").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddOrder").'</a></div>';
} }
} }
// Create contract // Create contract
if ($conf->contrat->enabled && $object->statut == 2 && $user->societe_id == 0) if ($conf->contrat->enabled && $object->statut == 2 && $user->societe_id == 0)
{ {
$langs->load("contracts"); $langs->load("contracts");
if ($user->rights->contrat->creer) if ($user->rights->contrat->creer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a></div>';
} }
} }
// Create an invoice and classify billed // Create an invoice and classify billed
if ($object->statut == 2 && $user->societe_id == 0) if ($object->statut == 2 && $user->societe_id == 0)
{ {
if (! empty($conf->facture->enabled) && $user->rights->facture->creer) if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
@ -2119,18 +2129,19 @@ else
} }
print '</div>'; print '</div>';
print "<br>\n";
} }
print "<br>\n";
if ($action != 'presend') if ($action != 'presend')
{ {
print '<table width="100%"><tr><td width="50%" valign="top">'; print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre //print '<table width="100%"><tr><td width="50%" valign="top">';
//print '<a name="builddoc"></a>'; // ancre
/* /*
* Documents generes * Documents generes
*/ */
$filename=dol_sanitizeFileName($object->ref); $filename=dol_sanitizeFileName($object->ref);
$filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
@ -2144,54 +2155,60 @@ else
/* /*
* Linked object block * Linked object block
*/ */
$somethingshown=$object->showLinkedObjectBlock(); $somethingshown=$object->showLinkedObjectBlock();
print '</td><td valign="top" width="50%">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print '</td><td valign="top" width="50%">';
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'propal',$socid); $somethingshown=$formactions->showactions($object,'propal',$socid);
print '</td></tr></table>';
//print '</td></tr></table>';
print '</div></div></div>';
} }
/* /*
* Action presend * Action presend
* *
*/ */
if ($action == 'presend') if ($action == 'presend')
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/')); $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
// Build document if it not exists // Build document if it not exists
if (! $file || ! is_readable($file)) if (! $file || ! is_readable($file))
{ {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang=''; $newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang)) if (! empty($newlang))
{ {
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) if ($result <= 0)
{ {
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/')); $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
} }
print '<br>'; print '<br>';
print_titre($langs->trans('SendPropalByMail')); print_titre($langs->trans('SendPropalByMail'));
@ -2217,28 +2234,28 @@ else
// Tableau des substitutions // Tableau des substitutions
$formmail->substit['__PROPREF__']=$object->ref; $formmail->substit['__PROPREF__']=$object->ref;
$formmail->substit['__SIGNATURE__']=$user->signature; $formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']=''; $formmail->substit['__CONTACTCIVNAME__']='';
//Find the good contact adress //Find the good contact adress
$custcontact=''; $custcontact='';
$contactarr=array(); $contactarr=array();
$contactarr=$object->liste_contact(-1,'external'); $contactarr=$object->liste_contact(-1,'external');
if (is_array($contactarr) && count($contactarr)>0) { if (is_array($contactarr) && count($contactarr)>0) {
foreach($contactarr as $contact) { foreach($contactarr as $contact) {
if ($contact['libelle']==$langs->trans('TypeContact_propal_external_CUSTOMER')) { if ($contact['libelle']==$langs->trans('TypeContact_propal_external_CUSTOMER')) {
$contactstatic=new Contact($db); $contactstatic=new Contact($db);
$contactstatic->fetch($contact['id']); $contactstatic->fetch($contact['id']);
$custcontact=$contactstatic->getFullName($langs,1); $custcontact=$contactstatic->getFullName($langs,1);
} }
} }
if (!empty($custcontact)) { if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact; $formmail->substit['__CONTACTCIVNAME__']=$custcontact;
} }
} }
// Tableau des parametres complementaires // Tableau des parametres complementaires
$formmail->param['action']='send'; $formmail->param['action']='send';
@ -2248,10 +2265,10 @@ else
// Init list of files // Init list of files
if (GETPOST("mode")=='init') if (GETPOST("mode")=='init')
{ {
$formmail->clear_attached_files(); $formmail->clear_attached_files();
$formmail->add_attached_files($file,basename($file),dol_mimetype($file)); $formmail->add_attached_files($file,basename($file),dol_mimetype($file));
} }
$formmail->show_form(); $formmail->show_form();

View File

@ -307,11 +307,13 @@ class Propal extends CommonObject
* @param int $fk_fournprice Id supplier price * @param int $fk_fournprice Id supplier price
* @param int $pa_ht Buying price without tax * @param int $pa_ht Buying price without tax
* @param string $label ??? * @param string $label ???
* @param timestamp $date_start Start date of the line
* @param timestamp $date_end End date of the line
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
* *
* @see add_product * @see add_product
*/ */
function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='') function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$date_start='', $date_end='')
{ {
global $conf; global $conf;
@ -402,6 +404,9 @@ class Propal extends CommonObject
$this->line->special_code=$special_code; $this->line->special_code=$special_code;
$this->line->fk_parent_line=$fk_parent_line; $this->line->fk_parent_line=$fk_parent_line;
$this->line->date_start=$date_start;
$this->line->date_end=$date_end;
// infos marge // infos marge
$this->line->fk_fournprice = $fk_fournprice; $this->line->fk_fournprice = $fk_fournprice;
$this->line->pa_ht = $pa_ht; $this->line->pa_ht = $pa_ht;
@ -465,9 +470,11 @@ class Propal extends CommonObject
* @param int $pa_ht Price (without tax) of product when it was bought * @param int $pa_ht Price (without tax) of product when it was bought
* @param string $label ??? * @param string $label ???
* @param int $type 0/1=Product/service * @param int $type 0/1=Product/service
* @param timestamp $date_start Start date of the line
* @param timestamp $date_end End date of the line
* @return int 0 if OK, <0 if KO * @return int 0 if OK, <0 if KO
*/ */
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0) function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='')
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
@ -546,6 +553,9 @@ class Propal extends CommonObject
$this->line->fk_fournprice = $fk_fournprice; $this->line->fk_fournprice = $fk_fournprice;
$this->line->pa_ht = $pa_ht; $this->line->pa_ht = $pa_ht;
$this->line->date_start=$date_start;
$this->line->date_end=$date_end;
// TODO deprecated // TODO deprecated
$this->line->price=$price; $this->line->price=$price;
$this->line->remise=$remise; $this->line->remise=$remise;
@ -1098,7 +1108,8 @@ class Propal extends CommonObject
*/ */
$sql = "SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,"; $sql = "SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,";
$sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,"; $sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,";
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label'; $sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label,';
$sql.= ' d.date_start, d.date_end';
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d"; $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid";
$sql.= " WHERE d.fk_propal = ".$this->id; $sql.= " WHERE d.fk_propal = ".$this->id;
@ -1154,6 +1165,9 @@ class Propal extends CommonObject
$line->product_desc = $objp->product_desc; // Description produit $line->product_desc = $objp->product_desc; // Description produit
$line->fk_product_type = $objp->fk_product_type; $line->fk_product_type = $objp->fk_product_type;
$line->date_start = $objp->date_start;
$line->date_end = $objp->date_end;
$this->lines[$i] = $line; $this->lines[$i] = $line;
//dol_syslog("1 ".$line->fk_product); //dol_syslog("1 ".$line->fk_product);
//print "xx $i ".$this->lines[$i]->fk_product; //print "xx $i ".$this->lines[$i]->fk_product;
@ -2627,6 +2641,9 @@ class PropaleLigne
var $total_localtax1; var $total_localtax1;
var $total_localtax2; var $total_localtax2;
var $date_start;
var $date_end;
var $skip_update_total; // Skip update price total for special lines var $skip_update_total; // Skip update price total for special lines
/** /**
@ -2651,7 +2668,8 @@ class PropaleLigne
$sql.= ' pd.remise, pd.remise_percent, pd.fk_remise_except, pd.subprice,'; $sql.= ' pd.remise, pd.remise_percent, pd.fk_remise_except, pd.subprice,';
$sql.= ' pd.info_bits, pd.total_ht, pd.total_tva, pd.total_ttc, pd.fk_product_fournisseur_price as fk_fournprice, pd.buy_price_ht as pa_ht, pd.special_code, pd.rang,'; $sql.= ' pd.info_bits, pd.total_ht, pd.total_tva, pd.total_ttc, pd.fk_product_fournisseur_price as fk_fournprice, pd.buy_price_ht as pa_ht, pd.special_code, pd.rang,';
$sql.= ' pd.localtax1_tx, pd.localtax2_tx, pd.total_localtax1, pd.total_localtax2,'; $sql.= ' pd.localtax1_tx, pd.localtax2_tx, pd.total_localtax1, pd.total_localtax2,';
$sql.= ' p.ref as product_ref, p.label as product_label, p.description as product_desc'; $sql.= ' p.ref as product_ref, p.label as product_label, p.description as product_desc,';
$sql.= ' pd.date_start, pd.date_end';
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pd'; $sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pd';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pd.fk_product = p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pd.fk_product = p.rowid';
$sql.= ' WHERE pd.rowid = '.$rowid; $sql.= ' WHERE pd.rowid = '.$rowid;
@ -2696,6 +2714,9 @@ class PropaleLigne
$this->product_label = $objp->product_label; $this->product_label = $objp->product_label;
$this->product_desc = $objp->product_desc; $this->product_desc = $objp->product_desc;
$this->date_start = $this->db->jdate($objp->date_start);
$this->date_end = $this->db->jdate($objp->date_end);
$this->db->free($result); $this->db->free($result);
} }
else else
@ -2749,7 +2770,8 @@ class PropaleLigne
$sql.= ' (fk_propal, fk_parent_line, label, description, fk_product, product_type, fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx,'; $sql.= ' (fk_propal, fk_parent_line, label, description, fk_product, product_type, fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx,';
$sql.= ' subprice, remise_percent, '; $sql.= ' subprice, remise_percent, ';
$sql.= ' info_bits, '; $sql.= ' info_bits, ';
$sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_product_fournisseur_price, buy_price_ht, special_code, rang)'; $sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_product_fournisseur_price, buy_price_ht, special_code, rang,';
$sql.= ' date_start, date_end)';
$sql.= " VALUES (".$this->fk_propal.","; $sql.= " VALUES (".$this->fk_propal.",";
$sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").",";
$sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
@ -2772,7 +2794,9 @@ class PropaleLigne
$sql.= " ".(isset($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").","; $sql.= " ".(isset($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").",";
$sql.= " ".(isset($this->pa_ht)?"'".price2num($this->pa_ht)."'":"null").","; $sql.= " ".(isset($this->pa_ht)?"'".price2num($this->pa_ht)."'":"null").",";
$sql.= ' '.$this->special_code.','; $sql.= ' '.$this->special_code.',';
$sql.= ' '.$this->rang; $sql.= ' '.$this->rang.',';
$sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").',';
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");
$sql.= ')'; $sql.= ')';
dol_syslog(get_class($this).'::insert sql='.$sql, LOG_DEBUG); dol_syslog(get_class($this).'::insert sql='.$sql, LOG_DEBUG);
@ -2904,6 +2928,8 @@ class PropaleLigne
if (strlen($this->special_code)) $sql.= " , special_code=".$this->special_code; if (strlen($this->special_code)) $sql.= " , special_code=".$this->special_code;
$sql.= " , fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); $sql.= " , fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null");
if (! empty($this->rang)) $sql.= ", rang=".$this->rang; if (! empty($this->rang)) $sql.= ", rang=".$this->rang;
$sql.= " , date_start=".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null");
$sql.= " , date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");
$sql.= " WHERE rowid = ".$this->rowid; $sql.= " WHERE rowid = ".$this->rowid;
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);

View File

@ -269,7 +269,8 @@ if ($socid > 0)
print_fiche_titre($langs->trans("NewGlobalDiscount"),'',''); print_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="38%">'.$langs->trans("AmountHT").'</td>'; print '<tr><td width="38%">'.$langs->trans("AmountHT").'</td>';
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'">&nbsp;'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'">';
print '<span class="hideonsmartphone">&nbsp;'.$langs->trans("Currency".$conf->currency).'</span></td></tr>';
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>'; print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
print '<td>'; print '<td>';
print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$objsoc); print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$objsoc);

View File

@ -934,6 +934,9 @@ class Commande extends CommonOrder
$line->special_code = $object->lines[$i]->special_code; $line->special_code = $object->lines[$i]->special_code;
$line->fk_parent_line = $object->lines[$i]->fk_parent_line; $line->fk_parent_line = $object->lines[$i]->fk_parent_line;
$line->date_start = $object->lines[$i]->date_start;
$line->date_end = $object->lines[$i]->date_end;
$line->fk_fournprice = $object->lines[$i]->fk_fournprice; $line->fk_fournprice = $object->lines[$i]->fk_fournprice;
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
$line->pa_ht = $marginInfos[0]; $line->pa_ht = $marginInfos[0];

View File

@ -329,8 +329,8 @@ else if ($action == 'add' && $user->rights->commande->creer)
$lines[$i]->fk_remise_except, $lines[$i]->fk_remise_except,
'HT', 'HT',
0, 0,
$datestart, $date_start,
$dateend, $date_end,
$product_type, $product_type,
$lines[$i]->rang, $lines[$i]->rang,
$lines[$i]->special_code, $lines[$i]->special_code,
@ -2307,7 +2307,7 @@ else
/* /*
* Boutons actions * Boutons actions
*/ */
if ($action != 'presend') if ($action != 'presend')
{ {
if ($user->societe_id == 0 && $action <> 'editline') if ($user->societe_id == 0 && $action <> 'editline')
@ -2435,19 +2435,19 @@ else
print '</div>'; print '</div>';
} }
print '<br>';
} }
print '<br>';
if ($action != 'presend') if ($action != 'presend')
{ {
print '<table width="100%"><tr><td width="50%" valign="top">'; print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre //print '<table width="100%"><tr><td width="50%" valign="top">';
//print '<a name="builddoc"></a>'; // ancre
/* /*
* Documents generes * Documents generes
* */
*/
$comref = dol_sanitizeFileName($object->ref); $comref = dol_sanitizeFileName($object->ref);
$file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf'; $file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
$relativepath = $comref.'/'.$comref.'.pdf'; $relativepath = $comref.'/'.$comref.'.pdf';
@ -2461,17 +2461,19 @@ else
/* /*
* Linked object block * Linked object block
*/ */
$somethingshown=$object->showLinkedObjectBlock(); $somethingshown=$object->showLinkedObjectBlock();
print '</td><td valign="top" width="50%">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print '</td><td valign="top" width="50%">';
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'order',$socid); $somethingshown=$formactions->showactions($object,'order',$socid);
print '</td></tr></table>'; //print '</td></tr></table>';
print '</div></div></div>';
} }

View File

@ -28,9 +28,9 @@
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
@ -84,17 +84,12 @@ if ($action == 'create')
if (($action == 'create' || $action == 'add') && empty($mesgs)) if (($action == 'create' || $action == 'add') && empty($mesgs))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (! empty($conf->projet->enabled)) { if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
} }
$langs->load('bills'); $langs->load('bills');
$langs->load('products'); $langs->load('products');
@ -287,7 +282,9 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$lines[$i]->special_code, $lines[$i]->special_code,
$object->origin, $object->origin,
$lines[$i]->rowid, $lines[$i]->rowid,
$fk_parent_line $fk_parent_line,
$lines[$i]->fk_fournprice,
$lines[$i]->pa_ht
); );
if ($result > 0) if ($result > 0)
{ {

View File

@ -27,7 +27,7 @@
* \brief List of details of bank transactions for an account * \brief List of details of bank transactions for an account
*/ */
require 'pre.inc.php'; // We use pre.inc.php to have a dynamic menu require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
@ -35,7 +35,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load("bills"); $langs->load("bills");
$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int'));

View File

@ -23,10 +23,13 @@
* \brief Page reporting mensuel Entrees/Sorties d'un compte bancaire * \brief Page reporting mensuel Entrees/Sorties d'un compte bancaire
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$id=GETPOST('account'); $id=GETPOST('account');
$ref=GETPOST('ref'); $ref=GETPOST('ref');

View File

@ -24,11 +24,13 @@
* \brief Fiche creation compte bancaire * \brief Fiche creation compte bancaire
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
$langs->load("bills"); $langs->load("bills");
$action=GETPOST('action'); $action=GETPOST('action');

View File

@ -22,7 +22,11 @@
* \brief Page de bilan * \brief Page de bilan
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
if (!$user->rights->banque->lire) if (!$user->rights->banque->lire)
accessforbidden(); accessforbidden();

View File

@ -23,8 +23,10 @@
* \brief Page de budget * \brief Page de budget
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories"); $langs->load("categories");
// Security check // Security check

View File

@ -23,7 +23,11 @@
* \brief Page ajout de categories bancaires * \brief Page ajout de categories bancaires
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
if (!$user->rights->banque->configurer) if (!$user->rights->banque->configurer)
accessforbidden(); accessforbidden();

View File

@ -24,13 +24,15 @@
* \brief Page to create/view a bank account * \brief Page to create/view a bank account
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
$langs->load("companies"); $langs->load("companies");
$action=GETPOST("action"); $action=GETPOST("action");

View File

@ -23,12 +23,13 @@
* \brief Page graph des transactions bancaires * \brief Page graph des transactions bancaires
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768); $WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768);
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200);

View File

@ -23,10 +23,11 @@
* \brief Home page of bank module * \brief Home page of bank module
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories"); $langs->load("categories");
@ -232,20 +233,20 @@ if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'
// Total // Total
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>'; print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>';
print "</table>"; print "</table>";
print "<br>";
/* /*
* Boutons d'actions * Boutons d'actions
*/ */
print "<br><div class=\"tabsAction\">\n";
if ($user->rights->banque->configurer) { print '<div class="tabsAction">'."\n";
if ($user->rights->banque->configurer)
{
print '<a class="butAction" href="fiche.php?action=create">'.$langs->trans("NewFinancialAccount").'</a>'; print '<a class="butAction" href="fiche.php?action=create">'.$langs->trans("NewFinancialAccount").'</a>';
print '<a class="butAction" href="categ.php">'.$langs->trans("Rubriques").'</a>';
} }
print "</div>"; print '</div>';
llxFooter(); llxFooter();

View File

@ -21,11 +21,13 @@
* \brief Onglet info d'une ecriture bancaire * \brief Onglet info d'une ecriture bancaire
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
$langs->load("companies"); $langs->load("companies");

View File

@ -25,13 +25,13 @@
* \brief Page to edit a bank transaction record * \brief Page to edit a bank transaction record
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("categories");
if (! empty($conf->adherent->enabled)) $langs->load("members"); if (! empty($conf->adherent->enabled)) $langs->load("members");

View File

@ -1,92 +0,0 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copytight (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/bank/pre.inc.php
* \ingroup compta
* \brief Fichier gestionnaire du menu compta banque
*/
require_once realpath(dirname(__FILE__)) . '/../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
/**
* Replace the default llxHeader function
*
* @param string $head Optionnal head lines
* @param string $title HTML title
* @param string $help_url Link to online url help to show on left menu
* @param string $target Force target on menu links
* @param int $disablejs More content into html header
* @param int $disablehead More content into html header
* @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
* @return none
*/
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
{
global $db, $user, $conf, $langs;
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$menu = new Menu();
// Entry for each bank account
if ($user->rights->banque->lire)
{
$sql = "SELECT rowid, label, courant, rappro, courant";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND clos = 0";
$sql.= " ORDER BY label";
$resql = $db->query($sql);
if ($resql)
{
$numr = $db->num_rows($resql);
$i = 0;
if ($numr > 0) $menu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
while ($i < $numr)
{
$objp = $db->fetch_object($resql);
$menu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
{
$menu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
}
$i++;
}
}
else dol_print_error($db);
$db->free($resql);
}
left_menu('', $help_url, '', $menu->liste, 1);
main_area();
}
?>

View File

@ -23,7 +23,7 @@
* \brief Page to reconciliate bank transactions * \brief Page to reconciliate bank transactions
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
@ -31,8 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
$langs->load("bills"); $langs->load("bills");
if (! $user->rights->banque->consolidate) accessforbidden(); if (! $user->rights->banque->consolidate) accessforbidden();

View File

@ -23,15 +23,16 @@
* \brief Page d'affichage d'un releve * \brief Page d'affichage d'un releve
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$action=GETPOST('action', 'alpha');
$langs->load("companies");
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
$langs->load("companies");
$langs->load("bills"); $langs->load("bills");
$action=GETPOST('action', 'alpha');
$id=GETPOST('account'); $id=GETPOST('account');
$ref=GETPOST('ref'); $ref=GETPOST('ref');
$dvid=GETPOST('dvid'); $dvid=GETPOST('dvid');

View File

@ -24,12 +24,15 @@
* \brief List of bank transactions * \brief List of bank transactions
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php';
$langs->load("banks");
$langs->load("categories");
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'banque'); $result=restrictedArea($user,'banque');
@ -134,9 +137,9 @@ if ($resql)
// Title // Title
$bankcateg=new BankCateg($db); $bankcateg=new BankCateg($db);
if (! empty($_REQUEST["bid"])) if (GETPOST("bid"))
{ {
$result=$bankcateg->fetch($_REQUEST["bid"]); $result=$bankcateg->fetch(GETPOST("bid"));
print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->nom:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->nom:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
} }
else else

View File

@ -23,14 +23,16 @@
* \brief Page de detail du budget de tresorerie * \brief Page de detail du budget de tresorerie
*/ */
require 'pre.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
$langs->load("bills"); $langs->load("bills");
// Security check // Security check

View File

@ -24,10 +24,12 @@
* \brief Page de saisie d'un virement * \brief Page de saisie d'un virement
*/ */
require 'pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
if (! $user->rights->banque->transfer) if (! $user->rights->banque->transfer)
accessforbidden(); accessforbidden();
@ -36,8 +38,9 @@ $action = GETPOST('action','alpha');
/* /*
* Action ajout d'un virement * Actions
*/ */
if ($action == 'add') if ($action == 'add')
{ {
$langs->load("errors"); $langs->load("errors");

View File

@ -3440,12 +3440,13 @@ else if ($id > 0 || ! empty($ref))
print '</div>'; print '</div>';
} }
} }
print '<br>';
if ($action != 'prerelance' && $action != 'presend') if ($action != 'prerelance' && $action != 'presend')
{ {
print '<table width="100%"><tr><td width="50%" valign="top">'; print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre //print '<table width="100%"><tr><td width="50%" valign="top">';
//print '<a name="builddoc"></a>'; // ancre
/* /*
* Documents generes * Documents generes
@ -3456,7 +3457,6 @@ else if ($id > 0 || ! empty($ref))
$genallowed=$user->rights->facture->creer; $genallowed=$user->rights->facture->creer;
$delallowed=$user->rights->facture->supprimer; $delallowed=$user->rights->facture->supprimer;
print '<br>';
print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
$somethingshown=$formfile->numoffiles; $somethingshown=$formfile->numoffiles;
@ -3472,16 +3472,16 @@ else if ($id > 0 || ! empty($ref))
print showPaypalPaymentUrl('invoice',$object->ref); print showPaypalPaymentUrl('invoice',$object->ref);
} }
print '</td><td valign="top" width="50%">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print '</td><td valign="top" width="50%">';
print '<br>';
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'invoice',$socid); $somethingshown=$formactions->showactions($object,'invoice',$socid);
print '</td></tr></table>'; //print '</td></tr></table>';
print '</div></div></div>';
} }
else else
{ {

View File

@ -95,7 +95,7 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
$idpays = $p[0]; $idpays = $p[0];
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.libelle,"; $sql = "SELECT f.rowid, f.ref_supplier, f.type, f.datef, f.libelle,";
$sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,"; $sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,";
$sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,"; $sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,";
$sql.= " p.rowid as pid, p.ref as ref, p.accountancy_code_buy,"; $sql.= " p.rowid as pid, p.ref as ref, p.accountancy_code_buy,";
@ -146,7 +146,7 @@ if ($result)
$compta_localtax2 = (! empty($obj->account_localtax2)?$obj->account_localtax2:$langs->trans("CodeNotDef")); $compta_localtax2 = (! empty($obj->account_localtax2)?$obj->account_localtax2:$langs->trans("CodeNotDef"));
$tabfac[$obj->rowid]["date"] = $obj->datef; $tabfac[$obj->rowid]["date"] = $obj->datef;
$tabfac[$obj->rowid]["ref"] = $obj->facnumber; $tabfac[$obj->rowid]["ref"] = $obj->ref_supplier;
$tabfac[$obj->rowid]["type"] = $obj->type; $tabfac[$obj->rowid]["type"] = $obj->type;
$tabfac[$obj->rowid]["lib"] = $obj->libelle; $tabfac[$obj->rowid]["lib"] = $obj->libelle;
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc; $tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc;

View File

@ -24,14 +24,15 @@
* \brief Page for cheque deposits * \brief Page for cheque deposits
*/ */
require 'pre.inc.php'; // We use pre.inc.php to have a dynamic menu require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load('bills'); $langs->load('bills');
$langs->load('banks');
$langs->load('companies'); $langs->load('companies');
$langs->load('compta'); $langs->load('compta');

View File

@ -23,11 +23,12 @@
* \brief Home page for cheque receipts * \brief Home page for cheque receipts
*/ */
require 'pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories");
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;

View File

@ -23,10 +23,12 @@
* \brief Page liste des bordereau de remise de cheque * \brief Page liste des bordereau de remise de cheque
*/ */
require 'pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load("bills"); $langs->load("bills");
// Security check // Security check

View File

@ -1,92 +0,0 @@
<?php
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copytight (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/paiement/cheque/pre.inc.php
* \ingroup compta
* \brief Fichier gestionnaire du menu cheques
*/
require_once realpath(dirname(__FILE__)) . '/../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
/**
* Replace the default llxHeader function
*
* @param string $head Optionnal head lines
* @param string $title HTML title
* @param string $help_url Link to online url help to show on left menu
* @param string $target Force target on menu links
* @param int $disablejs More content into html header
* @param int $disablehead More content into html header
* @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
* @return none
*/
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
{
global $db, $user, $conf, $langs;
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$menu = new Menu();
// Entry for each bank account
if ($user->rights->banque->lire)
{
$sql = "SELECT rowid, label, courant, rappro, courant";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND clos = 0";
$sql.= " ORDER BY label";
$resql = $db->query($sql);
if ($resql)
{
$numr = $db->num_rows($resql);
$i = 0;
if ($numr > 0) $menu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
while ($i < $numr)
{
$objp = $db->fetch_object($resql);
$menu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
if ($objp->rappro && $objp->courant != 2) // If not cash account and can be reconciliate
{
$menu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
}
$i++;
}
}
else dol_print_error($db);
$db->free($resql);
}
left_menu('', $help_url, '', $menu->liste, 1);
main_area();
}
?>

View File

@ -23,11 +23,14 @@
* \brief Fiche apercu du bon de prelevement * \brief Fiche apercu du bon de prelevement
*/ */
require '../bank/pre.inc.php'; require('../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load("bills"); $langs->load("bills");
$langs->load("categories"); $langs->load("categories");

View File

@ -24,11 +24,13 @@
* \brief Page liste des bons de prelevements * \brief Page liste des bons de prelevements
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("widthdrawals"); $langs->load("banks");
$langs->load("categories"); $langs->load("categories");
$langs->load("widthdrawals");
// Security check // Security check
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');

View File

@ -24,16 +24,18 @@
* \brief Prelevement creation page * \brief Prelevement creation page
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load("widthdrawals"); $langs->load("widthdrawals");
$langs->load("companies"); $langs->load("companies");
$langs->load("banks");
$langs->load("bills"); $langs->load("bills");
// Security check // Security check

View File

@ -24,14 +24,16 @@
* \brief Page to list withdraw requests * \brief Page to list withdraw requests
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/modules/modPrelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/modPrelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load("widthdrawals"); $langs->load("widthdrawals");
$langs->load("companies"); $langs->load("companies");
$langs->load("categories");
// Security check // Security check
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');

View File

@ -24,14 +24,16 @@
* \brief Page liste des factures prelevees * \brief Page liste des factures prelevees
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("companies"); $langs->load("banks");
$langs->load("categories"); $langs->load("categories");
$langs->load("companies");
$langs->load('withdrawals'); $langs->load('withdrawals');
// Securite acces client // Securite acces client

View File

@ -24,12 +24,14 @@
* \brief Withdraw reject * \brief Withdraw reject
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories"); $langs->load("categories");
$langs->load('withdrawals'); $langs->load('withdrawals');

View File

@ -23,17 +23,19 @@
* \brief Prelevement statistics * \brief Prelevement statistics
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load("withdrawals");
// Security check // Security check
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
$langs->load("withdrawals");
$langs->load("categories");
// Get supervariables // Get supervariables
$prev_id = GETPOST('id','int'); $prev_id = GETPOST('id','int');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -23,16 +23,19 @@
* \brief Fiche prelevement * \brief Fiche prelevement
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
if (!$user->rights->prelevement->bons->lire) if (!$user->rights->prelevement->bons->lire)
accessforbidden(); accessforbidden();
$langs->load("bills"); $langs->load("bills");
$langs->load("withdrawals"); $langs->load("withdrawals");
$langs->load("categories");
// Security check // Security check

View File

@ -24,14 +24,16 @@
* \brief Prelevement index page * \brief Prelevement index page
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("withdrawals"); $langs->load("banks");
$langs->load("categories"); $langs->load("categories");
$langs->load("withdrawals");
// Security check // Security check
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');

View File

@ -24,18 +24,21 @@
* \brief card of withdraw line * \brief card of withdraw line
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
// Security check // Security check
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
$langs->load("bills"); $langs->load("bills");
$langs->load("withdrawals"); $langs->load("withdrawals");
$langs->load("categories");
// Get supervariables // Get supervariables
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');

View File

@ -24,17 +24,20 @@
* \brief Prelevement lines * \brief Prelevement lines
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
// Security check // Security check
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
$langs->load("categories");
$langs->load('withdrawals'); $langs->load('withdrawals');
// Get supervariables // Get supervariables

View File

@ -23,10 +23,12 @@
* \ingroup prelevement * \ingroup prelevement
* \brief Page liste des prelevements * \brief Page liste des prelevements
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("withdrawals"); $langs->load("withdrawals");
$langs->load("companies"); $langs->load("companies");
$langs->load("categories"); $langs->load("categories");

View File

@ -24,13 +24,15 @@
* \brief Reject page * \brief Reject page
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load("withdrawals"); $langs->load("withdrawals");
$langs->load("companies"); $langs->load("companies");
$langs->load("categories");
// Security check // Security check
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');

View File

@ -24,12 +24,14 @@
* \brief Page de stats des prelevements * \brief Page de stats des prelevements
*/ */
require '../bank/pre.inc.php'; require('../../../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load("withdrawals"); $langs->load("withdrawals");
$langs->load("companies"); $langs->load("companies");
$langs->load("categories");
// Security check // Security check
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -115,6 +115,8 @@ class ChargeSociales extends CommonObject
*/ */
function create($user) function create($user)
{ {
global $conf;
// Nettoyage parametres // Nettoyage parametres
$newamount=price2num($this->amount,'MT'); $newamount=price2num($this->amount,'MT');
@ -127,10 +129,11 @@ class ChargeSociales extends CommonObject
$this->db->begin(); $this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount, entity)";
$sql.= " VALUES (".$this->type.",'".$this->db->escape($this->lib)."',"; $sql.= " VALUES (".$this->type.",'".$this->db->escape($this->lib)."',";
$sql.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',"; $sql.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',";
$sql.= " ".price2num($newamount); $sql.= " '".price2num($newamount)."',";
$sql.= " ".$conf->entity;
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::create sql=".$sql); dol_syslog(get_class($this)."::create sql=".$sql);

View File

@ -500,13 +500,13 @@ class Tva extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount";
if ($this->note) $sql.=", note"; if ($this->note) $sql.=", note";
if ($this->label) $sql.=", label"; if ($this->label) $sql.=", label";
$sql.= ", fk_user_creat, fk_bank"; $sql.= ", fk_user_creat, fk_bank, entity";
$sql.= ") "; $sql.= ") ";
$sql.= " VALUES ('".$this->db->idate($this->datep)."',"; $sql.= " VALUES ('".$this->db->idate($this->datep)."',";
$sql.= "'".$this->db->idate($this->datev)."'," . $this->amount; $sql.= "'".$this->db->idate($this->datev)."'," . $this->amount;
if ($this->note) $sql.=", '".$this->db->escape($this->note)."'"; if ($this->note) $sql.=", '".$this->db->escape($this->note)."'";
if ($this->label) $sql.=", '".$this->db->escape($this->label)."'"; if ($this->label) $sql.=", '".$this->db->escape($this->label)."'";
$sql.=", '".$user->id."', NULL"; $sql.=", '".$user->id."', NULL, ".$conf->entity;
$sql.= ")"; $sql.= ")";
dol_syslog("Tva::addPayment sql=".$sql); dol_syslog("Tva::addPayment sql=".$sql);

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -2702,31 +2702,47 @@ abstract class CommonObject
global $conf,$langs,$hookmanager; global $conf,$langs,$hookmanager;
print '<tr class="liste_titre nodrag nodrop">'; print '<tr class="liste_titre nodrag nodrop">';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
{ if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print '<td align="center" width="5">&nbsp;</td>';
print '<td align="center" width="5">&nbsp;</td>';
} // Description
print '<td>'.$langs->trans('Description').'</td>'; print '<td>'.$langs->trans('Description').'</td>';
// VAT
print '<td align="right" width="50">'.$langs->trans('VAT').'</td>'; print '<td align="right" width="50">'.$langs->trans('VAT').'</td>';
// Price HT
print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>';
if ($conf->global->MAIN_FEATURES_LEVEL > 1)
print '<td align="right" width="80">&nbsp;</td>'; if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<td align="right" width="80">&nbsp;</td>';
// Qty
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>'; print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
// Reduction short
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>'; print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
if (! empty($conf->margin->enabled)) { if (! empty($conf->margin->enabled)) {
if ($conf->global->MARGIN_TYPE == "1") if ($conf->global->MARGIN_TYPE == "1")
print '<td align="right" width="80">'.$langs->trans('BuyingPrice').'</td>'; print '<td align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
else else
print '<td align="right" width="80">'.$langs->trans('CostPrice').'</td>'; print '<td align="right" width="80">'.$langs->trans('CostPrice').'</td>';
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) if (! empty($conf->global->DISPLAY_MARGIN_RATES))
print '<td align="right" width="50">'.$langs->trans('MarginRate').'</td>'; print '<td align="right" width="50">'.$langs->trans('MarginRate').'</td>';
if (! empty($conf->global->DISPLAY_MARK_RATES)) if (! empty($conf->global->DISPLAY_MARK_RATES))
print '<td align="right" width="50">'.$langs->trans('MarkRate').'</td>'; print '<td align="right" width="50">'.$langs->trans('MarkRate').'</td>';
} }
// Total HT
print '<td align="right" width="50">'.$langs->trans('TotalHTShort').'</td>'; print '<td align="right" width="50">'.$langs->trans('TotalHTShort').'</td>';
print '<td width="10">&nbsp;</td>';
print '<td width="10">&nbsp;</td>'; print '<td width="10"></td>';
print '<td nowrap="nowrap">&nbsp;</td>'; // No width to allow autodim
print '<td width="10"></td>';
print '<td nowrap="nowrap"></td>'; // No width to allow autodim
print "</tr>\n"; print "</tr>\n";
$num = count($this->lines); $num = count($this->lines);
@ -2930,11 +2946,24 @@ abstract class CommonObject
global $conf,$langs,$bc; global $conf,$langs,$bc;
//var_dump($line); //var_dump($line);
if (!empty($line->date_start))
$date_start=$line->date_debut_prevue; {
if ($line->date_debut_reel) $date_start=$line->date_debut_reel; $date_start=$line->date_start;
$date_end=$line->date_fin_prevue; }
if ($line->date_fin_reel) $date_end=$line->date_fin_reel; else
{
$date_start=$line->date_debut_prevue;
if ($line->date_debut_reel) $date_start=$line->date_debut_reel;
}
if (!empty($line->date_end))
{
$date_end=$line->date_end;
}
else
{
$date_end=$line->date_fin_prevue;
if ($line->date_fin_reel) $date_end=$line->date_fin_reel;
}
$this->tpl['label'] = ''; $this->tpl['label'] = '';
if (! empty($line->fk_parent_line)) $this->tpl['label'].= img_picto('', 'rightarrow'); if (! empty($line->fk_parent_line)) $this->tpl['label'].= img_picto('', 'rightarrow');
@ -2962,7 +2991,11 @@ abstract class CommonObject
else else
{ {
$this->tpl['label'].= ($line->product_type == -1 ? '&nbsp;' : ($line->product_type == 1 ? img_object($langs->trans(''),'service') : img_object($langs->trans(''),'product'))); $this->tpl['label'].= ($line->product_type == -1 ? '&nbsp;' : ($line->product_type == 1 ? img_object($langs->trans(''),'service') : img_object($langs->trans(''),'product')));
$this->tpl['label'].= ($line->label ? '&nbsp;'.$line->label : ''); if (!empty($line->desc)) {
$this->tpl['label'].=$line->desc;
}else {
$this->tpl['label'].= ($line->label ? '&nbsp;'.$line->label : '');
}
// Dates // Dates
if ($line->product_type == 1 && ($date_start || $date_end)) if ($line->product_type == 1 && ($date_start || $date_end))
{ {

View File

@ -627,6 +627,10 @@ class ExtraFields
$formstat = new Form($db); $formstat = new Form($db);
$showtime = in_array($type,array('datetime')) ? 1 : 0; $showtime = in_array($type,array('datetime')) ? 1 : 0;
// Do not show current date when field not required (see select_date() method)
if(!$required && $value == '')
$value = '-1';
$out = $formstat->select_date($value, 'options_'.$key, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1); $out = $formstat->select_date($value, 'options_'.$key, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
//$out='<input type="text" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>'; //$out='<input type="text" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
} }

View File

@ -1188,6 +1188,9 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ="
if (empty($phone)) { return ''; } if (empty($phone)) { return ''; }
if (empty($country)) $country=$mysoc->country_code; if (empty($country)) $country=$mysoc->country_code;
// Short format for small screens
if ($conf->dol_optimize_smallscreen) $separ='';
$newphone=$phone; $newphone=$phone;
if (strtoupper($country) == "FR") if (strtoupper($country) == "FR")
{ {
@ -1213,9 +1216,14 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ="
} }
} }
if (! empty($addlink)) if (! empty($addlink)) // Link on phone number + link to add action (if conf->global->AGENDA_ADDACTIONFORPHONE set)
{ {
if (! empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') if (! empty($conf->browser)) // If phone, we use link of phone
{
$newphone ='<a href="tel:'.$phone.'"';
$newphone.='>'.$phone.'</a>';
}
else if (! empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') // If click to dial, we use click to dial url
{ {
if (empty($user->clicktodial_loaded)) $user->fetch_clicktodial(); if (empty($user->clicktodial_loaded)) $user->fetch_clicktodial();

View File

@ -438,7 +438,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// Tick to drag and drop // Tick to drag and drop
if ($addordertick) if ($addordertick)
{ {
print '<td align="center" class="tdlineupdown">&nbsp;</td>'; print '<td align="center" class="tdlineupdown hideonsmartphone">&nbsp;</td>';
} }
print "</tr>\n"; print "</tr>\n";
@ -459,13 +459,16 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
if ($total>0) if ($total>0)
{ {
print '<tr class="liste_total"><td class="liste_total">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total">';
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
if ($showproject) print '<td></td>'; if ($showproject) print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td align="right" nowrap="nowrap" class="liste_total">'.convertSecondToTime($total).'</td></tr>'; if ($addordertick) print '<td class="hideonsmartphone"></td>';
print '<td align="right" nowrap="nowrap" class="liste_total">'.convertSecondToTime($total).'</td>';
print '</tr>';
} }
return $inc; return $inc;

View File

@ -234,13 +234,62 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
} }
} }
/** // We update newmenu with entries found into database
* We update newmenu with entries found into database
* --------------------------------------------------
*/
$menuArbo = new Menubase($db,'auguria'); $menuArbo = new Menubase($db,'auguria');
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu); $newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
// We update newmenu for special dynamic menus
if ($conf->banque->enabled && $user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account
{
$sql = "SELECT rowid, label, courant, rappro, courant";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND clos = 0";
$sql.= " ORDER BY label";
$resql = $db->query($sql);
if ($resql)
{
$numr = $db->num_rows($resql);
$i = 0;
if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
while ($i < $numr)
{
$objp = $db->fetch_object($resql);
$newmenu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
{
$newmenu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
}
$i++;
}
}
else dol_print_error($db);
$db->free($resql);
}
if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP
{
$MAXFTP=20;
$i=1;
while ($i <= $MAXFTP)
{
$paramkey='FTP_NAME_'.$i;
//print $paramkey;
if (! empty($conf->global->$paramkey))
{
$link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i;
$newmenu->add($link, dol_trunc($conf->global->$paramkey,24));
}
$i++;
}
}
// Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after
//var_dump($menu_array_before);exit; //var_dump($menu_array_before);exit;
//var_dump($menu_array_after);exit; //var_dump($menu_array_after);exit;
$menu_array=$newmenu->liste; $menu_array=$newmenu->liste;

View File

@ -205,12 +205,12 @@ class MenuManager
$canonnexturl=preg_replace('/\?.*$/','',$nexturl); $canonnexturl=preg_replace('/\?.*$/','',$nexturl);
//var_dump($canonrelurl); //var_dump($canonrelurl);
//var_dump($canonnexturl); //var_dump($canonnexturl);
print '<ul>'; print '<ul>'."\n";
if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools')) if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools'))
|| strpos($canonrelurl,'/product/index.php') || strpos($canonrelurl,'/compta/bank/index.php')) || strpos($canonrelurl,'/product/index.php') || strpos($canonrelurl,'/compta/bank/index.php'))
{ {
// We add sub entry // We add sub entry
print '<li data-role="list-divider"><a href="'.$relurl.'">'.$langs->trans(ucfirst($val['mainmenu'])."Dashboard").'</a></li>'."\n"; print str_pad('',1).'<li data-role="list-divider" class="lilevel1"><a href="'.$relurl.'">'.$langs->trans(ucfirst($val['mainmenu'])."Dashboard").'</a></li>'."\n";
} }
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
{ {
@ -220,8 +220,9 @@ class MenuManager
$canonurl2=preg_replace('/\?.*$/','',$val2['url']); $canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
print '<li'.($val2['level']==0?' data-role="list-divider"':'').'>'; print str_pad('',$val2['level']+1).'<li'.($val2['level']==0?' data-role="list-divider"':'').' class="lilevel'.($val2['level']+1).'">';
if ($relurl2) print '<a href="'.$relurl2.'">'; if ($relurl2) print '<a href="'.$relurl2.'">';
print str_pad('',($val2['level']+1)*12,'&nbsp;');
print $val2['titre']; print $val2['titre'];
if ($relurl2) print '</a>'; if ($relurl2) print '</a>';
print '</li>'."\n"; print '</li>'."\n";

View File

@ -1161,9 +1161,60 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
// Add personalized menus and modules menus // Add personalized menus and modules menus
$menuArbo = new Menubase($db,'eldy'); $menuArbo = new Menubase($db,'eldy');
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,(empty($user->societe_id)?0:1),'eldy',$tabMenu); $newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,(empty($user->societe_id)?0:1),'eldy',$tabMenu);
// We update newmenu for special dynamic menus
if ($user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account
{
$sql = "SELECT rowid, label, courant, rappro, courant";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND clos = 0";
$sql.= " ORDER BY label";
$resql = $db->query($sql);
if ($resql)
{
$numr = $db->num_rows($resql);
$i = 0;
if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
while ($i < $numr)
{
$objp = $db->fetch_object($resql);
$newmenu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
{
$newmenu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
}
$i++;
}
}
else dol_print_error($db);
$db->free($resql);
}
if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP
{
$MAXFTP=20;
$i=1;
while ($i <= $MAXFTP)
{
$paramkey='FTP_NAME_'.$i;
//print $paramkey;
if (! empty($conf->global->$paramkey))
{
$link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i;
$newmenu->add($link, dol_trunc($conf->global->$paramkey,24));
}
$i++;
}
}
} }
// Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after
//var_dump($menu_array_before);exit; //var_dump($menu_array_before);exit;
//var_dump($menu_array_after);exit; //var_dump($menu_array_after);exit;
$menu_array=$newmenu->liste; $menu_array=$newmenu->liste;

View File

@ -159,12 +159,12 @@ class MenuManager
$canonnexturl=preg_replace('/\?.*$/','',$nexturl); $canonnexturl=preg_replace('/\?.*$/','',$nexturl);
//var_dump($canonrelurl); //var_dump($canonrelurl);
//var_dump($canonnexturl); //var_dump($canonnexturl);
print '<ul>'; print '<ul>'."\n";
if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools')) if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools'))
|| strpos($canonrelurl,'/product/index.php') || strpos($canonrelurl,'/compta/bank/index.php')) || strpos($canonrelurl,'/product/index.php') || strpos($canonrelurl,'/compta/bank/index.php'))
{ {
// We add sub entry // We add sub entry
print '<li data-role="list-divider"><a href="'.$relurl.'">'.$langs->trans(ucfirst($val['mainmenu'])."Dashboard").'</a></li>'."\n"; print str_pad('',1).'<li data-role="list-divider" class="lilevel1"><a href="'.$relurl.'">'.$langs->trans(ucfirst($val['mainmenu'])."Dashboard").'</a></li>'."\n";
} }
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
{ {
@ -174,8 +174,9 @@ class MenuManager
$canonurl2=preg_replace('/\?.*$/','',$val2['url']); $canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
print '<li'.($val2['level']==0?' data-role="list-divider"':'').'>'; print str_pad('',$val2['level']+1).'<li'.($val2['level']==0?' data-role="list-divider"':'').' class="lilevel'.($val2['level']+1).'">';
if ($relurl2) print '<a href="'.$relurl2.'">'; if ($relurl2) print '<a href="'.$relurl2.'">';
print str_pad('',($val2['level']+1)*12,'&nbsp;');
print $val2['titre']; print $val2['titre'];
if ($relurl2) print '</a>'; if ($relurl2) print '</a>';
print '</li>'."\n"; print '</li>'."\n";

View File

@ -102,7 +102,7 @@ class modMargin extends DolibarrModules
'type'=>'left', // This is a Top menu entry 'type'=>'left', // This is a Top menu entry
'titre'=>'Margins', 'titre'=>'Margins',
'mainmenu'=>'accountancy', 'mainmenu'=>'accountancy',
'leftmenu'=>'margins', // Use 1 if you also want to add left menu entries using this descriptor. Use 0 if left menu entries are defined in a file pre.inc.php (old school). 'leftmenu'=>'margins',
'url'=>'/margin/index.php', 'url'=>'/margin/index.php',
'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,

View File

@ -125,8 +125,8 @@
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {?> <?php if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {?>
<td align="right" nowrap="nowrap"><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?></td> <td align="right" nowrap="nowrap"><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?></td>
<?php <?php
} }
if (! empty($conf->global->DISPLAY_MARK_RATES)) {?> if (! empty($conf->global->DISPLAY_MARK_RATES)) {?>
<td align="right" nowrap="nowrap"><?php echo price($line->marque_tx).'%'; ?></td> <td align="right" nowrap="nowrap"><?php echo price($line->marque_tx).'%'; ?></td>
<?php } } ?> <?php } } ?>
@ -152,7 +152,7 @@
</a> </a>
</td> </td>
<?php if ($num > 1) { ?> <?php if ($num > 1 && empty($conf->browser->phone)) { ?>
<td align="center" class="tdlineupdown"> <td align="center" class="tdlineupdown">
<?php if ($i > 0) { ?> <?php if ($i > 0) { ?>
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>"> <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
@ -166,10 +166,10 @@
<?php } ?> <?php } ?>
</td> </td>
<?php } else { ?> <?php } else { ?>
<td align="center" class="tdlineupdown">&nbsp;</td> <td align="center"<?php echo (empty($conf->browser->phone)?' class="tdlineupdown"':''); ?>></td>
<?php } ?> <?php } ?>
<?php } else { ?> <?php } else { ?>
<td colspan="3">&nbsp;</td> <td colspan="3"></td>
<?php } ?> <?php } ?>
</tr> </tr>

View File

@ -40,11 +40,17 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
/** /**
* Wrapper, donc header vierge * Header empty
* *
* @return null * @return void
*/ */
function llxHeader() { } function llxHeader() { }
/**
* Footer empty
*
* @return void
*/
function llxFooter() { }
require 'main.inc.php'; // Load $user and permissions require 'main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

View File

@ -1442,7 +1442,9 @@ else if ($id > 0 || ! empty($ref))
if ($action != 'presend') if ($action != 'presend')
{ {
print '<table width="100%"><tr><td width="50%" valign="top">'; print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%"><tr><td width="50%" valign="top">';
/* /*
* Built documents * Built documents
*/ */
@ -1464,14 +1466,16 @@ else if ($id > 0 || ! empty($ref))
*/ */
$somethingshown=$object->showLinkedObjectBlock(); $somethingshown=$object->showLinkedObjectBlock();
print '</td><td valign="top" width="50%">'; //print '</td><td valign="top" width="50%">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'fichinter',$socid); $somethingshown=$formactions->showactions($object,'fichinter',$socid);
print "</td><td>";
print "&nbsp;</td>"; print '</div></div></div>';
print "</tr></table>\n"; //print "</td></tr></table>\n";
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2006 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 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -1671,7 +1671,7 @@ elseif (! empty($object->id))
*/ */
if ($user->societe_id == 0 && $action != 'editline' && $action != 'delete') if ($user->societe_id == 0 && $action != 'editline' && $action != 'delete')
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
// Validate // Validate
if ($object->statut == 0 && $num > 0) if ($object->statut == 0 && $num > 0)
@ -1762,9 +1762,12 @@ elseif (! empty($object->id))
print "</div>"; print "</div>";
} }
print "<br>";
print '<table width="100%"><tr><td width="50%" valign="top">';
print '<a name="builddoc"></a>'; // ancre print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%"><tr><td width="50%" valign="top">';
//print '<a name="builddoc"></a>'; // ancre
/* /*
* Documents generes * Documents generes
@ -1785,7 +1788,8 @@ elseif (! empty($object->id))
*/ */
$somethingshown=$object->showLinkedObjectBlock(); $somethingshown=$object->showLinkedObjectBlock();
print '</td><td valign="top" width="50%">'; //print '</td><td valign="top" width="50%">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
if ($user->rights->fournisseur->commande->commander && $object->statut == 2) if ($user->rights->fournisseur->commande->commander && $object->statut == 2)
{ {
@ -1853,7 +1857,8 @@ elseif (! empty($object->id))
$somethingshown=$formactions->showactions($object,'order_supplier',$socid); $somethingshown=$formactions->showactions($object,'order_supplier',$socid);
*/ */
print '</td></tr></table>'; print '</div></div></div>';
//print '</td></tr></table>';
} }
/* /*

View File

@ -2054,11 +2054,13 @@ else
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>'; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
} }
print '</div>'; print '</div>';
print '<br>';
if ($action != 'edit') if ($action != 'edit')
{ {
print '<table width="100%"><tr><td width="50%" valign="top">'; print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre //print '<table width="100%"><tr><td width="50%" valign="top">';
//print '<a name="builddoc"></a>'; // ancre
/* /*
* Documents generes * Documents generes
@ -2072,7 +2074,6 @@ else
$delallowed=$user->rights->fournisseur->facture->supprimer; $delallowed=$user->rights->fournisseur->facture->supprimer;
$modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)?'':$conf->global->INVOICE_SUPPLIER_ADDON_PDF)); $modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)?'':$conf->global->INVOICE_SUPPLIER_ADDON_PDF));
print '<br>';
print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,0,0,'','','',$societe->default_lang); print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,0,0,'','','',$societe->default_lang);
$somethingshown=$formfile->numoffiles; $somethingshown=$formfile->numoffiles;
@ -2081,15 +2082,17 @@ else
*/ */
$somethingshown=$object->showLinkedObjectBlock(); $somethingshown=$object->showLinkedObjectBlock();
print '</td><td valign="top" width="50%">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
print '<br>'; //print '</td><td valign="top" width="50%">';
//print '<br>';
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'invoice_supplier',$socid); $somethingshown=$formactions->showactions($object,'invoice_supplier',$socid);
print '</td></tr></table>'; print '</div></div></div>';
//print '</td></tr></table>';
} }
} }
/* /*

View File

@ -23,7 +23,7 @@
* \author Laurent Destailleur * \author Laurent Destailleur
*/ */
require 'pre.inc.php'; // We use pre.inc.php to have a dynamic menu require('../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';

View File

@ -1,72 +0,0 @@
<?php
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/ftp/pre.inc.php
* \ingroup ftp
* \brief File to manage left menu for FTP module
*/
require (realpath(dirname(__FILE__)) . "/../main.inc.php");
$user->getrights('ecm');
/**
* Replace the default llxHeader function
*
* @param string $head Optionnal head lines
* @param string $title HTML title
* @param string $help_url Link to online url help
* @param string $morehtml More content into html header
* @param string $target Force target on menu links
* @param int $disablejs More content into html header
* @param int $disablehead More content into html header
* @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
* @return none
*/
function llxHeader($head = '', $title='', $help_url='', $morehtml='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
{
global $conf,$langs,$user;
$langs->load("ftp");
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$menu = new Menu();
$MAXFTP=20;
$i=1;
while ($i <= $MAXFTP)
{
$paramkey='FTP_NAME_'.$i;
//print $paramkey;
if (! empty($conf->global->$paramkey))
{
$link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i;
$menu->add($link, dol_trunc($conf->global->$paramkey,24));
}
$i++;
}
left_menu($menu->liste, $help_url, $morehtml, '', 1);
main_area();
}
?>

View File

@ -876,7 +876,7 @@ class Holiday extends CommonObject
*/ */
function updateSoldeCP($userID='',$nbHoliday='') function updateSoldeCP($userID='',$nbHoliday='')
{ {
global $user; global $user, $langs;
if (empty($userID) && empty($nbHoliday)) if (empty($userID) && empty($nbHoliday))
{ {
@ -914,7 +914,7 @@ class Holiday extends CommonObject
$new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth'); $new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth');
// On ajoute la modification dans le LOG // On ajoute la modification dans le LOG
$this->addLogCP($user->id,$users[$i]['rowid'],'Event : Mise à jour mensuelle',$new_solde); $this->addLogCP($user->id,$users[$i]['rowid'], $langs->trans('Event').': '.$langs->trans('HolidaysMonthlyAssignment'),$new_solde);
$i++; $i++;
} }

View File

@ -67,7 +67,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
} }
// On ajoute la modification dans le LOG // On ajoute la modification dans le LOG
$holiday->addLogCP($user->id,$userID,'Event : Manual update',$userValue); $holiday->addLogCP($user->id,$userID, $langs->trans('Event').': '.$langs->trans('ManualUpdate'),$userValue);
// Mise à jour des congés de l'utilisateur // Mise à jour des congés de l'utilisateur
$holiday->updateSoldeCP($userID,$userValue); $holiday->updateSoldeCP($userID,$userValue);
@ -107,7 +107,7 @@ elseif($action == 'add_event')
$new_holiday = $nb_holiday + $add_holiday; $new_holiday = $nb_holiday + $add_holiday;
// On ajoute la modification dans le LOG // On ajoute la modification dans le LOG
$holiday->addLogCP($user->id,$userCP,'Event : '.$holiday->getNameEventCp($event),$new_holiday); $holiday->addLogCP($user->id,$userCP, $langs->trans('Event').': '.$holiday->getNameEventCp($event),$new_holiday);
$holiday->updateSoldeCP($userCP,$new_holiday); $holiday->updateSoldeCP($userCP,$new_holiday);
@ -144,7 +144,7 @@ print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print '<input type="hidden" name="action" value="update" />'; print '<input type="hidden" name="action" value="update" />';
print '<table class="noborder" width="100%;">'; print '<table class="noborder" width="100%;">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td width="5%">User ID</td>'; print '<td width="5%">'.$langs->trans('ID').'</td>';
print '<td width="20%">'.$langs->trans('UserName').'</td>'; print '<td width="20%">'.$langs->trans('UserName').'</td>';
print '<td width="10%">'.$langs->trans('Available').'</td>'; print '<td width="10%">'.$langs->trans('Available').'</td>';
print '<td>'.$langs->trans('UpdateButtonCP').'</td>'; print '<td>'.$langs->trans('UpdateButtonCP').'</td>';
@ -165,7 +165,7 @@ foreach($listUsers as $users)
print '</td>'; print '</td>';
print '<td>'; print '<td>';
print '<input type="text" value="'.$holiday->getCPforUser($users['rowid']).'" name="nb_holiday['.$users['rowid'].']" size="5" style="text-align: center;"/>'; print '<input type="text" value="'.$holiday->getCPforUser($users['rowid']).'" name="nb_holiday['.$users['rowid'].']" size="5" style="text-align: center;"/>';
print ' jours</td>'."\n"; print ' '.$langs->trans('days').'</td>'."\n";
print '<td><input type="submit" name="update_cp['.$users['rowid'].']" value="'.dol_escape_htmltag($langs->trans("Update")).'" class="button"/></td>'."\n"; print '<td><input type="submit" name="update_cp['.$users['rowid'].']" value="'.dol_escape_htmltag($langs->trans("Update")).'" class="button"/></td>'."\n";
print '</tr>'; print '</tr>';

View File

@ -373,7 +373,7 @@ if($action == 'confirm_valid')
$newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted')); $newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted'));
// On ajoute la modification dans le LOG // On ajoute la modification dans le LOG
$cp->addLogCP($user->id, $cp->fk_user, 'Event : '.$langs->transnoentitiesnoconv("Holiday"), $newSolde); $cp->addLogCP($userID,$cp->fk_user, $langs->trans('Event').': '.$langs->transnoentitiesnoconv("Holidays"),$newSolde);
// Mise à jour du solde // Mise à jour du solde
$cp->updateSoldeCP($cp->fk_user,$newSolde); $cp->updateSoldeCP($cp->fk_user,$newSolde);

View File

@ -254,7 +254,7 @@ print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk
print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Duration")); print_liste_field_titre($langs->trans("Duration"));
print_liste_field_titre($langs->trans("Statut"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
// FILTRES // FILTRES
@ -278,19 +278,20 @@ if($user->rights->holiday->lire_tous) {
} }
// VALIDEUR // VALIDEUR
if($user->rights->holiday->lire_tous){ if($user->rights->holiday->lire_tous)
{
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
// Liste des utiliseurs du groupes Comptabilité $validator = new UserGroup($db);
$excludefilter=$user->admin?'':'u.rowid <> '.$user->id;
$idGroupValid = $holiday->getConfCP('userGroup'); $valideurobjects = $validator->listUsersForGroup($excludefilter);
$valideurarray = array();
$validator = new UserGroup($db,$idGroupValid); foreach($valideurobjects as $val) $valideurarray[$val->id]=$val->id;
$valideur = $validator->listUsersForGroup(); $form->select_users($search_valideur,"search_valideur",1,"",0,$valideurarray,'');
$form->select_users($search_valideur,"search_valideur",1,"",0,$valideur,'');
print '</td>'; print '</td>';
} else { }
else
{
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
} }

View File

@ -77,7 +77,7 @@ print '<div class="tabBar">';
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print 'Choix mois : <input class="flat" type="text" size="1" maxlength="2" name="month_start" value="'.$month.'">&nbsp;'; print $langs->trans('Month').': <input class="flat" type="text" size="1" maxlength="2" name="month_start" value="'.$month.'">&nbsp;';
$htmlother->select_year($year,'year_start',1,10,3); $htmlother->select_year($year,'year_start',1,10,3);
print '<input type="submit" value="'.$langs->trans("Refresh").'" class="button" />'; print '<input type="submit" value="'.$langs->trans("Refresh").'" class="button" />';

View File

@ -78,8 +78,8 @@ foreach($cp->logs as $logs_CP)
print '<td>'.$user_action->getFullName($langs).'</td>'; print '<td>'.$user_action->getFullName($langs).'</td>';
print '<td>'.$user_update->getFullName($langs).'</td>'; print '<td>'.$user_update->getFullName($langs).'</td>';
print '<td>'.$logs_CP['type_action'].'</td>'; print '<td>'.$logs_CP['type_action'].'</td>';
print '<td style="text-align: right;">'.$logs_CP['prev_solde'].' jours</td>'; print '<td style="text-align: right;">'.$logs_CP['prev_solde'].' '.$langs->trans('days').'</td>';
print '<td style="text-align: right;">'.$logs_CP['new_solde'].' jours</td>'; print '<td style="text-align: right;">'.$logs_CP['new_solde'].' '.$langs->trans('days').'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
} }

View File

@ -1,346 +0,0 @@
# JavaScript Templates
## Demo
[JavaScript Templates Demo](http://blueimp.github.com/JavaScript-Templates/)
## Usage
### Client-side
Include the (minified) JavaScript Templates script in your HTML markup:
```html
<script src="tmpl.min.js"></script>
```
Add a script section with type **"text/x-tmpl"**, a unique **id** property and your template definition as content:
```html
<script type="text/x-tmpl" id="tmpl-demo">
<h3>{%=o.title%}</h3>
<p>Released under the
<a href="{%=o.license.url%}">{%=o.license.name%}</a>.</p>
<h4>Features</h4>
<ul>
{% for (var i=0; i<o.features.length; i++) { %}
<li>{%=o.features[i]%}</li>
{% } %}
</ul>
</script>
```
**"o"** (the lowercase letter) is a reference to the data parameter of the template function (see the API section on how to modify this identifier).
In your application code, create a JavaScript object to use as data for the template:
```js
var data = {
"title": "JavaScript Templates",
"license": {
"name": "MIT license",
"url": "http://www.opensource.org/licenses/MIT"
},
"features": [
"lightweight & fast",
"powerful",
"zero dependencies"
]
};
```
In a real application, this data could be the result of retrieving a [JSON](http://json.org/) resource.
Render the result by calling the **tmpl()** method with the id of the template and the data object as arguments:
```js
document.getElementById("result").innerHTML = tmpl("tmpl-demo", data);
```
### Server-side
The following is an example how to use the JavaScript Templates engine on the server-side with [node.js](http://nodejs.org/).
Create a new directory and add the **tmpl.js** file. Or alternatively, install the **blueimp-tmpl** package with [npm](http://npmjs.org/):
```sh
npm install blueimp-tmpl
```
Add a file **template.html** with the following content:
```html
<!DOCTYPE HTML>
<title>{%=o.title%}</title>
<h3><a href="{%=o.url%}">{%=o.title%}</a></h3>
<h4>Features</h4>
<ul>
{% for (var i=0; i<o.features.length; i++) { %}
<li>{%=o.features[i]%}</li>
{% } %}
</ul>
```
Add a file **server.js** with the following content:
```js
require("http").createServer(function (req, res) {
var fs = require("fs"),
// The tmpl module exports the tmpl() function:
tmpl = require("./tmpl").tmpl,
// Use the following version if you installed the package with npm:
// tmpl = require("blueimp-tmpl").tmpl,
// Sample data:
data = {
"title": "JavaScript Templates",
"url": "https://github.com/blueimp/JavaScript-Templates",
"features": [
"lightweight & fast",
"powerful",
"zero dependencies"
]
};
// Override the template loading method:
tmpl.load = function (id) {
var filename = id + ".html";
console.log("Loading " + filename);
return fs.readFileSync(filename, "utf8");
};
res.writeHead(200, {"Content-Type": "text/x-tmpl"});
// Render the content:
res.end(tmpl("template", data));
}).listen(8080, "localhost");
console.log("Server running at http://localhost:8080/");
```
Run the application with the following command:
```sh
node server.js
```
## Requirements
The JavaScript Templates script has zero dependencies.
## API
### tmpl() function
The **tmpl()** function is added to the global **window** object and can be called as global function:
```js
var result = tmpl("tmpl-demo", data);
```
The **tmpl()** function can be called with the id of a template, or with a template string:
```js
var result = tmpl("<h3>{%=o.title%}</h3>", data);
```
If called without second argument, **tmpl()** returns a reusable template function:
```js
var func = tmpl("<h3>{%=o.title%}</h3>");
document.getElementById("result").innerHTML = func(data);
```
### Templates cache
Templates loaded by id are cached in the map **tmpl.cache**:
```js
var func = tmpl("tmpl-demo"), // Loads and parses the template
cached = typeof tmpl.cache["tmpl-demo"] === "function", // true
result = tmpl("tmpl-demo", data); // Uses cached template function
tmpl.cache["tmpl-demo"] = null;
result = tmpl("tmpl-demo", data); // Loads and parses the template again
```
### Output encoding
The method **tmpl.encode** is used to escape HTML special characters in the template output:
```js
var output = tmpl.encode("<>&\"'\x00"); // Renders "&lt;&gt;&amp;&quot;&#39;"
```
**tmpl.encode** makes use of the regular expression **tmpl.encReg** and the encoding map **tmpl.encMap** to match and replace special characters, which can be modified to change the behavior of the output encoding.
Strings matched by the regular expression, but not found in the encoding map are removed from the output. This allows for example to automatically trim input values (removing whitespace from the start and end of the string):
```js
tmpl.encReg = /(^\s+)|(\s+$)|[<>&"'\x00]/g;
var output = tmpl.encode(" Banana! "); // Renders "Banana" (without whitespace)
```
### Local helper variables
The local variables available inside the templates are the following:
* **o**: The data object given as parameter to the template function (see the next section on how to modify the parameter name).
* **tmpl**: A reference to the **tmpl** function object.
* **_s**: The string for the rendered result content.
* **_e**: A reference to the **tmpl.encode** method.
* **print**: Helper function to add content to the rendered result string.
* **include**: Helper function to include the return value of a different template in the result.
To introduce additional local helper variables, the string **tmpl.helper** can be extended. The following adds a convenience function for *console.log* and a streaming function, that streams the template rendering result back to the callback argument (note the comma at the beginning of each variable declaration):
```js
tmpl.helper += ",log=function(){console.log.apply(console, arguments)}" +
",st='',stream=function(cb){var l=st.length;st=_s;cb( _s.slice(l));}";
```
Those new helper functions could be used to stream the template contents to the console output:
```html
<script type="text/x-tmpl" id="tmpl-demo">
<h3>{%=o.title%}</h3>
{% stream(log); %}
<p>Released under the
<a href="{%=o.license.url%}">{%=o.license.name%}</a>.</p>
{% stream(log); %}
<h4>Features</h4>
<ul>
{% stream(log); %}
{% for (var i=0; i<o.features.length; i++) { %}
<li>{%=o.features[i]%}</li>
{% stream(log); %}
{% } %}
</ul>
{% stream(log); %}
</script>
```
### Template function argument
The generated template functions accept one argument, which is the data object given to the **tmpl(id, data)** function. This argument is available inside the template definitions as parameter **o** (the lowercase letter).
The argument name can be modified by overriding **tmpl.arg**:
```js
tmpl.arg = "p";
// Renders "<h3>JavaScript Templates</h3>":
var result = tmpl("<h3>{%=p.title%}</h3>", {title: "JavaScript Templates"});
```
### Template parsing
The template contents are matched and replaced using the regular expression **tmpl.regexp** and the replacement function **tmpl.func**. The replacement function operates based on the [parenthesized submatch strings](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter).
To use different tags for the template syntax, override **tmpl.regexp** with a modified regular expression, by exchanging all occurrences of "**\\{%**" and "**%\\}**", e.g. with "**\\[%**" and "**%\\]**":
```js
tmpl.regexp = /([\s'\\])(?![^%]*%\])|(?:\[%(=|#)([\s\S]+?)%\])|(\[%)|(%\])/g;
```
By default, the plugin preserves whitespace (newlines, carriage returns, tabs and spaces). To strip unnecessary whitespace, you can override the **tmpl.func** function, e.g. with the following code:
```js
var originalFunc = tmpl.func;
tmpl.func = function (s, p1, p2, p3, p4, p5, offset, str) {
if (p1 && /\s/.test(p1)) {
if (!offset || /\s/.test(str.charAt(offset - 1)) ||
/^\s+$/g.test(str.slice(offset))) {
return '';
}
return ' ';
}
return originalFunc.apply(tmpl, arguments);
};
```
## Templates syntax
### Interpolation
Print variable with HTML special characters escaped:
```html
<h3>{%=o.title%}</h3>
```
Print variable without escaping:
```html
<h3>{%#o.user_id%}</h3>
```
Print output of function calls:
```html
<a href="{%=encodeURI(o.url)%}">Website</a>
```
Use dot notation to print nested properties:
```html
<strong>{%=o.author.name%}</strong>
```
Note that the JavaScript Templates engine prints **falsy** values as empty strings.
That is, **undefined**, **null**, **false**, **0** and **NaN** will all be converted to **''**.
To be able to print e.g. the number 0, convert it to a String before using it as an output variable:
```html
<h3>{%=0+''%}</h3>
```
### Evaluation
Use **print(str)** to add escaped content to the output:
```html
<span>Year: {% var d=new Date(); print(d.getFullYear()); %}</span>
```
Use **print(str, true)** to add unescaped content to the output:
```html
<span>{% print("Fast &amp; powerful", true); %}</span>
```
Use **include(str, obj)** to include content from a different template:
```html
<div>
{% include('tmpl-link', {name: "Website", url: "http://example.org"}); %}
</div>
```
If else condition:
```html
{% if (o.author.url) { %}
<a href="{%=encodeURI(o.author.url)%}">{%=o.author.name%}</a>
{% } else { %}
<em>No author url.</em>
{% } %}
```
For loop:
```html
<ul>
{% for (var i=0; i<o.features.length; i++) { %}
<li>{%=o.features[i]%}</li>
{% } %}
</ul>
```
## Compiled templates
The JavaScript Templates project comes with a compilation script, that allows you to compile your templates into JavaScript code and combine them with a minimal Templates runtime into one minified JavaScript file.
The compilation script is built for [node.js](http://nodejs.org/) and also requires [UglifyJS](https://github.com/mishoo/UglifyJS).
To use it, first install both the JavaScript Templates project and UglifyJS via [npm](http://npmjs.org/):
```sh
npm install uglify-js
npm install blueimp-tmpl
```
This will put the executables **uglifyjs** and **tmpl.js** into the folder **node_modules/.bin**. It will also make them available on your PATH if you install the packages globally (by adding the **-g** flag to the install command).
The **tmpl.js** executable accepts the paths to one or multiple template files as command line arguments and prints the generated JavaScript code to the console output. The following command line shows you how to store the generated code in a new JavaScript file that can be included in your project:
```sh
tmpl.js templates/upload.html templates/download.html > tmpl.min.js
```
The files given as command line arguments to **tmpl.js** can either be pure template files or HTML documents with embedded template script sections. For the pure template files, the file names (without extension) serve as template ids.
The generated file can be included in your project as a replacement for the original **tmpl.js** runtime. It provides you with the same API and provides a **tmpl(id, data)** function that accepts the id of one of your templates as first and a data object as optional second parameter.
## License
The JavaScript Templates script is released under the [MIT license](http://www.opensource.org/licenses/MIT).

View File

@ -1,82 +0,0 @@
#!/usr/bin/env node
/*
* JavaScript Templates Compiler 2.1.0
* https://github.com/blueimp/JavaScript-Templates
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*jslint nomen: true */
/*global require, __dirname, process, console */
(function () {
"use strict";
var tmpl = require("./tmpl.js").tmpl,
fs = require("fs"),
path = require("path"),
jsp = require("uglify-js").parser,
pro = require("uglify-js").uglify,
// Retrieve the content of the minimal runtime:
runtime = fs.readFileSync(__dirname + "/runtime.js", "utf8"),
// A regular expression to parse templates from script tags in a HTML page:
regexp = /<script( id="([\w\-]+)")? type="text\/x-tmpl"( id="([\w\-]+)")?>([\s\S]+?)<\/script>/gi,
// A regular expression to match the helper function names:
helperRegexp = new RegExp(
tmpl.helper.match(/\w+(?=\s*=\s*function\s*\()/g).join("\\s*\\(|") + "\\s*\\("
),
// A list to store the function bodies:
list = [],
code,
ast;
// Extend the Templating engine with a print method for the generated functions:
tmpl.print = function (str) {
// Only add helper functions if they are used inside of the template:
var helper = helperRegexp.test(str) ? tmpl.helper : "",
body = str.replace(tmpl.regexp, tmpl.func);
if (helper || (/_e\s*\(/.test(body))) {
helper = "_e=tmpl.encode" + helper + ",";
}
return "function(" + tmpl.arg + ",tmpl){" +
("var " + helper + "_s='" + body + "';return _s;")
.split("_s+='';").join("") + "}";
};
// Loop through the command line arguments:
process.argv.forEach(function (file, index) {
var listLength = list.length,
content,
result,
id;
// Skipt the first two arguments, which are "node" and the script:
if (index > 1) {
content = fs.readFileSync(file, "utf8");
while (true) {
// Find templates in script tags:
result = regexp.exec(content);
if (!result) {
break;
}
id = result[2] || result[4];
list.push("'" + id + "':" + tmpl.print(result[5]));
}
if (listLength === list.length) {
// No template script tags found, use the complete content:
id = path.basename(file, path.extname(file));
list.push("'" + id + "':" + tmpl.print(content));
}
}
});
// Combine the generated functions as cache of the minimal runtime:
code = runtime.replace("{}", "{" + list.join(",") + "}");
// Parse the code and get the initial AST (Abstract Syntac Tree):
ast = jsp.parse(code);
// Get a new AST with mangled names:
ast = pro.ast_mangle(ast);
// Get an AST with compression optimizations:
ast = pro.ast_squeeze(ast);
// Generate the code and print it to the console output:
console.log(pro.gen_code(ast));
}());

View File

@ -1,46 +0,0 @@
/*
* JavaScript Templates Runtime 2.1.0
* https://github.com/blueimp/JavaScript-Templates
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*jslint sloppy: true */
/*global define */
(function ($) {
var tmpl = function (id, data) {
var f = tmpl.cache[id];
return data ? f(data, tmpl) : function (data) {
return f(data, tmpl);
};
};
tmpl.cache = {};
tmpl.encReg = /[<>&"'\x00]/g;
tmpl.encMap = {
"<" : "&lt;",
">" : "&gt;",
"&" : "&amp;",
"\"" : "&quot;",
"'" : "&#39;"
};
tmpl.encode = function (s) {
return String(s || "").replace(
tmpl.encReg,
function (c) {
return tmpl.encMap[c] || "";
}
);
};
if (typeof define === "function" && define.amd) {
define(function () {
return tmpl;
});
} else {
$.tmpl = tmpl;
}
}(this));

View File

@ -1,86 +0,0 @@
/*
* JavaScript Templates 2.1.0
* https://github.com/blueimp/JavaScript-Templates
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*
* Inspired by John Resig's JavaScript Micro-Templating:
* http://ejohn.org/blog/javascript-micro-templating/
*/
/*jslint evil: true, regexp: true */
/*global document, define */
(function ($) {
"use strict";
var tmpl = function (str, data) {
var f = !/[^\w\-\.:]/.test(str) ? tmpl.cache[str] = tmpl.cache[str] ||
tmpl(tmpl.load(str)) :
new Function(
tmpl.arg + ',tmpl',
"var _e=tmpl.encode" + tmpl.helper + ",_s='" +
str.replace(tmpl.regexp, tmpl.func) +
"';return _s;"
);
return data ? f(data, tmpl) : function (data) {
return f(data, tmpl);
};
};
tmpl.cache = {};
tmpl.load = function (id) {
return document.getElementById(id).innerHTML;
};
tmpl.regexp = /([\s'\\])(?![^%]*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g;
tmpl.func = function (s, p1, p2, p3, p4, p5) {
if (p1) { // whitespace, quote and backspace in interpolation context
return {
"\n": "\\n",
"\r": "\\r",
"\t": "\\t",
" " : " "
}[s] || "\\" + s;
}
if (p2) { // interpolation: {%=prop%}, or unescaped: {%#prop%}
if (p2 === "=") {
return "'+_e(" + p3 + ")+'";
}
return "'+(" + p3 + "||'')+'";
}
if (p4) { // evaluation start tag: {%
return "';";
}
if (p5) { // evaluation end tag: %}
return "_s+='";
}
};
tmpl.encReg = /[<>&"'\x00]/g;
tmpl.encMap = {
"<" : "&lt;",
">" : "&gt;",
"&" : "&amp;",
"\"" : "&quot;",
"'" : "&#39;"
};
tmpl.encode = function (s) {
return String(s || "").replace(
tmpl.encReg,
function (c) {
return tmpl.encMap[c] || "";
}
);
};
tmpl.arg = "o";
tmpl.helper = ",print=function(s,e){_s+=e&&(s||'')||_e(s);}" +
",include=function(s,d){_s+=tmpl(s,d);}";
if (typeof define === "function" && define.amd) {
define(function () {
return tmpl;
});
} else {
$.tmpl = tmpl;
}
}(this));

View File

@ -1 +0,0 @@
(function(a){"use strict";var b=function(a,c){var d=/[^\w\-\.:]/.test(a)?new Function(b.arg+",tmpl","var _e=tmpl.encode"+b.helper+",_s='"+a.replace(b.regexp,b.func)+"';return _s;"):b.cache[a]=b.cache[a]||b(b.load(a));return c?d(c,b):function(a){return d(a,b)}};b.cache={},b.load=function(a){return document.getElementById(a).innerHTML},b.regexp=/([\s'\\])(?![^%]*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,b.func=function(a,b,c,d,e,f){if(b)return{"\n":"\\n","\r":"\\r","\t":"\\t"," ":" "}[a]||"\\"+a;if(c)return c==="="?"'+_e("+d+")+'":"'+("+d+"||'')+'";if(e)return"';";if(f)return"_s+='"},b.encReg=/[<>&"'\x00]/g,b.encMap={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#39;"},b.encode=function(a){return String(a||"").replace(b.encReg,function(a){return b.encMap[a]||""})},b.arg="o",b.helper=",print=function(s,e){_s+=e&&(s||'')||_e(s);},include=function(s,d){_s+=tmpl(s,d);}",typeof define=="function"&&define.amd?define(function(){return b}):a.tmpl=b})(this);

View File

@ -188,7 +188,7 @@ if ($user->societe_id == 0)
DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy', DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy',
DOL_URL_ROOT.'/contrat/liste.php'); DOL_URL_ROOT.'/contrat/liste.php');
// Translation lang files // Translation lang files
$langfile=array("bills", $langfile=array("companies",
"prospects", "prospects",
"suppliers", "suppliers",
"members", "members",

View File

@ -56,6 +56,7 @@ ALTER TABLE llx_facture_fourn DROP INDEX uk_facture_fourn;
ALTER TABLE llx_facture_fourn DROP INDEX uk_facture_fourn_ref; ALTER TABLE llx_facture_fourn DROP INDEX uk_facture_fourn_ref;
UPDATE llx_facture_fourn set ref = NULL where ref = ''; UPDATE llx_facture_fourn set ref = NULL where ref = '';
ALTER TABLE llx_facture_fourn ADD UNIQUE INDEX uk_facture_fourn_ref (ref, entity); ALTER TABLE llx_facture_fourn ADD UNIQUE INDEX uk_facture_fourn_ref (ref, entity);
ALTER TABLE llx_facture_fourn CHANGE COLUMN facnumber ref_supplier varchar(30);
ALTER TABLE llx_facture_fourn ADD UNIQUE INDEX uk_facture_fourn_ref_supplier (ref_supplier, fk_soc, entity); ALTER TABLE llx_facture_fourn ADD UNIQUE INDEX uk_facture_fourn_ref_supplier (ref_supplier, fk_soc, entity);
@ -92,7 +93,6 @@ alter table llx_societe_rib CHANGE COLUMN adresse_proprio owner_address text;
alter table llx_societe_address CHANGE COLUMN ville town text; alter table llx_societe_address CHANGE COLUMN ville town text;
alter table llx_societe_address CHANGE COLUMN cp zip varchar(10); alter table llx_societe_address CHANGE COLUMN cp zip varchar(10);
alter table llx_facture_fourn CHANGE COLUMN facnumber ref_supplier varchar(30);
-- remove constraint and index before rename field -- remove constraint and index before rename field
ALTER TABLE llx_expedition DROP FOREIGN KEY fk_expedition_fk_expedition_methode; ALTER TABLE llx_expedition DROP FOREIGN KEY fk_expedition_fk_expedition_methode;

View File

@ -0,0 +1,20 @@
-- ===================================================================
-- Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ===================================================================
ALTER TABLE llx_projet_extrafields ADD INDEX idx_projet_extrafields (fk_object);

View File

@ -0,0 +1,26 @@
-- ========================================================================
-- Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ========================================================================
create table llx_projet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -0,0 +1,20 @@
-- ===================================================================
-- Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ===================================================================
ALTER TABLE llx_projet_task_extrafields ADD INDEX idx_projet_task_extrafields (fk_object);

View File

@ -0,0 +1,26 @@
-- ========================================================================
-- Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ========================================================================
create table llx_projet_task_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -8,10 +8,10 @@ Margins=Marges
TotalMargin=Marge total TotalMargin=Marge total
MarginOnProducts=Marge / Productes MarginOnProducts=Marge / Productes
MarginOnServices=Marge / Serveis MarginOnServices=Marge / Serveis
MarginRate=Taxa de marge MarginRate=Marge sobre cost
MarkRate=Taxa de marca MarkRate=Marge sobre venda
DisplayMarginRates=Mostrar les taxes de marge DisplayMarginRates=Mostrar els marges sobre cost
DisplayMarkRates=Mostrar les taxes de marca DisplayMarkRates=Mostrar els marges sobre venda
InputPrice=Introduir un preu InputPrice=Introduir un preu
margin=Gestió de marges margin=Gestió de marges

View File

@ -1,6 +1,7 @@
# Dolibarr language file - en_US - holiday # Dolibarr language file - en_US - holiday
CHARSET= UTF-8 CHARSET= UTF-8
Holidays=Holidays
CPTitreMenu=Holidays CPTitreMenu=Holidays
MenuReportMonth=Monthly statement MenuReportMonth=Monthly statement
MenuAddCP=Apply for holidays MenuAddCP=Apply for holidays
@ -86,6 +87,8 @@ UserName=Name
Employee=Employee Employee=Employee
FirstDayOfHoliday=First day of holiday FirstDayOfHoliday=First day of holiday
LastDayOfHoliday=Last day of holiday LastDayOfHoliday=Last day of holiday
HolidaysMonthlyUpdate=Monthly update
ManualUpdate=Manual update
## Configuration du Module ## ## Configuration du Module ##
ConfCP=Configuration of holidays module ConfCP=Configuration of holidays module

View File

@ -2,7 +2,7 @@
CHARSET=UTF-8 CHARSET=UTF-8
Survey=Survey Survey=Survey
Surveys=Surveys Surveys=Surveys
OrganizeYourMeetingEasily=Organize your meeting and surveys easily. First select type of survey... OrganizeYourMeetingEasily=Organize your meetings and surveys easily. First select type of survey...
NewSurvey=New survey NewSurvey=New survey
NoSurveysInDatabase=%s survey(s) into database. NoSurveysInDatabase=%s survey(s) into database.
OpenSurveyArea=Surveys area OpenSurveyArea=Surveys area
@ -33,14 +33,14 @@ InitiatorOfPoll=Initiator of the poll
CommentsOfVoters=Comments of voters CommentsOfVoters=Comments of voters
ConfirmRemovalOfPoll=Are you sure you want to remove this poll (and all votes) ConfirmRemovalOfPoll=Are you sure you want to remove this poll (and all votes)
RemovePoll=Remove poll RemovePoll=Remove poll
PollManagement=Poll's management PollManagement=Polls management
BackToHoursSetup=Back to hours setup BackToHoursSetup=Back to hours setup
UrlForSurvey=URL to communicate to get a direct access to survey UrlForSurvey=URL to communicate to get a direct access to survey
PollOnChoice=Your are creating a poll to make a multi-choice for a poll. First enter all possible choices for your poll: PollOnChoice=Your are creating a poll to make a multi-choice for a poll. First enter all possible choices for your poll:
CheckBox=Simple checkbox CheckBox=Simple checkbox
YesNoList=List (empty/yes/no) YesNoList=List (empty/yes/no)
PourContreList=List (empty/for/against) PourContreList=List (empty/for/against)
AddNewColumn=Add new colum AddNewColumn=Add new column
TitleChoice=Choice label TitleChoice=Choice label
InfoAfterCreate=Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.<br>You should also receive an email with link to your poll for sending it to the voters. InfoAfterCreate=Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.<br>You should also receive an email with link to your poll for sending it to the voters.
ExportSpreadsheet=Export result spreadsheet ExportSpreadsheet=Export result spreadsheet
@ -61,7 +61,7 @@ AddADate=Add a date
AddStartHour=Add start hour AddStartHour=Add start hour
AddEndHour=Add end hour AddEndHour=Add end hour
votes=vote(s) votes=vote(s)
NoCommentYet=No comment yet posted for this poll NoCommentYet=No comments have been posted for this poll yet
CanEditVotes=Can change vote of others CanEditVotes=Can change vote of others
SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format :<br>- empty,<br>- "8h", "8H" or "8:00" to give a meeting's start hour,<br>- "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,<br>- "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes. SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format :<br>- empty,<br>- "8h", "8H" or "8:00" to give a meeting's start hour,<br>- "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,<br>- "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes.
BackToCurrentMonth=Back to current month BackToCurrentMonth=Back to current month

View File

@ -15,6 +15,7 @@ MyEvents=Mis eventos
OtherEvents=Otros eventos OtherEvents=Otros eventos
ListOfActions=Listado de eventos ListOfActions=Listado de eventos
EventOnFullDay=Evento para todo el día EventOnFullDay=Evento para todo el día
Busy=Ocupado
Location=Localización Location=Localización
SearchAnAction=Buscar un evento/tarea SearchAnAction=Buscar un evento/tarea
MenuToDoActions=Eventos incompletos MenuToDoActions=Eventos incompletos

View File

@ -39,7 +39,9 @@ ThirdParty=Tercero
ThirdParties=Terceros ThirdParties=Terceros
ThirdPartyAll=Terceros (todos) ThirdPartyAll=Terceros (todos)
ThirdPartyProspects=Clientes potenciales ThirdPartyProspects=Clientes potenciales
ThirdPartyProspectsStats=Clientes potenciales
ThirdPartyCustomers=Clientes ThirdPartyCustomers=Clientes
ThirdPartyCustomersStats=Clientes
ThirdPartyCustomersWithIdProf12=Clientes con %s ó %s ThirdPartyCustomersWithIdProf12=Clientes con %s ó %s
ThirdPartySuppliers=Proveedores ThirdPartySuppliers=Proveedores
ThirdPartyType=Tipo de tercero ThirdPartyType=Tipo de tercero

View File

@ -1,6 +1,7 @@
# Dolibarr language file - es_ES - holiday # Dolibarr language file - es_ES - holiday
CHARSET= UTF-8 CHARSET= UTF-8
Holidays=Vacaciones
CPTitreMenu=Vacaciones CPTitreMenu=Vacaciones
MenuReportMonth=Estado mensual MenuReportMonth=Estado mensual
MenuAddCP=Nueva petición MenuAddCP=Nueva petición
@ -20,12 +21,12 @@ CancelCP=Anulada
RefuseCP=Rechazada RefuseCP=Rechazada
ValidatorCP=Validador ValidatorCP=Validador
ListeCP=Lista de vacaciones ListeCP=Lista de vacaciones
ValidateByCP=Sera validada por ValidateByCP=Será validada por
DescCP=Descripción DescCP=Descripción
SendRequestCP=Enviar la petición de vacaciones SendRequestCP=Enviar la petición de vacaciones
DelayToRequestCP=Las peticiones de vacaciones deben realizarse al menos <b>%s días</b> antes. DelayToRequestCP=Las peticiones de vacaciones deben realizarse al menos <b>%s días</b> antes.
MenuConfCP=Definir los vacaciones MenuConfCP=Definir las vacaciones
UpdateAllCP=Actualizar los vacaciones UpdateAllCP=Actualizar las vacaciones
SoldeCPUser=Su saldo de vacaciones es de <b>%s días</b>. SoldeCPUser=Su saldo de vacaciones es de <b>%s días</b>.
ErrorEndDateCP=Debe indicar una fecha de fin superior a la fecha de inicio. ErrorEndDateCP=Debe indicar una fecha de fin superior a la fecha de inicio.
ErrorSQLCreateCP=Se ha producido un error de SQL durante la creación : ErrorSQLCreateCP=Se ha producido un error de SQL durante la creación :
@ -68,12 +69,12 @@ ConfirmCancelCP=¿Está seguro de querer anular la petición de vacaciones?
DetailRefusCP=Motivo del rechazo DetailRefusCP=Motivo del rechazo
DateRefusCP=Fecha del rechazo DateRefusCP=Fecha del rechazo
DateCancelCP=Fecha de la anulación DateCancelCP=Fecha de la anulación
DefineEventUserCP=Asignar vacación excepcional a un usuario DefineEventUserCP=Asignar permiso excepcional a un usuario
addEventToUserCP=Asignar esta vacación addEventToUserCP=Asignar este permiso
MotifCP=Motivo MotifCP=Motivo
UserCP=Usuario UserCP=Usuario
ErrorAddEventToUserCP=Se ha producido un error en la asignación de la vacación excepcional. ErrorAddEventToUserCP=Se ha producido un error en la asignación del permiso excepcional.
AddEventToUserOkCP=Se ha añadido la vaciación excepcional. AddEventToUserOkCP=Se ha añadido el permiso excepcional.
MenuLogCP=Ver los logs de vacaciones MenuLogCP=Ver los logs de vacaciones
LogCP=Logs de actualizaciones de vacaciones LogCP=Logs de actualizaciones de vacaciones
ActionByCP=Realizado por ActionByCP=Realizado por
@ -86,6 +87,10 @@ UserName=Nombre Apellidos
Employee=Empleado Employee=Empleado
FirstDayOfHoliday=Primer día libre FirstDayOfHoliday=Primer día libre
LastDayOfHoliday=Último día libre LastDayOfHoliday=Último día libre
Morning=Mañana
Afternoon=Tarde
HolidaysMonthlyUpdate=Actualización mensual
ManualUpdate=Actualización manual
## Configuration du Module ## ## Configuration du Module ##
ConfCP=Configuración del módulo Vacaciones ConfCP=Configuración del módulo Vacaciones
@ -97,9 +102,9 @@ LastUpdateCP=Última actualización automática de vacaciones
UpdateConfCPOK=Actualización efectuada correctamente. UpdateConfCPOK=Actualización efectuada correctamente.
ErrorUpdateConfCP=Se ha producido un error durante la actualización, vuélvalo a intentar. ErrorUpdateConfCP=Se ha producido un error durante la actualización, vuélvalo a intentar.
AddCPforUsers=Añada los saldos de vacaciones de los usuarios <a href="../define_holiday.php" style="font-weight: normal; color: red; text-decoration: underline;">haciendo clic aquí</a>. AddCPforUsers=Añada los saldos de vacaciones de los usuarios <a href="../define_holiday.php" style="font-weight: normal; color: red; text-decoration: underline;">haciendo clic aquí</a>.
DelayForSubmitCP=La fecha límite para solicitar vacaciones DelayForSubmitCP=Antelación mínima para solicitar vacaciones
AlertValidatorDelayCP=Prevenir al validador si la petición no respeta el límite previsto AlertValidatorDelayCP=Advertir al usuario validador si la petición no respeta el límite previsto
AlertValidorSoldeCP=Prevenir al validador si el usuario pide vacaciones superiores a su saldo AlertValidorSoldeCP=Advertir al usuario validador si el usuario pide vacaciones superiores a su saldo
nbUserCP=Número de usuarios tomados en cuenta en el módulo vacaciones nbUserCP=Número de usuarios tomados en cuenta en el módulo vacaciones
nbHolidayDeductedCP=Número de días retribuidos a deducir por día de vacaciones nbHolidayDeductedCP=Número de días retribuidos a deducir por día de vacaciones
nbHolidayEveryMonthCP=Número de vacaciones añadidas por mes nbHolidayEveryMonthCP=Número de vacaciones añadidas por mes

View File

@ -504,8 +504,8 @@ Warning=Alerta
Warnings=Alertas Warnings=Alertas
BuildPDF=Generar el PDF BuildPDF=Generar el PDF
RebuildPDF=Regenerar el PDF RebuildPDF=Regenerar el PDF
BuildDoc=Generar el doc BuildDoc=Generar el documento
RebuildDoc=Regenerar el doc RebuildDoc=Regenerar el documento
Entity=Entidad Entity=Entidad
Entities=Entidades Entities=Entidades
EventLogs=Log EventLogs=Log

View File

@ -8,10 +8,10 @@ Margins=Márgenes
TotalMargin=Margen total TotalMargin=Margen total
MarginOnProducts=Margen / Productos MarginOnProducts=Margen / Productos
MarginOnServices=Margen / Servicios MarginOnServices=Margen / Servicios
MarginRate=Tasa de margen MarginRate=Margen sobre coste
MarkRate=Tasa de marca MarkRate=Margen sobre venta
DisplayMarginRates=Mostrar las tasas de margen DisplayMarginRates=Mostrar el margen sobre costes
DisplayMarkRates=Mostrar las tasas de marca DisplayMarkRates=Mostrar el margen sobre ventas
InputPrice=Introducir un precio InputPrice=Introducir un precio
margin=Gestión de márgenes margin=Gestión de márgenes

View File

@ -0,0 +1,68 @@
# Dolibarr language file - es_ES - opensurvey
CHARSET=UTF-8
Survey=Encuesta
Surveys=Encuestas
OrganizeYourMeetingEasily=Organice sus reuniones y encuestas de forma fácil. Primero, seleccione el tipo de encuesta...
NewSurvey=Nueva encuesta
NoSurveysInDatabase=%s encuesta(s) en la base de datos.
OpenSurveyArea=Área de encuestas
AddACommentForPoll=Puede añadir un comentario a la encuesta...
AddComment=Añadir comentario
CreatePoll=Crear encuesta
PollTitle=Título de la encuesta
OpenSurveyYourName=Su nombre
OpenSurveyYourEMail=Su dirección de correo electrónico
VotersCanModify=Los votantes pueden modificar el voto de otros
ToReceiveEMailForEachVote=Para recibir un email por cada voto
TypeDate=Tipo fecha
TypeClassic=Tipo estándar
YouAreInPollCreateArea=Está en la sección de creación de encuestas
FieldMandatory=Campo obligatorio
OpenSurveyDesc=Servicio online para planificar una cita o elaborar una encuesta de forma fácil y rápida.
OpenSurveyNoRegistration=Sin registro requerido.
OpenSurveyStep2=Select your dates amoung the free days (green). Los días seleccionados son de color azul. Puede seleccionar un día previamente seleccionado haciendo click de nuevo en él
RemoveAllDays=Eliminar todos los días
CopyHoursOfFirstDay=Copiar horas del primer día
RemoveAllHours=Eliminar todas las horas
SelectedDays=Días seleccionados
TheBestChoice=Actualmente la mejor opción es
TheBestChoices=Actualmente las mejores opciones son
with=con
OpenSurveyHowTo=Si está de acuerdo con votar en esta encuesta, debe proporcionarnos su nombre, elegir los valores que más se adecúan a usted (sin prestar atención a las opciones de los otros votantes) y validar con el botón "más" al final de la línea.
InitiatorOfPoll=Impulsor de la encuesta
CommentsOfVoters=Comentarios de los votantes
ConfirmRemovalOfPoll=Está seguro de que desea eliminar esta encuesta (y todos los votos)
RemovePoll=Eliminar encuesta
PollManagement=Administración de las encuestas
BackToHoursSetup=Volver a la configuración de horas
UrlForSurvey=URL para tener acceso directo a la encuesta
PollOnChoice=Está creando una encuesta para hacer una multiselección para una encuesta. Primero introduzca todas las posibilidades posibles para su encuesta:
CheckBox=Checkbox simple
YesNoList=Lista (vacío/sí/no)
PourContreList=Lista (empty/for/en contra)
AddNewColumn=Añadir nueva columna
TitleChoice=Título de la opción
InfoAfterCreate=Una vez haya confirmado la creación de su encuesta, será redirigido automáticamente a la página de su encuesta.<br>También recibirá un email con un enlace a su encuesta para enviárselo a los votantes.
ExportSpreadsheet=Exportar resultados a una hoja de cálculo
ExpireDate=Fecha límite
NbOfVoters=Núm. de votantes
SurveyResults=Resultados
PollAdminDesc=Está autorizado para cambiar todas las líneas de la encuesta con el botón "Editar". Puede, también, eliminar una columna o una línea con %s. También puede añadir una nueva columna con %s.
5MoreChoices=5 opciones más
Abstention=Abstención
Against=En contra
YouAreInivitedToVote=Está invitado a votar en esta encuesta
VoteNameAlreadyExists=Este nombre ya había sido usado para esta encuesta
ErrorPollDoesNotExists=Error, la encuesta <strong>%s</strong> no existe.
OpenSurveyNothingToSetup=No hay una configuración específica que hacer.
PollWillExpire=Su encuesta expirará automáticamente <strong>%s</strong> días después de la última fecha de su encuesta.
RemovalDate=Fecha de eliminación
AddADate=Añadir una fecha
AddStartHour=Añadir hora de inicio
AddEndHour=Añadir hora de fin
votes=voto(s)
NoCommentYet=Ningún comentario ha sido publicado todavía para esta encuesta
CanEditVotes=Puede cambiar el voto de otros
SelectDayDesc=Para cada día seleccionado, puede elegir, o no, las horas de reunión en el siguiente formato:<br>- vacío,<br>- "8h", "8H" o "8:00" para proporcionar una hora de inicio de la reunión,<br>- "8-11", "8h-11h", "8H-11H" o "8:00-11:00" para proporcionar una hora de inicio y de fin de la reunión,<br>- "8h15-11h15", "8H15-11H15" or "8:15-11:15" para lo mismo pero con minutos.
BackToCurrentMonth=Volver al mes actual
PublicLinkToCreateSurvey=Enlace público que permite a cualquiera crear una encuesta

View File

@ -1,6 +1,7 @@
# Dolibarr language file - fr_FR - holiday # Dolibarr language file - fr_FR - holiday
CHARSET= UTF-8 CHARSET= UTF-8
Holidays=Congés
CPTitreMenu=Congés CPTitreMenu=Congés
MenuReportMonth=Etat mensuel MenuReportMonth=Etat mensuel
MenuAddCP=Nouvelle demande MenuAddCP=Nouvelle demande
@ -84,8 +85,10 @@ NewSoldeCP=Nouveau Solde
alreadyCPexist=Une demande de congés à déjà été effectuée sur cette période. alreadyCPexist=Une demande de congés à déjà été effectuée sur cette période.
UserName=Nom Prénom UserName=Nom Prénom
Employee=Salarié Employee=Salarié
FirstDayOfHoliday=Premier jour de congés FirstDayOfHoliday=Premier jour de congès
LastDayOfHoliday=Dernier jour de congés LastDayOfHoliday=Dernier jour de congès
HolidaysMonthlyUpdate=Mise à jour mensuelle
ManualUpdate=Mise à jour manuelle
## Configuration du Module ## ## Configuration du Module ##
ConfCP=Configuration du module Congés ConfCP=Configuration du module Congés

View File

@ -136,23 +136,6 @@ function is_error($cerr)
} }
/**
* Vérifie une adresse e-mail selon les normes RFC
*
* @param string $email l'adresse e-mail a vérifier
* @return bool vrai si l'adresse est correcte, faux sinon
* @see http://fightingforalostcause.net/misc/2006/compare-email-regex.php
* @see http://svn.php.net/viewvc/php/php-src/trunk/ext/filter/logical_filters.c?view=markup
*/
function validateEmail($email)
{
$pattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD';
return (bool) preg_match($pattern, $email);
}
/** /**
* Fonction vérifiant l'existance et la valeur non vide d'une clé d'un tableau * Fonction vérifiant l'existance et la valeur non vide d'une clé d'un tableau
* *

View File

@ -74,9 +74,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre") || GET
$_SESSION["mailsonde"] = false; $_SESSION["mailsonde"] = false;
} }
if(validateEmail($adresse) === false) { if (! isValidEmail($adresse)) $erreur_adresse = true;
$erreur_adresse = true;
}
//var_dump($titre.' - '.$nom.' - '.$adresse.' - '.!$erreur_adresse.' - '.! $erreur_injection_titre.' - '.! $erreur_injection_commentaires.' - '.! $erreur_injection_nom.' - '.$creation_sondage_date.' - '.$creation_sondage_autre); exit; //var_dump($titre.' - '.$nom.' - '.$adresse.' - '.!$erreur_adresse.' - '.! $erreur_injection_titre.' - '.! $erreur_injection_commentaires.' - '.! $erreur_injection_nom.' - '.$creation_sondage_date.' - '.$creation_sondage_autre); exit;

View File

@ -31,6 +31,20 @@ if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check ant
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
/**
* Header empty
*
* @return void
*/
function llxHeader() { }
/**
* Footer empty
*
* @return void
*/
function llxFooter() { }
require '../../main.inc.php'; require '../../main.inc.php';
$tag=GETPOST('tag'); $tag=GETPOST('tag');

View File

@ -29,6 +29,20 @@ if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this outpu
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
/**
* Header empty
*
* @return void
*/
function llxHeader() { }
/**
* Footer empty
*
* @return void
*/
function llxFooter() { }
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';

View File

@ -336,10 +336,19 @@ table.login_table .vmenu {
/* ! Message d'erreur lors du login : */ /* ! Message d'erreur lors du login : */
center .error { padding:8px !important; padding-left:26px !important; padding-right:20px; width:inherit; max-width:450px;color:#552323 !important; font-size:14px; border-radius:8px; text-align: left;} center .error { padding:8px !important; padding-left:26px !important; padding-right:20px; width:inherit; max-width:450px;color:#552323 !important; font-size:14px; border-radius:8px; text-align: left;}
/* For hide object and add pointer cursor */
.hideobject {display:none;}
.linkobject {cursor:pointer;} /* ============================================================================== */
/* Styles to hide objects */
/* ============================================================================== */
.hideobject { display:none; }
<?php if (! empty($dol_optimize_smallscreen)) { ?>
.hideonsmartphone { display: none; }
.noenlargeonsmartphone { width : 50px !important; display: inline !important; }
<?php } ?>
.linkobject { cursor:pointer; }
/* For dragging lines */ /* For dragging lines */

Some files were not shown because too many files have changed in this diff Show More