Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
77cfdfd59e
96
ChangeLog
96
ChangeLog
@ -153,56 +153,63 @@ parameter. All methods addline in this case were modified to remove this paramet
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.4.3 compared to 3.4.2 *****
|
||||
Fix: Bad get of localtaxes into contracts add lines
|
||||
|
||||
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
|
||||
Fix: field's problem into company's page (RIB)
|
||||
Fix: Document cerfa doesn't contained firstname & lastname from donator
|
||||
Fix: field's problem into company's page (RIB).
|
||||
Fix: Document cerfa doesn't contained firstname & lastname from donator.
|
||||
Fix: Bad rounding on margin calculations and display.
|
||||
Fix: Option drop table into backup was broken.
|
||||
Fix: [ bug #1105 ] Searching Boxes other search option
|
||||
Fix: wrong buy price update
|
||||
Fix: [ bug #1142 ] Set paiement on invoice (PGSql)
|
||||
Fix: [ bug #1145 ] Agenda button list type do not display
|
||||
Fix: [ bug #1148 ] Product consomation : supplier order bad status
|
||||
Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists
|
||||
Fix: [ bug #1174 ] Product translated description not good into PDF
|
||||
Fix: [ bug #1163 ] SQL Error when searching for supplier orders
|
||||
Fix: [ bug #1162 ] Translaction for morning and afternoon
|
||||
Fix: [ bug #1161 ] Search on product label
|
||||
Fix: [ bug #1105 ] Searching Boxes other search option.
|
||||
Fix: wrong buy price update.
|
||||
Fix: [ bug #1142 ] Set paiement on invoice (PGSql).
|
||||
Fix: [ bug #1145 ] Agenda button list type do not display.
|
||||
Fix: [ bug #1148 ] Product consomation : supplier order bad status.
|
||||
Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists.
|
||||
Fix: [ bug #1174 ] Product translated description not good into PDF.
|
||||
Fix: [ bug #1163 ] SQL Error when searching for supplier orders.
|
||||
Fix: [ bug #1162 ] Translaction for morning and afternoon.
|
||||
Fix: [ bug #1161 ] Search on product label.
|
||||
Fix: [ bug #1075 ] POS module doesn't decrement stock of products in delayed payment mode.
|
||||
Fix: [ bug #1171 ] Documents lost in interventions after validating
|
||||
Fix: fix unsubscribe URL into mailing when sending manually (not by script)
|
||||
Fix: [ bug #1182 ] ODT company_country tag is htmlencoded
|
||||
Fix: [ bug #1196 ] Product barcode search does not expect 13th digit on EAN13 type
|
||||
Fix: [ bug #1202 ] Wrong amount in deposit % invoice from proposal
|
||||
Fix: [ bug #1171 ] Documents lost in interventions after validating.
|
||||
Fix: fix unsubscribe URL into mailing when sending manually (not by script).
|
||||
Fix: [ bug #1182 ] ODT company_country tag is htmlencoded.
|
||||
Fix: [ bug #1196 ] Product barcode search does not expect 13th digit on EAN13 type.
|
||||
Fix: [ bug #1202 ] Wrong amount in deposit % invoice from proposal.
|
||||
Fix: Removed analytics tags into doc page.
|
||||
Fix: Call Image on this instead of pdf.
|
||||
Fix: Missing parameter for photo.
|
||||
Fix: Bad SQL request for turnover report.
|
||||
|
||||
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
|
||||
Fix: Display buying price on line edit when no supplier price is defined
|
||||
Fix: Retrieving of margin info when invoice created automatically from order
|
||||
Fix: Reordering supplier products in list by supplier or supplier ref was crashing
|
||||
Fix: [ bug #1029 ] Tulip numbering mask
|
||||
Fix: Supplier invoice and supplier order are not displayed into object link into agenda event card
|
||||
Fix: [ bug #1033 ] SUPPLIER REF disappeared
|
||||
Fix: update extrafield do not display immediately after update
|
||||
Fix: Fix bug with canvas thirdparty
|
||||
Fix: [ bug #1037 ] Consumption> Supplier invoices related
|
||||
Fix: User group name do not display in card (view or edit mode)
|
||||
Fix: Link "Show all supplier invoice" on supplier card not working
|
||||
Fix: [ bug #1039 ] Pre-defined invoices conversion
|
||||
Fix: If only service module is activated, it's impossible to delete service
|
||||
Fix: [ bug #1043 ] Bad interventions ref numbering
|
||||
Fix: Mailing module : if an email is already in destinaires list all other email from selector was not inserted
|
||||
Fix: Localtaxes balance not showing
|
||||
Fix: Intervention box links to contracts id
|
||||
Fix: Compatibility with multicompany module
|
||||
Fix: Edit propal line was losing product supplier price id
|
||||
Fix: Delete linked element to supplier invoice when deleted
|
||||
Fix: [ bug #1061 ] Bad info shipped products
|
||||
Fix: [ bug #1062 ] Documents lost in propals and contracts validating
|
||||
Fix: Supplier price displayed on document lines and margin infos didnt take discount
|
||||
Fix: sorting on qty did not work in supplier product list
|
||||
Fix: there was no escaping on filter fields in supplier product list
|
||||
Fix: bugs on margin reports and better margin calculation on credit notes
|
||||
Qual: Add travis-ci integration
|
||||
Fix: Display buying price on line edit when no supplier price is defined.
|
||||
Fix: Retrieving of margin info when invoice created automatically from order.
|
||||
Fix: Reordering supplier products in list by supplier or supplier ref was crashing.
|
||||
Fix: [ bug #1029 ] Tulip numbering mask.
|
||||
Fix: Supplier invoice and supplier order are not displayed into object link into agenda event card.
|
||||
Fix: [ bug #1033 ] SUPPLIER REF disappeared.
|
||||
Fix: update extrafield do not display immediatly after update.
|
||||
Fix: Fix bug with canvas thirdparty.
|
||||
Fix: [ bug #1037 ] Consumption> Supplier invoices related.
|
||||
Fix: User group name do not display in card (view or edit mode).
|
||||
Fix: Link "Show all supplier invoice" on suplier card not working.
|
||||
Fix: [ bug #1039 ] Pre-defined invoices conversion.
|
||||
Fix: If only service module is activated, it's impossible to delete service.
|
||||
Fix: [ bug #1043 ] Bad interventions ref numbering.
|
||||
Fix: Mailing module : if an email is already in destinaires list all other email from selector was not inserted.
|
||||
Fix: Localtaxes balance not showing.
|
||||
Fix: Intervention box links to contracts id.
|
||||
Fix: Compatiblity with multicompany module.
|
||||
Fix: Edit propal line was losing product supplier price id.
|
||||
Fix: Delete linked element to supplier invoice when deleted.
|
||||
Fix: [ bug #1061 ] Bad info shipped products.
|
||||
Fix: [ bug #1062 ] Documents lost in propals and contracts validating.
|
||||
Fix: Supplier price displayed on document lines and margin infos didnt take discount.
|
||||
Fix: sorting on qty did not work in supplier product list.
|
||||
Fix: there was no escaping on filter fields in supplier product list.
|
||||
Fix: bugs on margin reports and better margin calculation on credit notes.
|
||||
Qual: Add travis-ci integration.
|
||||
|
||||
***** ChangeLog for 3.4 compared to 3.3.* *****
|
||||
For users:
|
||||
@ -301,6 +308,7 @@ backport commit 384e3812eb73a15adafb472cacfb93397a54459b to fix W3C/edit contrac
|
||||
|
||||
|
||||
***** ChangeLog for 3.3.5 compared to 3.3.4 *****
|
||||
- Fix: Change to make debian package ok despite removal of ckeditor.
|
||||
- Fix: jcrop file to match debian rules
|
||||
- Fix: Add missing country UK.
|
||||
- Fix: Minor fix into package.
|
||||
|
||||
80
README.md
80
README.md
@ -76,61 +76,63 @@ See ChangeLog file found into package.
|
||||
|
||||
### Main modules/features:
|
||||
|
||||
- Customers, Prospects or Suppliers directory
|
||||
- Products and services catalog
|
||||
- Bank accounts management
|
||||
- Orders management
|
||||
- Commercial proposals management
|
||||
- Contracts management
|
||||
- Invoices management
|
||||
- Payments management
|
||||
- Standing orders management
|
||||
- Stock management
|
||||
- Shipping management
|
||||
- Customers, Prospects or Suppliers directory.
|
||||
- Products and services catalog.
|
||||
- Bank accounts management.
|
||||
- Orders management.
|
||||
- Commercial proposals management.
|
||||
- Contracts management.
|
||||
- Invoices management.
|
||||
- Payments management.
|
||||
- Standing orders management.
|
||||
- Stock management.
|
||||
- Shipping management.
|
||||
- PDF or ODT generation for invoice, proposals, orders...
|
||||
- Agenda with ical,vcal export for third tools integration
|
||||
- EDM (Electronic Document Management)
|
||||
- Foundations members management
|
||||
- Employee's holidays management
|
||||
- Mass Emailing
|
||||
- Realize surveys
|
||||
- Point of Sale
|
||||
- Agenda with ical,vcal export for third tools integration.
|
||||
- EDM (Electronic Document Management).
|
||||
- Foundations members management.
|
||||
- Employee's holidays management.
|
||||
- Mass Emailing.
|
||||
- Realize surveys.
|
||||
- Point of Sale.
|
||||
|
||||
### Other modules:
|
||||
|
||||
- Bookmarks management
|
||||
- Donations management
|
||||
- Reporting
|
||||
- Data export/import
|
||||
- LDAP connectivity
|
||||
- Third parties or products categories
|
||||
- ClickToDial integration
|
||||
- RSS integration
|
||||
- Bookmarks management.
|
||||
- Donations management.
|
||||
- Reporting.
|
||||
- Data export/import.
|
||||
- Third parties or products categories.
|
||||
- LDAP connectivity.
|
||||
- ClickToDial integration.
|
||||
- RSS integration.
|
||||
- Can be extended with a lot of other external modules available onto DoliStore.com.
|
||||
|
||||
### Miscellaneous:
|
||||
|
||||
- Multi-user, with several permissions levels for each feature.
|
||||
- Serveral menu managers (can be used by internal users, as a back-office, with a particular menu, or by external users, as a front-office, with another menu and permissions).
|
||||
- Very user friendly and easy to use.
|
||||
- Optional WYSIWYG forms, optional Ajax forms.
|
||||
- Several skins.
|
||||
- Code is highly customizable (a lot of use of modules and submodules).
|
||||
- Works with Mysql 4.1 or higher, or PostgreSql 8.14 or higher.
|
||||
- Works with PHP 5.0 or higher.
|
||||
- An easy to understand and maintain code (PHP with no heavy frameworks).
|
||||
- A trigger architecture to allow you to make Dolibarr business events run PHP code to update your own information system.
|
||||
- "NPR VAT Rate" (French particularity for managing VAT in DOM-TOM called "Non Perçue Récupérable").
|
||||
|
||||
- Highly customizable: Enable only modules you need, user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one).
|
||||
- Works with PHP 5.2.1, MySql 4.1 or PostgreSQL 8.1.
|
||||
- Compatible with all Cloud solutions that match MySql, PHP or PostgreSQL prerequisites.
|
||||
- An easy to understand, maintain and code interfaces with your own system information (PHP with no heavy frameworks, trigger and hook architecture).
|
||||
- Support countries specific features:
|
||||
Spanish Tax RE and ISPF.
|
||||
French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM).
|
||||
Canadian double taxes (federal/province) and other countries using cumulative VAT.
|
||||
Tunisian tax stamp.
|
||||
Compatible with European directives (2006/112/CE ... 2010/45/UE) (http://europa.eu/legislation_summaries/taxation/l31057_en.htm)
|
||||
...
|
||||
|
||||
|
||||
## WHAT DOLIBARR CAN'T DO YET (TODO LIST)
|
||||
|
||||
This is features that Dolibarr does not support completely yet:
|
||||
|
||||
- No double party accountancy (only bank management).
|
||||
- No double party accountancy (only bank and treasury management).
|
||||
- Dolibarr manage one currency at once (mono-currency).
|
||||
- Dolibarr manage one master company/foundation (mono-company). If you want to manage several companies or foundations, you must install several time the software (on same server or not). Another solution is to extend Dolibarr with the addon Module MultiCompany that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas).
|
||||
- Dolibarr does not contains Payroll module.
|
||||
- Dolibarr manage one master activity (mono-company). If you want to manage several companies or foundations, you must install several time the software (on same server or not). Another solution is to extend Dolibarr with the addon Module MultiCompany that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas).
|
||||
- Tasks on module project can't have dependencies between each other.
|
||||
- Dolibarr does not contains Payroll module.
|
||||
- Dolibarr does not include any Webmail.
|
||||
- Dolibarr can't do coffee (not yet).
|
||||
|
||||
@ -158,7 +158,7 @@ foreach ($modulesdir as $dir)
|
||||
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0;
|
||||
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
|
||||
// We discard modules according to property disabled
|
||||
if (isset($objMod->hidden) && $objMod->hidden) $modulequalified=false;
|
||||
if (! empty($objMod->hidden)) $modulequalified=false;
|
||||
|
||||
// Define array $categ with categ with at least one qualified module
|
||||
if ($modulequalified)
|
||||
|
||||
@ -528,13 +528,13 @@ class Categorie
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of contents of a category
|
||||
* Return list of id of elements having this category
|
||||
*
|
||||
* @param string $field Field name for select in table. Full field name will be fk_field.
|
||||
* @param string $classname PHP Class of object to store entity
|
||||
* @param string $category_table Table name for select in table. Full table name will be PREFIX_categorie_table.
|
||||
* @param string $object_table Table name for select in table. Full table name will be PREFIX_table.
|
||||
* @return void
|
||||
* @return mixed -1 if KO, array of instance of object if OK
|
||||
*/
|
||||
function get_type($field,$classname,$category_table='',$object_table='')
|
||||
{
|
||||
|
||||
@ -365,6 +365,8 @@ if($object->type == 2)
|
||||
$var=true;
|
||||
foreach ($socs as $key => $soc)
|
||||
{
|
||||
if ($user->societe_id > 0 && $soc->id != $user->societe_id) continue; // External user always see only themself
|
||||
|
||||
$i++;
|
||||
$var=!$var;
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
|
||||
@ -250,9 +250,12 @@ if ($id > 0)
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
||||
$img=picto_from_langcode($object->country_code);
|
||||
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
||||
else print ($img?$img.' ':'').$object->country;
|
||||
if (! empty($object->country_code))
|
||||
{
|
||||
$img=picto_from_langcode($object->country_code);
|
||||
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
||||
else print ($img?$img.' ':'').$object->country;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// EMail
|
||||
|
||||
@ -52,7 +52,9 @@ $startyear=$year-1;
|
||||
$endyear=$year;
|
||||
|
||||
$langs->load('orders');
|
||||
$langs->load('companies');
|
||||
$langs->load('other');
|
||||
$langs->load('suppliers');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -27,8 +27,7 @@
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||
|
||||
/**
|
||||
* \class Deplacement
|
||||
* \brief Class to manage trips and working credit notes
|
||||
* Class to manage trips and working credit notes
|
||||
*/
|
||||
class Deplacement extends CommonObject
|
||||
{
|
||||
@ -65,6 +64,9 @@ class Deplacement extends CommonObject
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
$this->statuts_short = array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed');
|
||||
$this->statuts = array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed');
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -327,7 +329,6 @@ class Deplacement extends CommonObject
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
//if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -173,23 +174,21 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
|
||||
// SQL request
|
||||
$catotal=0;
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label,";
|
||||
$sql.= " sum(l.total_ht) as amount, sum(l.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."facturedet as l";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON l.fk_facture = f.rowid";
|
||||
if ($selected_cat === -2) {
|
||||
$sql.=" LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
|
||||
}
|
||||
if ($selected_cat && $selected_cat !== -2) {
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = " . $selected_cat;
|
||||
if ($subcat) {
|
||||
$sql.=" OR c.fk_parent = " . $selected_cat;
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as l, ".MAIN_DB_PREFIX."product as p";
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
|
||||
}
|
||||
else if ($selected_cat) // Into a specific category
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp";
|
||||
}
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_categorie = c.rowid";
|
||||
}
|
||||
$sql.= " WHERE l.fk_product = p.rowid";
|
||||
$sql.= " AND l.fk_facture = f.rowid";
|
||||
$sql.= " AND f.fk_statut in (1,2)";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql.= " AND f.type IN (0,1,2)";
|
||||
@ -199,16 +198,21 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
if ($date_start && $date_end) {
|
||||
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
if ($selected_cat === -2) {
|
||||
$sql.=" AND cp.fk_product is null";
|
||||
}
|
||||
if ($selected_cat && $selected_cat !== -2) {
|
||||
$sql.= " AND cp.fk_product = p.rowid";
|
||||
}
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.=" AND cp.fk_product is null";
|
||||
}
|
||||
else if ($selected_cat) { // Into a specific category
|
||||
$sql.= " AND (c.rowid = ".$selected_cat;
|
||||
if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat;
|
||||
$sql.= ")";
|
||||
$sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
|
||||
}
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY p.rowid ";
|
||||
$sql.= "ORDER BY p.ref ";
|
||||
$sql.= " GROUP BY p.rowid";
|
||||
$sql.= " ORDER BY p.ref";
|
||||
|
||||
dol_syslog("cabyprodserv sql=".$sql);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
@ -384,7 +388,10 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
print '</form>';
|
||||
} else {
|
||||
// $modecompta != 'CREANCES-DETTES'
|
||||
print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant") . '<br>';
|
||||
// "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an
|
||||
// invoice with 2 product (product A for 10 euros and product B for 20 euros), what is part of paiment for product A and part of paiment for product B ?
|
||||
// Because there is no way to know this, this report is not relevant.
|
||||
print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant") . '<br>';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
@ -180,17 +180,14 @@ $catotal=0;
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
$sql = "SELECT DISTINCT s.rowid as socid, s.nom as name,";
|
||||
$sql.= " sum(f.total) as amount, sum(f.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."facture as f";
|
||||
if ($selected_cat === -2) {
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe";
|
||||
}
|
||||
if ($selected_cat && $selected_cat !== -2) {
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = ".$selected_cat;
|
||||
if ($subcat) {
|
||||
$sql.=" OR c.fk_parent = " . $selected_cat;
|
||||
}
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON cs.fk_categorie = c.rowid";
|
||||
else if ($selected_cat) // Into a specific category
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs";
|
||||
}
|
||||
$sql.= " WHERE f.fk_statut in (1,2)";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
@ -202,28 +199,50 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
if ($date_start && $date_end) {
|
||||
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
if ($selected_cat === -2) {
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.=" AND cs.fk_societe is null";
|
||||
}
|
||||
if ($selected_cat && $selected_cat !== -2) {
|
||||
$sql.= " AND cs.fk_societe = s.rowid";
|
||||
else if ($selected_cat) { // Into a specific category
|
||||
$sql.= " AND (c.rowid = ".$selected_cat;
|
||||
if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat;
|
||||
$sql.= ")";
|
||||
$sql.= " AND cs.fk_categorie = c.rowid AND cs.fk_societe = s.rowid";
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
/*
|
||||
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
|
||||
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
|
||||
*/
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, sum(pf.amount) as amount_ttc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiement as p";
|
||||
$sql .= " WHERE p.rowid = pf.fk_paiement";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe";
|
||||
}
|
||||
else if ($selected_cat) // Into a specific category
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs";
|
||||
}
|
||||
$sql.= " WHERE p.rowid = pf.fk_paiement";
|
||||
$sql.= " AND pf.fk_facture = f.rowid";
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
if ($date_start && $date_end) {
|
||||
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.=" AND cs.fk_societe is null";
|
||||
}
|
||||
else if ($selected_cat) { // Into a specific category
|
||||
$sql.= " AND (c.rowid = ".$selected_cat;
|
||||
if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat;
|
||||
$sql.= ")";
|
||||
$sql.= " AND cs.fk_categorie = c.rowid AND cs.fk_societe = s.rowid";
|
||||
}
|
||||
}
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
@ -231,6 +250,7 @@ $sql.= " GROUP BY s.rowid, s.nom";
|
||||
$sql.= " ORDER BY s.rowid";
|
||||
//echo $sql;
|
||||
|
||||
dol_syslog("casoc sql=".$sql);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
@ -251,7 +271,7 @@ if ($result) {
|
||||
|
||||
// On ajoute les paiements anciennes version, non lies par paiement_facture
|
||||
if ($modecompta != 'CREANCES-DETTES') {
|
||||
$sql = "SELECT '0' as socid, 'Autres' as name, sum(DISTINCT p.amount) as amount_ttc";
|
||||
$sql = "SELECT '0' as socid, 'Autres' as name, sum(p.amount) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiement as p";
|
||||
@ -483,4 +503,4 @@ print '</form>';
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -448,8 +448,8 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
|
||||
$desc=$product_desc;
|
||||
}
|
||||
|
||||
$localtax1_tx=get_localtax($tva_tx,1,$object->societe);
|
||||
$localtax2_tx=get_localtax($tva_tx,2,$object->societe);
|
||||
$localtax1_tx=get_localtax($tva_tx,1,$object->thirdparty);
|
||||
$localtax2_tx=get_localtax($tva_tx,2,$object->thirdparty);
|
||||
|
||||
// ajout prix achat
|
||||
$fk_fournprice = $_POST['fournprice'];
|
||||
|
||||
@ -213,30 +213,42 @@ if ($type == 'directory')
|
||||
$textifempty = $langs->trans('NoFileFound');
|
||||
}
|
||||
else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection"));
|
||||
|
||||
|
||||
$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url);
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))
|
||||
|
||||
if ($section)
|
||||
{
|
||||
if ($section)
|
||||
{
|
||||
$param.=($param?'?':'').(preg_replace('/^&/','',$param));
|
||||
$useajax=1;
|
||||
if (! empty($conf->dol_use_jmobile)) $useajax=0;
|
||||
if (empty($conf->use_javascript_ajax)) $useajax=0;
|
||||
if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
$useglobalvars=1;
|
||||
$form = new Form($db);
|
||||
$formquestion=array('urlfile'=>array('type'=>'hidden','value'=>'','name'=>'urlfile'));
|
||||
print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",'deletefile');
|
||||
$param.=($param?'?':'').(preg_replace('/^&/','',$param));
|
||||
|
||||
// Enable jquery handlers on new generated HTML objects
|
||||
print '<script type="text/javascript">'."\n";
|
||||
print 'jQuery(document).ready(function() {'."\n";
|
||||
print 'jQuery(".deletefilelink").click(function(e) { jQuery("#urlfile").val(jQuery(this).attr("rel")); jQuery("#dialog-confirm-deletefile").dialog("open"); return false; });'."\n";
|
||||
print '});'."\n";
|
||||
print '</script>'."\n";
|
||||
}
|
||||
if ($useajax || $action == 'delete')
|
||||
{
|
||||
$urlfile='';
|
||||
if ($action == 'delete') $urlfile=GETPOST('urlfile');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
$useglobalvars=1;
|
||||
$form = new Form($db);
|
||||
$formquestion=array('urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile'));
|
||||
print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0));
|
||||
}
|
||||
|
||||
if ($useajax)
|
||||
{
|
||||
// Enable jquery handlers on new generated HTML objects
|
||||
print '<script type="text/javascript">'."\n";
|
||||
print 'jQuery(document).ready(function() {'."\n";
|
||||
print 'jQuery(".deletefilelink").click(function(e) { jQuery("#urlfile").val(jQuery(this).attr("rel")); jQuery("#dialog-confirm-deletefile").dialog("open"); return false; });'."\n";
|
||||
print '});'."\n";
|
||||
print '</script>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Close db if mode is not noajax
|
||||
|
||||
@ -403,7 +403,7 @@ class Conf
|
||||
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024);
|
||||
|
||||
// Define list of limited modules
|
||||
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later.
|
||||
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later.
|
||||
|
||||
// Timeouts
|
||||
if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10;
|
||||
|
||||
@ -2525,6 +2525,19 @@ class Form
|
||||
|
||||
if (is_array($formquestion) && ! empty($formquestion))
|
||||
{
|
||||
// First add hidden fields and value
|
||||
foreach ($formquestion as $key => $input)
|
||||
{
|
||||
if (is_array($input) && ! empty($input))
|
||||
{
|
||||
if ($input['type'] == 'hidden')
|
||||
{
|
||||
$more.='<input type="hidden" id="'.$input['name'].'" name="'.$input['name'].'" value="'.dol_escape_htmltag($input['value']).'">'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now add questions
|
||||
$more.='<table class="paddingrightonly" width="100%">'."\n";
|
||||
$more.='<tr><td colspan="3" valign="top">'.(! empty($formquestion['text'])?$formquestion['text']:'').'</td></tr>'."\n";
|
||||
foreach ($formquestion as $key => $input)
|
||||
@ -2584,10 +2597,6 @@ class Form
|
||||
$more.=$input['value'];
|
||||
$more.='</td></tr>'."\n";
|
||||
}
|
||||
else if ($input['type'] == 'hidden')
|
||||
{
|
||||
$more.='<input type="hidden" id="'.$input['name'].'" name="'.$input['name'].'" value="'.$input['value'].'">';
|
||||
}
|
||||
}
|
||||
}
|
||||
$more.='</table>'."\n";
|
||||
|
||||
@ -813,7 +813,12 @@ class FormFile
|
||||
else
|
||||
$filepath=$file['name'];
|
||||
*/
|
||||
print '<a href="'.(($useinecm && ! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':$url.'?action=delete&urlfile='.urlencode($filepath).$param).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
||||
$useajax=1;
|
||||
if (! empty($conf->dol_use_jmobile)) $useajax=0;
|
||||
if (empty($conf->use_javascript_ajax)) $useajax=0;
|
||||
if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0;
|
||||
|
||||
print '<a href="'.(($useinecm && $useajax)?'#':$url.'?action=delete&urlfile='.urlencode($filepath).$param).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
||||
}
|
||||
else print ' ';
|
||||
print "</td>";
|
||||
|
||||
@ -557,19 +557,18 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany"));
|
||||
print_fiche_titre($title,$buttoncreate,'');
|
||||
|
||||
print "\n".'<table class="noborder" width="100%">'."\n";
|
||||
|
||||
|
||||
$param="socid=".$object->id;
|
||||
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||
if ($search_name != '') $param.='&search_name='.urlencode($search_name);
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
|
||||
print '<input type="hidden" name="socid" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
|
||||
$colspan=8;
|
||||
print "\n".'<table class="noborder" width="100%">'."\n";
|
||||
|
||||
$param="socid=".$object->id;
|
||||
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||
if ($search_name != '') $param.='&search_name='.urlencode($search_name);
|
||||
|
||||
$colspan=9;
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Poste"),$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder);
|
||||
@ -579,21 +578,20 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
$colspan++;
|
||||
print '<td>'.$langs->trans("Skype").'</td>';
|
||||
$colspan++;
|
||||
print '<td>'.$langs->trans("Skype").'</td>';
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'',$sortfield,$sortorder);
|
||||
// Copy to clipboard
|
||||
print "<td> </td>";
|
||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||
{
|
||||
$colspan++;
|
||||
print '<td> </td>';
|
||||
}
|
||||
if ($user->rights->societe->contact->creer)
|
||||
// Add to agenda
|
||||
if (! empty($conf->agenda->enabled) && ! empty($user->rights->agenda->myactions->create))
|
||||
{
|
||||
$colspan++;
|
||||
print '<td> </td>';
|
||||
}
|
||||
// Edit
|
||||
print '<td> </td>';
|
||||
print "</tr>";
|
||||
|
||||
|
||||
@ -603,7 +601,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print '</td>';
|
||||
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
|
||||
print '<td> </td>';
|
||||
|
||||
@ -612,21 +610,26 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print '<td> </td>';
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
$colspan++;
|
||||
print '<td> </td>';
|
||||
$colspan++;
|
||||
print '<td> </td>';
|
||||
}
|
||||
print '<td class="liste_titre">';
|
||||
|
||||
// Status
|
||||
print '<td class="liste_titre maxwidthonsmartphone">';
|
||||
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
|
||||
print '</td>';
|
||||
|
||||
// Copy to clipboard
|
||||
print "<td> </td>";
|
||||
|
||||
// Add to agenda
|
||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||
{
|
||||
$colspan++;
|
||||
print '<td> </td>';
|
||||
}
|
||||
|
||||
|
||||
// Edit
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '</td>';
|
||||
@ -689,9 +692,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Status
|
||||
print '<td>'.$contactstatic->getLibStatut(5).'</td>';
|
||||
|
||||
// copy in clipboard
|
||||
// Copy to clipboard
|
||||
$coords = '';
|
||||
if (!empty($object->name))
|
||||
$coords .= addslashes($object->name)."<br />";
|
||||
@ -722,10 +726,12 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
if (!empty($object->country))
|
||||
$coords .= "<br />".addslashes($object->country);
|
||||
}
|
||||
|
||||
print '<td align="center"><a href="#" onclick="return copyToClipboard(\''.$coords.'\');">';
|
||||
print img_picto($langs->trans("Address"), 'object_address.png');
|
||||
print '</a></td>';
|
||||
|
||||
// Add to agenda
|
||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||
{
|
||||
print '<td align="center">';
|
||||
@ -739,8 +745,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print img_object($langs->trans("Event"),"action");
|
||||
print '</a></td>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Edit
|
||||
if ($user->rights->societe->contact->creer)
|
||||
{
|
||||
print '<td align="right">';
|
||||
@ -748,7 +754,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
}
|
||||
|
||||
else print '<td> </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
@ -762,6 +768,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
}
|
||||
print "\n</table>\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
print "<br>\n";
|
||||
?>
|
||||
<div id="dialog" title="<?php echo dol_escape_htmltag($langs->trans('Address')); ?>" style="display: none;">
|
||||
|
||||
@ -18,7 +18,14 @@
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
function payment_prepare_head($object) {
|
||||
/**
|
||||
* Returns an array with the tabs for the "Payment" section
|
||||
* It loads tabs from modules looking for the entity payment
|
||||
*
|
||||
* @param Paiement $object Current payment object
|
||||
* @return array Tabs for the payment section
|
||||
*/
|
||||
function payment_prepare_head(Paiement $object) {
|
||||
|
||||
global $langs, $conf;
|
||||
|
||||
@ -46,7 +53,14 @@ function payment_prepare_head($object) {
|
||||
return $head;
|
||||
}
|
||||
|
||||
function payment_supplier_prepare_head($object) {
|
||||
/**
|
||||
* Returns an array with the tabs for the "Supplier payment" section
|
||||
* It loads tabs from modules looking for the entity payment_supplier
|
||||
*
|
||||
* @param Paiement $object Current payment object
|
||||
* @return array Tabs for the payment section
|
||||
*/
|
||||
function payment_supplier_prepare_head(Paiement $object) {
|
||||
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
@ -207,7 +207,7 @@ function project_admin_prepare_head()
|
||||
* @param string $var Color
|
||||
* @param int $showproject Show project columns
|
||||
* @param int &$taskrole Array of roles of user for each tasks
|
||||
* @param int $projectsListId List of id of project allowed to user (separated with comma)
|
||||
* @param int $projectsListId List of id of project allowed to user (string separated with comma)
|
||||
* @param int $addordertick Add a tick to move task
|
||||
* @return void
|
||||
*/
|
||||
@ -257,6 +257,22 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Caller did not ask to filter on tasks of a specific user (this probably means he want also tasks of all users, into public project
|
||||
// or into all other projects if user has permission to).
|
||||
if (empty($user->rights->projet->all->lire))
|
||||
{
|
||||
// User is not allowed on this project and project is not public, so we hide line
|
||||
if (! in_array($lines[$i]->fk_project, $projectsArrayId))
|
||||
{
|
||||
// Note that having a user assigned to a task into a project user has no permission on, should not be possible
|
||||
// because assignement on task can be done only on contact of project.
|
||||
// If assignement was done and after, was removed from contact of project, then we can hide the line.
|
||||
$showline=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($showline)
|
||||
{
|
||||
@ -367,7 +383,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
if (! $showlineingray) $inc++;
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId);
|
||||
if ($lines[$i]->id) projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, 0, $showalsopublicproj);
|
||||
$level--;
|
||||
$total += $lines[$i]->duration;
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
|
||||
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
|
||||
}
|
||||
}
|
||||
else if (in_array($feature,$checksoc))
|
||||
else if (in_array($feature,$checksoc)) // We check feature = checksoc
|
||||
{
|
||||
// If external user: Check permission for external users
|
||||
if ($user->societe_id > 0)
|
||||
@ -450,7 +450,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
|
||||
}
|
||||
}
|
||||
|
||||
//print $sql."<br>";
|
||||
//print "sql=".$sql."<br>";
|
||||
if ($sql)
|
||||
{
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@ -72,9 +72,9 @@ 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->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __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->societe->enabled', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/fiche.php?leftmenu=contacts&action=create', 'NewContactAddress', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __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->societe->enabled', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 1, __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->societe->enabled', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=p', 'Prospects', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 1, __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->societe->enabled', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=c', 'Customers', 2, 'companies', '$user->rights->societe->contact->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->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=f', 'Suppliers', 2, 'companies', '$user->rights->societe->contact->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->societe->enabled', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=p', 'ThirdPartyProspects', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 1, __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->societe->enabled', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=c', 'ThirdPartyCustomers', 2, 'companies', '$user->rights->societe->contact->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->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=f', 'ThirdPartySuppliers', 2, 'companies', '$user->rights->societe->contact->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->societe->enabled', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 4, __ENTITY__);
|
||||
-- Third parties - Category customer
|
||||
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->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 650__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=1', 'SuppliersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__);
|
||||
|
||||
@ -613,11 +613,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("suppliers");
|
||||
$newmenu->add("/fourn/liste.php?leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');
|
||||
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire);
|
||||
}
|
||||
$newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire);
|
||||
//$newmenu->add("/fourn/liste.php?leftmenu=suppliers", $langs->trans("List"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire);
|
||||
//$newmenu->add("/contact/list.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire && $user->rights->societe->contact->lire);
|
||||
}
|
||||
@ -640,25 +636,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
// Categories prospects/customers
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=2", $langs->trans("CustomersProspectsCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
// Categories Contact
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=4", $langs->trans("ContactCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=4", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=4", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
// Categories suppliers
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire);
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
}
|
||||
@ -752,10 +739,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/compta/facture.php?action=create&leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer);
|
||||
}
|
||||
$newmenu->add("/compta/facture.php?action=create&leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer);
|
||||
$newmenu->add("/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatables"),1,$user->rights->facture->lire);
|
||||
|
||||
$newmenu->add("/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpaid"),1,$user->rights->facture->lire);
|
||||
@ -778,10 +762,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
|
||||
}
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
|
||||
$newmenu->add("/fourn/facture/impayees.php", $langs->trans("Unpaid"),1,$user->rights->fournisseur->facture->lire);
|
||||
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire);
|
||||
|
||||
@ -959,11 +940,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->product->enabled))
|
||||
{
|
||||
$newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product');
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/product/fiche.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer);
|
||||
$newmenu->add("/product/liste.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
|
||||
}
|
||||
$newmenu->add("/product/fiche.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer);
|
||||
$newmenu->add("/product/liste.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
|
||||
if (! empty($conf->propal->enabled))
|
||||
{
|
||||
$newmenu->add("/product/popuprop.php?leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire);
|
||||
@ -978,10 +956,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
$newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service');
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/product/fiche.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
|
||||
}
|
||||
$newmenu->add("/product/fiche.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
|
||||
$newmenu->add("/product/liste.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire);
|
||||
if (! empty($conf->propal->enabled))
|
||||
{
|
||||
@ -994,10 +969,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("categories");
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=0", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=0", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
}
|
||||
|
||||
@ -1039,10 +1011,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/fourn/index.php?leftmenu=suppliers", $langs->trans("Suppliers"), 0, $user->rights->societe->lire && $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');
|
||||
|
||||
// Security check
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("NewSupplier"), 1, $user->rights->societe->creer && $user->rights->fournisseur->lire);
|
||||
}
|
||||
$newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("NewSupplier"), 1, $user->rights->societe->creer && $user->rights->fournisseur->lire);
|
||||
$newmenu->add("/fourn/liste.php",$langs->trans("List"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire);
|
||||
$newmenu->add("/contact/list.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 1, $user->rights->societe->contact->lire && $user->rights->fournisseur->lire);
|
||||
$newmenu->add("/fourn/stats.php",$langs->trans("Statistics"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire);
|
||||
@ -1052,12 +1021,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/fourn/facture/list.php?leftmenu=orders", $langs->trans("Bills"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'orders');
|
||||
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer);
|
||||
}
|
||||
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer);
|
||||
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"), 1, $user->rights->fournisseur->facture->lire);
|
||||
}
|
||||
|
||||
@ -1073,10 +1037,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("categories");
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=1", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
}
|
||||
|
||||
@ -1196,10 +1157,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("categories");
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=3", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=3", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
}
|
||||
|
||||
|
||||
@ -62,6 +62,8 @@ class modFckeditor extends DolibarrModules
|
||||
$this->config_page_url = array("fckeditor.php");
|
||||
|
||||
// Dependances
|
||||
global $dolibarr_js_CKEDITOR;
|
||||
$this->hidden = ($dolibarr_js_CKEDITOR == 'disabled'?1:0); // A condition to disable module (used for native debian packages)
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -16,12 +17,13 @@
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
$langs->load("link");
|
||||
|
||||
/*
|
||||
* Confirm suppression
|
||||
*/
|
||||
|
||||
if ($action == 'delete')
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret = $form->form_confirm(
|
||||
$_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'),
|
||||
|
||||
@ -375,7 +375,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<tr>';
|
||||
print '<td colspan="2">'.$langs->trans("TotalBuyingPriceMin").': ';
|
||||
if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
|
||||
print '</td>';
|
||||
print '</td>';
|
||||
print '<td align="right">'.($atleastonenotdefined?'':price($total,'','',0,0,-1,$conf->currency)).'</td>';
|
||||
if (! empty($conf->stock->enabled)) print '<td class="liste_total" align="right"> </td>';
|
||||
print '</tr>';
|
||||
@ -436,7 +436,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if (! empty($conf->categorie->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("CategoryFilter").' </td>';
|
||||
print '<td class="overflowwithjm200">'.$form->select_all_categories(0, $parent).'</td></tr>';
|
||||
print '<td class="maxwidthonsmartphone">'.$form->select_all_categories(0, $parent).'</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
@ -1281,7 +1281,7 @@ class Project extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean task not linked to a parent
|
||||
* Clean tasks not linked to an existing parent
|
||||
*
|
||||
* @return int Nb of records deleted
|
||||
*/
|
||||
@ -1292,7 +1292,7 @@ class Project extends CommonObject
|
||||
// There is orphelins. We clean that
|
||||
$listofid=array();
|
||||
|
||||
// Get list of id in array listofid
|
||||
// Get list of all id in array listofid
|
||||
$sql='SELECT rowid FROM '.MAIN_DB_PREFIX.'projet_task';
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -1313,19 +1313,24 @@ class Project extends CommonObject
|
||||
|
||||
if (count($listofid))
|
||||
{
|
||||
// Removed orphelins records
|
||||
print 'Some orphelins were found and restored to be parents so records are visible again: ';
|
||||
print join(',',$listofid);
|
||||
print 'Code asked to check and clean orphelins.';
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task";
|
||||
$sql.= " SET fk_task_parent = 0";
|
||||
$sql.= " WHERE fk_task_parent NOT IN (".join(',',$listofid).")";
|
||||
$sql.= " WHERE fk_task_parent NOT IN (".join(',',$listofid).")"; // So we update only records linked to a non existing parent
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$this->db->affected_rows($sql);
|
||||
|
||||
if ($nb > 0)
|
||||
{
|
||||
// Removed orphelins records
|
||||
print 'Some orphelins were found and modified to be parent so records are visible again: ';
|
||||
print join(',',$listofid);
|
||||
}
|
||||
|
||||
return $nb;
|
||||
}
|
||||
else
|
||||
|
||||
@ -79,7 +79,7 @@ $userAccess=0;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
*/
|
||||
|
||||
if ($action == 'createtask' && $user->rights->projet->creer)
|
||||
{
|
||||
@ -396,8 +396,7 @@ else
|
||||
print '</td></tr></table>';
|
||||
|
||||
// Get list of tasks in tasksarray and taskarrayfiltered
|
||||
// We need all tasks (even not limited to a user because a task to user
|
||||
// can have a parent that is not affected to him).
|
||||
// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).
|
||||
$tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $socid, 0);
|
||||
// We load also tasks limited to a particular user
|
||||
$tasksrole=($mode=='mine' ? $taskstatic->getUserRolesForProjectsOrTasks(0,$user,$object->id,0) : '');
|
||||
@ -426,7 +425,7 @@ else
|
||||
{
|
||||
// Show all lines in taskarray (recursive function to go down on tree)
|
||||
$j=0;
|
||||
$nboftaskshown=projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, '', 1);
|
||||
$nboftaskshown=projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $id, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -437,13 +436,16 @@ else
|
||||
|
||||
// Test if database is clean. If not we clean it.
|
||||
//print 'mode='.$_REQUEST["mode"].' $nboftaskshown='.$nboftaskshown.' count($tasksarray)='.count($tasksarray).' count($tasksrole)='.count($tasksrole).'<br>';
|
||||
if ($mode=='mine')
|
||||
if (! empty($user->rights->projet->all->lire)) // We make test to clean only if user has permission to see all (test may report false positive otherwise)
|
||||
{
|
||||
if ($nboftaskshown < count($tasksrole)) $object->clean_orphelins();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($nboftaskshown < count($tasksarray)) $object->clean_orphelins();
|
||||
if ($mode=='mine')
|
||||
{
|
||||
if ($nboftaskshown < count($tasksrole)) $object->clean_orphelins();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($nboftaskshown < count($tasksarray)) $object->clean_orphelins();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ else
|
||||
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
|
||||
}
|
||||
|
||||
// Get list of project id allowed to user
|
||||
// Get list of project id allowed to user (in a string list separated by coma)
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1,$socid);
|
||||
|
||||
// Get list of tasks in tasksarray and taskarrayfiltered
|
||||
@ -121,7 +121,7 @@ print "</tr>\n";
|
||||
|
||||
// Show all lines in taskarray (recursive function to go down on tree)
|
||||
$j=0; $level=0;
|
||||
$nboftaskshown=projectLinesa($j, 0, $tasksarray, $level, true, 1, $tasksrole, $projectsListId);
|
||||
$nboftaskshown=projectLinesa($j, 0, $tasksarray, $level, true, 1, $tasksrole, $projectsListId, 0);
|
||||
print "</table>";
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -38,12 +38,11 @@
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
// For MultiCompany module
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||
if (is_int($entity))
|
||||
{
|
||||
define("DOLENTITY", $entity);
|
||||
}
|
||||
if (is_int($entity)) define("DOLENTITY", $entity);
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
@ -27,12 +27,11 @@
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
// For MultiCompany module
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : 1);
|
||||
if (is_int($entity))
|
||||
{
|
||||
define("DOLENTITY", $entity);
|
||||
}
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||
if (is_int($entity)) define("DOLENTITY", $entity);
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
@ -27,12 +27,11 @@
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
// For MultiCompany module
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : 1);
|
||||
if (is_int($entity))
|
||||
{
|
||||
define("DOLENTITY", $entity);
|
||||
}
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||
if (is_int($entity)) define("DOLENTITY", $entity);
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
|
||||
@ -27,6 +27,12 @@
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||
if (is_int($entity)) define("DOLENTITY", $entity);
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
@ -26,6 +26,12 @@
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||
if (is_int($entity)) define("DOLENTITY", $entity);
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
@ -95,7 +101,7 @@ llxHeaderPayBox($langs->trans("PaymentForm"));
|
||||
print '<span id="dolpaymentspan"></span>'."\n";
|
||||
print '<div id="dolpaymentdiv" align="center">'."\n";
|
||||
|
||||
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br>\n";
|
||||
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>\n";
|
||||
|
||||
if (! empty($conf->global->PAYBOX_MESSAGE_KO)) print $conf->global->PAYBOX_MESSAGE_KO;
|
||||
|
||||
|
||||
@ -26,6 +26,12 @@
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||
if (is_int($entity)) define("DOLENTITY", $entity);
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
@ -118,7 +124,7 @@ if (! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL))
|
||||
}
|
||||
|
||||
|
||||
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
|
||||
print $langs->trans("YourPaymentHasBeenRecorded")."<br><br>\n";
|
||||
|
||||
if (! empty($conf->global->PAYBOX_MESSAGE_OK)) print $conf->global->PAYBOX_MESSAGE_OK;
|
||||
|
||||
|
||||
@ -29,12 +29,11 @@
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
// For MultiCompany module
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||
if (is_int($entity))
|
||||
{
|
||||
define("DOLENTITY", $entity);
|
||||
}
|
||||
if (is_int($entity)) define("DOLENTITY", $entity);
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
|
||||
|
||||
@ -29,11 +29,12 @@
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
// For MultiCompany module. This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=GETPOST('entity')?GETPOST('entity','int'):1;
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||
if (is_int($entity)) define("DOLENTITY", $entity);
|
||||
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php';
|
||||
@ -100,7 +101,7 @@ llxHeaderPaypal($langs->trans("PaymentForm"));
|
||||
// Show ko message
|
||||
print '<span id="dolpaymentspan"></span>'."\n";
|
||||
print '<div id="dolpaymentdiv" align="center">'."\n";
|
||||
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br>";
|
||||
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>";
|
||||
|
||||
$PAYPALTOKEN=GETPOST('TOKEN');
|
||||
if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token');
|
||||
|
||||
@ -29,11 +29,12 @@
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
// For MultiCompany module. This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=GETPOST('entity')?GETPOST('entity','int'):1;
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
|
||||
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
||||
if (is_int($entity)) define("DOLENTITY", $entity);
|
||||
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php';
|
||||
@ -128,33 +129,6 @@ if ($PAYPALTOKEN)
|
||||
dol_syslog("Call paymentok with token=".$token." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_paypal');
|
||||
|
||||
|
||||
// Send an email
|
||||
//if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=/',$fulltag))
|
||||
if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL))
|
||||
{
|
||||
//$sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL;
|
||||
$sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
|
||||
$from=$conf->global->MAILING_EMAIL_FROM;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile(
|
||||
'['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPaypalPaymentReceived"),
|
||||
$sendto,
|
||||
$from,
|
||||
$langs->transnoentitiesnoconv("NewPaypalPaymentReceived")."\ntag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt
|
||||
);
|
||||
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_paypal');
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_paypal');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Validate record
|
||||
if (! empty($paymentType))
|
||||
{
|
||||
@ -183,7 +157,7 @@ if ($PAYPALTOKEN)
|
||||
$NOTE=urldecode($resArray["NOTE"]);
|
||||
|
||||
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
|
||||
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."<br>\n";
|
||||
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."<br><br>\n";
|
||||
if (! empty($conf->global->PAYPAL_MESSAGE_OK)) print $conf->global->PAYPAL_MESSAGE_OK;
|
||||
|
||||
// Appel des triggers
|
||||
@ -192,6 +166,30 @@ if ($PAYPALTOKEN)
|
||||
$result=$interface->run_triggers('PAYPAL_PAYMENT_OK',$object,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
// Send an email
|
||||
if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL))
|
||||
{
|
||||
$sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
|
||||
$from=$conf->global->MAILING_EMAIL_FROM;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile(
|
||||
'['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPaypalPaymentReceived"),
|
||||
$sendto,
|
||||
$from,
|
||||
$langs->transnoentitiesnoconv("NewPaypalPaymentReceived")."\ntag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt
|
||||
);
|
||||
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_paypal');
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_paypal');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -208,6 +206,30 @@ if ($PAYPALTOKEN)
|
||||
echo "Error Severity Code: " . $ErrorSeverityCode;
|
||||
|
||||
if ($mysoc->email) echo "\nPlease, send a screenshot of this page to ".$mysoc->email;
|
||||
|
||||
// Send an email
|
||||
if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL))
|
||||
{
|
||||
$sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
|
||||
$from=$conf->global->MAILING_EMAIL_FROM;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile(
|
||||
'['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("ValidationOfPaypalPaymentFailed"),
|
||||
$sendto,
|
||||
$from,
|
||||
$langs->transnoentitiesnoconv("PaypalConfirmPaymentPageWasCalledButFailed")."\ntag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt."\nErrorCode=".$ErrorCode."\nErrorLongMsg=".$ErrorLongMsg
|
||||
);
|
||||
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_paypal');
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_paypal');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -4,7 +4,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
if (empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||
{
|
||||
print "Page available onto dev environment only";
|
||||
exit;
|
||||
|
||||
@ -158,7 +158,14 @@ if ($socid)
|
||||
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
|
||||
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012-2013 Philippe Berthet <berthet@systune.be>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* Version V1.1 Initial version of Philippe Berthet
|
||||
@ -30,10 +30,7 @@ require("../main.inc.php");
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
@ -104,10 +101,6 @@ if (empty($socid))
|
||||
$head = societe_prepare_head($object);
|
||||
dol_fiche_head($head, 'consumption', $langs->trans("ThirdParty"),0,'company');
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="25%">'.$langs->trans('ThirdPartyName').'</td>';
|
||||
print '<td colspan="3">';
|
||||
@ -160,47 +153,61 @@ dol_fiche_end();
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">'."\n";
|
||||
|
||||
|
||||
$sql_select='';
|
||||
if ($type_element == 'invoice')
|
||||
{ // Customer : show products from invoices
|
||||
$documentstatic=new Facture($db);
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as datePrint, ';
|
||||
$tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d";
|
||||
$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_facture = f.rowid";
|
||||
$where.= " AND f.entity = ".$conf->entity;
|
||||
$datePrint = 'f.datef';
|
||||
$doc_number='f.facnumber';
|
||||
$thirdTypeSelect='customer';
|
||||
{ // Customer : show products from invoices
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$documentstatic=new Facture($db);
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as datePrint, ';
|
||||
$tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d";
|
||||
$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_facture = f.rowid";
|
||||
$where.= " AND f.entity = ".$conf->entity;
|
||||
$datePrint = 'f.datef';
|
||||
$doc_number='f.facnumber';
|
||||
$thirdTypeSelect='customer';
|
||||
}
|
||||
if ($type_element == 'order')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
$documentstatic=new Commande($db);
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, "1" as doc_type, f.date_commande as datePrint, ';
|
||||
$tables_from = MAIN_DB_PREFIX."commande as f,".MAIN_DB_PREFIX."commandedet as d";
|
||||
$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_commande = f.rowid";
|
||||
$where.= " AND f.entity = ".$conf->entity;
|
||||
$datePrint = 'f.date_creation';
|
||||
$doc_number='f.ref';
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, "1" as doc_type, c.date_commande as datePrint, ';
|
||||
$tables_from = MAIN_DB_PREFIX."commande as c,".MAIN_DB_PREFIX."commandedet as d";
|
||||
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_commande = c.rowid";
|
||||
$where.= " AND c.entity = ".$conf->entity;
|
||||
$datePrint = 'c.datef';
|
||||
$doc_number='c.ref';
|
||||
$thirdTypeSelect='customer';
|
||||
|
||||
}
|
||||
if ($type_element == 'supplier_order')
|
||||
{ // Supplier : Show products from orders.
|
||||
$documentstatic=new CommandeFournisseur($db);
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, "1" as doc_type, c.date_valid as datePrint, ';
|
||||
$tables_from = MAIN_DB_PREFIX."commande_fournisseur as c,".MAIN_DB_PREFIX."commande_fournisseurdet as d";
|
||||
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_commande = c.rowid";
|
||||
$datePrint = 'c.date_creation';
|
||||
$doc_number='c.ref';
|
||||
$thirdTypeSelect='supplier';
|
||||
}
|
||||
if ($type_element == 'supplier_invoice')
|
||||
{
|
||||
// TODO
|
||||
|
||||
{ // Supplier : Show products from invoices.
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
$documentstatic=new FactureFournisseur($db);
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, "1" as doc_type, f.datef as datePrint, ';
|
||||
$tables_from = MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."facture_fourn_det as d";
|
||||
$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_facture_fourn = f.rowid";
|
||||
$datePrint = 'f.datef';
|
||||
$doc_number='f.ref';
|
||||
$thirdTypeSelect='supplier';
|
||||
}
|
||||
if ($type_element == 'supplier_order')
|
||||
{ // Supplier : Show products from orders.
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
$documentstatic=new CommandeFournisseur($db);
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, "1" as doc_type, c.date_valid as datePrint, ';
|
||||
$tables_from = MAIN_DB_PREFIX."commande_fournisseur as c,".MAIN_DB_PREFIX."commande_fournisseurdet as d";
|
||||
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_commande = c.rowid";
|
||||
$datePrint = 'c.date_valid';
|
||||
$doc_number='c.ref';
|
||||
$thirdTypeSelect='supplier';
|
||||
}
|
||||
|
||||
$sql = $sql_select;
|
||||
|
||||
@ -1576,12 +1576,12 @@ else
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'" class="nowrap">';
|
||||
if ($object->country_code)
|
||||
{
|
||||
$img=picto_from_langcode($object->country_code);
|
||||
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
||||
else print ($img?$img.' ':'').$object->country;
|
||||
}
|
||||
if (! empty($object->country_code))
|
||||
{
|
||||
$img=picto_from_langcode($object->country_code);
|
||||
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
||||
else print ($img?$img.' ':'').$object->country;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
@ -1826,7 +1826,7 @@ else
|
||||
else
|
||||
{
|
||||
$langs->load("mails");
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEmailDefined")).'">'.$langs->trans('SendMail').'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEmail")).'">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
|
||||
if ($user->rights->societe->creer)
|
||||
|
||||
@ -1357,7 +1357,7 @@ div.tabs {
|
||||
/* margin: 0px 0px 2px 6px;
|
||||
padding: 0px 6px 3px 0px; */
|
||||
text-align: <?php print $left; ?>;
|
||||
|
||||
margin-left: 4px !important;
|
||||
clear:both;
|
||||
height:100%;
|
||||
}
|
||||
@ -2761,7 +2761,7 @@ a.tab span.ui-btn-inner
|
||||
}
|
||||
|
||||
.ui-link {
|
||||
color: rgb(<?php print $colortext; ?>) !important;
|
||||
color: rgb(<?php print $colortext; ?>);
|
||||
}
|
||||
.liste_titre .ui-link {
|
||||
color: #<?php print $colortexttitle; ?> !important;
|
||||
@ -2843,10 +2843,21 @@ ul.ulmenu {
|
||||
border: 1px solid #ccc;
|
||||
text-shadow: none;
|
||||
}
|
||||
.ui-body-c .ui-link, .ui-body-c .ui-link:visited, .ui-body-c .ui-link:hover {
|
||||
color: rgb(<?php print $colortext; ?>);
|
||||
}
|
||||
.ui-btn-up-c .vsmenudisabled {
|
||||
color: #<?php echo $colorshadowtitle; ?> !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
.ui-controlgroup-horizontal .ui-btn.ui-first-child {
|
||||
-webkit-border-top-left-radius: 6px;
|
||||
border-top-left-radius: 6px;
|
||||
}
|
||||
.ui-controlgroup-horizontal .ui-btn.ui-last-child {
|
||||
-webkit-border-top-right-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
}
|
||||
.alilevel1 {
|
||||
color: #<?php echo $colortexttitle; ?> !important;
|
||||
text-shadow: 1px 0px 1px #<?php echo $colorshadowtitle; ?>;
|
||||
@ -2859,14 +2870,6 @@ ul.ulmenu {
|
||||
background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important;
|
||||
background-image: linear-gradient( #ddd,#d1d1d1 ) !important;
|
||||
}
|
||||
<?php if ($dol_use_jmobile) { ?>
|
||||
.overflowwithjm200
|
||||
{
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
if (is_object($db)) $db->close();
|
||||
|
||||
146
test/phpunit/PaypalTest.php
Normal file
146
test/phpunit/PaypalTest.php
Normal file
@ -0,0 +1,146 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file test/phpunit/PaypalTest.php
|
||||
* \ingroup test
|
||||
* \brief PHPUnit test
|
||||
* \remarks To run this script as CLI: phpunit filename.php
|
||||
*/
|
||||
|
||||
global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/geturl.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/paypal/lib/paypal.lib.php';
|
||||
|
||||
if (empty($user->id))
|
||||
{
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
$user->fetch(1);
|
||||
$user->getrights();
|
||||
}
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
|
||||
|
||||
/**
|
||||
* Class for PHPUnit tests
|
||||
*
|
||||
* @backupGlobals disabled
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class PaypalTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
protected $savlangs;
|
||||
protected $savdb;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* We save global variables into local variables
|
||||
*
|
||||
* @return ProductTest
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
$this->savlangs=$langs;
|
||||
$this->savdb=$db;
|
||||
|
||||
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
||||
//print " - db ".$db->db;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
// Static methods
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
|
||||
if (empty($conf->paypal->enabled)) { print __METHOD__." Module Paypal must be enabled.\n"; die(); }
|
||||
|
||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->rollback();
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Init phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* End phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* testProductCreate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testPaypalOk()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
$urltotest=getPaypalPaymentUrl(1,'free');
|
||||
print "urltotest=".$urltotest."\n";
|
||||
|
||||
$result=getURLContent($urltotest, 'GET');
|
||||
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThanOrEqual($result, 0);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user