diff --git a/htdocs/adherents/index.php3 b/htdocs/adherents/index.php3 new file mode 100644 index 00000000000..6b4e29813a3 --- /dev/null +++ b/htdocs/adherents/index.php3 @@ -0,0 +1,70 @@ + + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ +require("./pre.inc.php3"); +require("../contact.class.php3"); + + +llxHeader(); +$db = new Db(); +if ($sortorder == "") +{ + $sortorder="ASC"; +} +if ($sortfield == "") +{ + $sortfield="nom"; +} + +print_titre("Liste des adherents"); + + +$ds=ldap_connect("localhost"); + +if ($ds) +{ + print "Connected"; + // bind with appropriate dn to give update access + $r=ldap_bind($ds,"cn=admin,dc=rodo,dc=lan", "gnu8lx"); + + + // prepare data + $info["cn"]="John Jones"; + $info["sn"]="Jones"; + $info["mail"]="jonj@here.and.now"; + $info["objectclass"]="person"; + + // add data to directory + // $r=ldap_add($ds, "cn=John Jones, o=Adherents, c=FR", $info); + + + ldap_close($ds); +} +else +{ + echo "Unable to connect to LDAP server"; +} + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/adherents/pre.inc.php3 b/htdocs/adherents/pre.inc.php3 new file mode 100644 index 00000000000..cb0f2baf6bd --- /dev/null +++ b/htdocs/adherents/pre.inc.php3 @@ -0,0 +1,42 @@ + + * + * $Id$ + * $Source$ + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ +require("../main.inc.php3"); + +function llxHeader($head = "", $urlp = "") { + global $user, $conf; + + + /* + * + * + */ + top_menu($head); + + $menu = new Menu(); + + $menu->add("/adherents/", "Adherents"); + + left_menu($menu->liste); +} + + +?> diff --git a/htdocs/comm/action/fiche.php3 b/htdocs/comm/action/fiche.php3 index 50920cc3be2..62ad9cb2085 100644 --- a/htdocs/comm/action/fiche.php3 +++ b/htdocs/comm/action/fiche.php3 @@ -1,8 +1,5 @@ - * - * $Id$ - * $Source$ * * 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 @@ -18,6 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ */ require("./pre.inc.php3"); @@ -33,7 +32,8 @@ $db = new Db(); * * */ -if ($action=='add_action') { +if ($action=='add_action') +{ $contact = new Contact($db); $contact->fetch($contactid); $societe = new Societe($db); @@ -42,13 +42,16 @@ if ($action=='add_action') { $actioncomm = new ActionComm($db); - if ($actionid == 5) { - $actioncomm->date = $db->idate(mktime($heurehour,$heuremin,0,$remonth,$reday,$reyear)); - $actioncomm->percent = 0; - } else { - $actioncomm->date = $date; - $actioncomm->percent = 100; - } + if ($actionid == 5) + { + $actioncomm->date = $db->idate(mktime($heurehour,$heuremin,0,$remonth,$reday,$reyear)); + $actioncomm->percent = 0; + } + else + { + $actioncomm->date = $date; + $actioncomm->percent = 100; + } $actioncomm->priority = 2; $actioncomm->type = $actionid; $actioncomm->contact = $contactid; @@ -60,46 +63,57 @@ if ($action=='add_action') { $actioncomm->add($user); - if ($todo == 'on' ) { + if ($todo == 'on' ) + { - $todo = new ActionComm($db); - $todo->type = 0; - $todo->date = $db->idate(mktime(12,0,0,$remonth, $reday, $reyear)); - - $todo->libelle = $todo_label; - $todo->priority = 2; - $todo->societe = $societe->id; - $todo->contact = $contactid; - - $todo->user = $user; - - $todo->note = $todo_note; - - $todo->percent = 0; - - $todo->add($user); - - if ($conf->webcal && $todo_webcal == 'on') { - - $webcal = new Webcal(); - - $webcal->heure = $heurehour . $heuremin . '00'; - $webcal->duree = ($dureehour * 60) + $dureemin; - - if ($actionid == 5) { - $libelle = "Rendez-vous avec ".$contact->fullname; - $libelle .= "\n" . $todo->libelle; - } else { - $libelle = $todo->libelle; - } + $todo = new ActionComm($db); + $todo->type = 0; + $todo->date = $db->idate(mktime(12,0,0,$remonth, $reday, $reyear)); - $webcal->add($user, $todo->date, $societe->nom, $libelle); - } + $todo->libelle = $todo_label; + $todo->priority = 2; + $todo->societe = $societe->id; + $todo->contact = $contactid; + + $todo->user = $user; + + $todo->note = $todo_note; + + $todo->percent = 0; + + $todo->add($user); + + if ($conf->webcal && $todo_webcal == 'on') + { + + $webcal = new Webcal(); + + $webcal->heure = $heurehour . $heuremin . '00'; + $webcal->duree = ($dureehour * 60) + $dureemin; + + if ($actionid == 5) + { + $libelle = "Rendez-vous avec ".$contact->fullname; + $libelle .= "\n" . $todo->libelle; + } + else + { + $libelle = $todo->libelle; + } + + $webcal->add($user, $todo->date, $societe->nom, $libelle); + } } Header("Location: /comm/fiche.php3?socid=$socid"); } +/******************************************************************************/ +/* */ +/* Fin des Actions */ +/* */ +/******************************************************************************/ + llxHeader(); /* * @@ -152,7 +166,6 @@ if ($action=='create' && $actionid && $contactid) { print ''; print ''; - } /* * @@ -204,7 +217,8 @@ if ($action=='create' && $actionid && $contactid) { * * */ -if ($id) { +if ($id) +{ $act = new ActionComm($db); $act->fetch($id); diff --git a/htdocs/comm/addpropal.php3 b/htdocs/comm/addpropal.php3 index db631e085f2..1d7bf462c24 100644 --- a/htdocs/comm/addpropal.php3 +++ b/htdocs/comm/addpropal.php3 @@ -38,55 +38,6 @@ if ($result) } -if ($action == 'add') { - $propal = new Propal($db, $socidp); - - $propal->remise = $remise; - $propal->datep = $db->idate(mktime(12, 1 , 1, $pmonth, $pday, $pyear)); - - $propal->contactid = $contactidp; - $propal->projetidp = $projetidp; - - $propal->author = $user->id; - $propal->note = $note; - - $propal->ref = $ref; - - $propal->add_product($idprod1,$qty1); - $propal->add_product($idprod2,$qty2); - $propal->add_product($idprod3,$qty3); - $propal->add_product($idprod4,$qty4); - - $id = $propal->create(); - - /* - * - * Generation - * - */ - if ($id) - { - - //$gljroot = "/home/www/dolibarr/dolibarr/htdocs"; - - $command = "export DBI_DSN=\"dbi:mysql:dbname=".$conf->db->name.":host=localhost\" "; - $command .= " ; ./propal-tex.pl --propal=".$id ." --pdf --ps --output=".$conf->propal->outputdir; - $command .= " --templates=".$conf->propal->templatesdir; - - $output = system($command); - //print "

command : $command
"; - //print $output; - - /* - * Renvoie directement sur la fiche - */ - //Header("Location: propal.php3?propalid=$id"); - } - else - { - print $db->error(); - } -} llxHeader(); @@ -283,51 +234,7 @@ if ($action == 'create') { print "Vous devez d'abord associer un prefixe commercial a cette societe" ; } } -/* - * - * Liste des propales - * - */ -$sql = "SELECT s.nom,s.idp, p.price, p.ref,".$db->pdate("p.datep")." as dp, p.rowid as propalid, c.id as statut, c.label as lst"; -$sql .= " FROM societe as s, llx_propal as p, c_propalst as c "; -$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND s.idp = $socidp"; -$sql .= " ORDER BY p.datec DESC ;"; - -if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - print "

"; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - print "\n"; - print "\n"; - - print "\n"; - print "\n"; - print "\n"; - - $total = $total + $objp->price; - - $i++; - } - print ""; - print "
SociétéNumStatutDatePrix 
idp\">$objp->nompropalid\">$objp->ref$objp->lst".strftime("%d %B %Y",$objp->dp)."".price($objp->price)." 
Total : ".price($total)."euros
"; - $db->free(); -} else { - print $db->error(); - print "

$sql"; -} + /* * */ diff --git a/htdocs/comm/docsoc.php b/htdocs/comm/docsoc.php index 167898a189e..3b7c5a9ca60 100644 --- a/htdocs/comm/docsoc.php +++ b/htdocs/comm/docsoc.php @@ -39,24 +39,16 @@ function do_upload () { $error_msg = "Sorry, your file is too large."; return; } - global $HTTP_POST_FILES; - $realname = $HTTP_POST_FILES['userfile']['name']; - - print "$realname"; $upload_dir = "/tmp"; $local_file = "$upload_dir/TOTO"; - if ( file_exists ( '$local_file' ) ) + while ( file_exists ( '$local_file' ) ) { - $seq = 1; - while ( file_exists ( "$upload_dir/$the_time$seq" ) ) - { - $seq++; - } - $local_file = "$upload_dir/$the_time$seq"; - }; - + $seq++; + $local_file .= "$seq"; + } + print "$local_file"; rename ( $uploadfile, $local_file ); @@ -157,7 +149,7 @@ if ($socid > 0) { - +


diff --git a/htdocs/comm/fiche.php3 b/htdocs/comm/fiche.php3 index 91664cdef85..35c6deaa9c3 100644 --- a/htdocs/comm/fiche.php3 +++ b/htdocs/comm/fiche.php3 @@ -138,6 +138,7 @@ if ($socid > 0) { print "

Fiche client : $objsoc->nom
"; print "idp&action=add_bookmark\">[Bookmark]"; + print "idp\">doc"; print "idp&action=create\">[Projet]"; print "idp&action=create\">[Propal]"; print "idp\">Notes"; diff --git a/htdocs/comm/pre.inc.php3 b/htdocs/comm/pre.inc.php3 index 1028e9f2018..d5dabeca674 100644 --- a/htdocs/comm/pre.inc.php3 +++ b/htdocs/comm/pre.inc.php3 @@ -34,7 +34,6 @@ function llxHeader($head = "", $urlp = "") { $menu->add("/comm/clients.php3", "Clients"); - $menu->add_submenu("../soc.php3?&action=create", "Nouvelle société"); $menu->add_submenu("contact.php3", "Contacts"); $menu->add("/comm/action/", "Actions"); diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php new file mode 100644 index 00000000000..b4315621942 --- /dev/null +++ b/htdocs/compta/dons/liste.php @@ -0,0 +1,109 @@ + + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ +require("./pre.inc.php"); + +llxHeader(); + +$db = new Db(); + +if ($action == 'add') { + $datepaye = $db->idate(mktime(12, 0 , 0, $pmonth, $pday, $pyear)); + + $paiement = new Paiement($db); + + $paiement->facid = $facid; + $paiement->datepaye = $datepaye; + $paiement->amount = $amount; + $paiement->author = $author; + $paiement->paiementid = $paiementid; + $paiement->num_paiement = $num_paiement; + $paiement->note = $note; + + $paiement->create(); + + $action = ''; + +} + + +if ($sortorder == "") { + $sortorder="DESC"; +} +if ($sortfield == "") { + $sortfield="d.datedon"; +} + +if ($page == -1) { $page = 0 ; } + +$offset = $conf->liste_limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + + +$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.nom, d.amount, p.libelle as projet"; +$sql .= " FROM llx_don as d, llx_don_projet as p"; +$sql .= " WHERE p.rowid = d.fk_don_projet AND d.fk_statut = $statut"; +$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows(); + $i = 0; + + print_barre_liste("Dons", $page, $PHP_SELF); + print ""; + + print ''; + print ""; + print ""; + print ""; + print ""; + print ''; + print "\n"; + + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object( $i); + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print ''; + + print ""; + $i++; + } + print "
NomDateProjetMontant 
rowid&action=edit\">$objp->nomrowid&action=edit\">".strftime("%d %B %Y",$objp->datedon)."$objp->projet'.price($objp->amount).' 
"; +} +else +{ + print $db->error(); +} + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/compta/dons/pre.inc.php b/htdocs/compta/dons/pre.inc.php new file mode 100644 index 00000000000..e3c5dc20ef5 --- /dev/null +++ b/htdocs/compta/dons/pre.inc.php @@ -0,0 +1,45 @@ + + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ +require("../../main.inc.php3"); + +function llxHeader($head = "") { + global $user, $conf; + + + /* + * + * + */ + top_menu($head); + + $menu = new Menu(); + + $menu->add("/compta/dons/","Dons"); + $menu->add_submenu("fiche.php?action=create","Saisir un don"); + + $menu->add("/compta/bank/index.php3","Bank"); + + left_menu($menu->liste); + +} + +?> diff --git a/htdocs/compta/paiement.php3 b/htdocs/compta/paiement.php3 index 04ea8278aaa..2382508af8d 100644 --- a/htdocs/compta/paiement.php3 +++ b/htdocs/compta/paiement.php3 @@ -1,8 +1,5 @@ - * - * $Id$ - * $Source$ * * 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 @@ -18,29 +15,31 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ * */ require("./pre.inc.php3"); - +require("../paiement.class.php"); llxHeader(); $db = new Db(); - if ($action == 'add') { $datepaye = $db->idate(mktime(12, 0 , 0, $pmonth, $pday, $pyear)); - $sql = "INSERT INTO llx_paiement (fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note)"; - $sql .= " VALUES ($facid, now(), $datepaye,$amount,'$author', $paiementid, '$num_paiement', '$note')"; - $result = $db->query($sql); - if ($result) { - $label = "Facture $facnumber - $societe"; - $sql = "INSERT INTO llx_bank (datec, dateo, amount, author, label)"; - $sql .= " VALUES (now(), $datepaye, $amount,'$author', '$label')"; - $result = $db->query($sql); - } else { - print "$sql"; - } + $paiement = new Paiement($db); + + $paiement->facid = $facid; + $paiement->datepaye = $datepaye; + $paiement->amount = $amount; + $paiement->author = $author; + $paiement->paiementid = $paiementid; + $paiement->num_paiement = $num_paiement; + $paiement->note = $note; + + $paiement->create(); + $action = ''; } elseif ($action == 'create') { @@ -65,20 +64,16 @@ if ($action == 'add') { print "Numéro :$obj->facnumber"; print "Société :$obj->nom"; - print "Montant :".price($obj->total)." euros TTC"; - - - print "Paiement"; - - + print "Montant :".price($obj->total)." euros TTC"; $sql = "SELECT sum(p.amount) FROM llx_paiement as p WHERE p.fk_facture = $facid;"; $result = $db->query($sql); if ($result) { $sumpayed = $db->result(0,0); $db->free(); } - print 'Déjà payé'.price($sumpayed).' euros TTC'; + print 'Déjà payé'.price($sumpayed).' euros TTC'; + print "Paiement"; print ""; print ""; @@ -133,7 +128,7 @@ if ($action == 'add') { print ""; print "Commentaires :
"; - print ""; + print ""; $author = $GLOBALS["REMOTE_USER"]; print "\n"; @@ -155,8 +150,9 @@ if ($action == 'add') { print "
"; print "\n"; print "Numéro :
Num du cheque ou virement\n"; - print "Montant :Reste à payer : ".price($total - $sumpayed)." euros TTC
\n"; - print "\n"; + print " Reste à payer : ".price($total - $sumpayed)." euros TTC\n"; + print "Montant :\n"; + print "\n"; print "\n"; print "\n"; diff --git a/htdocs/compta/pre.inc.php3 b/htdocs/compta/pre.inc.php3 index 7c2d5fdd36e..94d57b69239 100644 --- a/htdocs/compta/pre.inc.php3 +++ b/htdocs/compta/pre.inc.php3 @@ -49,6 +49,8 @@ function llxHeader($head = "") { $menu->add("/compta/facture.php3","Factures"); $menu->add_submenu("paiement.php3","Paiements"); + $menu->add("/compta/propal.php3","Propales"); + $menu->add("charges/index.php3","Charges"); $menu->add_submenu("sociales/","Prest. Sociales"); @@ -65,7 +67,7 @@ function llxHeader($head = "") { $menu->add("resultat/","Résultats"); - $menu->add("/compta/propal.php3","Propales"); + $menu->add("bank/index.php3","Bank"); diff --git a/htdocs/compta/propal.php3 b/htdocs/compta/propal.php3 index 75f33277333..6c54b59261a 100644 --- a/htdocs/compta/propal.php3 +++ b/htdocs/compta/propal.php3 @@ -36,22 +36,6 @@ llxHeader(); $db = new Db(); -if ($sortfield == "") { - $sortfield="lower(p.label)"; -} -if ($sortorder == "") { - $sortorder="ASC"; -} - -$yn["t"] = "oui"; -$yn["f"] = "non"; - -if ($page == -1) { $page = 0 ; } -$limit = 26; -$offset = $limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - if ($action == 'setstatut') { /* * Cloture de la propale @@ -204,7 +188,7 @@ if ($propalid) { if ($result) { $num = $db->num_rows(); $i = 0; $total = 0; - print "

Facture(s) associée(s)"; + print "
Facture(s) associée(s)
"; print ""; print ""; print ""; @@ -237,38 +221,30 @@ if ($propalid) { */ print "

NumDate
"; - if ($obj->statut == 0) { - print ""; - } else { - if ($obj->statut == 1) { - print ""; - } else { + + if ($obj->statut == 2) + { + print '"; + } + else + { + print ''; + } + + + + print ""; + + + if ($obj->statut == 2) + { + print ""; + } + else + { print ""; } - } - if ($obj->statut == 2) { - print ""; - } else { - print ""; - } - if ($obj->statut == 1) { - $file = $conf->propal->outputdir. "/$obj->ref/$obj->ref.pdf"; - if (file_exists($file)) { - print ""; - } else { - print ""; - } - } else { - print ""; - } - if ($obj->statut == 0) { - print ""; - } elseif ($obj->statut == 2) { - print ""; - } else { - print ""; - } print "
[Supprimer][Cloturer]'; + print "Emettre une facture--[Facturée]-Emettre une facture-"; - print "[Envoyer la propale par mail]! Propale non generee !-[Valider][Facturée]-
"; /* * @@ -325,6 +301,29 @@ if ($propalid) { * * */ + + if ($sortfield == "") + { + $sortfield="lower(p.label)"; + } + if ($sortorder == "") + { + $sortorder="ASC"; + } + + $yn["t"] = "oui"; + $yn["f"] = "non"; + + if ($page == -1) + { + $page = 0 ; + } + $limit = 26; + $offset = $limit * $page ; + $pageprev = $page - 1; + $pagenext = $page + 1; + + print ""; print ""; print "
Propositions commerciales
"; diff --git a/htdocs/facture.class.php3 b/htdocs/facture.class.php3 index c3f057d2348..c9bfb018d25 100644 --- a/htdocs/facture.class.php3 +++ b/htdocs/facture.class.php3 @@ -176,7 +176,11 @@ class Facture { } - + /* + * + * + * + */ Function set_payed($rowid) { $sql = "UPDATE llx_facture set paye = 1 WHERE rowid = $rowid ;"; diff --git a/htdocs/info.php3 b/htdocs/info.php3 index 955076d96b9..285e57064cf 100644 --- a/htdocs/info.php3 +++ b/htdocs/info.php3 @@ -35,7 +35,7 @@ print 'pass' . $conf->db->pass . ' '; print 'Database name' . $conf->db->name . ''; -print 'Propale'; +print 'Propale'; print 'templates' . $conf->propal->templatesdir . ''; print 'output dir' . $conf->propal->outputdir . ''; print 'output url' . $conf->propal->outputurl . ''; diff --git a/htdocs/user/index.php3 b/htdocs/user/index.php3 index 5401b2298f3..6a753e93081 100644 --- a/htdocs/user/index.php3 +++ b/htdocs/user/index.php3 @@ -1,8 +1,5 @@ - * - * $Id$ - * $Source$ * * 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 @@ -18,17 +15,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ require("./pre.inc.php3"); llxHeader(); $db = new Db(); -/* - * Mode Liste - * - */ - print_titre("Liste des utilisateurs"); $sql = "SELECT u.rowid, u.name, u.firstname, u.code, u.login, u.module_comm, u.module_compta FROM llx_user as u";