Work on module builder

This commit is contained in:
Laurent Destailleur 2017-10-25 22:23:54 +02:00
parent b64d60d381
commit ff9a6ca01b
3 changed files with 5 additions and 4 deletions

View File

@ -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
*/

View File

@ -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 .= '<a class="butAction" href="' . DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&thirdpartyid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'id='.$object->id).'">' . $langs->trans("AddWebsiteAccount") . '</a>';
$morehtmlcenter .= '<a class="butAction" href="' . DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&thirdpartyid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">' . $langs->trans("AddWebsiteAccount") . '</a>';
} else {
$morehtmlcenter .= '<a class="butActionRefused" href="#">' . $langs->trans("AddAction") . '</a>';
}

View File

@ -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;