Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop_ldap
This commit is contained in:
commit
7e7dd6c126
@ -129,7 +129,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1530,13 +1530,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array();
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
||||||
print $hookmanager->resPrint;
|
|
||||||
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Lines from source
|
// Lines from source
|
||||||
if (! empty($origin) && ! empty($originid) && is_object($objectsrc))
|
if (! empty($origin) && ! empty($originid) && is_object($objectsrc))
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -142,7 +142,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -151,7 +151,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -174,7 +174,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -160,7 +160,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -133,7 +133,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -134,7 +134,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -159,6 +159,7 @@ if ($action == 'add')
|
|||||||
$params['options'][$key] = $value;
|
$params['options'][$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result=$extrafields->addExtraField(
|
$result=$extrafields->addExtraField(
|
||||||
GETPOST('attrname', 'alpha'),
|
GETPOST('attrname', 'alpha'),
|
||||||
GETPOST('label', 'alpha'),
|
GETPOST('label', 'alpha'),
|
||||||
@ -172,7 +173,7 @@ if ($action == 'add')
|
|||||||
$params,
|
$params,
|
||||||
(GETPOST('alwayseditable', 'alpha')?1:0),
|
(GETPOST('alwayseditable', 'alpha')?1:0),
|
||||||
(GETPOST('perms', 'alpha')?GETPOST('perms', 'alpha'):''),
|
(GETPOST('perms', 'alpha')?GETPOST('perms', 'alpha'):''),
|
||||||
(GETPOST('list', 'alpha')?1:0),
|
GETPOST('list', 'alpha'), // Same as visible -1=not visible by default in list, 1=visible, 0=not visible in list
|
||||||
(GETPOST('ishidden', 'alpha')?1:0),
|
(GETPOST('ishidden', 'alpha')?1:0),
|
||||||
GETPOST('computed_value','alpha'),
|
GETPOST('computed_value','alpha'),
|
||||||
(GETPOST('entitycurrentorall', 'alpha')?0:''),
|
(GETPOST('entitycurrentorall', 'alpha')?0:''),
|
||||||
@ -334,7 +335,7 @@ if ($action == 'update')
|
|||||||
$params,
|
$params,
|
||||||
(GETPOST('alwayseditable', 'alpha')?1:0),
|
(GETPOST('alwayseditable', 'alpha')?1:0),
|
||||||
(GETPOST('perms', 'alpha')?GETPOST('perms', 'alpha'):''),
|
(GETPOST('perms', 'alpha')?GETPOST('perms', 'alpha'):''),
|
||||||
(GETPOST('list', 'alpha')?1:0),
|
GETPOST('list', 'alpha'), // Same as visible -1=not visible by default in list, 1=visible, 0=not visible in list
|
||||||
(GETPOST('ishidden', 'alpha')?1:0),
|
(GETPOST('ishidden', 'alpha')?1:0),
|
||||||
GETPOST('default_value','alpha'),
|
GETPOST('default_value','alpha'),
|
||||||
GETPOST('computed_value','alpha'),
|
GETPOST('computed_value','alpha'),
|
||||||
|
|||||||
@ -140,14 +140,14 @@ class ExtraFields
|
|||||||
* @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
* @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
||||||
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
||||||
* @param string $perms Permission to check
|
* @param string $perms Permission to check
|
||||||
* @param int $list Into list view by default
|
* @param int $list Into list view by default (-1, 0 or 1)
|
||||||
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
||||||
* @param string $computed Computed value
|
* @param string $computed Computed value
|
||||||
* @param string $entity Entity of extrafields
|
* @param string $entity Entity of extrafields
|
||||||
* @param string $langfile Language file
|
* @param string $langfile Language file
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $computed='', $entity='', $langfile='')
|
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list=-1, $ishidden=0, $computed='', $entity='', $langfile='')
|
||||||
{
|
{
|
||||||
if (empty($attrname)) return -1;
|
if (empty($attrname)) return -1;
|
||||||
if (empty($label)) return -1;
|
if (empty($label)) return -1;
|
||||||
@ -279,7 +279,7 @@ class ExtraFields
|
|||||||
* @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
* @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
||||||
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
||||||
* @param string $perms Permission to check
|
* @param string $perms Permission to check
|
||||||
* @param int $list Into list view by default
|
* @param int $list Into list view by default (-1, 0 or 1)
|
||||||
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
||||||
* @param string $default Default value (in database. use the default_value feature for default value on screen).
|
* @param string $default Default value (in database. use the default_value feature for default value on screen).
|
||||||
* @param string $computed Computed value
|
* @param string $computed Computed value
|
||||||
@ -287,7 +287,7 @@ class ExtraFields
|
|||||||
* @param string $langfile Language file
|
* @param string $langfile Language file
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $default='', $computed='',$entity='', $langfile='')
|
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=-1, $ishidden=0, $default='', $computed='',$entity='', $langfile='')
|
||||||
{
|
{
|
||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,8 @@
|
|||||||
* $elementtype
|
* $elementtype
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$langs->load("modulebuilder");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE admin_extrafields_add.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE admin_extrafields_add.tpl.php -->
|
||||||
@ -101,13 +103,13 @@
|
|||||||
|
|
||||||
if (type == 'separate')
|
if (type == 'separate')
|
||||||
{
|
{
|
||||||
required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.val('').prop('disabled', true);
|
required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.removeAttr('checked').prop('disabled', true);
|
||||||
jQuery('#size, #default_value').val('').prop('disabled', true);
|
jQuery('#size, #default_value').val('').prop('disabled', true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
default_value.removeAttr('disabled');
|
default_value.removeAttr('disabled');
|
||||||
required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.val('').removeAttr('disabled');
|
required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.removeAttr('disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
init_typeoffields('<?php echo GETPOST('type','alpha'); ?>');
|
init_typeoffields('<?php echo GETPOST('type','alpha'); ?>');
|
||||||
@ -178,12 +180,9 @@
|
|||||||
<?php if ($conf->multicompany->enabled) { ?>
|
<?php if ($conf->multicompany->enabled) { ?>
|
||||||
<tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (GETPOST('entitycurrentorall','alpha') ? '':' checked'); ?>></td></tr>
|
<tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (GETPOST('entitycurrentorall','alpha') ? '':' checked'); ?>></td></tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { ?>
|
|
||||||
<!-- By default visible into list -->
|
<!-- By default visible into list -->
|
||||||
<tr><td><?php echo $langs->trans("ByDefaultInList"); ?>
|
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("ByDefaultInList"), $langs->trans("VisibleDesc")); ?>
|
||||||
<?php echo img_info($langs->trans("FeatureNotYetSupported")); ?>
|
</td><td class="valeur"><input id="list" size="1" type="text" name="list" value="<?php echo GETPOST('list','int')!='' ? GETPOST('list','int') : '1'; ?>"></td></tr>
|
||||||
</td><td class="valeur"><input id="list" type="checkbox" name="list" <?php echo (GETPOST('list','alpha')?' checked':''); ?>></td></tr>
|
|
||||||
<?php } ?>
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?php dol_fiche_end(); ?>
|
<?php dol_fiche_end(); ?>
|
||||||
|
|||||||
@ -25,6 +25,8 @@
|
|||||||
* $elementtype
|
* $elementtype
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$langs->load("modulebuilder");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE admin_extrafields_edit.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE admin_extrafields_edit.tpl.php -->
|
||||||
@ -96,13 +98,13 @@
|
|||||||
|
|
||||||
if (type == 'separate')
|
if (type == 'separate')
|
||||||
{
|
{
|
||||||
required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.val('').prop('disabled', true);
|
required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.removeAttr('checked').prop('disabled', true);
|
||||||
jQuery('#size, #default_value').val('').prop('disabled', true);
|
jQuery('#size, #default_value').val('').prop('disabled', true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
default_value.removeAttr('disabled');
|
default_value.removeAttr('disabled');
|
||||||
required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.val('').removeAttr('disabled');
|
required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.removeAttr('disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
init_typeoffields(jQuery("#type").val());
|
init_typeoffields(jQuery("#type").val());
|
||||||
@ -238,11 +240,8 @@ else
|
|||||||
<tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ?' checked':''); ?>></td></tr>
|
<tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ?' checked':''); ?>></td></tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<!-- By default visible into list -->
|
<!-- By default visible into list -->
|
||||||
<?php if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { ?>
|
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("ByDefaultInList"), $langs->trans("VisibleDesc")); ?>
|
||||||
<tr><td><?php echo $langs->trans("ByDefaultInList"); ?>
|
</td><td class="valeur"><input id="list" size="1" type="text" name="list" value="<?php echo ($list!=''?$list:'1'); ?>"></td></tr>
|
||||||
<?php echo img_info($langs->trans("FeatureNotYetSupported")); ?>
|
|
||||||
</td><td class="valeur"><input id="list" type="checkbox" name="list" <?php echo ($list?' checked':''); ?>></td></tr>
|
|
||||||
<?php } ?>
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?php dol_fiche_end(); ?>
|
<?php dol_fiche_end(); ?>
|
||||||
|
|||||||
@ -22,6 +22,9 @@
|
|||||||
* $extrafield
|
* $extrafield
|
||||||
* $elementtype
|
* $elementtype
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$langs->load("modulebuilder");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
|
||||||
@ -48,6 +51,7 @@ print '<td align="center">'.$langs->trans("Unique").'</td>';
|
|||||||
print '<td>'.$langs->trans("ComputedFormula").'</td>';
|
print '<td>'.$langs->trans("ComputedFormula").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("Required").'</td>';
|
print '<td align="center">'.$langs->trans("Required").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("AlwaysEditable").'</td>';
|
print '<td align="center">'.$langs->trans("AlwaysEditable").'</td>';
|
||||||
|
print '<td align="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>';
|
||||||
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.$langs->trans("Hidden").'</td>';
|
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.$langs->trans("Hidden").'</td>';
|
||||||
if ($conf->multicompany->enabled) {
|
if ($conf->multicompany->enabled) {
|
||||||
print '<td align="center">'.$langs->trans("Entities").'</td>';
|
print '<td align="center">'.$langs->trans("Entities").'</td>';
|
||||||
@ -59,7 +63,7 @@ if (count($extrafields->attribute_type))
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_type as $key => $value)
|
foreach($extrafields->attribute_type as $key => $value)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print "<td>".$extrafields->attribute_pos[$key]."</td>\n";
|
print "<td>".$extrafields->attribute_pos[$key]."</td>\n";
|
||||||
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
|
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
|
||||||
@ -70,7 +74,8 @@ if (count($extrafields->attribute_type))
|
|||||||
print '<td>'.dol_trunc($extrafields->attribute_computed[$key], 20)."</td>\n";
|
print '<td>'.dol_trunc($extrafields->attribute_computed[$key], 20)."</td>\n";
|
||||||
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
|
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
|
||||||
print '<td align="center">'.yn($extrafields->attribute_alwayseditable[$key])."</td>\n";
|
print '<td align="center">'.yn($extrafields->attribute_alwayseditable[$key])."</td>\n";
|
||||||
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.yn($extrafields->attribute_hidden[$key])."</td>\n"; // Add hidden option on not working feature. Why hide if user can't see it.
|
print '<td align="center">'.$extrafields->attribute_list[$key]."</td>\n";
|
||||||
|
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.yn($extrafields->attribute_hidden[$key])."</td>\n"; // Add hidden option on not working feature. Why hide if user can't see it.
|
||||||
if ($conf->multicompany->enabled) {
|
if ($conf->multicompany->enabled) {
|
||||||
print '<td align="center">'.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).'</td>';
|
print '<td align="center">'.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).'</td>';
|
||||||
}
|
}
|
||||||
@ -83,7 +88,7 @@ else
|
|||||||
{
|
{
|
||||||
$colspan=9;
|
$colspan=9;
|
||||||
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++;
|
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="opacitymedium" colspan="'.$colspan.'">';
|
print '<td class="opacitymedium" colspan="'.$colspan.'">';
|
||||||
print $langs->trans("None");
|
print $langs->trans("None");
|
||||||
|
|||||||
@ -79,7 +79,7 @@ $formfile->form_attach_new_file(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$disablemove=1;
|
$disablemove=1;
|
||||||
if ($modulepart == 'produit') $disablemove=0;
|
if ($modulepart == 'product' || $modulepart == 'produit') $disablemove=0; // Drag and drop for up and down allowed on product
|
||||||
|
|
||||||
// List of document
|
// List of document
|
||||||
$formfile->list_of_documents(
|
$formfile->list_of_documents(
|
||||||
|
|||||||
40
htdocs/core/tpl/extrafields_add.tpl.php
Normal file
40
htdocs/core/tpl/extrafields_add.tpl.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*
|
||||||
|
* Need to have following variables defined:
|
||||||
|
* $object (invoice, order, ...)
|
||||||
|
* $action
|
||||||
|
* $conf
|
||||||
|
* $langs
|
||||||
|
*
|
||||||
|
* $parameters
|
||||||
|
* $cols
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- BEGIN PHP TEMPLATE extrafields_add.tpl.php -->
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||||
|
print $object->showOptionals($extrafields, 'edit');
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!-- END PHP TEMPLATE extrafields_add.tpl.php -->
|
||||||
40
htdocs/core/tpl/extrafields_edit.tpl.php
Normal file
40
htdocs/core/tpl/extrafields_edit.tpl.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*
|
||||||
|
* Need to have following variables defined:
|
||||||
|
* $object (invoice, order, ...)
|
||||||
|
* $action
|
||||||
|
* $conf
|
||||||
|
* $langs
|
||||||
|
*
|
||||||
|
* $parameters
|
||||||
|
* $cols
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- BEGIN PHP TEMPLATE extrafields_edit.tpl.php -->
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||||
|
print $object->showOptionals($extrafields, 'edit');
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!-- END PHP TEMPLATE extrafields_edit.tpl.php -->
|
||||||
@ -110,7 +110,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -120,7 +120,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -175,7 +175,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -261,6 +261,12 @@ ALTER TABLE llx_extrafields ADD COLUMN fk_user_modif integer;
|
|||||||
ALTER TABLE llx_extrafields ADD COLUMN datec datetime;
|
ALTER TABLE llx_extrafields ADD COLUMN datec datetime;
|
||||||
ALTER TABLE llx_extrafields ADD COLUMN tms timestamp;
|
ALTER TABLE llx_extrafields ADD COLUMN tms timestamp;
|
||||||
|
|
||||||
|
-- We fix value of 'list' fro m0 to 1 for all extrafields created before this migration
|
||||||
|
UPDATE llx_extrafields SET list = 1 WHERE list = 0 AND fk_user_author IS NULL and fk_user_modif IS NULL and datec IS NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_extrafields MODIFY COLUMN list integer DEFAULT 1;
|
||||||
|
--VPGSQL8.2 ALTER TABLE llx_extrafields ALTER COLUMN list SET DEFAULT 1;
|
||||||
|
|
||||||
ALTER TABLE llx_extrafields MODIFY COLUMN langs varchar(64);
|
ALTER TABLE llx_extrafields MODIFY COLUMN langs varchar(64);
|
||||||
|
|
||||||
ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128);
|
ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128);
|
||||||
|
|||||||
@ -34,7 +34,7 @@ create table llx_extrafields
|
|||||||
pos integer DEFAULT 0,
|
pos integer DEFAULT 0,
|
||||||
alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status
|
alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status
|
||||||
param text, -- extra parameters to define possible values of field
|
param text, -- extra parameters to define possible values of field
|
||||||
list integer DEFAULT 0, -- list of values for field that are combo lists
|
list integer DEFAULT 1, -- list of values for field that are combo lists
|
||||||
langs varchar(64), -- example: fileofmymodule@mymodule
|
langs varchar(64), -- example: fileofmymodule@mymodule
|
||||||
ishidden integer DEFAULT 0, -- Can be foreign key of external system
|
ishidden integer DEFAULT 0, -- Can be foreign key of external system
|
||||||
fk_user_author integer, -- user making creation
|
fk_user_author integer, -- user making creation
|
||||||
|
|||||||
@ -81,8 +81,10 @@ class MyObject extends CommonObject
|
|||||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||||
'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1),
|
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200'),
|
||||||
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Amount'),
|
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Amount'),
|
||||||
|
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>45),
|
||||||
|
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>46),
|
||||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
function myobjectPrepareHead($object)
|
function myobjectPrepareHead($object)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $db, $langs, $conf;
|
||||||
|
|
||||||
$langs->load("mymodule@mymodule");
|
$langs->load("mymodule@mymodule");
|
||||||
|
|
||||||
@ -40,17 +40,30 @@ function myobjectPrepareHead($object)
|
|||||||
$head[$h][1] = $langs->trans("Card");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
if (isset($object->fields['note_public']) || isset($object->fields['note_pricate']))
|
|
||||||
|
if (isset($object->fields['note_public']) || isset($object->fields['note_private']))
|
||||||
{
|
{
|
||||||
$head[$h][0] = dol_buildpath("/mymodule/myobject_note.php", 1).'?id='.$object->id;
|
$nbNote = 0;
|
||||||
$head[$h][1] = $langs->trans("Notes");
|
if(!empty($object->fields['note_private'])) $nbNote++;
|
||||||
|
if(!empty($object->fields['note_public'])) $nbNote++;
|
||||||
|
$head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id;
|
||||||
|
$head[$h][1] = $langs->trans('Notes');
|
||||||
|
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
|
||||||
$head[$h][2] = 'note';
|
$head[$h][2] = 'note';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||||
|
$upload_dir = $conf->mymodule->dir_output . "/myobject/" . dol_sanitizeFileName($object->ref);
|
||||||
|
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
|
||||||
|
$nbLinks=Link::count($db, $object->element, $object->id);
|
||||||
$head[$h][0] = dol_buildpath("/mymodule/myobject_document.php", 1).'?id='.$object->id;
|
$head[$h][0] = dol_buildpath("/mymodule/myobject_document.php", 1).'?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Documents");
|
$head[$h][1] = $langs->trans('Documents');
|
||||||
|
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
|
||||||
$head[$h][2] = 'document';
|
$head[$h][2] = 'document';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = dol_buildpath("/mymodule/myobject_agenda.php", 1).'?id='.$object->id;
|
$head[$h][0] = dol_buildpath("/mymodule/myobject_agenda.php", 1).'?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Events");
|
$head[$h][1] = $langs->trans("Events");
|
||||||
$head[$h][2] = 'agenda';
|
$head[$h][2] = 'agenda';
|
||||||
|
|||||||
@ -166,8 +166,9 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
foreach ($object->fields as $key => $val)
|
foreach ($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
|
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Ignore special fields
|
||||||
|
|
||||||
$object->$key=GETPOST($key,'alpha');
|
$object->$key=GETPOST($key,'alpha');
|
||||||
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue;
|
|
||||||
if ($val['notnull'] > 0 && $object->$key == '')
|
if ($val['notnull'] > 0 && $object->$key == '')
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
@ -280,6 +281,7 @@ if ($action == 'create')
|
|||||||
print $langs->trans($val['label']);
|
print $langs->trans($val['label']);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
$defaultcss='minwidth100';
|
||||||
if ($val['type'] == 'text')
|
if ($val['type'] == 'text')
|
||||||
{
|
{
|
||||||
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
|
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
|
||||||
@ -292,12 +294,16 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cssforinput = 'minwidth100';
|
$cssforinput = empty($val['css'])?$defaultcss:$val['css'];
|
||||||
print '<input class="flat" class="'.$cssforinput.'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'">';
|
print '<input class="flat'.($cssforinput?' '.$cssforinput:'').'" class="'.$cssforinput.'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'">';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -307,8 +313,6 @@ if ($action == 'create')
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Part to edit record
|
// Part to edit record
|
||||||
if (($id || $ref) && $action == 'edit')
|
if (($id || $ref) && $action == 'edit')
|
||||||
{
|
{
|
||||||
@ -325,6 +329,7 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue;
|
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue;
|
||||||
|
|
||||||
print '<tr><td';
|
print '<tr><td';
|
||||||
print ' class="titlefieldcreate';
|
print ' class="titlefieldcreate';
|
||||||
if ($val['notnull'] > 0) print ' fieldrequired';
|
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||||
@ -332,24 +337,29 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
print '"';
|
print '"';
|
||||||
print '>'.$langs->trans($val['label']).'</td>';
|
print '>'.$langs->trans($val['label']).'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
$defaultcss='minwidth100';
|
||||||
if ($val['type'] == 'text')
|
if ($val['type'] == 'text')
|
||||||
{
|
{
|
||||||
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
|
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
|
||||||
print GETPOST($key,'none');
|
print GETPOST($key,'none')?GETPOST($key,'none'):$object->$key;
|
||||||
print '</textarea>';
|
print '</textarea>';
|
||||||
}
|
}
|
||||||
elseif (is_array($val['arrayofkeyval']))
|
elseif (is_array($val['arrayofkeyval']))
|
||||||
{
|
{
|
||||||
print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int'));
|
print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')!=''?GETPOST($key, 'int'):$object->$key);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cssforinput = 'minwidth100';
|
$cssforinput = empty($val['css'])?$defaultcss:$val['css'];
|
||||||
print '<input class="flat" class="'.$cssforinput.'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'">';
|
print '<input class="flat'.($cssforinput?' '.$cssforinput:'').'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):$object->$key).'">';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -361,9 +371,6 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Part to show record
|
// Part to show record
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||||
{
|
{
|
||||||
@ -463,18 +470,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue;
|
if (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue;
|
||||||
|
|
||||||
print '<tr><td';
|
print '<tr><td';
|
||||||
print ' class="titlefieldcreate';
|
print ' class="titlefield';
|
||||||
if ($val['notnull'] > 0) print ' fieldrequired';
|
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||||
print '"';
|
print '"';
|
||||||
print '>'.$langs->trans($val['label']).'</td>';
|
print '>'.$langs->trans($val['label']).'</td>';
|
||||||
print '<td><input class="flat" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'"></td>';
|
print '<td>';
|
||||||
|
print dol_escape_htmltag($object->$key, 1, 1);
|
||||||
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
|
||||||
|
|
||||||
// Other attributes
|
//if ($key == 'targetsrcfile3') break; // key used for break on second column
|
||||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -483,7 +492,30 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
// ...
|
$alreadyoutput = 1;
|
||||||
|
foreach($object->fields as $key => $val)
|
||||||
|
{
|
||||||
|
if ($alreadyoutput)
|
||||||
|
{
|
||||||
|
//if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue;
|
||||||
|
|
||||||
|
print '<tr><td';
|
||||||
|
print ' class="titlefield';
|
||||||
|
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||||
|
print '"';
|
||||||
|
print '>'.$langs->trans($val['label']).'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print dol_escape_htmltag($object->$key, 1, 1);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -512,6 +544,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a></div>'."\n";
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a></div>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ($user->rights->sellyoursaas->create)
|
||||||
|
{
|
||||||
|
if ($object->status == 1)
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable">'.$langs->trans("Disable").'</a></div>'."\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable">'.$langs->trans("Enable").'</a></div>'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if ($user->rights->mymodule->delete)
|
if ($user->rights->mymodule->delete)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a></div>'."\n";
|
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a></div>'."\n";
|
||||||
|
|||||||
@ -79,7 +79,9 @@ $extralabels = $extrafields->fetch_name_optionals_label('myobject');
|
|||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity] . "/" . $object->id;
|
|
||||||
|
//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->id);
|
||||||
|
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->ref);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -167,10 +169,16 @@ if ($object->id)
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
$modulepart = 'societe';
|
$modulepart = 'mymodule';
|
||||||
$permission = $user->rights->societe->creer;
|
//$permission = $user->rights->mymodule->create;
|
||||||
$permtoedit = $user->rights->societe->creer;
|
$permission = 1;
|
||||||
|
//$permtoedit = $user->rights->mymodule->create;
|
||||||
|
$permtoedit = 1;
|
||||||
$param = '&id=' . $object->id;
|
$param = '&id=' . $object->id;
|
||||||
|
|
||||||
|
//$relativepathwithnofile='myobject/' . dol_sanitizeFileName($object->id).'/';
|
||||||
|
$relativepathwithnofile='myobject/' . dol_sanitizeFileName($object->ref).'/';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -130,7 +130,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -183,7 +183,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -114,7 +114,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -137,7 +137,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -127,7 +127,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -622,7 +622,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -197,7 +197,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -105,7 +105,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user