*
@@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobjectline.class.php';
/**
- * Classe des gestion des fiches interventions
+ * Class to manage interventions
*/
class Fichinter extends CommonObject
{
diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php
index 889e584d99a..edd5372471e 100644
--- a/htdocs/fichinter/fiche.php
+++ b/htdocs/fichinter/fiche.php
@@ -1682,11 +1682,11 @@ else if ($id > 0 || ! empty($ref))
{
if ($object->statut != 2)
{
- print '';
+ print '';
}
else
{
- print '';
+ print '';
}
}
}
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index f7eb1e49986..4dfb8489c9c 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -63,8 +63,9 @@ $search_status=GETPOST('search_status');
*/
$form = new Form($db);
+$interventionstatic=new Fichinter($db);
-llxHeader();
+llxHeader('', $langs->trans("Intervention"));
$sql = "SELECT";
@@ -102,8 +103,6 @@ if ($result)
{
$num = $db->num_rows($result);
- $interventionstatic=new Fichinter($db);
-
$urlparam="&socid=$socid";
print_barre_liste($langs->trans("ListOfInterventions"), $page, $_SERVER['PHP_SELF'], $urlparam, $sortfield, $sortorder, '', $num);
@@ -139,8 +138,8 @@ if ($result)
print ' ';
}
print '';
- $liststatus=array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Validated"), '2'=>$langs->trans("Billed"));
- print $form->selectarray('search_status', $liststatus, GETPOST('search_status'), 1);
+ $liststatus=$interventionstatic->statuts_short;
+ print $form->selectarray('search_status', $liststatus, GETPOST('search_status'), 1, 0, 0, '', 1);
print ' ';
print ' ';
print "\n";
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 2859620445e..c9969543d20 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -106,8 +106,8 @@ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='ye
if ($datepaye && ($datepaye < $tmpinvoice->date))
{
$langs->load("errors");
- $error++;
- setEventMessage($langs->transnoentities("ErrorPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'errors');
+ //$error++;
+ setEventMessage($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'warnings');
}
}
diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
index e6b8e526bf2..635154768bb 100644
--- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
+++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
@@ -20,6 +20,9 @@
+ALTER TABLE llx_fichinter ADD COLUMN ref_ext varchar(255);
+
+
-- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B)
ALTER TABLE llx_c_typent ADD COLUMN fk_country integer NULL AFTER libelle;
diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql
index 87769ab9558..868acf7fff0 100644
--- a/htdocs/install/mysql/migration/repair.sql
+++ b/htdocs/install/mysql/migration/repair.sql
@@ -108,6 +108,7 @@ UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps
-- VMYSQL DELETE from llx_menu where module = 'margins' and url = '/margin/index.php' and not exists (select * from llx_const where name = 'MAIN_MODULE_MARGIN' or name = 'MAIN_MODULE_MARGINS');
+ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur;
ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur;
@@ -178,3 +179,9 @@ UPDATE llx_actioncomm set fk_user_action = fk_user_author where fk_user_author >
-- DROP TABLE llx_pos_moviments;
-- DROP TABLE llx_pos_ticketdet;
+-- To replace amount on all invoice and lines when forgetting to apply a 20% vat
+-- update llx_facturedet set tva_tx = 20 where tva_tx = 0;
+-- update llx_facturedet set total_ht = round(total_ttc / 1.2, 5) where total_ht = total_ttc;
+-- update llx_facturedet set total_tva = total_ttc - total_ht where total_vat = 0;
+-- update llx_facture set total = round(total_ttc / 1.2, 5) where total_ht = total_ttc;
+-- update llx_facture set tva = total_ttc - total where tva = 0;
diff --git a/htdocs/install/mysql/tables/llx_fichinter.sql b/htdocs/install/mysql/tables/llx_fichinter.sql
index b2397b2d2c3..242710a0993 100644
--- a/htdocs/install/mysql/tables/llx_fichinter.sql
+++ b/htdocs/install/mysql/tables/llx_fichinter.sql
@@ -24,6 +24,7 @@ create table llx_fichinter
fk_projet integer DEFAULT 0, -- projet auquel est rattache la fiche
fk_contrat integer DEFAULT 0, -- contrat auquel est rattache la fiche
ref varchar(30) NOT NULL, -- number
+ ref_ext varchar(255),
entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp,
datec datetime, -- date de creation
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index 6745b56daf1..0c1ad62eab2 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -122,6 +122,7 @@ CustomerInvoicePayment=Payment of invoice customer
ThirdPartyAccount=Thirdparty account
+NewAccountingMvt=New movement
NumMvts=Number of movement
ListeMvts=List of the movement
ErrorDebitCredit=Debit and Credit cannot have a value at the same time
diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang
index 728661dfa04..66ddea95a5c 100644
--- a/htdocs/langs/en_US/donations.lang
+++ b/htdocs/langs/en_US/donations.lang
@@ -30,3 +30,4 @@ SearchADonation=Search a donation
DonationRecipient=Donation recipient
ThankYou=Thank You
IConfirmDonationReception=The recipient declare reception, as a donation, of the following amount
+MinimumAmount=Minimum amount is %s
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 89404614db5..ed8354b9e8d 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -133,7 +133,6 @@ ErrorPHPNeedModule=Error, your PHP must have module %s installed to use t
ErrorOpenIDSetupNotComplete=You setup Dolibarr config file to allow OpenID authentication, but URL of OpenID service is not defined into constant %s
ErrorWarehouseMustDiffers=Source and target warehouses must differs
ErrorBadFormat=Bad format!
-ErrorPaymentDateLowerThanInvoiceDate=Payment date (%s) cant' be before invoice date (%s) for invoice %s.
ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, this member is not yet linked to any thirdparty. Link member to an existing third party or create a new thirdparty before creating subscription with invoice.
ErrorThereIsSomeDeliveries=Error, there is some deliveries linked to this shipment. Deletion refused.
ErrorCantDeletePaymentReconciliated=Can't delete a payment that had generated a bank transaction that was conciliated
@@ -155,4 +154,6 @@ WarningCloseAlways=Warning, closing is done even if amount differs between sourc
WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box.
WarningClickToDialUserSetupNotComplete=Setup of ClickToDial information for your user are not complete (see tab ClickToDial onto your user card).
WarningNotRelevant=Irrelevant operation for this dataset
-WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs=Feature disabled when display setup is optimized for blind person or text browsers.
\ No newline at end of file
+WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs=Feature disabled when display setup is optimized for blind person or text browsers.
+WarningPaymentDateLowerThanInvoiceDate=Payment date (%s) is earlier than invoice date (%s) for invoice %s.
+WarningTooManyDataPleaseUseMoreFilters=Too many data. Please use more filters
diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang
index 266ce059d8b..17641a0ab3e 100644
--- a/htdocs/langs/en_US/interventions.lang
+++ b/htdocs/langs/en_US/interventions.lang
@@ -24,8 +24,8 @@ NameAndSignatureOfInternalContact=Name and signature of intervening :
NameAndSignatureOfExternalContact=Name and signature of customer :
DocumentModelStandard=Standard document model for interventions
InterventionCardsAndInterventionLines=Interventions and lines of interventions
-ClassifyBilled=Classify "Billed"
-ClassifyUnBilled=Classify "Unbilled"
+InterventionClassifyBilled=Classify "Billed"
+InterventionClassifyUnBilled=Classify "Unbilled"
StatusInterInvoiced=Billed
RelatedInterventions=Related interventions
ShowIntervention=Show intervention
diff --git a/htdocs/langs/es_ES/accountancy.lang b/htdocs/langs/es_ES/accountancy.lang
index afcb8456a5d..624e2c02291 100644
--- a/htdocs/langs/es_ES/accountancy.lang
+++ b/htdocs/langs/es_ES/accountancy.lang
@@ -120,6 +120,7 @@ CustomerInvoicePayment=Pago Factura a cliente
ThirdPartyAccount=Cuenta tercero
+NewAccountingMvt=Nueva movimiento
NumMvts=Número de movimiento
ListeMvts=Apuntes del movimiento
ErrorDebitCredit=Débito y Crédito no pueden terner valor al mismo tiempo
diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang
index 818b93c87c0..926a356db32 100644
--- a/htdocs/langs/es_ES/errors.lang
+++ b/htdocs/langs/es_ES/errors.lang
@@ -133,7 +133,6 @@ ErrorPHPNeedModule=Error, su PHP debe tener instalado el módulo %s para
ErrorOpenIDSetupNotComplete=Ha configurado Dolibarr para aceptar la autentificación OpenID, pero la URL del servicio OpenID no se encuentra definida en la constante %s
ErrorWarehouseMustDiffers=El almacén de origen y destino deben de ser diferentes
ErrorBadFormat=¡El formato es erróneo!
-ErrorPaymentDateLowerThanInvoiceDate=La fecha de pago (%s) no puede ser anterior a la fecha (%s) de la factura %s.
ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, este miembro aún no está enlazado a un tercero. Enlace el miembro a un tercero existente o cree un tercero nuevo antes de crear la suscripción con la factura.
ErrorThereIsSomeDeliveries=Error, hay entregas vinculadas a este envío. No se puede eliminar.
ErrorCantDeletePaymentReconciliated=No se puede eliminar un pago que ha generado una transacción bancaria que se encuentra conciliada
@@ -156,3 +155,4 @@ WarningUsingThisBoxSlowDown=Atención, el uso de este panel provoca serias ralen
WarningClickToDialUserSetupNotComplete=La configuración de ClickToDial para su cuenta de usuario no está completa (vea la pestaña ClickToDial en su ficha de usuario)
WarningNotRelevant=Operación irrelevante para este conjunto de datos
WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs=Funcionalidad desactivada cuando la configuración de visualización es optimizada para personas ciegas o navegadores de texto.
+WarningPaymentDateLowerThanInvoiceDate=La fecha de pago (%s) es anterior a la fecha (%s) de la factura %s.
diff --git a/htdocs/langs/fr_FR/accountancy.lang b/htdocs/langs/fr_FR/accountancy.lang
index 72c7475fd1d..8f66eb5319f 100644
--- a/htdocs/langs/fr_FR/accountancy.lang
+++ b/htdocs/langs/fr_FR/accountancy.lang
@@ -122,6 +122,7 @@ CustomerInvoicePayment=Règlement de facture client
ThirdPartyAccount=Compte tiers
+NewAccountingMvt=Nouveau mouvement
NumMvts=Numéro de mouvement
ListeMvts=Liste du mouvement
ErrorDebitCredit=Debit et Credit ne peuvent avoir une valeur en même temps
diff --git a/htdocs/langs/fr_FR/donations.lang b/htdocs/langs/fr_FR/donations.lang
index 9af7a87a12d..2da59454571 100644
--- a/htdocs/langs/fr_FR/donations.lang
+++ b/htdocs/langs/fr_FR/donations.lang
@@ -37,4 +37,5 @@ IConfirmDonationReception=Le bénéficiaire reconnait avoir reçu au titre des d
FrenchOptions=Options éligibles en France
DONATION_ART200=Les dons ou versements reçus sont éligibles à l'article 200 du CGI
DONATION_ART238=Les dons ou versements reçus sont éligibles à l'article 238bis du CGI
-DONATION_ART885=Les dons ou versements reçus sont éligibles à l'article 885-0 V bis A du CGI
\ No newline at end of file
+DONATION_ART885=Les dons ou versements reçus sont éligibles à l'article 885-0 V bis A du CGI
+MinimumAmount=Le montant minimum du don est de %s
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang
index 3cd8609a047..954a83375b9 100644
--- a/htdocs/langs/fr_FR/errors.lang
+++ b/htdocs/langs/fr_FR/errors.lang
@@ -133,7 +133,6 @@ ErrorPHPNeedModule=Erreur, votre PHP doit avoir le module %s installé po
ErrorOpenIDSetupNotComplete=Vous avez configuré Dolibarr pour accepter l'authentication OpenID, mais l'URL du service OpenID n'est pas défini dans la constante %s
ErrorWarehouseMustDiffers=Les entrepôts source et destination doivent être différents
ErrorBadFormat=Mauvais format
-ErrorPaymentDateLowerThanInvoiceDate=La date de paiement (%s) ne peut être inférieure à la date de facturaction (%s) de la facture %s.
ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Erreur, cet adhérent n'est lié à aucun tiers. Lier l'adhérent à un tiers existant ou créer un nouveau tiers pour le lier avant de créer l'adhésion avec facture.
ErrorThereIsSomeDeliveries=Erreur, il y a des bordereaux de réception liées à ces expéditions. La suppression est refusée.
@@ -154,3 +153,4 @@ WarningUsingThisBoxSlowDown=Attention, l'utilisation de cette boite provoque de
WarningClickToDialUserSetupNotComplete=La configuration ClickToDial pour votre compte utilisateur n'est pas complète (voir l'onglet ClickToDial sur votre fiche utilisateur)
WarningNotRelevant=Opération non pertinente pour cet ensemble de données
WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs=Fonction désactivé quand l'affichage est en mode optimisé pour les personnes aveugles ou les navigateurs textes.
+WarningPaymentDateLowerThanInvoiceDate=La date de paiement (%s) est inférieure à la date de facturaction (%s) de la facture %s.
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 06505a8fbc6..8bd8632e2e1 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1398,7 +1398,7 @@ class Product extends CommonObject
return -1;
}
- $sql = "SELECT rowid, ref, label, description, url, note, customcode, fk_country, price, price_ttc,";
+ $sql = "SELECT rowid, ref, ref_ext, label, description, url, note, customcode, fk_country, price, price_ttc,";
$sql.= " price_min, price_min_ttc, price_base_type, tva_tx, recuperableonly as tva_npr, localtax1_tx, localtax2_tx, tosell,";
$sql.= " tobuy, fk_product_type, duration, seuil_stock_alerte, canvas,";
$sql.= " weight, weight_units, length, length_units, surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,";
@@ -1423,6 +1423,7 @@ class Product extends CommonObject
$this->id = $obj->rowid;
$this->ref = $obj->ref;
+ $this->ref_ext = $obj->ref_ext;
$this->libelle = $obj->label; // TODO deprecated
$this->label = $obj->label;
$this->description = $obj->description;
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index f4815c936f9..f359f789c3f 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -41,9 +41,10 @@ $mine = GETPOST('mode')=='mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$object = new Project($db);
-if ($ref)
+if ($id > 0 || ! empty($ref))
{
- $object->fetch(0,$ref);
+ $object->fetch($id,$ref);
+ $object->fetch_thirdparty();
$id=$object->id;
}
@@ -140,82 +141,73 @@ $userstatic=new User($db);
if ($id > 0 || ! empty($ref))
{
- if ( $object->fetch($id,$ref) > 0)
+ // To verify role of users
+ //$userAccess = $object->restrictedProjectArea($user,'read');
+ $userWrite = $object->restrictedProjectArea($user,'write');
+ //$userDelete = $object->restrictedProjectArea($user,'delete');
+ //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
+
+ $head = project_prepare_head($object);
+ dol_fiche_head($head, 'contact', $langs->trans("Project"), 0, ($object->public?'projectpub':'project'));
+
+
+ /*
+ * Projet synthese pour rappel
+ */
+ print '';
+
+ $linkback = ''.$langs->trans("BackToList").' ';
+
+ // Ref
+ print ''.$langs->trans('Ref').' ';
+ // Define a complementary filter for search of next/prev ref.
+ if (! $user->rights->projet->all->lire)
{
- if ($object->societe->id > 0) $result=$object->societe->fetch($object->societe->id);
-
- // To verify role of users
- //$userAccess = $object->restrictedProjectArea($user,'read');
- $userWrite = $object->restrictedProjectArea($user,'write');
- //$userDelete = $object->restrictedProjectArea($user,'delete');
- //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
-
- $head = project_prepare_head($object);
- dol_fiche_head($head, 'contact', $langs->trans("Project"), 0, ($object->public?'projectpub':'project'));
-
-
- /*
- * Projet synthese pour rappel
- */
- print '';
-
- $linkback = ''.$langs->trans("BackToList").' ';
-
- // Ref
- print ''.$langs->trans('Ref').' ';
- // Define a complementary filter for search of next/prev ref.
- if (! $user->rights->projet->all->lire)
- {
- $objectsListId = $object->getProjectsAuthorizedForUser($user,$mine,0);
- $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
- }
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
- print ' ';
-
- // Label
- print ''.$langs->trans("Label").' '.$object->title.' ';
-
- // Customer
- print "".$langs->trans("ThirdParty")." ";
- print '';
- if ($object->societe->id > 0) print $object->societe->getNomUrl(1);
- else print ' ';
- print ' ';
-
- // Visibility
- print ''.$langs->trans("Visibility").' ';
- if ($object->public) print $langs->trans('SharedProject');
- else print $langs->trans('PrivateProject');
- print ' ';
-
- // Statut
- print ''.$langs->trans("Status").' '.$object->getLibStatut(4).' ';
-
- // Date start
- print ''.$langs->trans("DateStart").' ';
- print dol_print_date($object->date_start,'day');
- print ' ';
-
- // Date end
- print ''.$langs->trans("DateEnd").' ';
- print dol_print_date($object->date_end,'day');
- print ' ';
-
- print "
";
-
- print '';
-
- // Contacts lines (modules that overwrite templates must declare this into descriptor)
- $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
- foreach($dirtpls as $reldir)
- {
- $res=@include dol_buildpath($reldir.'/contacts.tpl.php');
- if ($res) break;
- }
+ $objectsListId = $object->getProjectsAuthorizedForUser($user,$mine,0);
+ $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
}
- else
+ print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+ print ' ';
+
+ // Label
+ print ''.$langs->trans("Label").' '.$object->title.' ';
+
+ // Customer
+ print "".$langs->trans("ThirdParty")." ";
+ print '';
+ if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1);
+ else print ' ';
+ print ' ';
+
+ // Visibility
+ print ''.$langs->trans("Visibility").' ';
+ if ($object->public) print $langs->trans('SharedProject');
+ else print $langs->trans('PrivateProject');
+ print ' ';
+
+ // Statut
+ print ''.$langs->trans("Status").' '.$object->getLibStatut(4).' ';
+
+ // Date start
+ print ''.$langs->trans("DateStart").' ';
+ print dol_print_date($object->date_start,'day');
+ print ' ';
+
+ // Date end
+ print ''.$langs->trans("DateEnd").' ';
+ print dol_print_date($object->date_end,'day');
+ print ' ';
+
+ print "
";
+
+ print '';
+
+ // Contacts lines (modules that overwrite templates must declare this into descriptor)
+ $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
+ foreach($dirtpls as $reldir)
{
- print "ErrorRecordNotFound";
+ $res=@include dol_buildpath($reldir.'/contacts.tpl.php');
+ if ($res) break;
}
}
diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php
index d40682d7ce6..611fc314481 100644
--- a/htdocs/projet/document.php
+++ b/htdocs/projet/document.php
@@ -46,9 +46,9 @@ if ($user->societe_id > 0) $socid=$user->societe_id;
$result=restrictedArea($user,'projet',$id,'');
$object = new Project($db);
-$object->fetch($id,$ref);
-if ($object->id > 0)
+if ($id > 0 || ! empty($ref))
{
+ $object->fetch($id,$ref);
$object->fetch_thirdparty();
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
}
@@ -85,8 +85,6 @@ if ($object->id > 0)
{
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref);
- if ($object->societe->id > 0) $result=$object->societe->fetch($object->societe->id);
-
// To verify role of users
//$userAccess = $object->restrictedProjectArea($user,'read');
$userWrite = $object->restrictedProjectArea($user,'write');
@@ -124,7 +122,7 @@ if ($object->id > 0)
// Company
print ''.$langs->trans("ThirdParty").' ';
- if (! empty($object->societe->id)) print $object->societe->getNomUrl(1);
+ if (! empty($object->thirdparty->id)) print $object->thirdparty->getNomUrl(1);
else print ' ';
print ' ';
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index abdf6f81b5b..b5a1d089c96 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -61,12 +61,17 @@ $mine = $_REQUEST['mode']=='mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$project = new Project($db);
-if ($ref)
+if ($id > 0 || ! empty($ref))
{
- $project->fetch(0,$ref);
+ $project->fetch($id,$ref);
+ $project->fetch_thirdparty();
$projectid=$project->id;
-}else {
+}
+else
+{
$project->fetch($projectid);
+ $project->fetch_thirdparty();
+ $projectid=$project->id;
}
// Security check
@@ -87,10 +92,6 @@ $formproject=new FormProjets($db);
$userstatic=new User($db);
-$project = new Project($db);
-$project->fetch($projectid,$ref);
-$project->fetch_thirdparty();
-
// To verify role of users
$userAccess = $project->restrictedProjectArea($user);
diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php
index b87a89181c5..1fe3d91346d 100644
--- a/htdocs/projet/fiche.php
+++ b/htdocs/projet/fiche.php
@@ -49,10 +49,11 @@ $hookmanager->initHooks(array('projectcard'));
$object = new Project($db);
$extrafields = new ExtraFields($db);
-$object->fetch($id,$ref);
-if ($object->id > 0)
+if ($id > 0 || ! empty($ref))
{
+ $object->fetch($id,$ref);
$object->fetch_thirdparty();
+ $id=$object->id;
}
// Security check
@@ -259,8 +260,8 @@ if (empty($reshook))
{
$db->commit();
- if (GETPOST('socid','int') > 0) $object->societe->fetch(GETPOST('socid','int'));
- else unset($object->societe);
+ if (GETPOST('socid','int') > 0) $object->thirdparty->fetch(GETPOST('socid','int'));
+ else unset($object->thirdparty);
}
}
@@ -488,7 +489,6 @@ else
* Show or edit
*/
- if ($object->societe->id > 0) $result=$object->societe->fetch($object->societe->id);
$res=$object->fetch_optionals($object->id,$extralabels);
// To verify role of users
@@ -562,7 +562,7 @@ else
// Customer
print ''.$langs->trans("ThirdParty").' ';
- $text=$form->select_company($object->societe->id,'socid','',1,1);
+ $text=$form->select_company($object->thirdparty->id,'socid','',1,1);
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
print $form->textwithtooltip($text.' '.img_help(),$texthelp,1);
print ' ';
@@ -633,7 +633,7 @@ else
// Third party
print ''.$langs->trans("ThirdParty").' ';
- if ($object->societe->id > 0) print $object->societe->getNomUrl(1);
+ if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1);
else print' ';
print ' ';
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index 79d302addd3..0c06c30ba57 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -38,9 +38,10 @@ $mine = ($mode == 'mine' ? 1 : 0);
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$object = new Project($db);
-if ($ref)
+if ($id > 0 || ! empty($ref))
{
- $object->fetch(0,$ref);
+ $object->fetch($id,$ref);
+ $object->fetch_thirdparty();
$id=$object->id;
}
@@ -69,7 +70,6 @@ $formother=new FormOther($db);
$userstatic=new User($db);
$companystatic=new Societe($db);
$task = new Task($db);
-$object = new Project($db);
$arrayofcss=array('/includes/jsgantt/jsgantt.css');
@@ -86,9 +86,6 @@ llxHeader("",$langs->trans("Tasks"),$help_url,'',0,0,$arrayofjs,$arrayofcss);
if ($id > 0 || ! empty($ref))
{
- $object->fetch($id,$ref);
- if ($object->societe->id > 0) $result=$object->societe->fetch($object->societe->id);
-
// To verify role of users
//$userAccess = $object->restrictedProjectArea($user,'read');
$userWrite = $object->restrictedProjectArea($user,'write');
@@ -123,7 +120,7 @@ if ($id > 0 || ! empty($ref))
print ''.$langs->trans("Label").' '.$object->title.' ';
print ''.$langs->trans("ThirdParty").' ';
- if (! empty($object->societe->id)) print $object->societe->getNomUrl(1);
+ if (! empty($object->thirdparty->id)) print $object->thirdparty->getNomUrl(1);
else print ' ';
print ' ';
print ' ';
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 9622f4fa480..4e81c2efca3 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -180,9 +180,10 @@ if ( $resql )
if ($num > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
{
-/* print '';
+/* $langs->load("errors");
+ print ' ';
print '';
- print $langs->trans("TooManyDataPleaseUseMoreFilters");
+ print $langs->trans("WarningTooManyDataPleaseUseMoreFilters");
print ' ';*/
}
else
diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php
index 493141cbe95..a086f632a36 100644
--- a/htdocs/projet/note.php
+++ b/htdocs/projet/note.php
@@ -36,9 +36,10 @@ $mine = $_REQUEST['mode']=='mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$object = new Project($db);
-if ($ref)
+if ($id > 0 || ! empty($ref))
{
- $object->fetch(0,$ref);
+ $object->fetch($id,$ref);
+ $object->fetch_thirdparty();
$id=$object->id;
}
@@ -66,77 +67,71 @@ llxHeader("",$langs->trans("Project"),$help_url);
$form = new Form($db);
$userstatic=new User($db);
-$object = new Project($db);
$now=dol_now();
if ($id > 0 || ! empty($ref))
{
- if ($object->fetch($id, $ref))
+ // To verify role of users
+ //$userAccess = $object->restrictedProjectArea($user,'read');
+ $userWrite = $object->restrictedProjectArea($user,'write');
+ //$userDelete = $object->restrictedProjectArea($user,'delete');
+ //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
+
+ $head = project_prepare_head($object);
+ dol_fiche_head($head, 'notes', $langs->trans('Project'), 0, ($object->public?'projectpub':'project'));
+
+ print '';
+
+ $linkback = ''.$langs->trans("BackToList").' ';
+
+ // Ref
+ print ''.$langs->trans("Ref").' ';
+ // Define a complementary filter for search of next/prev ref.
+ if (! $user->rights->projet->all->lire)
{
- if ($object->societe->id > 0) $result=$object->societe->fetch($object->societe->id);
-
- // To verify role of users
- //$userAccess = $object->restrictedProjectArea($user,'read');
- $userWrite = $object->restrictedProjectArea($user,'write');
- //$userDelete = $object->restrictedProjectArea($user,'delete');
- //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
-
- $head = project_prepare_head($object);
- dol_fiche_head($head, 'notes', $langs->trans('Project'), 0, ($object->public?'projectpub':'project'));
-
- print '';
-
- $linkback = ''.$langs->trans("BackToList").' ';
-
- // Ref
- print ''.$langs->trans("Ref").' ';
- // Define a complementary filter for search of next/prev ref.
- if (! $user->rights->projet->all->lire)
- {
- $projectsListId = $object->getProjectsAuthorizedForUser($user,$mine,0);
- $object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
- }
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
- print ' ';
-
- // Label
- print ''.$langs->trans("Label").' '.$object->title.' ';
-
- // Third party
- print ''.$langs->trans("ThirdParty").' ';
- if ($object->societe->id > 0) print $object->societe->getNomUrl(1);
- else print' ';
- print ' ';
-
- // Visibility
- print ''.$langs->trans("Visibility").' ';
- if ($object->public) print $langs->trans('SharedProject');
- else print $langs->trans('PrivateProject');
- print ' ';
-
- // Statut
- print ''.$langs->trans("Status").' '.$object->getLibStatut(4).' ';
-
- // Date start
- print ''.$langs->trans("DateStart").' ';
- print dol_print_date($object->date_start,'day');
- print ' ';
-
- // Date end
- print ''.$langs->trans("DateEnd").' ';
- print dol_print_date($object->date_end,'day');
- print ' ';
-
- print "
";
-
- print ' ';
-
- $colwidth=30;
- include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
-
- dol_fiche_end();;
+ $projectsListId = $object->getProjectsAuthorizedForUser($user,$mine,0);
+ $object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
}
+ print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+ print ' ';
+
+ // Label
+ print ''.$langs->trans("Label").' '.$object->title.' ';
+
+ // Third party
+ print ''.$langs->trans("ThirdParty").' ';
+ if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1);
+ else print' ';
+ print ' ';
+
+ // Visibility
+ print ''.$langs->trans("Visibility").' ';
+ if ($object->public) print $langs->trans('SharedProject');
+ else print $langs->trans('PrivateProject');
+ print ' ';
+
+ // Statut
+ print ''.$langs->trans("Status").' '.$object->getLibStatut(4).' ';
+
+ // Date start
+ print ''.$langs->trans("DateStart").' ';
+ print dol_print_date($object->date_start,'day');
+ print ' ';
+
+ // Date end
+ print ''.$langs->trans("DateEnd").' ';
+ print dol_print_date($object->date_end,'day');
+ print ' ';
+
+ print "
";
+
+ print ' ';
+
+ $colwidth=30;
+ include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
+
+ dol_fiche_end();;
}
llxFooter();
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index f72b8c6963d..994779fcac9 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -47,7 +47,7 @@ $object = new Project($db);
$taskstatic = new Task($db);
$extrafields_project = new ExtraFields($db);
$extrafields_task = new ExtraFields($db);
-if ($id > 0 || $ref)
+if ($id > 0 || ! empty($ref))
{
$object->fetch($id,$ref);
$id=$object->id;
@@ -130,8 +130,8 @@ if ($action == 'createtask' && $user->rights->projet->creer)
if ($taskid > 0)
{
$result = $task->add_contact($_POST["userid"], 'TASKEXECUTIVE', 'internal');
- }
- else
+ }
+ else
{
setEventMessage($task->error,'errors');
setEventMessage($task->errors,'errors');
@@ -183,7 +183,7 @@ llxHeader("",$langs->trans("Tasks"),$help_url);
if ($id > 0 || ! empty($ref))
{
$object->fetch($id, $ref);
- if ($object->societe->id > 0) $result=$object->societe->fetch($object->societe->id);
+ $object->fetch_thirdparty();
$res=$object->fetch_optionals($object->id,$extralabels_projet);
@@ -198,7 +198,7 @@ if ($id > 0 || ! empty($ref))
$head=project_prepare_head($object);
dol_fiche_head($head, $tab, $langs->trans("Project"),0,($object->public?'projectpub':'project'));
-
+
$param=($mode=='mine'?'&mode=mine':'');
print '';
@@ -221,7 +221,7 @@ if ($id > 0 || ! empty($ref))
print ''.$langs->trans("Label").' '.$object->title.' ';
print ''.$langs->trans("ThirdParty").' ';
- if (! empty($object->societe->id)) print $object->societe->getNomUrl(1);
+ if (! empty($object->thirdparty->id)) print $object->thirdparty->getNomUrl(1);
else print ' ';
print ' ';
print ' ';
@@ -259,7 +259,7 @@ if ($id > 0 || ! empty($ref))
}
-if ($action == 'create' && $user->rights->projet->creer && (empty($object->societe->id) || $userWrite > 0))
+if ($action == 'create' && $user->rights->projet->creer && (empty($object->thirdparty->id) || $userWrite > 0))
{
if ($id > 0 || ! empty($ref)) print ' ';
diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php
index 1b915ceca19..cdf90a918a3 100644
--- a/htdocs/projet/tasks/index.php
+++ b/htdocs/projet/tasks/index.php
@@ -128,9 +128,10 @@ print "\n";
if (count($tasksarray) > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
{
+ $langs->load("errors");
print '';
print '';
- print $langs->trans("TooManyDataPleaseUseMoreFilters");
+ print $langs->trans("WarningTooManyDataPleaseUseMoreFilters");
print ' ';
}
else