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

This commit is contained in:
Laurent Destailleur 2015-05-29 17:15:27 +02:00
commit 11552e90b7
21 changed files with 175 additions and 75 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -206,34 +206,40 @@ if ($action == 'create') {
print '<input type="hidden" name="action" value="confirm_create">' . "\n"; print '<input type="hidden" name="action" value="confirm_create">' . "\n";
print '<input type="hidden" name="next_num_mvt" value="' . $next_num_mvt . '">' . "\n"; print '<input type="hidden" name="next_num_mvt" value="' . $next_num_mvt . '">' . "\n";
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr class="pair">'; print '<tr>';
print '<td>' . $langs->trans("NumMvts") . '</td>'; print '<td>' . $langs->trans("NumMvts") . '</td>';
print '<td>' . $next_num_mvt . '</td>'; print '<td>' . $next_num_mvt . '</td>';
print '</tr>'; print '</tr>';
print '<tr class="impair">'; print '<tr>';
print '<td>' . $langs->trans("Docdate") . '</td>'; print '<td>' . $langs->trans("Docdate") . '</td>';
print '<td>'; print '<td>';
print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1); print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '<tr class="pair">'; print '<tr>';
print '<td>' . $langs->trans("Codejournal") . '</td>'; print '<td>' . $langs->trans("Codejournal") . '</td>';
print '<td>' . $html->selectarray('code_journal', $code_journal_array) . '</td>'; print '<td>' . $html->selectarray('code_journal', $code_journal_array) . '</td>';
print '</tr>'; print '</tr>';
print '<tr class="impair">'; print '<tr>';
print '<td>' . $langs->trans("Docref") . '</td>'; print '<td>' . $langs->trans("Docref") . '</td>';
print '<td><input type="text" size="20" name="doc_ref" value=""/></td>'; print '<td><input type="text" size="20" name="doc_ref" value=""/></td>';
print '</tr>'; print '</tr>';
print '<tr class="pair">'; print '<tr>';
print '<td>' . $langs->trans("Doctype") . '</td>'; print '<td>' . $langs->trans("Doctype") . '</td>';
print '<td><input type="text" size="20" name="doc_type" value=""/></td>'; print '<td><input type="text" size="20" name="doc_type" value=""/></td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '<br>';
print '<input type="submit" class="butAction" value="' . $langs->trans("Save") . '">'; dol_fiche_end();
print '<div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="'.$langs->trans("Cancel").'" class="button" onclick="history.go(-1)" />';
print '</div>';
print '</form>'; print '</form>';
} }

View File

@ -1,7 +1,7 @@
<?PHP <?PHP
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -44,7 +44,6 @@ if ($user->societe_id > 0)
/* /*
* Actions * Actions
*/ */
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
if (! GETPOST('cancel', 'alpha')) if (! GETPOST('cancel', 'alpha'))
{ {
@ -63,6 +62,10 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
} }
} }
/*
* View
*/
llxHeader("", "", "FicheVentilation"); llxHeader("", "", "FicheVentilation");
if ($cancel == $langs->trans("Cancel")) { if ($cancel == $langs->trans("Cancel")) {
@ -108,6 +111,8 @@ if (! empty($id)) {
$linkback='<a href="'.DOL_URL_ROOT.'/accountancy/customer/lines.php">'.$langs->trans("Back").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/accountancy/customer/lines.php">'.$langs->trans("Back").'</a>';
print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'title_setup'); print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'title_setup');
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref facture // Ref facture
@ -120,13 +125,13 @@ if (! empty($id)) {
print '<tr><td width="20%">' . $langs->trans("Line") . '</td>'; print '<tr><td width="20%">' . $langs->trans("Line") . '</td>';
print '<td>' . nl2br($objp->description) . '</td></tr>'; print '<td>' . nl2br($objp->description) . '</td></tr>';
print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>'; print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>';
print $objp->account_number . '-' . $objp->label;
print '<tr><td width="20%">' . $langs->trans("NewAccount") . '</td><td>';
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1); print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '<br><div class="center">'; dol_fiche_end();
print '<div class="center">';
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">'; print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">'; print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';

View File

@ -1,9 +1,9 @@
<?php <?php
/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -172,8 +172,8 @@ if ($resql) {
while ( $i < $num ) { while ( $i < $num ) {
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
$var=!$var;
print '<tr><td>' . length_accountg($row[0]) . '</td>'; print '<tr '.$bc[$var].'><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>'; print '<td align="left">' . $row[1] . '</td>';
print '<td align="right">' . price($row[2]) . '</td>'; print '<td align="right">' . price($row[2]) . '</td>';
print '<td align="right">' . price($row[3]) . '</td>'; print '<td align="right">' . price($row[3]) . '</td>';

View File

@ -43,7 +43,7 @@ $search_facture = GETPOST('search_facture','alpha');
$search_label = GETPOST('search_label','alpha'); $search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha'); $search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha'); $search_amount = GETPOST('search_amount','alpha');
$search_acount = GETPOST('search_account','alpha'); $search_account = GETPOST('search_account','alpha');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)

View File

@ -555,9 +555,9 @@ else
$h=0; $h=0;
$head[$h][0] = $_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal; $head[$h][0] = $_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal;
$head[$h][1] = $langs->trans("Report"); $head[$h][1] = $langs->trans("Report");
$head[$h][2] = 'report'; $head[$h][2] = 'card';
dol_fiche_head($head, $hselected); dol_fiche_head($head, 'card', $langs->trans("BankJournal"), 0, 'payment');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal.'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal.'">';
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';

View File

@ -1,11 +1,11 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -34,31 +34,32 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
// Langs // Langs
$langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other");
$langs->load("main");
$langs->load("accountancy"); $langs->load("accountancy");
$action = GETPOST('action'); $action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int');
$codeventil = GETPOST('codeventil'); $codeventil = GETPOST('codeventil');
$id = GETPOST('id');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
{ if (! GETPOST('cancel', 'alpha'))
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; {
$sql .= " SET fk_code_ventilation = " . $codeventil; $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
$sql .= " WHERE rowid = " . $id; $sql .= " SET fk_code_ventilation = " . $codeventil;
$sql .= " WHERE rowid = " . $id;
dol_syslog('accountancy/journal/sellsjournal.php:: $sql=' . $sql); dol_syslog('accountancy/supplier/card.php:: $sql=' . $sql);
$resql = $db->query($sql);
$resql = $db->query($sql); if (! $resql) {
if (! $resql) { setEventMessage($db->lasterror(), 'errors');
setEventMessage($db->lasterror(), 'errors'); }
} else {
header("Location: ./lines.php");
exit();
} }
} }
@ -78,7 +79,7 @@ $form = new Form($db);
$facturefournisseur_static = new FactureFournisseur($db); $facturefournisseur_static = new FactureFournisseur($db);
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);
if ($_GET["id"]) { if (! empty($id)) {
$sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.rowid, l.fk_code_ventilation, "; $sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.rowid, l.fk_code_ventilation, ";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label";
$sql .= ", aa.account_number, aa.label"; $sql .= ", aa.account_number, aa.label";
@ -87,11 +88,14 @@ if ($_GET["id"]) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn "; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")"; $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
} }
dol_syslog("/accounting/supplier/card.php sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result) {
$num_lines = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
@ -103,7 +107,10 @@ if ($_GET["id"]) {
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="ventil">'; print '<input type="hidden" name="action" value="ventil">';
print_fiche_titre($langs->trans("SuppliersVentilation")); $linkback='<a href="'.DOL_URL_ROOT.'/accountancy/supplier/lines.php">'.$langs->trans("Back").'</a>';
print_fiche_titre($langs->trans('SuppliersVentilation'),$linkback,'title_setup');
dol_fiche_head();
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
@ -119,19 +126,24 @@ if ($_GET["id"]) {
print '<tr><td width="20%">' . $langs->trans("ProductLabel") . '</td>'; print '<tr><td width="20%">' . $langs->trans("ProductLabel") . '</td>';
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>'; print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>'; print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>';
print $objp->account_number . '-' . $objp->label;
print '<tr><td width="20%">' . $langs->trans("NewAccount") . '</td><td>';
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1); print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>&nbsp;</td><td><input type="submit" class="button" value="' . $langs->trans("Update") . '"></td></tr>';
print '</table>'; print '</table>';
dol_fiche_end();
print '<div class="center">';
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
print '</div>';
print '</form>'; print '</form>';
} else { } else {
print "Error 1"; print "Error";
} }
} else { } else {
print "Error 2"; print "Error";
} }
} else { } else {
print "Error ID incorrect"; print "Error ID incorrect";

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -158,8 +158,8 @@ if ($resql) {
while ( $i < $num ) { while ( $i < $num ) {
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
$var=!$var;
print '<tr><td>' . length_accountg($row[0]) . '</td>'; print '<tr '.$bc[$var].'><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>'; print '<td align="left">' . $row[1] . '</td>';
print '<td align="right">' . price($row[2]) . '</td>'; print '<td align="right">' . price($row[2]) . '</td>';
print '<td align="right">' . price($row[3]) . '</td>'; print '<td align="right">' . price($row[3]) . '</td>';

View File

@ -44,7 +44,7 @@ $search_facture = GETPOST('search_facture','alpha');
$search_label = GETPOST('search_label','alpha'); $search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha'); $search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha'); $search_amount = GETPOST('search_amount','alpha');
$search_acount = GETPOST('search_account','alpha'); $search_account = GETPOST('search_account','alpha');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)

View File

@ -480,7 +480,7 @@ class Categorie extends CommonObject
* Link an object to the category * Link an object to the category
* *
* @param Object $obj Object to link to category * @param Object $obj Object to link to category
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact') * @param string $type Type of category ('societe', 'member', 'product', 'contact', 'fournisseur)
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked * @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
*/ */
function add_type($obj,$type) function add_type($obj,$type)
@ -493,12 +493,22 @@ class Categorie extends CommonObject
// For backward compatibility // For backward compatibility
if ($type == 'company') $type='societe'; if ($type == 'company') $type='societe';
if ($type == 'customer') $type='societe'; elseif ($type == 'customer') $type='societe';
if ($type == 'supplier') $type='fournisseur'; elseif ($type == 'supplier') $type='fournisseur';
$column_name=$type; /**
if ($type=='contact') $column_name='socpeople'; * llx_categorie_contact => fk_socpeople
if ($type=='fournisseur') $column_name='societe'; * llx_categorie_fournisseur, llx_categorie_societe => fk_soc
* llx_categorie_member => fk_member
* llx_categorie_product => fk_product
*/
if ($type == 'contact') {
$column_name = 'socpeople';
} elseif ($type == 'fournisseur' || ($type == 'societe')) {
$column_name = 'soc';
} else {
$column_name = $type;
}
$this->db->begin(); $this->db->begin();

View File

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

View File

@ -789,14 +789,15 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
if ($displaytab > $limittoshow) if ($displaytab > $limittoshow)
{ {
$out.='<div id="moretabs" class="inline-block tabsElem">'; $tabsname=str_replace ("@", "", $picto);
$out.='<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">';
$out.='<a href="" data-role="button" style="background-color: #f0f0f0;" class="tab inline-block">'.$langs->trans("More").'...</a>'; $out.='<a href="" data-role="button" style="background-color: #f0f0f0;" class="tab inline-block">'.$langs->trans("More").'...</a>';
$out.='<div id="moretabsList" style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div>'; $out.='<div id="moretabsList'.$tabsname.'" style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div>';
$out.="</div>\n"; $out.="</div>\n";
$out.="<script>"; $out.="<script>";
$out.="$('#moretabs').mouseenter( function() { $('#moretabsList').css('left','auto');});"; $out.="$('#moretabs".$tabsname.").mouseenter( function() { $('#moretabsList".$tabsname.").css('left','auto');});";
$out.="$('#moretabs').mouseleave( function() { $('#moretabsList').css('left','-999em');});"; $out.="$('#moretabs".$tabsname.").mouseleave( function() { $('#moretabsList".$tabsname.").css('left','-999em');});";
$out.="</script>"; $out.="</script>";
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -644,4 +644,5 @@ ALTER TABLE llx_actioncomm ADD COLUMN recurdateend datetime;
ALTER TABLE llx_stcomm ADD COLUMN picto varchar(128); ALTER TABLE llx_stcomm ADD COLUMN picto varchar(128);
-- New trigger for Supplier invoice unvalidation
INSERT INTO llx_c_action_trigger (code, label, description, elementtype, rang) VALUES ('BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15);

View File

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

View File

@ -698,7 +698,7 @@ else
if ($action == 'edit' && $userWrite > 0) if ($action == 'edit' && $userWrite > 0)
{ {
print '<div align="center">'; print '<div align="center">';
print '<input name="update" class="button" type="submit" value="'.$langs->trans("Modify").'"> &nbsp; &nbsp; '; print '<input name="update" class="button" type="submit" value="'.$langs->trans("Modify").'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
} }