From 1f503948a81a45a080f6c9726e1a650cc65018a8 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 17 Sep 2013 10:15:24 +0200 Subject: [PATCH 01/25] Update llx_societe.sql add outstanding value --- htdocs/install/mysql/tables/llx_societe.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 9348ab3b6d5..a7004844352 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -85,6 +85,7 @@ create table llx_societe barcode varchar(255), -- barcode fk_barcode_type integer NULL DEFAULT 0, -- barcode type price_level integer NULL, -- level of price for multiprices + outstanding double(24,8) DEFAULT 0, default_lang varchar(6), -- default language logo varchar(255), canvas varchar(32), -- type of canvas if used (null by default) From 7e9fb00f113717b8183aa128cbe0422f64872648 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 17 Sep 2013 10:27:02 +0200 Subject: [PATCH 02/25] Update fiche.php --- htdocs/comm/fiche.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 9021ad0acaf..8593e0b0aa5 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -128,6 +128,14 @@ if ($action == 'cstc') if ($result < 0) setEventMessage($object->error,'errors'); } +// Update communication level +if ($action == 'setOutstandingBill') +{ + $object->fetch($id); + $object->stcomm_id=GETPOST('OutstandingBill'); + $result=$object->set_OutstandingBill($user); + if ($result < 0) setEventMessage($object->error,'errors'); +} /* @@ -369,6 +377,18 @@ if ($id > 0) print ''; print ''; + if ($object->client) + { + print ''; + print ''; + print $form->editfieldkey("OutstandingBill",'OutstandingBill',$object->outstanding,$object,$user->rights->societe->creer); + print ''; + print $form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding,$object,$user->rights->societe->creer); + print ''; + print ''; + } + + // Multiprice level if (! empty($conf->global->PRODUIT_MULTIPRICES)) { @@ -898,4 +918,4 @@ dol_htmloutput_mesg('',$mesgs); // End of page llxFooter(); $db->close(); -?> \ No newline at end of file +?> From 4a2ef0810d3891867a52faa65ecfaf71d06494a1 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 17 Sep 2013 10:33:47 +0200 Subject: [PATCH 03/25] Update societe.class.php --- htdocs/societe/class/societe.class.php | 41 +++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index bd1fae497f2..811c2c55e4d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -126,6 +126,7 @@ class Societe extends CommonObject var $statut_commercial; var $price_level; + var $outstanding; var $datec; var $date_update; @@ -710,7 +711,7 @@ class Societe extends CommonObject $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj'; $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax2_assuj, s.fk_prospectlevel, s.default_lang, s.logo'; - $sql .= ', s.import_key, s.canvas'; + $sql .= ', s.outstanding, s.import_key, s.canvas'; $sql .= ', fj.libelle as forme_juridique'; $sql .= ', e.libelle as effectif'; $sql .= ', p.code as country_code, p.libelle as country'; @@ -840,6 +841,8 @@ class Societe extends CommonObject $this->default_lang = $obj->default_lang; $this->logo = $obj->logo; + $this->outstanding = $obj->outstanding; + // multiprix $this->price_level = $obj->price_level; @@ -2740,6 +2743,42 @@ class Societe extends CommonObject } } + /** + * Set outstanding value + * + * @param User $user User making change + * @return int <0 if KO, >0 if OK + */ + function set_outstanding($user) + { + if ($this->id) + { + $this->db->begin(); + + $now=dol_now(); + + $outstanding = price2num($this->outstanding); + + // Positionne l'encours de facturaiton + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET "; + $sql.= " outstanding=".$outstanding; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::set_outstanding sql=".$sql); + $resql=$this->db->query($sql); + if (! $resql) + { + $this->db->rollback(); + $this->error=$this->db->error(); + return -1; + } + + $this->db->commit(); + return 1; + } + } + + /** * Return label of status customer is prospect/customer * From 1e34bc26bcc3092b5a2303e6398621bfe520f9fc Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 17 Sep 2013 10:35:41 +0200 Subject: [PATCH 04/25] Update companies.lang --- htdocs/langs/fr_FR/companies.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 9848d21ec61..982a39ba36a 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -395,7 +395,7 @@ InActivity=En activité ActivityCeased=Clos ActivityStateFilter=Statut d'activité ProductsIntoElements=Liste des produits dans les %s - +OutstandingBill=Encours de facturation # Monkey MonkeyNumRefModelDesc=Renvoie le numéro sous la forme %syymm-nnnn pour les codes clients et %syymm-nnnn pour les codes fournisseurs où yy est l'année, mm le mois et nnnn un compteur séquentiel sans rupture et sans remise à 0. # Leopard From a6335c44feecd46de8d6436dc603a3fc480d7684 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 17 Sep 2013 10:36:21 +0200 Subject: [PATCH 05/25] Update companies.lang --- htdocs/langs/en_US/companies.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 75f98701fe3..bff2a149211 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -395,7 +395,7 @@ InActivity=Open ActivityCeased=Closed ActivityStateFilter=Activity status ProductsIntoElements=List of products into - +OutstandingBill=Outstanding Bill # Monkey MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for supplier code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0. # Leopard From 14e96f5c1bc3ac1f2105c0026b57c1521c5161ce Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 17 Sep 2013 10:39:30 +0200 Subject: [PATCH 06/25] Update 3.4.0-3.5.0.sql --- htdocs/install/mysql/migration/3.4.0-3.5.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index 2c3542a777d..60f18dafcdd 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -294,3 +294,5 @@ ALTER TABLE llx_facture_fourn ADD fk_mode_reglement integer NULL AFTER fk_cond_r ALTER TABLE llx_facture_fourn MODIFY COLUMN fk_mode_reglement integer NULL; ALTER TABLE llx_facture_fourn MODIFY COLUMN fk_cond_reglement integer NULL; +-- add outstanding bill +ALTER TABLE llx_societe ADD outstanding double(24,8) 0 AFTER mode_reglement_supplier; From 9e3a98da0d3e0e86fbeaf09ad00da1cc1e08b88b Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 27 Sep 2013 21:58:15 +0200 Subject: [PATCH 07/25] Update fiche.php --- htdocs/comm/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 8593e0b0aa5..7752b9c4606 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -132,7 +132,7 @@ if ($action == 'cstc') if ($action == 'setOutstandingBill') { $object->fetch($id); - $object->stcomm_id=GETPOST('OutstandingBill'); + $object->outstanding=GETPOST('OutstandingBill'); $result=$object->set_OutstandingBill($user); if ($result < 0) setEventMessage($object->error,'errors'); } From 4c168b3adb24875c2c1a179404640d6f7c64da92 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 27 Sep 2013 22:00:11 +0200 Subject: [PATCH 08/25] Update propal.php --- htdocs/comm/propal.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index e2504eca6af..232fea74d3a 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1884,6 +1884,18 @@ else print ''; } + if ($soc->outstandingbill) + { + // Outstanding Bill + print ''; + print $langs->trans('OutstandingBill'); + print ''; + print price($soc->get_OutstandingBill()).' / '; + print price($soc->outstandingbill).''.$langs->trans("Currency".$conf->currency); + print ''; + print ''; + } + // Other attributes $res=$object->fetch_optionals($object->id,$extralabels); $parameters=array('colspan' => ' colspan="3"'); From fff1309cec9a320e128b4cb241470d100edfe5fb Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 27 Sep 2013 22:06:05 +0200 Subject: [PATCH 09/25] Update facture.php --- htdocs/compta/facture.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index ee62ac5d977..7e8230eccd8 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3007,6 +3007,7 @@ else if ($id > 0 || ! empty($ref)) $nbrows=8; $nbcols=2; if (! empty($conf->projet->enabled)) $nbrows++; if (! empty($conf->banque->enabled)) $nbcols++; + if (! empty($soc->outstandingbill)) $nbrows++; if($mysoc->localtax1_assuj=="1") $nbrows++; if($mysoc->localtax2_assuj=="1") $nbrows++; if ($selleruserevenustamp) $nbrows++; @@ -3278,6 +3279,18 @@ else if ($id > 0 || ! empty($ref)) } print ''; + if ($soc->outstandingbill) + { + // Outstanding Bill + print ''; + print $langs->trans('OutstandingBill'); + print ''; + print price($soc->get_OutstandingBill()).' / '; + print price($soc->outstandingbill); + print ''; + print ''; + } + // Amount print ''.$langs->trans('AmountHT').''; print ''.price($object->total_ht,1,'',1,-1,-1,$conf->currency).''; From ca0ba99effb6ae70e20e1b3b78145bc3eaad3d10 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 27 Sep 2013 22:08:06 +0200 Subject: [PATCH 10/25] Update facture.php --- htdocs/compta/facture.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 7e8230eccd8..bd8970d6c26 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2292,6 +2292,18 @@ if ($action == 'create') print ''; } + if ($soc->outstandingbill) + { + // Outstanding Bill + print ''; + print $langs->trans('OutstandingBill'); + print ''; + print price($soc->get_OutstandingBill()).' / '; + print price($soc->outstandingbill).''; + print ''; + print ''; + } + // Other attributes $parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook From f52e9812fa91889b6562fa946b1f87ce00f9c40e Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 27 Sep 2013 22:12:12 +0200 Subject: [PATCH 11/25] Update societe.class.php --- htdocs/societe/class/societe.class.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 811c2c55e4d..937167a6bca 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2778,6 +2778,28 @@ class Societe extends CommonObject } } + /** + * return amount of bill not paid + * + * @return boolean Yes or no + */ + function get_OutstandingBill() + { + $sql = "SELECT sum(total) as amount FROM ".MAIN_DB_PREFIX."facture as f"; + $sql .= " WHERE fk_soc = ". $this->id; + $sql .= " AND paye = 0"; + $sql .= " AND fk_statut <> 0"; + + dol_syslog("get_OutstandingBill sql=".$sql); + $resql=$this->db->query($sql); + if ($resql) + { + $obj=$this->db->fetch_object($resql); + return ($obj->amount); + } + else + return 0; + } /** * Return label of status customer is prospect/customer From 6b909746f483ab2184eb336900d1c6be918a169c Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Oct 2013 17:14:14 +0200 Subject: [PATCH 12/25] Update llx_societe.sql --- htdocs/install/mysql/tables/llx_societe.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index a7004844352..6d149ea263c 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -85,7 +85,7 @@ create table llx_societe barcode varchar(255), -- barcode fk_barcode_type integer NULL DEFAULT 0, -- barcode type price_level integer NULL, -- level of price for multiprices - outstanding double(24,8) DEFAULT 0, + outstanding_limit double(24,8) DEFAULT 0, default_lang varchar(6), -- default language logo varchar(255), canvas varchar(32), -- type of canvas if used (null by default) From 5bae0dbc180899cb630bd146f951db82b3e12f7f Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Oct 2013 17:14:50 +0200 Subject: [PATCH 13/25] Update 3.4.0-3.5.0.sql --- htdocs/install/mysql/migration/3.4.0-3.5.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index 60f18dafcdd..dddb6c5cb1d 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -295,4 +295,4 @@ ALTER TABLE llx_facture_fourn MODIFY COLUMN fk_mode_reglement integer NULL; ALTER TABLE llx_facture_fourn MODIFY COLUMN fk_cond_reglement integer NULL; -- add outstanding bill -ALTER TABLE llx_societe ADD outstanding double(24,8) 0 AFTER mode_reglement_supplier; +ALTER TABLE llx_societe ADD outstanding_limit double(24,8) 0 AFTER mode_reglement_supplier; From 95a69b5d8e835feb7fb9b94584a25a4d7483f0cb Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Oct 2013 17:17:51 +0200 Subject: [PATCH 14/25] Update fiche.php --- htdocs/comm/fiche.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 7752b9c4606..a4e310d5ce7 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -132,7 +132,7 @@ if ($action == 'cstc') if ($action == 'setOutstandingBill') { $object->fetch($id); - $object->outstanding=GETPOST('OutstandingBill'); + $object->outstanding_limit=GETPOST('OutstandingBill'); $result=$object->set_OutstandingBill($user); if ($result < 0) setEventMessage($object->error,'errors'); } @@ -381,9 +381,9 @@ if ($id > 0) { print ''; print ''; - print $form->editfieldkey("OutstandingBill",'OutstandingBill',$object->outstanding,$object,$user->rights->societe->creer); + print $form->editfieldkey("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer); print ''; - print $form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding,$object,$user->rights->societe->creer); + print $form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer); print ''; print ''; } From 7828219787e8e2597f45dd68c3da7d39a2c8fd47 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Oct 2013 17:19:18 +0200 Subject: [PATCH 15/25] Update societe.class.php --- htdocs/societe/class/societe.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 937167a6bca..47556296c2f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -126,7 +126,7 @@ class Societe extends CommonObject var $statut_commercial; var $price_level; - var $outstanding; + var $outstanding_limit; var $datec; var $date_update; @@ -711,7 +711,7 @@ class Societe extends CommonObject $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj'; $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax2_assuj, s.fk_prospectlevel, s.default_lang, s.logo'; - $sql .= ', s.outstanding, s.import_key, s.canvas'; + $sql .= ', s.outstanding_limit, s.import_key, s.canvas'; $sql .= ', fj.libelle as forme_juridique'; $sql .= ', e.libelle as effectif'; $sql .= ', p.code as country_code, p.libelle as country'; @@ -841,7 +841,7 @@ class Societe extends CommonObject $this->default_lang = $obj->default_lang; $this->logo = $obj->logo; - $this->outstanding = $obj->outstanding; + $this->outstanding_limit = $obj->outstanding_limit; // multiprix $this->price_level = $obj->price_level; @@ -2757,11 +2757,11 @@ class Societe extends CommonObject $now=dol_now(); - $outstanding = price2num($this->outstanding); + $outstanding = price2num($this->outstanding_limit); // Positionne l'encours de facturaiton $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET "; - $sql.= " outstanding=".$outstanding; + $sql.= " outstanding_limit=".$outstanding; $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::set_outstanding sql=".$sql); From 2360dc52dd69c4049d70407691433c8fba0dd933 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Oct 2013 17:21:10 +0200 Subject: [PATCH 16/25] Update societe.class.php --- htdocs/societe/class/societe.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 47556296c2f..a3815b937ae 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2785,6 +2785,13 @@ class Societe extends CommonObject */ function get_OutstandingBill() { + /* Accurate value of remain to pay is to sum remaintopay for each invoice + $paiement = $invoice->getSommePaiement(); + $creditnotes=$invoice->getSumCreditNotesUsed(); + $deposits=$invoice->getSumDepositsUsed(); + $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); + $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); + */ $sql = "SELECT sum(total) as amount FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " WHERE fk_soc = ". $this->id; $sql .= " AND paye = 0"; From 53531ff847b5766949d5eb56687b7057a2b43997 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Oct 2013 17:23:31 +0200 Subject: [PATCH 17/25] Update facture.php --- htdocs/compta/facture.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index bd8970d6c26..a455d2b51f9 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2292,14 +2292,14 @@ if ($action == 'create') print ''; } - if ($soc->outstandingbill) + if ($soc->outstanding_limit) { // Outstanding Bill print ''; print $langs->trans('OutstandingBill'); print ''; print price($soc->get_OutstandingBill()).' / '; - print price($soc->outstandingbill).''; + print price($soc->outstanding_limit).''; print ''; print ''; } From a40729312fc4bb6a20e57764b6e80524ecb27580 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Oct 2013 17:27:53 +0200 Subject: [PATCH 18/25] Update propal.php --- htdocs/comm/propal.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 232fea74d3a..015b566d1c5 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1884,14 +1884,14 @@ else print ''; } - if ($soc->outstandingbill) + if ($soc->outstanding_limit) { // Outstanding Bill print ''; print $langs->trans('OutstandingBill'); - print ''; + print ''; print price($soc->get_OutstandingBill()).' / '; - print price($soc->outstandingbill).''.$langs->trans("Currency".$conf->currency); + print price($soc->outstanding_limit, 0, '', 1, -1, -1, $conf->currency); print ''; print ''; } From a9308ca32055a8152c2e9d370595dc0b37b10fd4 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Oct 2013 17:30:19 +0200 Subject: [PATCH 19/25] Update fiche.php --- htdocs/commande/fiche.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 6bc2d02f25e..ce57b057531 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2195,6 +2195,19 @@ else print ''; } + + if ($soc->outstanding_limit) + { + // Outstanding Bill + print ''; + print $langs->trans('OutstandingBill'); + print ''; + print price($soc->get_OutstandingBill()).' / '; + print price($soc->outstanding_limit, 0, '', 1, -1, -1, $conf->currency); + print ''; + print ''; + } + // Other attributes $res=$object->fetch_optionals($object->id,$extralabels); $parameters=array('colspan' => ' colspan="3"'); From 9555cb35f08da1bab4b2d89fc66c2d2ea73430b4 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Sat, 19 Oct 2013 17:51:21 +0200 Subject: [PATCH 20/25] Add project clone option : copy project files, copy task files --- ChangeLog | 2 +- htdocs/langs/en_US/projects.lang | 3 ++- htdocs/projet/class/project.class.php | 16 +++++++++------- htdocs/projet/class/task.class.php | 3 ++- htdocs/projet/fiche.php | 14 ++++++++------ 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00a99cef973..4304564ef04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -315,7 +315,7 @@ For users: - New: Can list elements (invoices, orders or proposals) on a particular user contact). This allow to view a "basket" of its elements. - New: Show bank account on payment list of invoice card. -- New: Cloning project allow to clones task, notes, files, contacts. +- New: Cloning project allow to clones task, notes, projects files, tasks files, contacts. - New: Enhance default style. - New: Can edit and resiliate member status from list. - New: Can insert URL links into elements lines. Also reported into PDF. diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 066732aa22a..196230c110b 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -89,7 +89,8 @@ CloneProject=Clone project CloneTasks=Clone tasks CloneContacts=Clone contacts CloneNotes=Clone notes -CloneFiles=Clone joined files +CloneProjectFiles=Clone project joined files +CloneTaskFiles=Clone task(s) joined files (if task(s) cloned) ConfirmCloneProject=Are you sure to clone this project ? ProjectReportDate=Change task date according project start date ErrorShiftTaskDate=Impossible to shift task date according to new project start date diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index e6644c048c5..fc88d75cb95 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -970,11 +970,13 @@ class Project extends CommonObject * @param int $fromid Id of object to clone * @param bool $clone_contact clone contact of project * @param bool $clone_task clone task of project - * @param bool $clone_file clone file of project + * @param bool $clone_project_file clone file of project + * @param bool $clone_task_file clone file of task (if task are copied) * @param bool $clone_note clone note of project + * @param bool $notrigger no trigger flag * @return int New id of clone */ - function createFromClone($fromid,$clone_contact=false,$clone_task=true,$clone_file=false,$clone_note=true) + function createFromClone($fromid,$clone_contact=false,$clone_task=true,$clone_project_file=false,$clone_task_file=false,$clone_note=true,$notrigger=0) { global $user,$langs,$conf; @@ -1025,7 +1027,7 @@ class Project extends CommonObject $clone_project->ref=$defaultref; // Create clone - $result=$clone_project->create($user); + $result=$clone_project->create($user,$notrigger); // Other options if ($result < 0) @@ -1088,7 +1090,7 @@ class Project extends CommonObject foreach ($tab as $contacttoadd) { - $clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source']); + $clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'],$notrigger); if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); @@ -1108,7 +1110,7 @@ class Project extends CommonObject } //Duplicate file - if ($clone_file) + if ($clone_project_file) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -1151,7 +1153,7 @@ class Project extends CommonObject foreach ($tasksarray as $tasktoclone) { - $result_clone = $taskstatic->createFromClone($tasktoclone->id,$clone_project_id,$tasktoclone->fk_parent,true,true,false,true,true,false); + $result_clone = $taskstatic->createFromClone($tasktoclone->id,$clone_project_id,$tasktoclone->fk_parent,true,true,false,$clone_task_file,true,false); if ($result_clone <= 0) { $this->error.=$result_clone->error; @@ -1181,7 +1183,7 @@ class Project extends CommonObject { $taskstatic->fk_task_parent=$tab_conv_child_parent[$taskstatic->fk_task_parent]; } - $res=$taskstatic->update($user); + $res=$taskstatic->update($user,$notrigger); if ($result_clone <= 0) { $this->error.=$taskstatic->error; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 1f5529d688b..5abf23e6df3 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1083,6 +1083,7 @@ class Task extends CommonObject $this->db->commit(); $clone_task_id=$clone_task->id; + $clone_task_ref = $clone_task->ref; //Note Update if (!$clone_note) @@ -1139,7 +1140,7 @@ class Task extends CommonObject $clone_project_ref=$ori_project_ref; } - $clone_task_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($clone_project_ref). "/" . dol_sanitizeFileName($clone_task_id); + $clone_task_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($clone_project_ref). "/" . dol_sanitizeFileName($clone_task_ref); $ori_task_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($ori_project_ref). "/" . dol_sanitizeFileName($fromid); $filearray=dol_dir_list($ori_task_dir,"files",0,'','\.meta$','',SORT_ASC,1); diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index a07e3755fa5..bce51a1028a 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -314,9 +314,10 @@ if ($action == 'confirm_clone' && $user->rights->projet->creer && GETPOST('confi { $clone_contacts=GETPOST('clone_contacts')?1:0; $clone_tasks=GETPOST('clone_tasks')?1:0; - $clone_files=GETPOST('clone_files')?1:0; + $clone_project_files = GETPOST ( 'clone_project_files' ) ? 1 : 0; + $clone_task_files = GETPOST ( 'clone_task_files' ) ? 1 : 0; $clone_notes=GETPOST('clone_notes')?1:0; - $result=$object->createFromClone($object->id,$clone_contacts,$clone_tasks,$clone_files,$clone_notes); + $result=$object->createFromClone($object->id,$clone_contacts,$clone_tasks,$clone_project_files,$clone_task_files,$clone_notes); if ($result <= 0) { $mesg='
'.$object->error.'
'; @@ -479,10 +480,11 @@ else { $formquestion=array( 'text' => $langs->trans("ConfirmClone"), - array('type' => 'checkbox', 'name' => 'clone_contacts','label' => $langs->trans("CloneContacts"), 'value' => true), - array('type' => 'checkbox', 'name' => 'clone_tasks', 'label' => $langs->trans("CloneTasks"), 'value' => true), - array('type' => 'checkbox', 'name' => 'clone_notes', 'label' => $langs->trans("CloneNotes"), 'value' => true), - array('type' => 'checkbox', 'name' => 'clone_files', 'label' => $langs->trans("CloneFiles"), 'value' => false) + array('type' => 'checkbox', 'name' => 'clone_contacts', 'label' => $langs->trans("CloneContacts"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_tasks', 'label' => $langs->trans("CloneTasks"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_notes', 'label' => $langs->trans("CloneNotes"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_project_files','label' => $langs->trans ( "CloneProjectFiles" ), 'value' => false), + array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans ( "CloneTaskFiles" ), 'value' => false) ); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 240); From 395bc5a800cac48a96d312064b46dfa2d3e0621e Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Sat, 19 Oct 2013 17:53:27 +0200 Subject: [PATCH 21/25] Add french translation --- htdocs/langs/fr_FR/projects.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 44f7d90d29c..dca6881a611 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -89,7 +89,8 @@ CloneProject=Cloner le projet CloneTasks=Cloner les tâches CloneContacts=Cloner les contacts CloneNotes=Cloner les notes -CloneFiles=Cloner les pièces jointes +CloneProjectFiles=Cloner les pièces jointes du projet +CloneTaskFiles=Cloner les pièces jointes des tâche(s) (si tâche(s) cloner) ConfirmCloneProject=Êtes-vous sûr de vouloir cloner ce projet ? ProjectReportDate=Reporter les dates des tâches en fonction de la date de départ. ErrorShiftTaskDate=Une erreur c'est produite dans le report des dates des tâches. From 305ca25267058e65a50e48ff7ef1a0dd3be7a83a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Oct 2013 14:05:51 +0200 Subject: [PATCH 22/25] New: Add menu entry to page massstockmove.php --- htdocs/core/menus/init_menu_auguria.sql | 1 + htdocs/core/menus/standard/eldy.lib.php | 7 ++-- htdocs/product/stock/massstockmove.php | 46 ++++++++++++------------- htdocs/product/stock/replenish.php | 2 +- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 140fc3480ea..95b1ffc2e0f 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -103,6 +103,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3103__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/valo.php', 'EnhancedValue', 1, 'stocks', '$user->rights->stock->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/mouvement.php', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php', 'StockTransfer', 1, 'stocks', '$user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); -- Product - Categories insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=0', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 98021186e34..5f62b06c868 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -565,7 +565,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu /* - * Menu TIERS + * Menu THIRDPARTIES */ if ($mainmenu == 'companies') { @@ -598,7 +598,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu //$newmenu->add("/contact/list.php?leftmenu=customers&type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); } - // Clients + // Customers/Prospects if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { $langs->load("commercial"); @@ -608,7 +608,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu //$newmenu->add("/contact/list.php?leftmenu=customers&type=c", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); } - // Fournisseurs + // Suppliers if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled)) { $langs->load("suppliers"); @@ -1008,6 +1008,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/valo.php", $langs->trans("EnhancedValue"), 1, $user->rights->stock->lire); if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/mouvement.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); if ($conf->fournisseur->enabled) if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire); + if ($conf->fournisseur->enabled) if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/massstockmove.php", $langs->trans("StockTransfer"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire); } // Expeditions diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 4e9abfcbaeb..6159a4362e9 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -18,8 +18,8 @@ /** * \file htdocs/product/stock/massstockmove.php * \ingroup stock - * \brief This page allows to select several products, then incoming warehouse and - * outgoing warehouse and create all stock movements for this. + * \brief This page allows to select several products, then incoming warehouse and + * outgoing warehouse and create all stock movements for this. */ require '../../main.inc.php'; @@ -74,7 +74,7 @@ if (! empty($_SESSION['massstockmove'])) $listofdata=dol_json_decode($_SESSION[' if ($action == 'addline') { - if (! ($id_product > 0)) + if (! ($id_product > 0)) { $error++; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Product")),'errors'); @@ -94,20 +94,20 @@ if ($action == 'addline') $error++; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("WarehouseTarget")),'errors'); } - if ($id_sw > 0 && $id_tw == $id_sw) + if ($id_sw > 0 && $id_tw == $id_sw) { $error++; $langs->load("errors"); setEventMessage($langs->trans("ErrorWarehouseMustDiffers"),'errors'); } - + if (! $error) { if (count(array_keys($listofdata)) > 0) $id=max(array_keys($listofdata)) + 1; else $id=1; $listofdata[$id]=array('id'=>$id, 'id_product'=>$id_product, 'qty'=>$qty, 'id_sw'=>$id_sw, 'id_tw'=>$id_tw); $_SESSION['massstockmove']=dol_json_encode($listofdata); - + unset($id_product); //unset($id_sw); //unset($id_tw); @@ -125,27 +125,27 @@ if ($action == 'delline' && $idline != '') if ($action == 'createmovements') { $error=0; - + if (! GETPOST("label")) { $error++; setEventMessage($langs->trans("ErrorFieldRequired"),$langs->transnoentitiesnoconv("LabelMovement")); } - + $db->begin(); - + if (! $error) { $product = new Product($db); foreach($listofdata as $key => $val) // Loop on each movement to do - { + { $id=$val['id']; $id_product=$val['id_product']; $id_sw=$val['id_sw']; $id_tw=$val['id_tw']; $qty=price2num($val['qty']); - + if (! $error && $id_sw <> $id_tw && is_numeric($qty) && $id_product) { $result=$product->fetch($id_product); @@ -171,9 +171,9 @@ if ($action == 'createmovements') if ($result1 < 0) { $error++; - setEventMessage($product->errors,'errors'); + setEventMessage($product->errors,'errors'); } - + // Add stock $result2=$product->correct_stock( $user, @@ -186,21 +186,21 @@ if ($action == 'createmovements') if ($result2 < 0) { $error++; - setEventMessage($product->errors,'errors'); + setEventMessage($product->errors,'errors'); } } else { dol_print_error('',"Bad value saved into sessions"); - $error++; + $error++; } } } - + if (! $error) { unset($_SESSION['massstockmove']); - + $db->commit(); setEventMessage($langs->trans("StockMovementRecorded"),'mesgs'); header("Location: ".DOL_URL_ROOT.'/product/stock/index.php'); // Redirect to avoid pb when using back @@ -238,7 +238,7 @@ $titletoaddnoent=$langs->transnoentitiesnoconv("Select"); $buttonrecord=$langs->trans("RecordMovement"); $buttonrecordnoent=$langs->trans("RecordMovement"); print $langs->trans("SelectProductInAndOutWareHouse",$titletoaddnoent,$buttonrecordnoent).'
'; -print '
'."\n"; +print '
'."\n"; $var=true; @@ -286,11 +286,11 @@ print ''; foreach($listofdata as $key => $val) { $var=!$var; - + $productstatic->fetch($val['id_product']); $warehousestatics->fetch($val['id_sw']); $warehousestatict->fetch($val['id_tw']); - + print ''; print ''.$productstatic->getNomUrl(1).''; print ''; @@ -307,7 +307,7 @@ foreach($listofdata as $key => $val) print ''; print ''.$val['qty'].''; print ''.img_delete($langs->trans("Remove")).''; - + print ''; } @@ -324,7 +324,7 @@ print ''; print ''; // Button to record mass movement -$labelmovement=GETPOST("label")?GETPOST('label'):$langs->trans("MassStockMovement").' '.dol_print_date($now,'%Y-%m-%d %H:%M'); +$labelmovement=GETPOST("label")?GETPOST('label'):$langs->trans("StockTransfer").' '.dol_print_date($now,'%Y-%m-%d %H:%M'); print ''; print ''; @@ -333,7 +333,7 @@ print '
'; print ''; print ''; print ''; -print '
'; +print ''; print '
'; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index ace77f1a0ef..a5754cf10b4 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -540,7 +540,7 @@ while ($i < min($num, $limit)) } $i++; } -print ''. +print ''; $value=$langs->trans("CreateOrders"); From 3a46348988f330a3b7f51fa92ea33e7a9657820e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Oct 2013 14:31:08 +0200 Subject: [PATCH 23/25] Fix: checkstyle --- htdocs/projet/fiche.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index bce51a1028a..d8739c22b08 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -314,8 +314,8 @@ if ($action == 'confirm_clone' && $user->rights->projet->creer && GETPOST('confi { $clone_contacts=GETPOST('clone_contacts')?1:0; $clone_tasks=GETPOST('clone_tasks')?1:0; - $clone_project_files = GETPOST ( 'clone_project_files' ) ? 1 : 0; - $clone_task_files = GETPOST ( 'clone_task_files' ) ? 1 : 0; + $clone_project_files = GETPOST('clone_project_files') ? 1 : 0; + $clone_task_files = GETPOST('clone_task_files') ? 1 : 0; $clone_notes=GETPOST('clone_notes')?1:0; $result=$object->createFromClone($object->id,$clone_contacts,$clone_tasks,$clone_project_files,$clone_task_files,$clone_notes); if ($result <= 0) @@ -483,8 +483,8 @@ else array('type' => 'checkbox', 'name' => 'clone_contacts', 'label' => $langs->trans("CloneContacts"), 'value' => true), array('type' => 'checkbox', 'name' => 'clone_tasks', 'label' => $langs->trans("CloneTasks"), 'value' => true), array('type' => 'checkbox', 'name' => 'clone_notes', 'label' => $langs->trans("CloneNotes"), 'value' => true), - array('type' => 'checkbox', 'name' => 'clone_project_files','label' => $langs->trans ( "CloneProjectFiles" ), 'value' => false), - array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans ( "CloneTaskFiles" ), 'value' => false) + array('type' => 'checkbox', 'name' => 'clone_project_files','label' => $langs->trans("CloneProjectFiles"), 'value' => false), + array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans("CloneTaskFiles"), 'value' => false) ); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 240); From 4f39243eab35cbdc2a054c5c2a74efc7de3d7bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9onard?= Date: Sun, 20 Oct 2013 14:58:10 +0200 Subject: [PATCH 24/25] Fix misspelling in french projects language file --- htdocs/langs/fr_FR/projects.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index dca6881a611..3e6f48534ae 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -105,7 +105,7 @@ TypeContact_project_task_internal_TASKEXECUTIVE=Responsable TypeContact_project_task_external_TASKEXECUTIVE=Responsable TypeContact_project_task_internal_CONTRIBUTOR=Intervenant TypeContact_project_task_external_CONTRIBUTOR=Intervenant -SelectElement=Eléments associable au projet : +SelectElement=Eléments associables au projet : AddElement=Associer # Documents models DocumentModelBaleine=Modèle de rapport de projet complet (logo...) From ec576c91ccd8b215a4feb61b00777cfd8fabdff1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Oct 2013 13:43:31 +0200 Subject: [PATCH 25/25] Enhance prototype for tables --- htdocs/core/tpl/ajaxrow.tpl.php | 9 ++- htdocs/public/test/test_arrays.php | 80 ++++++++++++++++++-------- htdocs/theme/amarok/style.css.php | 1 + htdocs/theme/auguria/style.css.php | 1 + htdocs/theme/bureau2crea/style.css.php | 1 + htdocs/theme/cameleo/style.css.php | 1 + htdocs/theme/eldy/style.css.php | 1 + 7 files changed, 68 insertions(+), 26 deletions(-) diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php index 398ca6e008f..aa96b46a859 100644 --- a/htdocs/core/tpl/ajaxrow.tpl.php +++ b/htdocs/core/tpl/ajaxrow.tpl.php @@ -16,6 +16,8 @@ * along with this program. If not, see . * * Javascript code to activate drag and drop on lines + * You can use this if you want to be abale to drag and drop rows of a table. + * You must add id="tablelines" ont table level tag and have count($object->lines) or count($taskarray) > 0 */ ?> @@ -26,6 +28,7 @@ $fk_element=$object->fk_element; $table_element_line=$object->table_element_line; $nboflines=(isset($object->lines)?count($object->lines):(isset($tasksarray)?count($tasksarray):0)); $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; +$tagidfortablednd=(empty($tagidfortablednd)?'tablelines':$tagidfortablednd); if (GETPOST('action') != 'editline' && $nboflines > 1) { ?> + @@ -37,32 +39,43 @@ if (empty($conf->global->MAIN_FEATURES_LEVEL)) This page is a sample of page using tables. To make test with
- css (edit page to change)
- jmobile (edit page to enable/disable)
-- dataTables.
+- dataTables
+- tablednd

-
Example 1 : Table using tags: div.tagtable+form+div or div.tagtable+div.tagtr+div.tagtd
+use_javascript_ajax) && $object->statut == 0) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; +?> -
-
-
snake
+
+ +
line1
-
snagfdgfd gd fgf ke
+
line2
dfsdf
-
+
-
snagfdgfd gd fgf ke
+
line3
dfsdf
-
+
+
+
+
line4
+
dfsdf
+
+
@@ -133,68 +146,89 @@ $('xxxth').replaceWith( - snagfdgfd gd fgf ke + line1 dfsdf xxx - snagfdgfd gd fgf ke + line2 dfsdf xxx - snagfdgfd gd fgf ke + line3 dfsdf xxx - snagfdgfd gd fgf ke + line4 dfsdf xxx - snagfdgfd gd fgf ke + line5 dfsdf xxx - snagfdgfd gd fgf ke + line6 dfsdf xxx - snagfdgfd gd fgf ke + line7 dfsdf xxx - snagfdgfd gd fgf ke + line8 dfsdf xxx - snagfdgfd gd fgf ke + line9 dfsdf xxx - snagfdgfd gd fgf ke + line10 dfsdf xxx - snagfdgfd gd fgf ke + line11 dfsdf xxx - snagfdgfd gd fgf ke + line12 dfsdf xxx + +

+ + + +
+Example 3 : Standard table
+use_javascript_ajax) && $object->statut == 0) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; +?> + + + + + +
title1title2
a1b1
a2b2
+
+ +
diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index beafd1c8d2f..4b5a40eee82 100644 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -374,6 +374,7 @@ td.showDragHandle { } .tdlineupdown { white-space: nowrap; + min-width: 10px; } /* ============================================================================== */ diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 22d0a5292a2..6e70faf60dd 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -256,6 +256,7 @@ td.showDragHandle { } .tdlineupdown { white-space: nowrap; + min-width: 10px; } diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 8cbf8829ac8..d0f3185cee9 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -282,6 +282,7 @@ td.showDragHandle { } .tdlineupdown { white-space: nowrap; + min-width: 10px; } diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index a3311ac2566..a6631db8e6e 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -256,6 +256,7 @@ td.showDragHandle { } .tdlineupdown { white-space: nowrap; + min-width: 10px; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index aeaabc585c5..209ce753814 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -426,6 +426,7 @@ td.showDragHandle { } .tdlineupdown { white-space: nowrap; + min-width: 10px; }