From ff9a6ca01b90a76a48233a8393d6904de8888ebf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 25 Oct 2017 22:23:54 +0200 Subject: [PATCH] Work on module builder --- htdocs/core/class/html.form.class.php | 2 +- htdocs/societe/website.php | 5 +++-- htdocs/website/class/websiteaccount.class.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 341a05159cf..b3bd62fcf59 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5633,7 +5633,7 @@ class Form * * @param string $htmlname Name of select * @param array $array Array with array of fields we could show. This array may be modified according to setup of user. - * @param string $varpage Id of context for page. Can be set with $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + * @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage); * @return string HTML multiselect string * @see selectarray */ diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 16bbc0554d2..11aedd037d9 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -39,7 +39,7 @@ $langs->loadLangs(array("companies","website")); $search_status=GETPOST('search_status'); // Security check -$id = GETPOST('id','int'); +$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'societe', $socid, '&societe'); @@ -91,6 +91,7 @@ foreach($objectwebsiteaccount->fields as $key => $val) // If $val['visible']==0, then we never show the field if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']); } + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -230,7 +231,7 @@ dol_fiche_end(); $morehtmlcenter = ''; if (! empty($conf->website->enabled)) { if (! empty($user->rights->societe->lire)) { - $morehtmlcenter .= '' . $langs->trans("AddWebsiteAccount") . ''; + $morehtmlcenter .= '' . $langs->trans("AddWebsiteAccount") . ''; } else { $morehtmlcenter .= '' . $langs->trans("AddAction") . ''; } diff --git a/htdocs/website/class/websiteaccount.class.php b/htdocs/website/class/websiteaccount.class.php index f14a38f119d..e07eef3deaf 100644 --- a/htdocs/website/class/websiteaccount.class.php +++ b/htdocs/website/class/websiteaccount.class.php @@ -89,7 +89,7 @@ class WebsiteAccount extends CommonObject 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>-1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1,), 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'default'=>1, 'arrayofkeyval'=>array('1'=>'Active','0'=>'Disabled')), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1,), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>0,), ); public $rowid; public $login;