From a4a7489a541aea8c04f9f9854b3189ac124569dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Dec 2014 15:12:32 +0100 Subject: [PATCH 1/5] Fix: Missing the hook init --- htdocs/societe/consumption.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index d5ef1af6dbb..f8b5829b03e 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -76,11 +76,18 @@ $langs->load("orders"); $langs->load("suppliers"); $langs->load("propal"); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('consumptionthirdparty')); + /* * Actions */ +$parameters=array('id'=>$socid); +$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'); + /* From 455a2fe07a354bbddf8e3f6c085d998288a94381 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Dec 2014 15:14:24 +0100 Subject: [PATCH 2/5] Fixed: Missing hook init Fixed: Translation at wrong place --- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/resource.lang | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 27dabba3d88..29664483d18 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -781,6 +781,7 @@ DictionaryOrderMethods=Ordering methods DictionarySource=Origin of proposals/orders DictionaryAccountancyplan=Chart of accounts DictionaryAccountancysystem=Models for chart of accounts +DictionaryEMailTemplates=Emails templates SetupSaved=Setup saved BackToModuleList=Back to modules list BackToDictionaryList=Back to dictionaries list diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang index d64075dfbf5..32bdd92f884 100644 --- a/htdocs/langs/en_US/resource.lang +++ b/htdocs/langs/en_US/resource.lang @@ -31,6 +31,4 @@ ConfirmDeleteResource=Confirm to delete this resource RessourceSuccessfullyDeleted=Resource successfully deleted DictionaryResourceType=Type of resources -DictionaryEMailTemplates=Modèles d'Emails - SelectResource=Select resource From c35018be5f1ca6ca9a597f425fd8e722fefce4c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Dec 2014 18:24:45 +0100 Subject: [PATCH 3/5] Fixed: Translations --- .../contact/canvas/default/tpl/contactcard_create.tpl.php | 2 +- .../contact/canvas/default/tpl/contactcard_edit.tpl.php | 2 +- .../contact/canvas/default/tpl/contactcard_view.tpl.php | 2 +- htdocs/contact/card.php | 8 ++++---- htdocs/contact/exportimport.php | 4 ++-- htdocs/contact/ldap.php | 4 ++-- htdocs/contact/list.php | 2 +- htdocs/contact/note.php | 4 ++-- htdocs/contact/perso.php | 8 ++++---- htdocs/core/class/html.formfile.class.php | 8 +++++--- htdocs/societe/document.php | 2 +- 11 files changed, 24 insertions(+), 22 deletions(-) diff --git a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php index a0605d3656e..70d6b41bf35 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php @@ -50,7 +50,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?> - trans("Company"); ?> + trans("ThirdParty"); ?> control->tpl['company']; ?> diff --git a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php index a445444e42c..3be1d16bc8d 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php @@ -59,7 +59,7 @@ echo $this->control->tpl['ajax_selectcountry']; - trans("Company"); ?> + trans("ThirdParty"); ?> control->tpl['company']; ?> diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php index 623fad27e77..0b4b8a07fcb 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php @@ -44,7 +44,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors'] - trans("Company"); ?> + trans("ThirdParty"); ?> control->tpl['company']; ?> diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index db83554c7ae..af07cbb9a62 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -456,7 +456,7 @@ else { if ($socid > 0) { - print ''; + print ''; print ''; print $objsoc->getNomUrl(1); print ''; @@ -464,7 +464,7 @@ else print ''; } else { - print ''; + print ''; print $form->select_company($socid,'socid','',1); print ''; } @@ -690,7 +690,7 @@ else // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - print ''; + print ''; print ''; print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1),'socid','',1); print ''; @@ -924,7 +924,7 @@ else // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - print ''.$langs->trans("Company").''; + print ''.$langs->trans("ThirdParty").''; if ($object->socid > 0) { $objsoc->fetch($object->socid); diff --git a/htdocs/contact/exportimport.php b/htdocs/contact/exportimport.php index bcb3b9c2be0..e9e9c70966c 100644 --- a/htdocs/contact/exportimport.php +++ b/htdocs/contact/exportimport.php @@ -77,11 +77,11 @@ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) $objsoc = new Societe($db); $objsoc->fetch($contact->socid); - print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; + print ''.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).''; } else { - print ''.$langs->trans("Company").''; + print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; } diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index fe3098eaa9a..170ed039904 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -105,11 +105,11 @@ if ($contact->socid > 0) $objsoc = new Societe($db); $objsoc->fetch($contact->socid); - print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; + print ''.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).''; } else { - print ''.$langs->trans("Company").''; + print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index eab4369ac21..4413b721fc9 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -300,7 +300,7 @@ if ($result) print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.lastname", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder); - if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder); + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder); diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 73b0f513db9..ab8101dd739 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -98,12 +98,12 @@ if ($id > 0) $objsoc = new Societe($db); $objsoc->fetch($object->socid); - print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; + print ''.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).''; } else { - print ''.$langs->trans("Company").''; + print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; } diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 92ba03e9861..6ec43320e54 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -111,11 +111,11 @@ if ($action == 'edit') $objsoc = new Societe($db); $objsoc->fetch($object->socid); - print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; + print ''.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).''; } else { - print ''.$langs->trans("Company").''; + print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; } @@ -179,12 +179,12 @@ else $objsoc = new Societe($db); $objsoc->fetch($object->socid); - print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; + print ''.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).''; } else { - print ''.$langs->trans("Company").''; + print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 2bcfd36bdde..cf06894dde5 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -271,13 +271,13 @@ class FormFile if (! empty($iconPDF)) { return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir); } - + $printer=0; if (in_array($modulepart,array('facture','propal','proposal','order','commande'))) // This feature is implemented only for such elements { $printer = (!empty($user->rights->printipp->read) && !empty($conf->printipp->enabled))?true:false; } - + $hookmanager->initHooks(array('formfile')); $forname='builddoc'; $out=''; @@ -1100,6 +1100,8 @@ class FormFile global $bc; global $sortfield, $sortorder; + $langs->load("link"); + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; $link = new Link($this->db); $links = array(); @@ -1161,7 +1163,7 @@ class FormFile $nboflinks = count($links); if ($nboflinks > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - $var = false; + $var = true; foreach ($links as $link) { $var =! $var; diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 2fde1ef5dcf..c2ad751f196 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -147,7 +147,7 @@ if ($object->id) print ''; - print ''; + dol_fiche_end(); $modulepart = 'societe'; $permission = $user->rights->societe->creer; From 1db6d86c78002f6eb8ce7ff0ade5637b0c5ac60a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Dec 2014 19:10:24 +0100 Subject: [PATCH 4/5] Fix: versions --- htdocs/install/check.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index d815d67dd59..1f233e9f551 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -71,12 +71,12 @@ if (! empty($useragent)) // Check PHP version -if (versioncompare(versionphparray(),array(4,3,10)) < 0) // Minimum to use (error if lower) +if (versioncompare(versionphparray(),array(5,2,3)) < 0) // Minimum to use (error if lower) { - print 'Error '.$langs->trans("ErrorPHPVersionTooLow",'4.3.10'); + print 'Error '.$langs->trans("ErrorPHPVersionTooLow",'5.2.3'); $checksok=0; // 0=error, 1=warning } -else if (versioncompare(versionphparray(),array(5,3,0)) < 0) // Minimum supported (error if lower) +else if (versioncompare(versionphparray(),array(5,3,0)) < 0) // Minimum supported (warning if lower) { print 'Error '.$langs->trans("ErrorPHPVersionTooLow",'5.3.0'); $checksok=0; // 0=error, 1=warning From 1e8e7474d8e27c75cb2988f95227a6da3d78029b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Dec 2014 21:22:43 +0100 Subject: [PATCH 5/5] Fixed: specimen init did not include new vars of 3.7 --- htdocs/comm/action/class/actioncomm.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 56fb713ae0c..15394c81a3a 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1142,7 +1142,7 @@ class ActionComm extends CommonObject */ function initAsSpecimen() { - global $user,$langs,$conf; + global $user,$langs,$conf,$user; $now=dol_now(); @@ -1166,6 +1166,9 @@ class ActionComm extends CommonObject $this->transparency=1; // 1 means opaque $this->priority=1; $this->note = 'Note'; + + $this->userownerid=$user->id; + $this->userassigned[$user->id]=array('id'=>$user->id, 'transparency'=> 1); } }