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

This commit is contained in:
Laurent Destailleur 2012-03-17 21:32:32 +01:00
commit e5190a00c8
24 changed files with 580 additions and 1031 deletions

View File

@ -2,7 +2,7 @@
<project name="dolibarr" default="hudson" basedir=".">
<!-- Exclude/ignore paths -->
<property name="ignorepaths" value="${basedir}/htdocs/core/filemanagerdol,${basedir}/htdocs/includes" />
<property name="ignorepaths" value="${basedir}/htdocs/conf,${basedir}/htdocs/core/filemanagerdol,${basedir}/htdocs/includes" />
<property name="ignoreregexp" value="**/PEAR/*,**/NET/*,**/HTTP/*" />
<target name="clean">
@ -43,6 +43,7 @@
<target name="phpcpd">
<exec executable="phpcpd">
<arg line=" --log-pmd '${basedir}/hudson/logs/pmd-cpd.xml'
--exclude '${basedir}/htdocs/conf'
--exclude '${basedir}/htdocs/core/filemanagerdol'
--exclude '${basedir}/htdocs/includes'
--exclude '**/PEAR/*,**/NET/*,**/HTTP/*'
@ -57,6 +58,7 @@
<target name="phploc">
<exec executable="phploc">
<arg line=" --log-csv '${basedir}/hudson/logs/phploc.csv'
--exclude '${basedir}/htdocs/conf'
--exclude '${basedir}/htdocs/core/filemanagerdol'
--exclude '${basedir}/htdocs/includes'
--exclude '**/PEAR/*,**/NET/*,**/HTTP/*'

View File

@ -199,12 +199,10 @@ if ($id > 0 || ! empty($ref))
print "</table>";
print '</div>';
/*
* Lignes de contacts
*/
print '<br>';
// Contacts lines
include(DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php');
}

View File

@ -143,21 +143,12 @@ if ($id > 0 || ! empty($ref))
print '</td>';
print '</tr>';
print "</table>";
print '<br>';
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
print "</table>";
print '</div>';
/*
* Actions
*/
print '<div class="tabsAction">';
if ($user->rights->propale->creer && $action <> 'edit')
{
print '<a class="butAction" href="note.php?id='.$object->id.'&amp;action=edit">'.$langs->trans('Modify').'</a>';
}
print '</div>';
}
}

View File

@ -90,7 +90,7 @@ else if ($action == 'swapstatut' && $user->rights->commande->creer)
}
// Efface un contact
else if ($action == 'deleteline' && $user->rights->commande->creer)
else if ($action == 'deletecontact' && $user->rights->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]);
@ -199,187 +199,11 @@ if ($id > 0 || ! empty($ref))
print '</div>';
/*
* Lignes de contacts
*/
echo '<br><table class="noborder" width="100%">';
print '<br>';
// Contacts lines
include(DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php');
/*
* Ajouter une ligne de contact
* Non affiche en mode modification de ligne
*/
if ($action != 'editline' && $user->rights->commande->creer)
{
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>';
print '<td>'.$langs->trans("Company").'</td>';
print '<td>'.$langs->trans("Contacts").'</td>';
print '<td>'.$langs->trans("ContactType").'</td>';
print '<td>&nbsp;</td>';
print '<td colspan="2">&nbsp;</td>';
print "</tr>\n";
$var = false;
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="internal">';
print '<input type="hidden" name="id" value="'.$id.'">';
// Ligne ajout pour contact interne
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">';
print img_object('','user').' '.$langs->trans("Users");
print '</td>';
print '<td colspan="1">';
print $conf->global->MAIN_INFO_SOCIETE_NOM;
print '</td>';
print '<td colspan="1">';
//$userAlreadySelected = $object->getListContactId('internal'); // On ne doit pas desactiver un contact deja selectionne car on doit pouvoir le selectionner une deuxieme fois pour un autre type
$form->select_users($user->id,'contactid',0,$userAlreadySelected);
print '</td>';
print '<td>';
$formcompany->selectTypeContact($object, '', 'type','internal');
print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
print '</form>';
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="external">';
print '<input type="hidden" name="id" value="'.$id.'">';
// Ligne ajout pour contact externe
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">';
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
print '</td>';
print '<td colspan="1">';
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->client->id;
$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany');
print '</td>';
print '<td colspan="1">';
$nbofcontacts=$form->select_contacts($selectedCompany, '', 'contactid');
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
print '</td>';
print '<td>';
$formcompany->selectTypeContact($object, '', 'type','external');
print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"';
if (! $nbofcontacts) print ' disabled="disabled"';
print '></td>';
print '</tr>';
print "</form>";
print '<tr><td colspan="7">&nbsp;</td></tr>';
}
// List of linked contacts
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>';
print '<td>'.$langs->trans("Company").'</td>';
print '<td>'.$langs->trans("Contacts").'</td>';
print '<td>'.$langs->trans("ContactType").'</td>';
print '<td align="center">'.$langs->trans("Status").'</td>';
print '<td colspan="2">&nbsp;</td>';
print "</tr>\n";
$companystatic=new Societe($db);
$var = true;
foreach(array('internal','external') as $source)
{
$tab = $object->liste_contact(-1,$source);
$num=count($tab);
$i = 0;
while ($i < $num)
{
$var = !$var;
print '<tr '.$bc[$var].' valign="top">';
// Source
print '<td align="left">';
if ($tab[$i]['source']=='internal') print $langs->trans("User");
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
print '</td>';
// Societe
print '<td align="left">';
if ($tab[$i]['socid'] > 0)
{
$companystatic->fetch($tab[$i]['socid']);
print $companystatic->getNomUrl(1);
}
if ($tab[$i]['socid'] < 0)
{
print $conf->global->MAIN_INFO_SOCIETE_NOM;
}
if (! $tab[$i]['socid'])
{
print '&nbsp;';
}
print '</td>';
// Contact
print '<td>';
if ($tab[$i]['source']=='internal')
{
$userstatic->id=$tab[$i]['id'];
$userstatic->lastname=$tab[$i]['lastname'];
$userstatic->firstname=$tab[$i]['firstname'];
print $userstatic->getNomUrl(1);
}
if ($tab[$i]['source']=='external')
{
$contactstatic->id=$tab[$i]['id'];
$contactstatic->lastname=$tab[$i]['lastname'];
$contactstatic->firstname=$tab[$i]['firstname'];
print $contactstatic->getNomUrl(1);
}
print '</td>';
// Type de contact
print '<td>'.$tab[$i]['libelle'].'</td>';
// Statut
print '<td align="center">';
// Activation desativation du contact
if ($object->statut >= 0) print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
print $contactstatic->LibStatut($tab[$i]['status'],3);
if ($object->statut >= 0) print '</a>';
print '</td>';
// Icon update et delete
print '<td align="center" nowrap="nowrap" colspan="2">';
if ($object->statut < 5 && $user->rights->commande->creer)
{
print '&nbsp;';
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=deleteline&amp;lineid='.$tab[$i]['rowid'].'">';
print img_delete();
print '</a>';
}
print '</td>';
print "</tr>\n";
$i ++;
}
}
print "</table>";
}
else
{

View File

@ -1191,6 +1191,66 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
}
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
if ($action == 'addcontact' && $user->rights->commande->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$result = $object->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->commande->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
}
}
/*
* View
@ -1951,9 +2011,21 @@ else
print '</table><br>';
print "\n";
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
/*

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -27,25 +27,24 @@ require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php');
require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php");
$socid=isset($_GET["socid"])?$_GET["socid"]:isset($_POST["socid"])?$_POST["socid"]:"";
if (!$user->rights->commande->lire) accessforbidden();
$langs->load("companies");
$langs->load("bills");
$langs->load("orders");
$id = GETPOST('id','int');
$ref=GETPOST('ref','alpha');
$socid=GETPOST('socid','int');
$action=GETPOST('action','alpha');
// Security check
$socid=0;
$comid = isset($_GET["id"])?$_GET["id"]:'';
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'commande',$comid,'');
$result=restrictedArea($user,'commande',$id,'');
$id = $_GET['id'];
$ref= $_GET['ref'];
$commande = new Commande($db);
if (! $commande->fetch($_GET['id'],$_GET['ref']) > 0)
$object = new Commande($db);
if (! $object->fetch($id, $ref) > 0)
{
dol_print_error($db);
}
@ -55,25 +54,19 @@ if (! $commande->fetch($_GET['id'],$_GET['ref']) > 0)
* Actions
*/
if ($_POST["action"] == 'update' && $user->rights->commande->creer)
if ($action == 'setnote_public' && $user->rights->commande->creer)
{
$db->begin();
$resPrivateNote=$commande->update_note($_POST["note"]);
$resPublicNote=$commande->update_note_public($_POST["note_public"]);
if ($resPrivateNote < 0 || $resPublicNote < 0)
{
$mesg='<div class="error">'.$commande->error.'</div>';
$db->rollback();
}
else
{
$db->commit();
}
$object->fetch($id);
$result=$object->update_note_public(GETPOST('note_public','alpha'));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note(GETPOST('note','alpha'));
if ($result < 0) dol_print_error($db,$object->error);
}
/*
* View
@ -86,17 +79,17 @@ $form = new Form($db);
if ($id > 0 || ! empty($ref))
{
$soc = new Societe($db);
$soc->fetch($commande->socid);
$soc->fetch($object->socid);
$head = commande_prepare_head($commande);
$head = commande_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), 0, 'order');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($commande,'ref','',1,'ref','ref');
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object,'ref','',1,'ref','ref');
print "</td></tr>";
// Ref commande client
@ -106,72 +99,24 @@ if ($id > 0 || ! empty($ref))
print '</td>';
print '</tr></table>';
print '</td><td colspan="3">';
print $commande->ref_client;
print $object->ref_client;
print '</td>';
print '</tr>';
// Customer
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$soc->getNomUrl(1).'</td></tr>';
// Note publique
print '<tr><td valign="top">'.$langs->trans("NotePublic").' :</td>';
print '<td valign="top" colspan="3">';
if ($_GET["action"] == 'edit')
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<textarea name="note_public" cols="80" rows="'.ROWS_4.'">'.$commande->note_public."</textarea><br>";
}
else
{
print ($commande->note_public?nl2br($commande->note_public):"&nbsp;");
}
print "</td></tr>";
// Note private
if (! $user->societe_id)
{
print '<tr><td valign="top">'.$langs->trans("NotePrivate").' :</td>';
print '<td valign="top" colspan="3">';
if ($_GET["action"] == 'edit')
{
print '<textarea name="note" cols="80" rows="'.ROWS_8.'">'.$commande->note."</textarea><br>";
}
else
{
print ($commande->note?nl2br($commande->note):"&nbsp;");
}
print "</td></tr>";
}
print "</table>";
if ($_GET["action"] == 'edit')
{
print '<br><center>';
print ' <input type="submit" class="button" value="'.$langs->trans('Save').'">';
print '</center>';
print '</form>';
}
print '<br>';
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
print '</div>';
/*
* Actions
*/
print '<div class="tabsAction">';
if ($user->rights->commande->creer && $_GET["action"] <> 'edit')
{
print "<a class=\"butAction\" href=\"note.php?id=".$commande->id."&amp;action=edit\">".$langs->trans('Modify')."</a>";
}
print "</div>";
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -498,7 +498,9 @@ else if ($id)
print "</table><br>";
// Notes
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
print '</div>';

View File

@ -1506,6 +1506,65 @@ else if ($action == 'builddoc') // En get ou en post
}
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
if ($action == 'addcontact' && $user->rights->facture->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$result = $object->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->facture->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->facture->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
}
}
/*
@ -2738,9 +2797,22 @@ else
print '</table><br>';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
/*
@ -3392,7 +3464,7 @@ else
}
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -136,7 +136,8 @@ class Facture extends CommonObject
// Clean parameters
if (empty($this->type)) $this->type = 0;
$this->ref_client=trim($this->ref_client);
$this->note=trim($this->note);
$this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated
$this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note));
$this->note_public=trim($this->note_public);
if (! $this->cond_reglement_id) $this->cond_reglement_id = 0;
if (! $this->mode_reglement_id) $this->mode_reglement_id = 0;
@ -219,7 +220,7 @@ class Facture extends CommonObject
$sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL');
$sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL');
$sql.= ", '".$this->db->idate($this->date)."'";
$sql.= ",".($this->note?"'".$this->db->escape($this->note)."'":"null");
$sql.= ",".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ",".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ",".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null");
$sql.= ",".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null");
@ -820,8 +821,8 @@ class Facture extends CommonObject
$this->cond_reglement_doc = $obj->cond_reglement_libelle_doc;
$this->fk_project = $obj->fk_projet;
$this->fk_facture_source = $obj->fk_facture_source;
$this->note = $obj->note_private;
$this->note_private = $obj->note_private; // deprecated
$this->note = $obj->note_private; // deprecated
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->user_author = $obj->fk_user_author;
$this->user_valid = $obj->fk_user_valid;
@ -964,7 +965,8 @@ class Facture extends CommonObject
if (isset($this->increment)) $this->increment=trim($this->increment);
if (isset($this->close_code)) $this->close_code=trim($this->close_code);
if (isset($this->close_note)) $this->close_note=trim($this->close_note);
if (isset($this->note)) $this->note=trim($this->note);
if (isset($this->note) || isset($this->note_private)) $this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated
if (isset($this->note) || isset($this->note_private)) $this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note));
if (isset($this->note_public)) $this->note_public=trim($this->note_public);
if (isset($this->modelpdf)) $this->modelpdf=trim($this->modelpdf);
if (isset($this->import_key)) $this->import_key=trim($this->import_key);
@ -1002,7 +1004,7 @@ class Facture extends CommonObject
$sql.= " fk_cond_reglement=".(isset($this->cond_reglement_id)?$this->cond_reglement_id:"null").",";
$sql.= " fk_mode_reglement=".(isset($this->mode_reglement_id)?$this->mode_reglement_id:"null").",";
$sql.= " date_lim_reglement=".(strval($this->date_lim_reglement)!='' ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'null').",";
$sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").",";
$sql.= " note=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").",";
$sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").",";
$sql.= " model_pdf=".(isset($this->modelpdf)?"'".$this->db->escape($this->modelpdf)."'":"null").",";
$sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null")."";
@ -3077,6 +3079,7 @@ class Facture extends CommonObject
$this->mode_reglement_id = 7;
$this->mode_reglement_code = 'CHQ';
$this->note_public='This is a comment (public)';
$this->note_private='This is a comment (private)';
$this->note='This is a comment (private)';
if (empty($option) || $option != 'nolines')

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -32,56 +33,56 @@ require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$langs->load("bills");
$langs->load("companies");
$facid = GETPOST('facid');
$id = GETPOST('facid');
$ref= GETPOST('ref');
$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
$ref = GETPOST('ref');
$socid=GETPOST('socid','int');
$action=GETPOST('action','alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'facture', $facid);
$result = restrictedArea($user, 'facture', $id);
$object = new Facture($db);
/*
* Ajout d'un nouveau contact
*/
if ($_POST["action"] == 'addcontact' && $user->rights->facture->creer)
if ($action == 'addcontact' && $user->rights->facture->creer)
{
$result = 0;
$facture = new Facture($db);
$result = $facture->fetch($facid);
$result = $object->fetch($id);
if ($result > 0 && $facid > 0)
if ($result > 0 && $id > 0)
{
$result = $facture->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
$result = $object->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: contact.php?facid=".$facture->id);
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($facture->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$facture->error.'</div>';
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
if ($_GET["action"] == 'swapstatut' && $user->rights->facture->creer)
else if ($action == 'swapstatut' && $user->rights->facture->creer)
{
$facture = new Facture($db);
if ($facture->fetch($facid))
if ($object->fetch($id))
{
$result=$facture->swapContactStatus(GETPOST('ligne'));
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
@ -90,15 +91,14 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->facture->creer)
}
// Efface un contact
if ($_GET["action"] == 'deleteline' && $user->rights->facture->creer)
else if ($action == 'deletecontact' && $user->rights->facture->creer)
{
$facture = new Facture($db);
$facture->fetch($facid);
$result = $facture->delete_contact($_GET["lineid"]);
$object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]);
if ($result >= 0)
{
Header("Location: contact.php?facid=".$facture->id);
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
@ -128,12 +128,11 @@ dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{
$facture = new Facture($db);
if ($facture->fetch($id, $ref) > 0)
if ($object->fetch($id, $ref) > 0)
{
$facture->fetch_thirdparty();
$object->fetch_thirdparty();
$head = facture_prepare_head($facture);
$head = facture_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'), 0, 'bill');
@ -147,7 +146,7 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="3">';
$morehtmlref='';
$discount=new DiscountAbsolute($db);
$result=$discount->fetch(0,$facture->id);
$result=$discount->fetch(0,$object->id);
if ($result > 0)
{
$morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')';
@ -156,198 +155,20 @@ if ($id > 0 || ! empty($ref))
{
dol_print_error('',$discount->error);
}
print $form->showrefnav($facture,'ref','',1,'facnumber','ref',$morehtmlref);
print $form->showrefnav($object,'ref','',1,'facnumber','ref',$morehtmlref);
print '</td></tr>';
// Customer
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$facture->client->getNomUrl(1,'compta').'</td></tr>';
print '<td colspan="3">'.$object->client->getNomUrl(1,'compta').'</td></tr>';
print "</table>";
print '</div>';
/*
* Lignes de contacts
*/
echo '<br><table class="noborder" width="100%">';
/*
* Ajouter une ligne de contact
* Non affiche en mode modification de ligne
*/
if ($_GET["action"] != 'editline' && $user->rights->facture->creer)
{
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>';
print '<td>'.$langs->trans("Company").'</td>';
print '<td>'.$langs->trans("Contacts").'</td>';
print '<td>'.$langs->trans("ContactType").'</td>';
print '<td colspan="3">&nbsp;</td>';
print "</tr>\n";
$var = false;
print '<form action="contact.php?facid='.$id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="internal">';
print '<input type="hidden" name="id" value="'.$id.'">';
// Line to add an internal contact
print "<tr ".$bc[$var].">";
print '<td nowrap="nowrap">';
print img_object('','user').' '.$langs->trans("Users");
print '</td>';
print '<td colspan="1">';
print $mysoc->name;
print '</td>';
print '<td colspan="1">';
// Ge get ids of alreadey selected users
//$userAlreadySelected = $facture->getListContactId('internal'); // On ne doit pas desactiver un contact deja selectionner car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
$form->select_users($user->id,'contactid',0,$userAlreadySelected);
print '</td>';
print '<td>';
$formcompany->selectTypeContact($facture, '', 'type','internal');
print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
print '</form>';
print '<form action="contact.php?facid='.$id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="external">';
print '<input type="hidden" name="id" value="'.$id.'">';
// Line to add an external contact
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td nowrap="nowrap">';
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
print '</td>';
print '<td nowrap="nowrap">';
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$facture->client->id;
$selectedCompany = $formcompany->selectCompaniesForNewContact($facture, 'facid', $selectedCompany, $htmlname = 'newcompany');
print '</td>';
print '<td>';
$nbofcontacts=$form->select_contacts($selectedCompany, '', 'contactid');
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
print '</td>';
print '<td>';
$formcompany->selectTypeContact($facture, '', 'type','external');
print '</td>';
print '<td align="right" colspan="3"><input type="submit" class="button" value="'.$langs->trans("Add").'"';
if (! $nbofcontacts) print ' disabled="disabled"';
print '></td>';
print '</tr>';
print "</form>";
print '<tr><td colspan="6">&nbsp;</td></tr>';
}
// List of linked contacts
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>';
print '<td>'.$langs->trans("Company").'</td>';
print '<td>'.$langs->trans("Contacts").'</td>';
print '<td>'.$langs->trans("ContactType").'</td>';
print '<td align="center">'.$langs->trans("Status").'</td>';
print '<td colspan="2">&nbsp;</td>';
print "</tr>\n";
$companystatic = new Societe($db);
$var = true;
foreach(array('internal','external') as $source)
{
$tab = $facture->liste_contact(-1,$source);
$num=count($tab);
$i = 0;
while ($i < $num)
{
$var = !$var;
print '<tr '.$bc[$var].' valign="top">';
// Source
print '<td align="left">';
if ($tab[$i]['source']=='internal') print $langs->trans("User");
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
print '</td>';
// Third party
print '<td align="left">';
if ($tab[$i]['socid'] > 0)
{
$companystatic->fetch($tab[$i]['socid']);
print $companystatic->getNomUrl(1);
}
if ($tab[$i]['socid'] < 0)
{
print $mysoc->name;
}
if (! $tab[$i]['socid'])
{
print '&nbsp;';
}
print '</td>';
// Contact
print '<td>';
if ($tab[$i]['source']=='internal')
{
$userstatic->id=$tab[$i]['id'];
$userstatic->lastname=$tab[$i]['lastname'];
$userstatic->firstname=$tab[$i]['firstname'];
print $userstatic->getNomUrl(1);
}
if ($tab[$i]['source']=='external')
{
$contactstatic->id=$tab[$i]['id'];
$contactstatic->lastname=$tab[$i]['lastname'];
$contactstatic->firstname=$tab[$i]['firstname'];
print $contactstatic->getNomUrl(1);
}
print '</td>';
// Type of contact
print '<td>'.$tab[$i]['libelle'].'</td>';
// Status
print '<td align="center">';
// Activate/Unactivate contact
if ($facture->statut >= 0) print '<a href="contact.php?facid='.$facture->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
print $contactstatic->LibStatut($tab[$i]['status'],3);
if ($facture->statut >= 0) print '</a>';
print '</td>';
// Icon update et delete
print '<td align="center" nowrap>';
if ($user->rights->facture->creer)
{
print '&nbsp;';
print '<a href="contact.php?facid='.$facture->id.'&amp;action=deleteline&amp;lineid='.$tab[$i]['rowid'].'">';
print img_delete();
print '</a>';
}
print '</td>';
print "</tr>\n";
$i ++;
}
}
print "</table>";
print '<br>';
// Contacts lines
include(DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php');
}
else
{
@ -356,7 +177,7 @@ if ($id > 0 || ! empty($ref))
}
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -27,64 +28,42 @@ require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT.'/core/class/discount.class.php');
require_once(DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php');
$socid=isset($_GET["socid"])?$_GET["socid"]:isset($_POST["socid"])?$_POST["socid"]:"";
if (!$user->rights->facture->lire)
accessforbidden();
$langs->load("companies");
$langs->load("bills");
$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
$ref=GETPOST('ref','alpha');
$socid=GETPOST('socid','int');
$action=GETPOST('action','alpha');
// Security check
if ($user->societe_id > 0)
{
unset($_GET["action"]);
$socid = $user->societe_id;
}
$socid=0;
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'facture',$id,'');
$fac = new Facture($db);
$fac->fetch($_GET["facid"]);
$object = new Facture($db);
$object->fetch($id);
/******************************************************************************/
/* Actions */
/******************************************************************************/
if ($_POST["action"] == 'update_public' && $user->rights->facture->creer)
if ($action == 'setnote_public' && $user->rights->facture->creer)
{
$db->begin();
$res=$fac->update_note_public($_POST["note_public"],$user);
if ($res < 0)
{
$mesg='<div class="error">'.$fac->error.'</div>';
$db->rollback();
}
else
{
$db->commit();
}
$object->fetch($id);
$result=$object->update_note_public(GETPOST('note_public','alpha'));
if ($result < 0) dol_print_error($db,$object->error);
}
if ($_POST["action"] == 'update' && $user->rights->facture->creer)
else if ($action == 'setnote' && $user->rights->facture->creer)
{
$db->begin();
$res=$fac->update_note($_POST["note"],$user);
if ($res < 0)
{
$mesg='<div class="error">'.$fac->error.'</div>';
$db->rollback();
}
else
{
$db->commit();
}
$object->fetch($id);
$result=$object->update_note(GETPOST('note','alpha'));
if ($result < 0) dol_print_error($db,$object->error);
}
/******************************************************************************/
/* Affichage fiche */
/******************************************************************************/
@ -93,28 +72,26 @@ llxHeader();
$form = new Form($db);
$id = $_GET['facid'];
$ref= $_GET['ref'];
if ($id > 0 || ! empty($ref))
{
$fac = new Facture($db);
$fac->fetch($id,$ref);
$object = new Facture($db);
$object->fetch($id,$ref);
$soc = new Societe($db);
$soc->fetch($fac->socid);
$soc->fetch($object->socid);
$head = facture_prepare_head($fac);
$head = facture_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), 0, 'bill');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
print '<td colspan="3">';
$morehtmlref='';
$discount=new DiscountAbsolute($db);
$result=$discount->fetch(0,$fac->id);
$result=$discount->fetch(0,$object->id);
if ($result > 0)
{
$morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')';
@ -123,72 +100,24 @@ if ($id > 0 || ! empty($ref))
{
dol_print_error('',$discount->error);
}
print $form->showrefnav($fac,'ref','',1,'facnumber','ref',$morehtmlref);
print $form->showrefnav($object,'ref','',1,'facnumber','ref',$morehtmlref);
print '</td></tr>';
// Company
print '<tr><td>'.$langs->trans("Company").'</td>';
print '<td colspan="3">'.$soc->getNomUrl(1,'compta').'</td>';
// Note publique
print '<tr><td valign="top">'.$langs->trans("NotePublic").' :</td>';
print '<td valign="top" colspan="3">';
if ($_GET["action"] == 'edit')
{
print '<form method="post" action="note.php?facid='.$fac->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update_public">';
print '<textarea name="note_public" cols="80" rows="8">'.$fac->note_public."</textarea><br>";
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '</form>';
}
else
{
print ($fac->note_public?nl2br($fac->note_public):"&nbsp;");
}
print "</td></tr>";
// Note priv<69>e
if (! $user->societe_id)
{
print '<tr><td valign="top">'.$langs->trans("NotePrivate").' :</td>';
print '<td valign="top" colspan="3">';
if ($_GET["action"] == 'edit')
{
print '<form method="post" action="note.php?facid='.$fac->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<textarea name="note" cols="80" rows="8">'.$fac->note."</textarea><br>";
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '</form>';
}
else
{
print ($fac->note?nl2br($fac->note):"&nbsp;");
}
print "</td></tr>";
}
print "</table>";
print '<br>';
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
/*
* Actions
*/
print '</div>';
print '<div class="tabsAction">';
if ($user->rights->facture->creer && $_GET["action"] <> 'edit')
{
print "<a class=\"butAction\" href=\"note.php?facid=$fac->id&amp;action=edit\">".$langs->trans('Modify')."</a>";
}
print "</div>";
print '</div>';
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -1,74 +1,74 @@
<?php
/* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file /htdocs/core/ajax/extraparams.php
* \brief File to return Ajax response on set extra parameters of elements
*/
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
include("../../main.inc.php");
$id = GETPOST('id','int');
$element = GETPOST('element','alpha');
$htmlelement = GETPOST('htmlelement','alpha');
$type = GETPOST('type', 'alpha');
/*
* View
*/
top_httphead();
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
if(! empty($id) && ! empty($element) && ! empty($htmlelement) && ! empty($type))
{
$value = GETPOST('value','alpha');
$params=array();
dol_syslog("AjaxSetExtraParameters id=".$id." element=".$element." htmlelement=".$htmlelement." type=".$type." value=".$value, LOG_DEBUG);
$classpath = $subelement = $element;
// For compatibility
if ($element == 'order' || $element == 'commande') { $classpath = $subelement = 'commande'; }
else if ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; }
else if ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; }
else if ($element == 'contract') { $classpath = $subelement = 'contrat'; }
else if ($element == 'shipping') { $classpath = $subelement = 'expedition'; }
else if ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; }
dol_include_once('/'.$classpath.'/class/'.$subelement.'.class.php');
$classname = ucfirst($subelement);
$object = new $classname($db);
$object->fetch($id);
$params[$htmlelement] = array($type => $value);
$object->extraparams = array_merge($object->extraparams, $params);
$result=$object->setExtraParameters();
}
?>
<?php
/* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file /htdocs/core/ajax/extraparams.php
* \brief File to return Ajax response on set extra parameters of elements
*/
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
include("../../main.inc.php");
$id = GETPOST('id','int');
$element = GETPOST('element','alpha');
$htmlelement = GETPOST('htmlelement','alpha');
$type = GETPOST('type', 'alpha');
/*
* View
*/
top_httphead();
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
if(! empty($id) && ! empty($element) && ! empty($htmlelement) && ! empty($type))
{
$value = GETPOST('value','alpha');
$params=array();
dol_syslog("AjaxSetExtraParameters id=".$id." element=".$element." htmlelement=".$htmlelement." type=".$type." value=".$value, LOG_DEBUG);
$classpath = $subelement = $element;
// For compatibility
if ($element == 'order' || $element == 'commande') { $classpath = $subelement = 'commande'; }
else if ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; }
else if ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; }
else if ($element == 'contract') { $classpath = $subelement = 'contrat'; }
else if ($element == 'shipping') { $classpath = $subelement = 'expedition'; }
else if ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; }
dol_include_once('/'.$classpath.'/class/'.$subelement.'.class.php');
$classname = ucfirst($subelement);
$object = new $classname($db);
$object->fetch($id);
$params[$htmlelement] = array($type => $value);
$object->extraparams = array_merge($object->extraparams, $params);
$result=$object->setExtraParameters();
}
?>

View File

@ -545,7 +545,7 @@ class FormCompany
}
// We call a page after a small delay when a new input has been selected
$javaScript = "window.location=\'./contact.php?".$var_id."=".($forceid>0?$forceid:$object->id)."&amp;".$htmlname."=\' + document.getElementById(\'".$htmlname."\').value;";
$javaScript = "window.location=\'".$_SERVER['PHP_SELF']."?".$var_id."=".($forceid>0?$forceid:$object->id)."&amp;".$htmlname."=\' + document.getElementById(\'".$htmlname."\').value;";
$htmloption = 'onChange="ac_delay(\''.$javaScript.'\',\'500\');"'; // When we select with mouse
$htmloption.= 'onKeyUp="if (event.keyCode== 13) { ac_delay(\''.$javaScript.'\',\'500\'); }"'; // When we select with keyboard
@ -571,7 +571,7 @@ class FormCompany
}
else
{
$javaScript = "window.location='./contact.php?".$var_id."=".($forceid>0?$forceid:$object->id)."&amp;".$htmlname."=' + form.".$htmlname.".options[form.".$htmlname.".selectedIndex].value;";
$javaScript = "window.location='".$_SERVER['PHP_SELF']."?".$var_id."=".($forceid>0?$forceid:$object->id)."&amp;".$htmlname."=' + form.".$htmlname.".options[form.".$htmlname.".selectedIndex].value;";
print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" onChange="'.$javaScript.'">';
$num = $this->db->num_rows($resql);
$i = 0;

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -41,11 +42,14 @@ function fichinter_prepare_head($object)
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('InterventionContact');
$head[$h][2] = 'contact';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('InterventionContact');
$head[$h][2] = 'contact';
$h++;
}
if (! empty($conf->global->MAIN_USE_PREVIEW_TABS))
{

View File

@ -39,11 +39,14 @@ function facture_prepare_head($object)
$head[$h][1] = $langs->trans('CardBill');
$head[$h][2] = 'compta';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact';
$h++;
}
if (! empty($conf->global->MAIN_USE_PREVIEW_TABS))
{

View File

@ -67,11 +67,14 @@ function commande_prepare_head($object)
$head[$h][2] = 'preview';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact';
$h++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line

View File

@ -25,18 +25,16 @@ else if ($module == 'fichinter') { $module = 'ficheinter'; $note_private = 'note
?>
<!-- BEGIN PHP TEMPLATE NOTES -->
<table class="border allwidth">
<tr>
<td width="25%" valign="top"><?php echo $form->editfieldkey("NotePublic",$note_public,$object->note_public,$object,$user->rights->$module->creer,'textarea'); ?></td>
<td><?php echo $form->editfieldval("NotePublic",$note_public,$object->note_public,$object,$user->rights->$module->creer,'textarea'); ?></td>
</tr>
<?php if (! $user->societe_id) { ?>
<tr>
<td width="25%" valign="top"><?php echo $form->editfieldkey("NotePrivate",$note_private,$object->note_private,$object,$user->rights->$module->creer,'textarea'); ?></td>
<td><?php echo $form->editfieldval("NotePrivate",$note_private,$object->note_private,$object,$user->rights->$module->creer,'textarea'); ?></td>
</tr>
<?php } ?>
</table>
<div class="table-border">
<div class="table-border-row">
<div class="table-key-border-col"><?php echo $form->editfieldkey("NotePublic",$note_public,$object->note_public,$object,$user->rights->$module->creer,'textarea'); ?></div>
<div class="table-val-border-col"><?php echo $form->editfieldval("NotePublic",$note_public,$object->note_public,$object,$user->rights->$module->creer,'textarea'); ?></div>
</div>
<?php if (! $user->societe_id) { ?>
<div class="table-border-row">
<div class="table-key-border-col"><?php echo $form->editfieldkey("NotePrivate",$note_private,$object->note_private,$object,$user->rights->$module->creer,'textarea'); ?></div>
<div class="table-val-border-col"><?php echo $form->editfieldval("NotePrivate",$note_private,$object->note_private,$object,$user->rights->$module->creer,'textarea'); ?></div>
</div>
<?php } ?>
</div>
<!-- END PHP TEMPLATE NOTES-->

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
@ -33,12 +33,14 @@ $langs->load("interventions");
$langs->load("sendings");
$langs->load("companies");
$fichinterid = GETPOST('id','int');
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
$result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db);
/*
@ -47,42 +49,38 @@ $result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
if ($action == 'addcontact' && $user->rights->ficheinter->creer)
{
$result = $object->fetch($id);
$result = 0;
$fichinter = new Fichinter($db);
$result = $fichinter->fetch($fichinterid);
if ($result > 0 && $fichinterid > 0)
if ($result > 0 && $id > 0)
{
$result = $fichinter->add_contact(GETPOST('contactid','int'), GETPOST('type','int'), GETPOST('source','alpha'));
$result = $object->add_contact(GETPOST('contactid','int'), GETPOST('type','int'), GETPOST('source','alpha'));
}
if ($result >= 0)
{
Header("Location: contact.php?id=".$fichinter->id);
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($fichinter->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$fichinter->error.'</div>';
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
if ($action == 'swapstatut' && $user->rights->ficheinter->creer)
else if ($action == 'swapstatut' && $user->rights->ficheinter->creer)
{
$fichinter = new Fichinter($db);
if ($fichinter->fetch($fichinterid))
if ($object->fetch($id))
{
$result=$fichinter->swapContactStatus(GETPOST('ligne','int'));
$result=$object->swapContactStatus(GETPOST('ligne','int'));
}
else
{
@ -91,15 +89,14 @@ if ($action == 'swapstatut' && $user->rights->ficheinter->creer)
}
// Efface un contact
if ($action == 'deleteline' && $user->rights->ficheinter->creer)
else if ($action == 'deletecontact' && $user->rights->ficheinter->creer)
{
$fichinter = new Fichinter($db);
$fichinter->fetch($fichinterid);
$result = $fichinter->delete_contact(GETPOST('lineid','int'));
$object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid','int'));
if ($result >= 0)
{
Header("Location: contact.php?id=".$fichinter->id);
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
@ -128,16 +125,15 @@ $userstatic=new User($db);
dol_htmloutput_mesg($mesg);
if ($fichinterid > 0)
if ($id > 0)
{
$fichinter = new Fichinter($db);
if ($fichinter->fetch($fichinterid) > 0)
if ($object->fetch($id) > 0)
{
$soc = new Societe($db);
$soc->fetch($fichinter->socid);
$soc->fetch($object->socid);
$head = fichinter_prepare_head($fichinter);
$head = fichinter_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("InterventionCard"), 0, 'intervention');
@ -148,199 +144,23 @@ if ($fichinterid > 0)
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $fichinter->ref;
print $object->ref;
print "</td></tr>";
// Customer
if ( is_null($fichinter->client) )
$fichinter->fetch_thirdparty();
if ( is_null($object->client) )
$object->fetch_thirdparty();
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$fichinter->client->getNomUrl(1).'</td></tr>';
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
print "</table>";
print '</div>';
/*
* Lignes de contacts
*/
echo '<br><table class="noborder" width="100%">';
/*
* Ajouter une ligne de contact
* Non affiche en mode modification de ligne
*/
if ($action != 'editline' && $user->rights->ficheinter->creer)
{
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>';
print '<td>'.$langs->trans("Company").'</td>';
print '<td>'.$langs->trans("Contacts").'</td>';
print '<td>'.$langs->trans("ContactType").'</td>';
print '<td colspan="3">&nbsp;</td>';
print "</tr>\n";
$var = false;
print '<form action="contact.php?id='.$fichinterid.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="internal">';
print '<input type="hidden" name="id" value="'.$fichinterid.'">';
// Ligne ajout pour contact interne
print "<tr $bc[$var]>";
print '<td nowrap="nowrap">';
print img_object('','user').' '.$langs->trans("Users");
print '</td>';
print '<td colspan="1">';
print $conf->global->MAIN_INFO_SOCIETE_NOM;
print '</td>';
print '<td colspan="1">';
//$userAlreadySelected = $fichinter->getListContactId('internal'); // On ne doit pas desactiver un contact deja selectionner car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
$form->select_users($user->id,'contactid',0,$userAlreadySelected);
print '</td>';
print '<td>';
$formcompany->selectTypeContact($fichinter, '', 'type','internal');
print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
print '</form>';
print '<form action="contact.php?id='.$fichinterid.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="external">';
print '<input type="hidden" name="id" value="'.$fichinterid.'">';
// Ligne ajout pour contact externe
$var=!$var;
print "<tr $bc[$var]>";
print '<td nowrap="nowrap">';
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
print '</td>';
print '<td colspan="1">';
$selectedCompany = GETPOST('newcompany','int')?GETPOST('newcompany','int'):$fichinter->client->id;
$selectedCompany = $formcompany->selectCompaniesForNewContact($fichinter, 'id', $selectedCompany, $htmlname = 'newcompany');
print '</td>';
print '<td colspan="1">';
$nbofcontacts=$form->select_contacts($selectedCompany, '', 'contactid');
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
print '</td>';
print '<td>';
$formcompany->selectTypeContact($fichinter, '', 'type','external');
print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"';
if (! $nbofcontacts) print ' disabled="disabled"';
print '></td>';
print '</tr>';
print "</form>";
print '<tr><td colspan="6">&nbsp;</td></tr>';
}
// Liste des contacts li<6C>s
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>';
print '<td>'.$langs->trans("Company").'</td>';
print '<td>'.$langs->trans("Contacts").'</td>';
print '<td>'.$langs->trans("ContactType").'</td>';
print '<td align="center">'.$langs->trans("Status").'</td>';
print '<td colspan="2">&nbsp;</td>';
print "</tr>\n";
$companystatic = new Societe($db);
$var = true;
foreach(array('internal','external') as $source)
{
$tab = $fichinter->liste_contact(-1,$source);
$num=count($tab);
$i = 0;
while ($i < $num)
{
$var = !$var;
print '<tr '.$bc[$var].' valign="top">';
// Source
print '<td align="left">';
if ($tab[$i]['source']=='internal') print $langs->trans("User");
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
print '</td>';
// Societe
print '<td align="left">';
if ($tab[$i]['socid'] > 0)
{
$companystatic->fetch($tab[$i]['socid']);
print $companystatic->getNomUrl(1);
}
if ($tab[$i]['socid'] < 0)
{
print $conf->global->MAIN_INFO_SOCIETE_NOM;
}
if (! $tab[$i]['socid'])
{
print '&nbsp;';
}
print '</td>';
// Contact
print '<td>';
if ($tab[$i]['source']=='internal')
{
$userstatic->id=$tab[$i]['id'];
$userstatic->lastname=$tab[$i]['lastname'];
$userstatic->firstname=$tab[$i]['firstname'];
print $userstatic->getNomUrl(1);
}
if ($tab[$i]['source']=='external')
{
$contactstatic->id=$tab[$i]['id'];
$contactstatic->lastname=$tab[$i]['lastname'];
$contactstatic->firstname=$tab[$i]['firstname'];
print $contactstatic->getNomUrl(1);
}
print '</td>';
// Type de contact
print '<td>'.$tab[$i]['libelle'].'</td>';
// Statut
print '<td align="center">';
// Activation desativation du contact
if ($fichinter->statut >= 0) print '<a href="contact.php?id='.$fichinter->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
print $contactstatic->LibStatut($tab[$i]['status'],3);
if ($fichinter->statut >= 0) print '</a>';
print '</td>';
// Icon update et delete
print '<td align="center" nowrap>';
if ($fichinter->statut < 5 && $user->rights->ficheinter->creer)
{
print '&nbsp;';
print '<a href="contact.php?id='.$fichinter->id.'&amp;action=deleteline&amp;lineid='.$tab[$i]['rowid'].'">';
print img_delete();
print '</a>';
}
print '</td>';
print "</tr>\n";
$i ++;
}
}
print "</table>";
print '<br>';
// Contacts lines
include(DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php');
}
else
{
@ -348,7 +168,7 @@ if ($fichinterid > 0)
}
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -621,6 +621,66 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA
$action='presend';
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
if ($action == 'addcontact' && $user->rights->ficheinter->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$result = $object->add_contact(GETPOST('contactid','int'), GETPOST('type','int'), GETPOST('source','alpha'));
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->ficheinter->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne','int'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid','int'));
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
}
}
/*
* View
@ -856,10 +916,23 @@ else if ($id > 0 || ! empty($ref))
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
print "</table><br>";
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
/*

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
*
* 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
@ -29,58 +29,35 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/fichinter.lib.php");
$langs->load('companies');
$langs->load("interventions");
$fichinterid = GETPOST('id','int');
$id = GETPOST('id','int');
$action=GETPOST('action','alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
$result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db);
/******************************************************************************/
/* Actions */
/******************************************************************************/
if ($action == 'update_public' && $user->rights->ficheinter->creer)
if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
{
$fichinter = new Fichinter($db);
$fichinter->fetch($fichinterid);
$db->begin();
$res=$fichinter->update_note_public(GETPOST('note_public','alpha'),$user);
if ($res < 0)
{
$mesg='<div class="error">'.$fichinter->error.'</div>';
$db->rollback();
}
else
{
$db->commit();
}
$object->fetch($id);
$result=$object->update_note_public(GETPOST('note_public','alpha'));
if ($result < 0) dol_print_error($db,$object->error);
}
if ($action == 'update' && $user->rights->ficheinter->creer)
else if ($action == 'setnote' && $user->rights->ficheinter->creer)
{
$fichinter = new Fichinter($db);
$fichinter->fetch($fichinterid);
$db->begin();
$res=$fichinter->update_note(GETPOST('note_private','alpha'),$user);
if ($res < 0)
{
$mesg='<div class="error">'.$fichinter->error.'</div>';
$db->rollback();
}
else
{
$db->commit();
}
$object->fetch($id);
$result=$object->update_note(GETPOST('note','alpha'));
if ($result < 0) dol_print_error($db,$object->error);
}
/******************************************************************************/
/* Affichage fiche */
/******************************************************************************/
@ -89,82 +66,36 @@ llxHeader();
$form = new Form($db);
if ($fichinterid)
if ($id > 0)
{
if ($mesg) print $mesg;
$fichinter = new Fichinter($db);
if ( $fichinter->fetch($fichinterid) )
if ($object->fetch($id))
{
$societe = new Societe($db);
if ( $societe->fetch($fichinter->socid) )
if ($societe->fetch($object->socid))
{
$head = fichinter_prepare_head($fichinter);
$head = fichinter_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans('InterventionCard'), 0, 'intervention');
print '<table class="border" width="100%">';
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'.$fichinter->ref.'</td></tr>';
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'.$object->ref.'</td></tr>';
// Soci<EFBFBD>t<EFBFBD>
// Company
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
// Note publique
print '<tr><td valign="top">'.$langs->trans("NotePublic").' :</td>';
print '<td valign="top" colspan="3">';
if ($action == 'edit')
{
print '<form method="post" action="note.php?id='.$fichinter->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update_public">';
print '<textarea name="note_public" cols="80" rows="8">'.$fichinter->note_public."</textarea><br>";
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '</form>';
}
else
{
print ($fichinter->note_public?nl2br($fichinter->note_public):"&nbsp;");
}
print "</td></tr>";
// Note priv<69>e
if (! $user->societe_id)
{
print '<tr><td valign="top">'.$langs->trans("NotePrivate").' :</td>';
print '<td valign="top" colspan="3">';
if ($action == 'edit')
{
print '<form method="post" action="note.php?id='.$fichinter->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<textarea name="note_private" cols="80" rows="8">'.$fichinter->note_private."</textarea><br>";
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '</form>';
}
else
{
print ($fichinter->note_private?nl2br($fichinter->note_private):"&nbsp;");
}
print "</td></tr>";
}
print "</table>";
print '</div>';
/*
* Actions
*/
print '<div class="tabsAction">';
if ($user->rights->ficheinter->creer && $action <> 'edit')
{
print '<a class="butAction" href="note.php?id='.$fichinter->id.'&amp;action=edit">'.$langs->trans('Modify').'</a>';
}
print '<br>';
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
print '</div>';
}
}
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -1219,7 +1219,7 @@ table.liste td {
padding-right: 2px;
}
tr.liste_titre
div.liste_titre, tr.liste_titre
{
height: 24px;
background: #7699A9;
@ -2000,6 +2000,34 @@ a.cke_dialog_ui_button
height: 72px !important;
}
/* ============================================================================== */
/* Table with div */
/* ============================================================================== */
div.table-border {
display:table;
width: 100%;
border-collapse: collapse;
border: 1px solid #9CACBB;
}
div.table-border-row {
display:table-row;
}
div.table-key-border-col {
display:table-cell;
width: 25%;
vertical-align:top;
padding: 1px 2px 1px 1px;
border: 1px solid #9CACBB;
border-collapse: collapse;
}
div.table-val-border-col {
display:table-cell;
width:auto;
padding: 1px 2px 1px 1px;
border: 1px solid #9CACBB;
border-collapse: collapse;
}
/* ============================================================================== */
/* Test using div instead of tables */

View File

@ -2318,6 +2318,34 @@ div.scroll2 {
width: 582px !important;
}
/* ============================================================================== */
/* Table with div */
/* ============================================================================== */
div.table-border {
display:table;
width: 100%;
border-collapse: collapse;
border: 1px solid #9CACBB;
}
div.table-border-row {
display:table-row;
}
div.table-key-border-col {
display:table-cell;
width: 25%;
vertical-align:top;
padding: 1px 2px 1px 1px;
border: 1px solid #9CACBB;
border-collapse: collapse;
}
div.table-val-border-col {
display:table-cell;
width:auto;
padding: 1px 2px 1px 1px;
border: 1px solid #9CACBB;
border-collapse: collapse;
}
<?php
if (is_object($db)) $db->close();

View File

@ -2,7 +2,7 @@
<project name="dolibarr" default="hudson" basedir=".">
<!-- Exclude/ignore paths -->
<property name="ignorepaths" value="${basedir}/htdocs/core/filemanagerdol,${basedir}/htdocs/includes" />
<property name="ignorepaths" value="${basedir}/htdocs/conf,${basedir}/htdocs/core/filemanagerdol,${basedir}/htdocs/includes" />
<property name="ignoreregexp" value="**/PEAR/*,**/NET/*,**/HTTP/*" />
<target name="clean">
@ -41,6 +41,7 @@
<target name="phpcpd">
<exec executable="phpcpd">
<arg line=" --log-pmd '${basedir}/hudson/logs/pmd-cpd.xml'
--exclude '${basedir}/htdocs/conf'
--exclude '${basedir}/htdocs/core/filemanagerdol'
--exclude '${basedir}/htdocs/includes'
--exclude '**/PEAR/*,**/NET/*,**/HTTP/*'
@ -55,6 +56,7 @@
<target name="phploc">
<exec executable="phploc">
<arg line=" --log-csv '${basedir}/hudson/logs/phploc.csv'
--exclude '${basedir}/htdocs/conf'
--exclude '${basedir}/htdocs/core/filemanagerdol'
--exclude '${basedir}/htdocs/includes'
--exclude '**/PEAR/*,**/NET/*,**/HTTP/*'

View File

@ -280,7 +280,7 @@ class FactureTest extends PHPUnit_Framework_TestCase
*/
public function changeProperties(&$localobject)
{
$localobject->note='New note';
$localobject->note_private='New note';
//$localobject->note='New note after update';
}