diff --git a/.travis.yml b/.travis.yml index bac020e13c5..d66915eb44b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -325,18 +325,21 @@ script: set +e echo #cat $TRAVIS_BUILD_DIR/upgrade400500-2.log + #cat $TRAVIS_BUILD_DIR/upgrade500600.log + #cat $TRAVIS_BUILD_DIR/upgrade500600-2.log + #cat $TRAVIS_BUILD_DIR/upgrade500600-3.log #cat /tmp/dolibarr_install.log - | echo "Unit testing" - # Ensure we catch errors. Set this to +e if you want to go to the end to see log file. + # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. set -e phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php set +e - | #echo "Output dolibarr.log" - #echo cat documents/dolibarr.log + #cat documents/dolibarr.log after_script: - | diff --git a/ChangeLog b/ChangeLog index d75938891f4..0b5d58609da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,8 @@ Following changes may create regressions for some external modules, but were nec * The substitution key for reference of object is now __REF__ whatever is the object (it replaces __ORDERREF__, __PROPALREF__, ...) * Some REST API to access the dictionary (country, town, ...) were moved into a common API. +* Page bank/index.php and bank/bankentries.php were renamed into bank/list.php and bank/bankentries_list.php to + follow page naming conventions (so default filter/sort order features can also work). ***** ChangeLog for 6.0.1 compared to 6.0.* ***** diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php index 08ad248ecc0..0c32c7ea6a3 100755 --- a/dev/initdata/import-thirdparties.php +++ b/dev/initdata/import-thirdparties.php @@ -21,7 +21,7 @@ /** * \file dev/initdata/import-thirdparties.php - * \brief Script example to insert thirdparties from a csv file. + * \brief Script example to insert thirdparties from a csv file. * To purge data, you can have a look at purge-data.php */ @@ -123,15 +123,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) if ($endlinenb && $i > $endlinenb) continue; $nboflines++; - + $object = new Societe($db); $object->state = $fields[6]; $object->client = $fields[7]; $object->fournisseur = $fields[8]; - + $object->name = $fields[13]?trim($fields[13]):$fields[0]; $object->name_alias = $fields[0]!=$fields[13]?trim($fields[0]):''; - + $object->address = trim($fields[14]); $object->zip = trim($fields[15]); $object->town = trim($fields[16]); @@ -149,7 +149,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $condpayment = trim($fields[36]); if ($condpayment == 'A la commande') $condpayment = 'A réception de commande'; if ($condpayment == 'A reception facture') $condpayment = 'Réception de facture'; - $object->cond_reglement_id = dol_getIdFromCode($db, $condpayment, 'c_payment_term', 'libelle_facture', 'rowid'); + $object->cond_reglement_id = dol_getIdFromCode($db, $condpayment, 'c_payment_term', 'libelle_facture', 'rowid', 1); if (empty($object->cond_reglement_id)) { print " - Error cant find payment mode for ".$condpayment."\n"; @@ -166,7 +166,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) // Set price level $object->price_level = 1; if ($labeltype == 'Revendeur') $object->price_level = 2; - + print "Process line nb ".$i.", name ".$object->name; @@ -182,7 +182,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create result code = ".$ret." - ".$object->errorsToString(); $errorrecord++; } - else + else { print " - Creation OK with name ".$object->name." - id = ".$ret; } @@ -198,7 +198,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) if (! $errorrecord && $fields[3]) { $salesrep=new User($db); - + $tmp=explode(' ',$fields[3],2); $salesrep->firstname = trim($tmp[0]); $salesrep->lastname = trim($tmp[1]); @@ -206,7 +206,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) else $salesrep->login=strtolower($salesrep->firstname); $salesrep->login=preg_replace('/ /','',$salesrep->login); $salesrep->fetch(0,$salesrep->login); - + $result = $object->add_commercial($user, $salesrep->id); if ($result < 0) { @@ -217,14 +217,14 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) { print " - create link sale representative OK"; } - } - + } + dol_syslog("Add invoice contacts"); // Insert an invoice contact if there is an invoice email != standard email if (! $errorrecord && $fields[27] && $fields[26] != $fields[27]) { $ret1=$ret2=0; - + $contact = new Contact($db); $contact->lastname = $object->name; $contact->address=$object->address; @@ -233,7 +233,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $contact->country_id=$object->country_id; $contact->email=$fields[27]; $contact->socid=$object->id; - + $ret1=$contact->create($user); if ($ret1 > 0) { @@ -244,18 +244,18 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create contact result code = ".$ret1." ".$ret2." - ".$object->errorsToString(); $errorrecord++; } - else + else { print " - create contact OK"; } } - + dol_syslog("Add delivery contacts"); // Insert a delivery contact if (! $errorrecord && $fields[47]) { $ret1=$ret2=0; - + $contact2 = new Contact($db); $contact2->lastname = 'Service livraison - '.$fields[47]; $contact2->address = $fields[48]; @@ -264,10 +264,10 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $contact2->country_id=dol_getIdFromCode($db, trim($fields[52]), 'c_country', 'code', 'rowid'); $contact2->note_public=$fields[54]; $contact2->socid=$object->id; - + // Extrafields $contact2->array_options['options_anazoneliv']=price2num($fields[53]); - + $ret1=$contact2->create($user); if ($ret1 > 0) { @@ -278,16 +278,16 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create contact result code = ".$ret1." ".$ret2." - ".$object->errorsToString(); $errorrecord++; } - else + else { print " - create contact OK"; } } - + print "\n"; - - if ($errorrecord) + + if ($errorrecord) { fwrite($fhandleerr, 'Error on record nb '.$i." - ".$object->errorsToString()."\n"); $error++; // $errorrecord will be reset diff --git a/dev/resources/iso-normes/code_nace.txt b/dev/resources/iso-normes/code_nace.txt new file mode 100644 index 00000000000..0c490bd4bf1 --- /dev/null +++ b/dev/resources/iso-normes/code_nace.txt @@ -0,0 +1 @@ +http://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_CLS_DLD&StrNom=NACE_REV2&StrLanguageCode=FR&StrLayoutCode=# \ No newline at end of file diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index e9ad42858aa..ac92dcab195 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -419,7 +419,7 @@ class AccountancyExport /** - * Export format : Agiris + * Export format : Agiris Isacompta * * @param array $objectLines data * @@ -433,30 +433,23 @@ class AccountancyExport $date = dol_print_date($line->doc_date, '%d%m%Y'); - print $line->id . $this->separator; - print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator; + print $line->piece_num . $this->separator; + print $line->label_operation . $this->separator; print $date . $this->separator; - print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator; + print $line->label_operation . $this->separator; if (empty($line->subledger_account)) { print length_accountg($line->numero_compte) . $this->separator; } else { - // FIXME Because the subledger_account is already an accounting account, does we really need - // to concat 4011 or 401 to it ? - if (substr($line->numero_compte, 0, 1) == 'C' || substr($line->numero_compte, 0, 1) == '9') { - print '411' . substr(str_replace(" ", "", $line->subledger_account), 0, 5) . $this->separator; - } - if (substr($line->numero_compte, 0, 1) == 'F' || substr($line->numero_compte, 0, 1) == '0') { - print '401' . substr(str_replace(" ", "", $line->subledger_account), 0, 5) . $this->separator; - } + print length_accounta($line->subledger_account) . $this->separator; } - print length_accounta($line->subledger_account) . $this->separator; + print $line->doc_ref . $this->separator; print price($line->debit) . $this->separator; print price($line->credit) . $this->separator; print price($line->montant).$this->separator; print $line->sens.$this->separator; - print $line->code_journal . $this->separator; + print $line->code_journal; print $this->end_line; } } diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 145bcf4e497..1228dc92bf9 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -38,6 +38,28 @@ $langs->load("members"); $id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('rowid','int'); +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield='a.datep,a.id'; +if (! $sortorder) $sortorder='DESC'; + +if (GETPOST('actioncode','array')) +{ + $actioncode=GETPOST('actioncode','array',3); + if (! count($actioncode)) $actioncode='0'; +} +else +{ + $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); +} +$search_agenda_label=GETPOST('search_agenda_label'); + // Security check $result=restrictedArea($user,'adherent',$id); @@ -56,7 +78,26 @@ if ($result > 0) * Actions */ -// None +$parameters=array('id'=>$id, 'objcanvas'=>$objcanvas); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + // Cancel + if (GETPOST('cancel','alpha') && ! empty($backtopage)) + { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers + { + $actioncode=''; + $search_agenda_label=''; + } +} @@ -87,41 +128,49 @@ if ($object->id > 0) dol_fiche_head($head, 'agenda', $langs->trans("Member"), -1, 'user'); - $linkback = ''.$langs->trans("BackToList").''; - + $linkback = ''.$langs->trans("BackToList").''; + dol_banner_tab($object, 'rowid', $linkback); - + print '
| ' . fieldLabel('RubriquesTransactions', 'custcats') . ' | '; $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1); @@ -591,28 +591,28 @@ if ($result) } print " |
| ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ' | '; print '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' | '; print '
| ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ' | '; print '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' | '; print '
| ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ' | '; print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' | '; @@ -507,16 +507,16 @@ if ($object->id > 0) // TODO Replace this by an include with same code to show already done payment visible in invoice card print '
| '.$langs->trans('RemainderToPay').' | '.price($resteapayer, 1, '', 1, - 1, - 1, $conf->currency).' |
| '.$langs->trans("UserTitle").' | ';
print $object->getCivilityLabel();
@@ -160,7 +160,7 @@ if ($object->id)
print '';
dol_fiche_end();
-
+
$modulepart = 'contact';
$permission = $user->rights->societe->contact->creer;
$permtoedit = $user->rights->societe->contact->creer;
diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php
index 20d379b50d0..287c27d8b10 100644
--- a/htdocs/contact/info.php
+++ b/htdocs/contact/info.php
@@ -61,7 +61,7 @@ if ($id > 0)
dol_fiche_head($head, 'info', $title, -1, 'contact');
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = ''.$langs->trans("BackToList").'';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
@@ -71,11 +71,11 @@ if ($id > 0)
print '';
print ' '; - + dol_print_object_info($object); print ''; - + dol_fiche_end(); } diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 759831f7d57..02a25d8005c 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -90,6 +90,8 @@ $head = contact_prepare_head($object); dol_fiche_head($head, 'ldap', $title, -1, 'contact'); +$linkback = ''.$langs->trans("BackToList").''; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); print ' ';
diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php
index b52f9bf8727..1fa766e0913 100644
--- a/htdocs/contact/note.php
+++ b/htdocs/contact/note.php
@@ -74,8 +74,8 @@ if ($id > 0)
$head = contact_prepare_head($object);
dol_fiche_head($head, 'note', $title, -1, 'contact');
-
- $linkback = ''.$langs->trans("BackToList").'';
+
+ $linkback = ''.$langs->trans("BackToList").'';
$morehtmlref=' ';
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
@@ -88,13 +88,13 @@ if ($id > 0)
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
}
$morehtmlref.=' ';
-
+
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
-
+
$cssclass='titlefield';
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
//if ($action == 'editnote_private') $cssclass='titlefieldcreate';
-
+
print '';
print '';
@@ -107,12 +107,12 @@ if ($id > 0)
print " | ||
| '.$langs->trans("Ref").' | '; print $object->id; print ' | '; - + // Photo print '';
print $form->showphoto('contact',$object)."\n";
if ($object->photo) print " \n"; - + print '
| |||||
| '.$langs->trans('Discount').' | ';
if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent);
@@ -225,7 +225,7 @@ if ($id > 0 || ! empty($ref))
print '';
dol_fiche_end();
-
+
print ' '; // Contacts lines diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 132ab187777..351bdc74a46 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -107,7 +107,7 @@ if ($object->id) // Contract card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref=''; @@ -170,7 +170,7 @@ if ($object->id) print ' ';
print '';
-
+
print '
';
//print ' ';
print '';
-
+
print '';
-
-
+
+
dol_fiche_end();
// Lignes de contacts
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 7a0a7fabfc7..4cdff0bd38c 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -42,9 +42,10 @@ $result = restrictedArea($user, 'expedition',$expeditionid,'');
$diroutputmassaction=$conf->expedition->dir_output . '/temp/massgeneration/'.$user->id;
-$search_ref_exp = GETPOST("search_ref_exp");
-$search_ref_liv = GETPOST('search_ref_liv');
-$search_company = GETPOST("search_company");
+$search_ref_exp = GETPOST("search_ref_exp", 'alpha');
+$search_ref_liv = GETPOST('search_ref_liv', 'alpha');
+$search_ref_customer = GETPOST('search_ref_customer', 'alpha');
+$search_company = GETPOST("search_company", 'alpha');
$search_town=GETPOST('search_town','alpha');
$search_zip=GETPOST('search_zip','alpha');
$search_state=trim(GETPOST("search_state"));
@@ -133,6 +134,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
{
$search_ref_exp='';
$search_ref_liv='';
+ $search_ref_customer='';
$search_company='';
$search_town='';
$search_zip="";
@@ -213,6 +215,7 @@ if ($socid)
if ($viewstatut <> '' && $viewstatut >= 0) {
$sql.= " AND e.fk_statut = ".$viewstatut;
}
+if ($search_ref_customer != '') $sql.=natural_search('e.ref_customer', $search_ref_customer);
if ($search_billed != '' && $search_billed >= 0) $sql.=' AND e.billed = '.$search_billed;
if ($search_town) $sql.= natural_search('s.town', $search_town);
if ($search_zip) $sql.= natural_search("s.zip",$search_zip);
@@ -262,13 +265,14 @@ if ($resql)
$expedition = new Expedition($db);
$param='';
- if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
- if ($sall) $param.= "&sall=".$sall;
- if ($search_ref_exp) $param.= "&search_ref_exp=".$search_ref_exp;
- if ($search_ref_liv) $param.= "&search_ref_liv=".$search_ref_liv;
- if ($search_company) $param.= "&search_company=".$search_company;
- if ($optioncss != '') $param.='&optioncss='.$optioncss;
+ if ($sall) $param.= "&sall=".urlencode($sall);
+ if ($search_ref_exp) $param.= "&search_ref_exp=".urlencode($search_ref_exp);
+ if ($search_ref_liv) $param.= "&search_ref_liv=".urlencode($search_ref_liv);
+ if ($search_ref_customer) $param.= "&search_ref_customer=".urlencode($search_ref_customer);
+ if ($search_company) $param.= "&search_company=".urlencode($search_company);
+ if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index c32ec5c5124..cb123360288 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -100,9 +100,9 @@ if ($id > 0 || ! empty($ref))
$head=shipping_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans("Shipment"), -1, 'sending');
-
+
// Shipment card
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = ''.$langs->trans("BackToList").'';
$morehtmlref='';
//print '';
-
-
+
+
//print ' ';
//print '';
// Ref customer shipment
@@ -145,13 +145,13 @@ if ($id > 0 || ! empty($ref))
}
}
$morehtmlref.=' ';
-
-
+
+
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
-
-
+
+
print '';
-
+
$cssclass='titlefield';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 849053c610c..80274f9b579 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -85,14 +85,14 @@ if (empty($reshook))
$object->fetch($id);
$object->setProject(GETPOST('projectid','int'));
}
-
+
if ($action == 'confirm_cloture' && GETPOST('confirm','alpha') == 'yes')
{
$object = new Commande($db);
$object->fetch($id);
$result = $object->cloture($user);
}
-
+
// Positionne ref commande client
else if ($action == 'setref_client' && $user->rights->commande->creer) {
$result = $object->set_ref_client($user, GETPOST('ref_client'));
@@ -101,12 +101,12 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
}
}
-
+
if ($action == 'setdatedelivery' && $user->rights->commande->creer)
{
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datelivraison=dol_mktime(0, 0, 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'),GETPOST('liv_year','int'));
-
+
$object = new Commande($db);
$object->fetch($id);
$result=$object->set_date_livraison($user,$datelivraison);
@@ -131,7 +131,7 @@ if (empty($reshook))
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
-
+
if ($action == 'setavailability' && $user->rights->commande->creer) {
$object = new Commande($db);
$object->fetch($id);
@@ -139,7 +139,7 @@ if (empty($reshook))
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
-
+
if ($action == 'setdemandreason' && $user->rights->commande->creer) {
$object = new Commande($db);
$object->fetch($id);
@@ -147,7 +147,7 @@ if (empty($reshook))
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
-
+
if ($action == 'setconditions' && $user->rights->commande->creer)
{
$object = new Commande($db);
@@ -156,7 +156,7 @@ if (empty($reshook))
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
-
+
// shipping method
if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
$object = new Commande($db);
@@ -165,7 +165,7 @@ if (empty($reshook))
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
-
+
// warehouse
if ($action == 'setwarehouse' && $user->rights->commande->creer) {
$object = new Commande($db);
@@ -174,14 +174,14 @@ if (empty($reshook))
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
-
+
if ($action == 'update_extras')
{
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
if ($ret < 0) $error++;
-
+
if (! $error)
{
// Actions on extra fields (by external module or standard code)
@@ -197,20 +197,20 @@ if (empty($reshook))
} else if ($reshook < 0)
$error++;
}
-
+
if ($error)
$action = 'edit_extras';
}
-
+
if ($action == 'set_thirdparty' && $user->rights->commande->creer)
{
$object->fetch($id);
$object->setValueFrom('fk_soc', $socid, '', '', 'date', '', $user, 'ORDER_MODIFY');
-
+
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
exit();
}
-
+
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
}
@@ -243,13 +243,13 @@ if ($id > 0 || ! empty($ref))
$author->fetch($object->user_author_id);
$res = $object->fetch_optionals($object->id, $extralabels);
-
+
$head = commande_prepare_head($object);
dol_fiche_head($head, 'shipping', $langs->trans("CustomerOrder"), -1, 'order');
-
+
$formconfirm = '';
-
+
// Confirm validation
if ($action == 'cloture')
{
@@ -263,14 +263,14 @@ if ($id > 0 || ! empty($ref))
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
}
-
+
// Print form confirm
print $formconfirm;
-
-
+
+
// Order card
- $linkback = '' . $langs->trans("BackToList") . '';
+ $linkback = '' . $langs->trans("BackToList") . '';
$morehtmlref='';
@@ -320,7 +320,7 @@ if ($id > 0 || ! empty($ref))
print ' ';
print ' ';
print '';
-
+
print ' ';
$somethingshown=1;
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 1460d97323c..16dd8dbf8b1 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -1454,7 +1454,7 @@ else
print '';
}
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = ''.$langs->trans("BackToList").'';
print '
';
$morehtmlref.=' ';
-
+
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
-
+
print '';
print '';
-
+
$cssclass="titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
print ' ';
-
+
dol_fiche_end();
}
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index 84bcebf8ea1..52c23f551d2 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2002-2007 Rodolphe Quiedeville ';
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 1c023415de0..bdbb03492f7 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -655,28 +655,52 @@ class Fichinter extends CommonObject
/**
* Return clicable name (with picto eventually)
*
- * @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
- * @param string $option Options
- * @return string String with URL
+ * @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
+ * @param string $option Options
+ * @param int $notooltip 1=Disable tooltip
+ * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
+ * @return string String with URL
*/
- function getNomUrl($withpicto=0,$option='')
+ function getNomUrl($withpicto=0, $option='', $notooltip=0, $save_lastsearch_value=-1)
{
global $langs;
$result='';
+
$label = '' . $langs->trans("ShowIntervention") . '';
if (! empty($this->ref))
$label .= ' ' . $langs->trans('Ref') . ': '.$this->ref; - $link = ''; + $picto='intervention'; + $url = DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id; + + //if ($option !== 'nolink') + //{ + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + //} + + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowIntervention"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip"'; + } + + $linkstart = ''; $linkend=''; - $picto='intervention'; - - - if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend); + if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend); if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$link.$this->ref.$linkend; + if ($withpicto != 2) $result.=$linkstart.$this->ref.$linkend; return $result; } diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index 2b40553a3d9..d7be9c95cec 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -126,9 +126,9 @@ if ($id > 0 || ! empty($ref)) // Intervention card - $linkback = ''.$langs->trans("BackToList").''; - - + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref=' ';
// Ref customer
//$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
@@ -169,13 +169,13 @@ if ($id > 0 || ! empty($ref))
}
}
$morehtmlref.=' ';
-
+
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
-
+
dol_fiche_end();
-
+
print ''; - + if (! empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_USER)) $hideaddcontactforuser=1; if (! empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_THIPARTY)) $hideaddcontactforthirdparty=1; diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 3d5a3c544e8..33db56a6e78 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -102,9 +102,9 @@ if ($object->id) // Intervention card - $linkback = ''.$langs->trans("BackToList").''; - - + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref=' ';
// Ref customer
//$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
@@ -145,13 +145,13 @@ if ($object->id)
}
}
$morehtmlref.=' ';
-
+
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
-
-
+
+
print '';
print '';
-
+
print ' ';
-
+
dol_fiche_end();
-
+
$modulepart = 'facture_fournisseur';
$permission = $user->rights->fournisseur->facture->creer;
diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php
index 73d6b94a0d6..ffda7e2f4cd 100644
--- a/htdocs/fourn/facture/info.php
+++ b/htdocs/fourn/facture/info.php
@@ -63,7 +63,7 @@ $head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), -1, 'bill');
-$linkback = '' . $langs->trans("BackToList") . '';
+$linkback = '' . $langs->trans("BackToList") . '';
$morehtmlref='
'; print ''; - + print ' ';
// Ref supplier
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index 9df425040e1..6afe9f37c8c 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -76,14 +76,14 @@ if ($object->id > 0)
$object->fetch_thirdparty();
$alreadypaid=$object->getSommePaiement();
-
+
$head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
dol_fiche_head($head, 'note', $titre, -1, 'bill');
// Supplier invoice card
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = ''.$langs->trans("BackToList").'';
$morehtmlref=' ';
// Ref supplier
@@ -128,7 +128,7 @@ if ($object->id > 0)
$object->totalpaye = $alreadypaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print ' ';
print '';
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index d6fd80e47fe..000bf0b9743 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -745,7 +745,7 @@ if (empty($action))
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn AS p';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn AS pf ON p.rowid=pf.fk_paiementfourn';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn AS f ON f.rowid=pf.fk_facturefourn';
- $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement AS c ON p.fk_paiement = c.id';
+ $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement AS c ON p.fk_paiement = c.id AND c.entity IN (' . getEntity('c_paiement').')';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
@@ -913,7 +913,7 @@ if (empty($action))
print ' '.$objp->num_paiement.' | ';
print '';
- if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).'';
+ if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).'';
else print ' ';
print ' | ';
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index 5a6c39840ac..c957ec67a5b 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -806,7 +806,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
print '
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'; - } - print $langs->trans('User').' : '.$userstatic->getNomUrl().'
'; - print $langs->trans('Date').' : '.dol_print_date($comment->datec,'dayhoursec'); - print '