diff --git a/COPYRIGHT b/COPYRIGHT index d97b00721da..4272219f80b 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -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: -Composant Version License Compatible GPL Usage +Composant Version License Compatible GPL Usage ---------------------------------------------------------------------------- PHP libraries: -AdoDb-Date 0.21 Modified BSD License Yes Date convertion (not into rpm package) -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) -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) -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 -PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests -TCPDF 5.9.180 LGPL-3+ Yes PDF generation +AdoDb-Date 0.21 Modified BSD License Yes Date convertion (not into rpm package) +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) +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) +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 +PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests +TCPDF 5.9.180 LGPL-3+ Yes PDF generation JS libraries: -jQuery 1.8.2 MIT Licence Yes JS library -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 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 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 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 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 Layout 1.3.0 GPL and MIT Licence Yes JS library plugin Layout (RC-29.15) -jQuery TableDnD 0.5 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows) -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 -JSGantt 1.2 BSD Licence Yes JS library (to build Gantt reports) +jQuery 1.8.2 MIT Licence Yes JS library +jQuery UI 1.9.1 GPL and MIT Licence Yes JS library plugin UI +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 DataTables 1.9.4 BSD Yes JS library for tables output +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 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 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 jquerytreeview 1.4.1 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 Mobile 1.3 GPL and MIT Licence Yes JS library for smartphone (not used) +jQuery TableDnD 0.5 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows) +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: http://www.fsf.org/licensing/licenses/index_html diff --git a/ChangeLog b/ChangeLog index 722047b7546..2ef52f1354a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,6 +83,8 @@ WARNING: If you used external modules, some of them may need to be upgraded due - 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: Bad link to all proposals into Third party card if customer is prospect +- Fix: [ bug #789 ] VAT not being calculated in POS diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 3538a3908d1..292252c2716 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -118,7 +118,7 @@ class Facturation } // 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 $total_ht = $resultarray[0]; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 6090e909920..c178c37078b 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1,34 +1,34 @@ * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2010-2011 Philippe Grand - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2013 Florian Henry - * - * 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 . - */ +* Copyright (C) 2004 Eric Seigne +* Copyright (C) 2005 Marc Barilley / Ocebo +* Copyright (C) 2005-2012 Regis Houssin +* Copyright (C) 2006 Andre Cianfarani +* Copyright (C) 2010-2013 Juanjo Menent +* Copyright (C) 2010-2011 Philippe Grand +* Copyright (C) 2012 Christophe Battarel +* Copyright (C) 2013 Florian Henry +* +* 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 . +*/ /** * \file htdocs/comm/propal.php - * \ingroup propale - * \brief Page of commercial proposals card and list - */ +* \ingroup propale +* \brief Page of commercial proposals card and list +*/ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; @@ -54,7 +54,7 @@ $langs->load('orders'); $langs->load('products'); $langs->load("deliveries"); if (! empty($conf->margin->enabled)) - $langs->load('margins'); + $langs->load('margins'); $error=0; @@ -100,7 +100,7 @@ $hookmanager->initHooks(array('propalcard')); /* * Actions - */ +*/ $parameters=array('socid'=>$socid); $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) { - $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)) - { - $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); - } + if (empty($datep)) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + } - if (! $error) - { - $result=$object->set_date($user,$datep); - if ($result < 0) dol_print_error($db,$object->error); - } + if (! $error) + { + $result=$object->set_date($user,$datep); + if ($result < 0) dol_print_error($db,$object->error); + } } else if ($action == 'setecheance' && $user->rights->propal->creer) { @@ -257,7 +257,7 @@ else if ($action == 'add' && $user->rights->propal->creer) if (empty($datep)) { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); - $action='create'; + $action='create'; $error++; } if (empty($duration)) @@ -276,123 +276,123 @@ else if ($action == 'add' && $user->rights->propal->creer) if (! $error) { - $db->begin(); + $db->begin(); - // Si on a selectionne une propal a copier, on realise la copie - if (GETPOST('createmode')=='copy' && GETPOST('copie_propal')) - { - if ($object->fetch(GETPOST('copie_propal')) > 0) - { - $object->ref = GETPOST('ref'); - $object->datep = $datep; - $object->date_livraison = $date_delivery; - $object->availability_id = GETPOST('availability_id'); - $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->fk_delivery_address = GETPOST('fk_address'); - $object->duree_validite = $duration; - $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); - $object->remise_percent = GETPOST('remise_percent'); - $object->remise_absolue = GETPOST('remise_absolue'); - $object->socid = GETPOST('socid'); - $object->contactid = GETPOST('contactidp'); - $object->fk_project = GETPOST('projectid'); - $object->modelpdf = GETPOST('model'); - $object->author = $user->id; // deprecated - $object->note = GETPOST('note'); - $object->statut = 0; + // Si on a selectionne une propal a copier, on realise la copie + if (GETPOST('createmode')=='copy' && GETPOST('copie_propal')) + { + if ($object->fetch(GETPOST('copie_propal')) > 0) + { + $object->ref = GETPOST('ref'); + $object->datep = $datep; + $object->date_livraison = $date_delivery; + $object->availability_id = GETPOST('availability_id'); + $object->demand_reason_id = GETPOST('demand_reason_id'); + $object->fk_delivery_address = GETPOST('fk_address'); + $object->duree_validite = $duration; + $object->cond_reglement_id = GETPOST('cond_reglement_id'); + $object->mode_reglement_id = GETPOST('mode_reglement_id'); + $object->remise_percent = GETPOST('remise_percent'); + $object->remise_absolue = GETPOST('remise_absolue'); + $object->socid = GETPOST('socid'); + $object->contactid = GETPOST('contactidp'); + $object->fk_project = GETPOST('projectid'); + $object->modelpdf = GETPOST('model'); + $object->author = $user->id; // deprecated + $object->note = GETPOST('note'); + $object->statut = 0; - $id = $object->create_from($user); - } - else - { - setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors'); - } - } - else - { - $object->ref = GETPOST('ref'); - $object->ref_client = GETPOST('ref_client'); - $object->datep = $datep; - $object->date_livraison = $date_delivery; - $object->availability_id = GETPOST('availability_id'); - $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->fk_delivery_address = GETPOST('fk_address'); - $object->duree_validite = GETPOST('duree_validite'); - $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); + $id = $object->create_from($user); + } + else + { + setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors'); + } + } + else + { + $object->ref = GETPOST('ref'); + $object->ref_client = GETPOST('ref_client'); + $object->datep = $datep; + $object->date_livraison = $date_delivery; + $object->availability_id = GETPOST('availability_id'); + $object->demand_reason_id = GETPOST('demand_reason_id'); + $object->fk_delivery_address = GETPOST('fk_address'); + $object->duree_validite = GETPOST('duree_validite'); + $object->cond_reglement_id = GETPOST('cond_reglement_id'); + $object->mode_reglement_id = GETPOST('mode_reglement_id'); - $object->contactid = GETPOST('contactidp'); - $object->fk_project = GETPOST('projectid'); - $object->modelpdf = GETPOST('model'); - $object->author = $user->id; // deprecated - $object->note = GETPOST('note'); + $object->contactid = GETPOST('contactidp'); + $object->fk_project = GETPOST('projectid'); + $object->modelpdf = GETPOST('model'); + $object->author = $user->id; // deprecated + $object->note = GETPOST('note'); - $object->origin = GETPOST('origin'); - $object->origin_id = GETPOST('originid'); + $object->origin = GETPOST('origin'); + $object->origin_id = GETPOST('originid'); - for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) - { - if ($_POST['idprod'.$i]) - { - $xid = 'idprod'.$i; - $xqty = 'qty'.$i; - $xremise = 'remise'.$i; - $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); - } - } + for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) + { + if ($_POST['idprod'.$i]) + { + $xid = 'idprod'.$i; + $xqty = 'qty'.$i; + $xremise = 'remise'.$i; + $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); + } + } - // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + // Fill array 'array_options' with data from add form + $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - $id = $object->create($user); - } + $id = $object->create($user); + } - if ($id > 0) - { - // Insertion contact par defaut si defini - if (GETPOST('contactidp')) - { - $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); - if ($result < 0) - { - $error++; - setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); - } - } + if ($id > 0) + { + // Insertion contact par defaut si defini + if (GETPOST('contactidp')) + { + $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); + if ($result < 0) + { + $error++; + setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); + } + } - if (! $error) - { - $db->commit(); + if (! $error) + { + $db->commit(); - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; - } - else - { - $db->rollback(); - } - } - else - { - dol_print_error($db,$object->error); - $db->rollback(); - exit; - } + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + exit; + } + else + { + $db->rollback(); + } + } + else + { + dol_print_error($db,$object->error); + $db->rollback(); + exit; + } } } @@ -432,7 +432,7 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST( /* * Add file in email form - */ +*/ if (GETPOST('addfile')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -447,7 +447,7 @@ if (GETPOST('addfile')) /* * Remove file in email form - */ +*/ if (GETPOST('removedfile')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -463,7 +463,7 @@ if (GETPOST('removedfile')) /* * Send mail - */ +*/ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) { $langs->load('mails'); @@ -661,7 +661,7 @@ else if ($action == "addline" && $user->rights->propal->creer) $pu_ttc=0; $price_min=0; $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); - + // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit @@ -738,18 +738,18 @@ else if ($action == "addline" && $user->rights->propal->creer) $desc = $prod->description; } - $desc=dol_concatdesc($desc,$product_desc); + $desc=dol_concatdesc($desc,$product_desc); - // Add custom code and origin country into description - if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) - { - $tmptxt='('; - if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; - 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); - $tmptxt.=')'; - $desc= dol_concatdesc($desc, $tmptxt); - } + // Add custom code and origin country into description + if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) + { + $tmptxt='('; + if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; + 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); + $tmptxt.=')'; + $desc= dol_concatdesc($desc, $tmptxt); + } } $type = $prod->type; @@ -768,7 +768,7 @@ else if ($action == "addline" && $user->rights->propal->creer) // Margin $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); $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')); @@ -875,7 +875,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa $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 $special_code=0; if (! GETPOST('qty')) $special_code=3; @@ -1068,7 +1068,7 @@ else if ($action == 'setmode' && $user->rights->propal->creer) /* * Ordonnancement des lignes - */ +*/ else if ($action == 'up' && $user->rights->propal->creer) { @@ -1202,7 +1202,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal-> /* * View - */ +*/ llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); @@ -1465,7 +1465,7 @@ else { /* * Show object in view mode - */ + */ $soc = new Societe($db); $soc->fetch($object->socid); @@ -1510,7 +1510,7 @@ else // Confirm validate proposal else if ($action == 'validate') { - $error=0; + $error=0; // on verifie si l'objet est en numerotation provisoire $ref = substr($object->ref, 1, 4); @@ -1519,8 +1519,8 @@ else $numref = $object->getNextNumRef($soc); if (empty($numref)) { - $error++; - dol_htmloutput_errors($object->error); + $error++; + dol_htmloutput_errors($object->error); } } else @@ -1542,8 +1542,8 @@ else if (! $formconfirm) { - $parameters=array('lineid'=>$lineid); - $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + $parameters=array('lineid'=>$lineid); + $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook } // Print form confirm @@ -1691,11 +1691,11 @@ else print ''; 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 { - $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 ''; print ''; @@ -1844,54 +1844,54 @@ else } // TODO : use showOptionals($extrafields) function - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''; - // Convert date into timestamp format - 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]; - } + // Convert date into timestamp format + 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]; + } - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print $extrafields->showInputField($key,$value); - } - else - { - print $extrafields->showOutputField($key,$value); - } - print ''."\n"; - } - } + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print $extrafields->showInputField($key,$value); + } + else + { + print $extrafields->showOutputField($key,$value); + } + print ''."\n"; + } + } - if(count($extrafields->attribute_label) > 0) { + if(count($extrafields->attribute_label) > 0) { - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print ''; - print ''; - print ''; - print ''; + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print ''; + print ''; + print ''; + print ''; - } - else { - if ($object->statut == 0 && $user->rights->propal->creer) - { - print ''.img_picto('','edit').' '.$langs->trans('Modify').''; - } - } - } + } + else { + if ($object->statut == 0 && $user->rights->propal->creer) + { + print ''.img_picto('','edit').' '.$langs->trans('Modify').''; + } + } + } } // Amount HT @@ -1901,9 +1901,9 @@ else // Margin Infos if (! empty($conf->margin->enabled)) { - print ''; - $object->displayMarginInfos(); - print ''; + print ''; + $object->displayMarginInfos(); + print ''; } print ''; @@ -1953,7 +1953,7 @@ else /* * Lines - */ + */ if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { @@ -2006,18 +2006,18 @@ else { /* * Formulaire cloture (signe ou non) - */ + */ $form_close = '
'; $form_close.= ''; $form_close.= ''; - $form_close.= ''; + $form_close.= ''; $form_close.= ''; @@ -2034,7 +2034,7 @@ else /* * Boutons Actions - */ + */ if ($action != 'presend') { print '
'; @@ -2044,8 +2044,8 @@ else // Validate if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) { - if (count($object->lines) > 0) print ''; - //else print ''.$langs->trans('Validate').''; + if (count($object->lines) > 0) print ''; + //else print ''.$langs->trans('Validate').''; } // Edit @@ -2064,34 +2064,34 @@ else // Send if ($object->statut == 1 || $object->statut == 2) { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) - { - print ''; - } - else print ''; + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) + { + print ''; + } + else print ''; } - // Create an order - if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0) - { - if ($user->rights->commande->creer) - { - print ''; - } - } + // Create an order + if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0) + { + if ($user->rights->commande->creer) + { + print ''; + } + } - // Create contract - if ($conf->contrat->enabled && $object->statut == 2 && $user->societe_id == 0) - { - $langs->load("contracts"); + // Create contract + if ($conf->contrat->enabled && $object->statut == 2 && $user->societe_id == 0) + { + $langs->load("contracts"); if ($user->rights->contrat->creer) { - print ''; + print ''; } - } + } - // Create an invoice and classify billed + // Create an invoice and classify billed if ($object->statut == 2 && $user->societe_id == 0) { if (! empty($conf->facture->enabled) && $user->rights->facture->creer) @@ -2129,18 +2129,19 @@ else } print '
'; - print "
\n"; } + print "
\n"; if ($action != 'presend') { - print '
'.$langs->trans("CloseAs").''; - $form_close.= ''; - $form_close.= ''; - $form_close.= '
'.$langs->trans("CloseAs").''; + $form_close.= ''; + $form_close.= ''; + $form_close.= '
'.$langs->trans('Note').'
'; - print ''; // ancre + print '
'; + //print '
'; + //print ''; // ancre /* * Documents generes - */ + */ $filename=dol_sanitizeFileName($object->ref); $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; @@ -2154,54 +2155,60 @@ else /* * Linked object block - */ + */ $somethingshown=$object->showLinkedObjectBlock(); - print ''; + + + print '
'; + //print '
'; + // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'propal',$socid); - print '
'; + + //print '
'; + print ''; } /* * Action presend - * - */ + * + */ if ($action == 'presend') { $ref = dol_sanitizeFileName($object->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/')); - $file=$fileparams['fullname']; + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/')); + $file=$fileparams['fullname']; - // Build document if it not exists - if (! $file || ! is_readable($file)) - { - // Define output language - $outputlangs = $langs; - $newlang=''; - 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 (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } + // Build document if it not exists + if (! $file || ! is_readable($file)) + { + // Define output language + $outputlangs = $langs; + $newlang=''; + 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 (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } - $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/')); - $file=$fileparams['fullname']; - } + $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/')); + $file=$fileparams['fullname']; + } print '
'; print_titre($langs->trans('SendPropalByMail')); @@ -2227,28 +2234,28 @@ else // Tableau des substitutions $formmail->substit['__PROPREF__']=$object->ref; - $formmail->substit['__SIGNATURE__']=$user->signature; - $formmail->substit['__PERSONALIZED__']=''; - $formmail->substit['__CONTACTCIVNAME__']=''; + $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; - //Find the good contact adress - $custcontact=''; - $contactarr=array(); - $contactarr=$object->liste_contact(-1,'external'); + //Find the good contact adress + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); - if (is_array($contactarr) && count($contactarr)>0) { - foreach($contactarr as $contact) { - if ($contact['libelle']==$langs->trans('TypeContact_propal_external_CUSTOMER')) { - $contactstatic=new Contact($db); - $contactstatic->fetch($contact['id']); - $custcontact=$contactstatic->getFullName($langs,1); - } - } + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_propal_external_CUSTOMER')) { + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } - if (!empty($custcontact)) { - $formmail->substit['__CONTACTCIVNAME__']=$custcontact; - } - } + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } // Tableau des parametres complementaires $formmail->param['action']='send'; @@ -2258,10 +2265,10 @@ else // Init list of files - if (GETPOST("mode")=='init') + if (GETPOST("mode")=='init') { $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(); diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 1588a0761d3..7f92b7e65c0 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -269,7 +269,8 @@ if ($socid > 0) print_fiche_titre($langs->trans("NewGlobalDiscount"),'',''); print ''; print ''; - print ''; + print ''; print ''; print ''; - - print "
'.$langs->trans("AmountHT").' '.$langs->trans("Currency".$conf->currency).'
'; + print ' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("VAT").''; print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$objsoc); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 350051705d2..2a501f10f73 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -9,17 +9,17 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Florian Henry - * + * * 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 . */ @@ -272,7 +272,7 @@ else if ($action == 'add' && $user->rights->commande->creer) { $object->linked_objects = array_merge($object->linked_objects, $other_linked_objects); } - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -373,7 +373,7 @@ else if ($action == 'add' && $user->rights->commande->creer) { // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - + $object_id = $object->create($user); // If some invoice's lines already known @@ -2307,7 +2307,7 @@ else /* * Boutons actions - */ + */ if ($action != 'presend') { if ($user->societe_id == 0 && $action <> 'editline') @@ -2435,19 +2435,19 @@ else print ''; } - print '
'; } + print '
'; if ($action != 'presend') { - print '
'; - print ''; // ancre + print '
'; + //print '
'; + //print ''; // ancre /* * Documents generes - * - */ + */ $comref = dol_sanitizeFileName($object->ref); $file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf'; $relativepath = $comref.'/'.$comref.'.pdf'; @@ -2461,17 +2461,19 @@ else /* * Linked object block - */ + */ $somethingshown=$object->showLinkedObjectBlock(); - print ''; + print '
'; + //print '
'; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'order',$socid); - print '
'; + //print '
'; + print ''; } diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 45678f54fb4..7830abef655 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -27,7 +27,7 @@ * \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.'/societe/class/societe.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/tva/class/tva.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"); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 64e51824338..ada636adb33 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -23,9 +23,12 @@ * \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.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $id=GETPOST('account'); $ref=GETPOST('ref'); diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 31d929dfed5..402dbeda095 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -24,11 +24,13 @@ * \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/company.lib.php'; - -$langs->load("banks"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); $action=GETPOST('action'); diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index 7ee5d069e11..2224627cd94 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -22,7 +22,11 @@ * \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) accessforbidden(); diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index d513c65fb30..e14b3e92df6 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -23,9 +23,11 @@ * \brief Page de budget */ -require 'pre.inc.php'; - -$langs->load("categories"); +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 423abdf9fb9..9fcd579bc15 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -23,7 +23,11 @@ * \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) accessforbidden(); diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index b811e35f7d7..e7d6fbbce9f 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -24,13 +24,15 @@ * \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/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php'; - -$langs->load("banks"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); $action=GETPOST("action"); diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index fb4e2a09a86..932acf5dcb5 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -23,12 +23,13 @@ * \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.'/compta/bank/class/account.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); $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 54f89cd95e6..344231cea5d 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -23,13 +23,14 @@ * \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.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -232,20 +233,20 @@ if (! $found) print '
'.$langs->trans("None").' // Total print '
'.$langs->trans("Total").''.price($total).'
"; +print "
"; /* * Boutons d'actions */ -print "
\n"; -if ($user->rights->banque->configurer) { + +print '
'."\n"; +if ($user->rights->banque->configurer) +{ print ''.$langs->trans("NewFinancialAccount").''; - print ''.$langs->trans("Rubriques").''; } -print "
"; +print '
'; llxFooter(); diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index 2a94840e3b7..a4a871cec93 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -21,11 +21,13 @@ * \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.'/compta/paiement/class/paiement.class.php'; - -$langs->load("banks"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 58675900a8c..dcad7cd4f22 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -25,13 +25,13 @@ * \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'; $langs->load("banks"); +$langs->load("categories"); $langs->load("compta"); $langs->load("bills"); -$langs->load("categories"); if (! empty($conf->adherent->enabled)) $langs->load("members"); diff --git a/htdocs/compta/bank/pre.inc.php b/htdocs/compta/bank/pre.inc.php deleted file mode 100644 index a507c4c0a71..00000000000 --- a/htdocs/compta/bank/pre.inc.php +++ /dev/null @@ -1,92 +0,0 @@ - - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2010 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin - * - * 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 . - */ - -/** - * \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(); -} -?> diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index 4e8b717201c..e38ce88633a 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -23,7 +23,7 @@ * \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.'/societe/class/societe.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/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; - -$langs->load("banks"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); if (! $user->rights->banque->consolidate) accessforbidden(); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index f3603da2d6d..adbed8ea740 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -23,15 +23,16 @@ * \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'; - -$action=GETPOST('action', 'alpha'); - +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); -$langs->load("banks"); $langs->load("bills"); +$action=GETPOST('action', 'alpha'); $id=GETPOST('account'); $ref=GETPOST('ref'); $dvid=GETPOST('dvid'); diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index f7cbf8f8629..9117a099fb5 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -24,11 +24,14 @@ * \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.'/societe/class/societe.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/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -134,9 +137,9 @@ if ($resql) // Title $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); } else diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index eb39379ace0..91f05a2fdaa 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -23,14 +23,16 @@ * \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.'/societe/class/societe.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.'/compta/sociales/class/chargesociales.class.php'; - -$langs->load("banks"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); // Security check diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 2908039a26d..f770c5bc371 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -24,10 +24,12 @@ * \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'; - -$langs->load("banks"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); if (! $user->rights->banque->transfer) accessforbidden(); @@ -36,8 +38,9 @@ $action = GETPOST('action','alpha'); /* - * Action ajout d'un virement + * Actions */ + if ($action == 'add') { $langs->load("errors"); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 3cc3677d301..53e839e0241 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2122,7 +2122,7 @@ if ($action == 'create') } $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); - + //print ''; // Private note @@ -3440,12 +3440,13 @@ else if ($id > 0 || ! empty($ref)) print ''; } } - + print '
'; if ($action != 'prerelance' && $action != 'presend') { - print '
'; - print ''; // ancre + print '
'; + //print '
'; + //print ''; // ancre /* * Documents generes @@ -3456,7 +3457,6 @@ else if ($id > 0 || ! empty($ref)) $genallowed=$user->rights->facture->creer; $delallowed=$user->rights->facture->supprimer; - print '
'; print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); $somethingshown=$formfile->numoffiles; @@ -3472,16 +3472,16 @@ else if ($id > 0 || ! empty($ref)) print showPaypalPaymentUrl('invoice',$object->ref); } - print '
'; - - print '
'; + print '
'; + //print '
'; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'invoice',$socid); - print '
'; + //print '
'; + print ''; } else { diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 6347a847e36..8a24ab3ce29 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -24,14 +24,15 @@ * \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.'/compta/paiement/class/paiement.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'; - + +$langs->load("banks"); +$langs->load("categories"); $langs->load('bills'); -$langs->load('banks'); $langs->load('companies'); $langs->load('compta'); diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index b3ccf19ae19..cfde42a5cf3 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -23,11 +23,12 @@ * \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/bank/class/account.class.php'; - -$langs->load("banks"); + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/paiement/cheque/liste.php b/htdocs/compta/paiement/cheque/liste.php index 3f4b1d12cbd..8370bd95551 100644 --- a/htdocs/compta/paiement/cheque/liste.php +++ b/htdocs/compta/paiement/cheque/liste.php @@ -23,10 +23,12 @@ * \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/bank/class/account.class.php'; - + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); // Security check diff --git a/htdocs/compta/paiement/cheque/pre.inc.php b/htdocs/compta/paiement/cheque/pre.inc.php deleted file mode 100644 index bc730c9740d..00000000000 --- a/htdocs/compta/paiement/cheque/pre.inc.php +++ /dev/null @@ -1,92 +0,0 @@ - - * Copyright (C) 2004-2010 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin - * - * 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 . - */ - -/** - * \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(); -} - -?> diff --git a/htdocs/compta/prelevement/bon.php b/htdocs/compta/prelevement/bon.php index 792fd012fdf..6448a5b3df5 100644 --- a/htdocs/compta/prelevement/bon.php +++ b/htdocs/compta/prelevement/bon.php @@ -23,11 +23,14 @@ * \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/files.lib.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("categories"); diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index bc69163e000..218d8fb9523 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -24,11 +24,13 @@ * \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/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("widthdrawals"); -$langs->load("categories"); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 054a73db062..5be91cb8044 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -24,16 +24,18 @@ * \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/facture/class/facture.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/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("companies"); -$langs->load("banks"); $langs->load("bills"); // Security check diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 3d685d18e94..4d83076c600 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -24,14 +24,16 @@ * \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.'/compta/facture/class/facture.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("companies"); -$langs->load("categories"); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 0ec6018f9eb..5271dbd03b4 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -24,14 +24,16 @@ * \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.'/compta/prelevement/class/bonprelevement.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/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); -$langs->load("categories"); $langs->load('withdrawals'); // Securite acces client diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index c88df2483a3..3cc372094a3 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -24,13 +24,15 @@ * \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.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; - -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load('withdrawals'); // Securite acces client diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 28cf71231b5..20e9c09145f 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -23,17 +23,19 @@ * \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.'/compta/prelevement/class/bonprelevement.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 if ($user->societe_id > 0) accessforbidden(); -$langs->load("withdrawals"); -$langs->load("categories"); - // Get supervariables $prev_id = GETPOST('id','int'); $page = GETPOST('page','int'); diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index 895d5b35080..283f0c24183 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -23,16 +23,19 @@ * \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.'/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) accessforbidden(); $langs->load("bills"); $langs->load("withdrawals"); -$langs->load("categories"); // Security check diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index f685922e167..c1d0a0aaa3f 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -24,14 +24,16 @@ * \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/facture/class/facture.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.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("withdrawals"); -$langs->load("categories"); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index d2c8c71e62a..5f7e17fb679 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -24,18 +24,21 @@ * \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/ligneprelevement.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/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id > 0) accessforbidden(); $langs->load("bills"); $langs->load("withdrawals"); -$langs->load("categories"); // Get supervariables $action = GETPOST('action','alpha'); diff --git a/htdocs/compta/prelevement/lignes.php b/htdocs/compta/prelevement/lignes.php index 0f87e78213d..298effa2b15 100644 --- a/htdocs/compta/prelevement/lignes.php +++ b/htdocs/compta/prelevement/lignes.php @@ -24,17 +24,20 @@ * \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.'/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/rejetprelevement.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 if ($user->societe_id > 0) accessforbidden(); -$langs->load("categories"); $langs->load('withdrawals'); // Get supervariables diff --git a/htdocs/compta/prelevement/liste.php b/htdocs/compta/prelevement/liste.php index 3d49c050268..1410b177ff2 100644 --- a/htdocs/compta/prelevement/liste.php +++ b/htdocs/compta/prelevement/liste.php @@ -23,10 +23,12 @@ * \ingroup prelevement * \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/ligneprelevement.class.php'; - +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); $langs->load("withdrawals"); $langs->load("companies"); $langs->load("categories"); diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index b22289b5f50..012c2364635 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -24,13 +24,15 @@ * \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/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("companies"); -$langs->load("categories"); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index a2edee3061e..419fb7eb3e8 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -24,12 +24,14 @@ * \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/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("withdrawals"); $langs->load("companies"); -$langs->load("categories"); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 70065d7b7d2..2ec6539db9e 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * * 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 diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 1f85a99916d..6fbd0a23143 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -115,6 +115,8 @@ class ChargeSociales extends CommonObject */ function create($user) { + global $conf; + // Nettoyage parametres $newamount=price2num($this->amount,'MT'); @@ -127,10 +129,11 @@ class ChargeSociales extends CommonObject $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.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',"; - $sql.= " ".price2num($newamount); + $sql.= " '".price2num($newamount)."',"; + $sql.= " ".$conf->entity; $sql.= ")"; dol_syslog(get_class($this)."::create sql=".$sql); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index ab393c12ba2..34dc0262c2e 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -500,13 +500,13 @@ class Tva extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount"; if ($this->note) $sql.=", note"; if ($this->label) $sql.=", label"; - $sql.= ", fk_user_creat, fk_bank"; + $sql.= ", fk_user_creat, fk_bank, entity"; $sql.= ") "; $sql.= " VALUES ('".$this->db->idate($this->datep)."',"; $sql.= "'".$this->db->idate($this->datev)."'," . $this->amount; if ($this->note) $sql.=", '".$this->db->escape($this->note)."'"; if ($this->label) $sql.=", '".$this->db->escape($this->label)."'"; - $sql.=", '".$user->id."', NULL"; + $sql.=", '".$user->id."', NULL, ".$conf->entity; $sql.= ")"; dol_syslog("Tva::addPayment sql=".$sql); diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index c8139c5575f..a95f7b85963 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * * 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 diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8d2d4a4f5d6..9f8a2aabf7d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1418,7 +1418,7 @@ abstract class CommonObject dol_syslog(get_class($this)."::upate_note Parameter suffix must be empty, '_private' or '_public'", LOG_ERR); return -2; } - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= " SET note".$suffix." = ".(!empty($note)?("'".$this->db->escape($note)."'"):"NULL"); $sql.= " WHERE rowid =". $this->id; @@ -1441,7 +1441,7 @@ abstract class CommonObject /** * Update public note (kept for backward compatibility) - * + * * @param string $note New value for note * @return int <0 if KO, >0 if OK * @deprecated @@ -1450,7 +1450,7 @@ abstract class CommonObject { return $this->update_note($note,'_public'); } - + /** * Update total_ht, total_ttc and total_vat for an object (sum of lines) * @@ -2702,31 +2702,47 @@ abstract class CommonObject global $conf,$langs,$hookmanager; print ''; - if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) - { - print ' '; - } + + if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ' '; + + // Description print ''.$langs->trans('Description').''; + + // VAT print ''.$langs->trans('VAT').''; + + // Price HT print ''.$langs->trans('PriceUHT').''; - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - print ' '; + + if ($conf->global->MAIN_FEATURES_LEVEL > 1) print ' '; + + // Qty print ''.$langs->trans('Qty').''; + + // Reduction short print ''.$langs->trans('ReductionShort').''; + if (! empty($conf->margin->enabled)) { if ($conf->global->MARGIN_TYPE == "1") print ''.$langs->trans('BuyingPrice').''; else print ''.$langs->trans('CostPrice').''; + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''.$langs->trans('MarginRate').''; if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''.$langs->trans('MarkRate').''; } + + // Total HT print ''.$langs->trans('TotalHTShort').''; - print ' '; - print ' '; - print ' '; // No width to allow autodim + + print ''; + + print ''; + + print ''; // No width to allow autodim + print "\n"; $num = count($this->lines); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index e6ef238d502..aae14dba217 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -627,6 +627,10 @@ class ExtraFields $formstat = new Form($db); $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=''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dc9d0ec5773..7ea8087613e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1188,6 +1188,9 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ=" if (empty($phone)) { return ''; } if (empty($country)) $country=$mysoc->country_code; + // Short format for small screens + if ($conf->dol_optimize_smallscreen) $separ=''; + $newphone=$phone; 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 =''; + } + 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(); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ac8140a2239..7f4be0bc8a3 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -438,7 +438,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // Tick to drag and drop if ($addordertick) { - print ' '; + print ' '; } print "\n"; @@ -459,13 +459,16 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($total>0) { - print ''.$langs->trans("Total").''; + print ''; + print ''.$langs->trans("Total").''; if ($showproject) print ''; print ''; print ''; print ''; print ''; - print ''.convertSecondToTime($total).''; + if ($addordertick) print ''; + print ''.convertSecondToTime($total).''; + print ''; } return $inc; diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 43c270c188d..316c4d5b607 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -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'); $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_after);exit; $menu_array=$newmenu->liste; diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 5fefb32d4a1..d82c4889335 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -205,12 +205,12 @@ class MenuManager $canonnexturl=preg_replace('/\?.*$/','',$nexturl); //var_dump($canonrelurl); //var_dump($canonnexturl); - print '
    '; + print '
      '."\n"; if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools')) || strpos($canonrelurl,'/product/index.php') || strpos($canonrelurl,'/compta/bank/index.php')) { // We add sub entry - print '
    • '.$langs->trans(ucfirst($val['mainmenu'])."Dashboard").'
    • '."\n"; + print str_pad('',1).'
    • '.$langs->trans(ucfirst($val['mainmenu'])."Dashboard").'
    • '."\n"; } 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']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; - print ''; + print str_pad('',$val2['level']+1).''; if ($relurl2) print ''; + print str_pad('',($val2['level']+1)*12,' '); print $val2['titre']; if ($relurl2) print ''; print ''."\n"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index cd99f7fe2a5..641925f42a9 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1161,9 +1161,60 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Add personalized menus and modules menus $menuArbo = new Menubase($db,'eldy'); $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_after);exit; $menu_array=$newmenu->liste; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 4530dcd6f8f..935546ce846 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -159,12 +159,12 @@ class MenuManager $canonnexturl=preg_replace('/\?.*$/','',$nexturl); //var_dump($canonrelurl); //var_dump($canonnexturl); - print '
        '; + print '
          '."\n"; if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools')) || strpos($canonrelurl,'/product/index.php') || strpos($canonrelurl,'/compta/bank/index.php')) { // We add sub entry - print '
        • '.$langs->trans(ucfirst($val['mainmenu'])."Dashboard").'
        • '."\n"; + print str_pad('',1).'
        • '.$langs->trans(ucfirst($val['mainmenu'])."Dashboard").'
        • '."\n"; } 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']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; - print ''; + print str_pad('',$val2['level']+1).''; if ($relurl2) print ''; + print str_pad('',($val2['level']+1)*12,' '); print $val2['titre']; if ($relurl2) print ''; print ''."\n"; diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 4baa4f51680..e6235572c1a 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -102,7 +102,7 @@ class modMargin extends DolibarrModules 'type'=>'left', // This is a Top menu entry 'titre'=>'Margins', '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', 'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>100, diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 051f4f98071..059cf7b83d4 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -125,8 +125,8 @@ global->DISPLAY_MARGIN_RATES)) {?> pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?> global->DISPLAY_MARK_RATES)) {?> + } + if (! empty($conf->global->DISPLAY_MARK_RATES)) {?> marque_tx).'%'; ?> @@ -152,7 +152,7 @@ - 1) { ?> + 1 && empty($conf->browser->phone)) { ?> 0) { ?> id; ?>"> @@ -166,10 +166,10 @@ -   + browser->phone)?' class="tdlineupdown"':''); ?>> -   + diff --git a/htdocs/document.php b/htdocs/document.php index 29d189f9a83..2a04ba28a74 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -40,11 +40,17 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); /** - * Wrapper, donc header vierge + * Header empty * - * @return null + * @return void */ function llxHeader() { } +/** + * Footer empty + * + * @return void + */ +function llxFooter() { } require 'main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 4e8b9e2b1d8..70fed335c93 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1442,7 +1442,9 @@ else if ($id > 0 || ! empty($ref)) if ($action != 'presend') { - print '
          '; + print '
          '; + //print '"; - print "
          '; + /* * Built documents */ @@ -1464,14 +1466,16 @@ else if ($id > 0 || ! empty($ref)) */ $somethingshown=$object->showLinkedObjectBlock(); - print ''; + //print ''; + print '
          '; + // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'fichinter',$socid); - print "
          "; - print " 
          \n"; + + print '
          '; + //print "
          \n"; } diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 6d405305d6a..653397cfaf5 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent @@ -999,7 +999,7 @@ if ($action=="create") print ''; print ''; - + print ''.$langs->trans('NotePublic').''; print ''; $doleditor = new DolEditor('note_public', GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); @@ -1016,7 +1016,7 @@ if ($action=="create") //print ''; print ''; - + // Other options $parameters=array(); @@ -1516,7 +1516,7 @@ elseif (! empty($object->id)) $parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i); $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$object,$action); } - + $nbrows=ROWS_2; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; $doleditor=new DolEditor('eldesc',$line->description,'',200,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); @@ -1671,7 +1671,7 @@ elseif (! empty($object->id)) */ if ($user->societe_id == 0 && $action != 'editline' && $action != 'delete') { - print '
          '; + print '
          '; if ($action != 'edit') { - print '
          '; - print ''; // ancre + print '
          '; + //print '
          '; + //print ''; // ancre /* * Documents generes @@ -2072,7 +2074,6 @@ else $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)); - print '
          '; print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,0,0,'','','',$societe->default_lang); $somethingshown=$formfile->numoffiles; @@ -2081,15 +2082,17 @@ else */ $somethingshown=$object->showLinkedObjectBlock(); - print '
          '; - print '
          '; + print '
          '; + //print '
          '; + //print '
          '; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'invoice_supplier',$socid); - print '
          '; + print '
          '; + //print '
          '; } } /* diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index d376c96c7ff..63f98a2be14 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -23,7 +23,7 @@ * \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/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; diff --git a/htdocs/ftp/pre.inc.php b/htdocs/ftp/pre.inc.php deleted file mode 100644 index 19a9d2547fb..00000000000 --- a/htdocs/ftp/pre.inc.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * 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 . - */ - -/** - * \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(); -} -?> diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index d288bd9b97b..c269a148615 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -278,19 +278,20 @@ if($user->rights->holiday->lire_tous) { } // VALIDEUR -if($user->rights->holiday->lire_tous){ +if($user->rights->holiday->lire_tous) +{ print ''; - // Liste des utiliseurs du groupes Comptabilité - - $idGroupValid = $holiday->getConfCP('userGroup'); - - $validator = new UserGroup($db,$idGroupValid); - $valideur = $validator->listUsersForGroup(); - - $form->select_users($search_valideur,"search_valideur",1,"",0,$valideur,''); + $validator = new UserGroup($db); + $excludefilter=$user->admin?'':'u.rowid <> '.$user->id; + $valideurobjects = $validator->listUsersForGroup($excludefilter); + $valideurarray = array(); + foreach($valideurobjects as $val) $valideurarray[$val->id]=$val->id; + $form->select_users($search_valideur,"search_valideur",1,"",0,$valideurarray,''); print ''; -} else { +} +else +{ print ' '; } diff --git a/htdocs/includes/jquery/plugins/template/README.md b/htdocs/includes/jquery/plugins/template/README.md deleted file mode 100644 index 5f9d6e986d9..00000000000 --- a/htdocs/includes/jquery/plugins/template/README.md +++ /dev/null @@ -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 - -``` - -Add a script section with type **"text/x-tmpl"**, a unique **id** property and your template definition as content: - -```html - -``` - -**"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 - -{%=o.title%} -

          {%=o.title%}

          -

          Features

          -
            -{% for (var i=0; i{%=o.features[i]%} -{% } %} -
          -``` - -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("

          {%=o.title%}

          ", data); -``` - -If called without second argument, **tmpl()** returns a reusable template function: - -```js -var func = tmpl("

          {%=o.title%}

          "); -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 "<>&"'" -``` - -**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 - -``` - -### 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 "

          JavaScript Templates

          ": -var result = tmpl("

          {%=p.title%}

          ", {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 -

          {%=o.title%}

          -``` - -Print variable without escaping: - -```html -

          {%#o.user_id%}

          -``` - -Print output of function calls: - -```html -Website -``` - -Use dot notation to print nested properties: - -```html -{%=o.author.name%} -``` - -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 -

          {%=0+''%}

          -``` - -### Evaluation -Use **print(str)** to add escaped content to the output: - -```html -Year: {% var d=new Date(); print(d.getFullYear()); %} -``` - -Use **print(str, true)** to add unescaped content to the output: - -```html -{% print("Fast & powerful", true); %} -``` - -Use **include(str, obj)** to include content from a different template: - -```html -
          -{% include('tmpl-link', {name: "Website", url: "http://example.org"}); %} -
          -``` - -If else condition: - -```html -{% if (o.author.url) { %} - {%=o.author.name%} -{% } else { %} - No author url. -{% } %} -``` - -For loop: - -```html -
            -{% for (var i=0; i{%=o.features[i]%} -{% } %} -
          -``` - -## 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). diff --git a/htdocs/includes/jquery/plugins/template/compile.js b/htdocs/includes/jquery/plugins/template/compile.js deleted file mode 100644 index ebca48aab4e..00000000000 --- a/htdocs/includes/jquery/plugins/template/compile.js +++ /dev/null @@ -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 = /([\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)); -}()); diff --git a/htdocs/includes/jquery/plugins/template/runtime.js b/htdocs/includes/jquery/plugins/template/runtime.js deleted file mode 100644 index 4cc0c3c68b1..00000000000 --- a/htdocs/includes/jquery/plugins/template/runtime.js +++ /dev/null @@ -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 = { - "<" : "<", - ">" : ">", - "&" : "&", - "\"" : """, - "'" : "'" - }; - 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)); diff --git a/htdocs/includes/jquery/plugins/template/tmpl.js b/htdocs/includes/jquery/plugins/template/tmpl.js deleted file mode 100644 index c8b4b8658a5..00000000000 --- a/htdocs/includes/jquery/plugins/template/tmpl.js +++ /dev/null @@ -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 = { - "<" : "<", - ">" : ">", - "&" : "&", - "\"" : """, - "'" : "'" - }; - 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)); diff --git a/htdocs/includes/jquery/plugins/template/tmpl.min.js b/htdocs/includes/jquery/plugins/template/tmpl.min.js deleted file mode 100644 index 065532e7cae..00000000000 --- a/htdocs/includes/jquery/plugins/template/tmpl.min.js +++ /dev/null @@ -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={"<":"<",">":">","&":"&",'"':""","'":"'"},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); \ No newline at end of file diff --git a/htdocs/index.php b/htdocs/index.php index 29c9ccfb4de..49404f72c65 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -188,7 +188,7 @@ if ($user->societe_id == 0) DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy', DOL_URL_ROOT.'/contrat/liste.php'); // Translation lang files - $langfile=array("bills", + $langfile=array("companies", "prospects", "suppliers", "members", diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 3935045d35f..e2dbcd39af1 100755 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -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 * diff --git a/htdocs/opensurvey/public/create_survey.php b/htdocs/opensurvey/public/create_survey.php index 168f601b9f5..2010a6fdd03 100755 --- a/htdocs/opensurvey/public/create_survey.php +++ b/htdocs/opensurvey/public/create_survey.php @@ -74,9 +74,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre") || GET $_SESSION["mailsonde"] = false; } - if(validateEmail($adresse) === false) { - $erreur_adresse = true; - } + if (! isValidEmail($adresse)) $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; diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index d29bb0fefc4..e44342278f0 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -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('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'; $tag=GETPOST('tag'); diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index c1245ace0ad..8585b19cd4a 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -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('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_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 0d913e037fa..6bf44532621 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -336,10 +336,19 @@ table.login_table .vmenu { /* ! 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;} -/* For hide object and add pointer cursor */ -.hideobject {display:none;} -.linkobject {cursor:pointer;} + +/* ============================================================================== */ +/* Styles to hide objects */ +/* ============================================================================== */ + +.hideobject { display:none; } + +.hideonsmartphone { display: none; } +.noenlargeonsmartphone { width : 50px !important; display: inline !important; } + +.linkobject { cursor:pointer; } + /* For dragging lines */ diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 44cc9b39641..6068aebf385 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -62,7 +62,13 @@ if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global- // Define image path files $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; -//'/theme/auguria/img/menus/trtitle.png'; + +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_use_jmobile=$conf->dol_use_jmobile; + $img_liste_titre=dol_buildpath($path.'/theme/'.$theme.'/img/menus/trtitle.png',1); $img_head=dol_buildpath($path.'/theme/'.$theme.'/img/headbg2.jpg',1); $img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1); @@ -196,8 +202,9 @@ div.inline-block /* ============================================================================== */ .hideobject { display: none; } -dol_optimize_smallscreen)) { ?> + .hideonsmartphone { display: none; } +.noenlargeonsmartphone { width : 50px !important; display: inline !important; } .linkobject { cursor: pointer; } diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 113ee0e5998..ea565c5d1f4 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -60,6 +60,12 @@ $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_use_jmobile=$conf->dol_use_jmobile; + $path=''; // This value may be used in future for external module to overwrite theme $theme='bureau2crea'; // Value of theme if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; } @@ -225,8 +231,9 @@ div.inline-block /* ============================================================================== */ .hideobject { display: none; } -dol_optimize_smallscreen)) { ?> + .hideonsmartphone { display: none; } +.noenlargeonsmartphone { width : 50px !important; display: inline !important; } .linkobject { cursor: pointer; } diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index b33a6fd958b..ddc88ac61d9 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -60,6 +60,12 @@ $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_use_jmobile=$conf->dol_use_jmobile; + $path=''; // This value may be used in future for external module to overwrite theme $theme='cameleo'; // Value of theme if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; } @@ -201,8 +207,9 @@ div.inline-block /* ============================================================================== */ .hideobject { display: none; } -dol_optimize_smallscreen)) { ?> + .hideonsmartphone { display: none; } +.noenlargeonsmartphone { width : 50px !important; display: inline !important; } .linkobject { cursor: pointer; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5bc359dd58c..47e27f3f968 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -352,8 +352,9 @@ th .button { /* ============================================================================== */ .hideobject { display: none; } -dol_optimize_smallscreen)) { ?> + .hideonsmartphone { display: none; } +.noenlargeonsmartphone { width : 50px !important; display: inline !important; } .linkobject { cursor: pointer; } diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 0eb74e30f88..01f8ea84b55 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -36,13 +36,18 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Pour autre que companylogo, on charge environnement + info issus de logon comme le user if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); - /** - * Wrapper, donc header vierge + * Header empty * - * @return null + * @return void */ function llxHeader() { } +/** + * Footer empty + * + * @return void + */ +function llxFooter() { } require 'main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/test/phpunit/phpunittest.xml b/test/phpunit/phpunittest.xml index b18471c06f2..424359786ae 100644 --- a/test/phpunit/phpunittest.xml +++ b/test/phpunit/phpunittest.xml @@ -47,10 +47,6 @@ ../../htdocs/societe/canvas/ ../../htdocs/includes/ ../../htdocs/boutique/osc_master.inc.php - ../../htdocs/compta/bank/pre.inc.php - ../../htdocs/compta/paiement/cheque/pre.inc.php - ../../htdocs/holiday/common.inc.php - ../../htdocs/ftp/pre.inc.php