mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
- LSform :
-> Ajout d'une notion de layout pour pouvoir définir l'affichage d'un formulaire par onglet et définir l'ordre d'affichage des attributs -> Création de templates LSform plutôt que de le redéfinir dans chaque template l'affichage d'un formulaire : - LSform.tpl : Template de formualaire - LSform_view.tpl : Template d'affichage (vue) -> Ajout du JS même lors d'une view -> JS : ajout de méthode de gestion des onglets - LSeepeople : Ajout de commentaire dans le fichier de configuration - LSformElement_select_object && LSformElement_mail : -> Utilisation des paramètres LSform plutôt que de consulter directement les champs cachés.
This commit is contained in:
parent
4c0e7669f5
commit
2b6479240e
12 changed files with 378 additions and 75 deletions
|
@ -30,6 +30,7 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'orderby' => 'displayValue', // Valeurs possibles : 'displayValue' ou 'subDn'
|
'orderby' => 'displayValue', // Valeurs possibles : 'displayValue' ou 'subDn'
|
||||||
'rdn' => 'uid',
|
'rdn' => 'uid',
|
||||||
'container_dn' => 'ou=people',
|
'container_dn' => 'ou=people',
|
||||||
|
|
||||||
'container_auto_create' => array(
|
'container_auto_create' => array(
|
||||||
'objectclass' => array(
|
'objectclass' => array(
|
||||||
'top',
|
'top',
|
||||||
|
@ -39,12 +40,15 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'ou' => 'people'
|
'ou' => 'people'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
'before_modify' => 'valid',
|
'before_modify' => 'valid',
|
||||||
'after_modify' => 'valid',
|
'after_modify' => 'valid',
|
||||||
'after_create' => 'createMaildirByFTP',
|
'after_create' => 'createMaildirByFTP',
|
||||||
'after_delete' => 'removeMaildirByFTP',
|
'after_delete' => 'removeMaildirByFTP',
|
||||||
'select_display_attrs' => '%{cn}',
|
'select_display_attrs' => '%{cn}',
|
||||||
'label' => _('Utilisateurs'),
|
'label' => _('Utilisateurs'),
|
||||||
|
|
||||||
|
// LSrelation
|
||||||
'relations' => array(
|
'relations' => array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'label' => _('Appartient aux groupes...'),
|
'label' => _('Appartient aux groupes...'),
|
||||||
|
@ -61,8 +65,49 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// LSform
|
||||||
|
'LSform' => array (
|
||||||
|
// Layout
|
||||||
|
'layout' => array (
|
||||||
|
'Civilite' => array(
|
||||||
|
'label' => 'Civilité',
|
||||||
|
'img' => 1,
|
||||||
|
'args' => array (
|
||||||
|
'uid',
|
||||||
|
'personalTitle',
|
||||||
|
'givenName',
|
||||||
|
'sn',
|
||||||
|
'cn',
|
||||||
|
'mail',
|
||||||
|
'description',
|
||||||
|
'jpegPhoto'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'Posix' => array (
|
||||||
|
'label' => 'Posix',
|
||||||
|
'args' => array (
|
||||||
|
'uidNumber',
|
||||||
|
'gidNumber',
|
||||||
|
'loginShell',
|
||||||
|
'homeDirectory'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'Samba' => array (
|
||||||
|
'label' => 'Samba',
|
||||||
|
'args' => array (
|
||||||
|
'sambaSID',
|
||||||
|
'sambaLMPassword',
|
||||||
|
'sambaNTPassword'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) // fin Layout
|
||||||
|
), // fin LSform
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
'attrs' => array (
|
'attrs' => array (
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'uid' => array (
|
'uid' => array (
|
||||||
'label' => _('Identifiant'),
|
'label' => _('Identifiant'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -101,6 +146,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'homeDirectory'
|
'homeDirectory'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'uidNumber' => array (
|
'uidNumber' => array (
|
||||||
'label' => _('Identifiant (numérique)'),
|
'label' => _('Identifiant (numérique)'),
|
||||||
'ldap_type' => 'numeric',
|
'ldap_type' => 'numeric',
|
||||||
|
@ -128,6 +176,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'modify' => 0,
|
'modify' => 0,
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'givenName' => array (
|
'givenName' => array (
|
||||||
'label' => _('Prenom'),
|
'label' => _('Prenom'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -151,6 +202,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
),
|
),
|
||||||
'onDisplay' => 'return_data'
|
'onDisplay' => 'return_data'
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'sn' => array (
|
'sn' => array (
|
||||||
'label' => _('Nom'),
|
'label' => _('Nom'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -167,6 +221,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'create' => 1
|
'create' => 1
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'cn' => array (
|
'cn' => array (
|
||||||
'label' => _('Nom complet'),
|
'label' => _('Nom complet'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -189,6 +246,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'create' => 1
|
'create' => 1
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'gidNumber' => array (
|
'gidNumber' => array (
|
||||||
'label' => _('Groupe principal'),
|
'label' => _('Groupe principal'),
|
||||||
'ldap_type' => 'numeric',
|
'ldap_type' => 'numeric',
|
||||||
|
@ -231,6 +291,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'loginShell' => array (
|
'loginShell' => array (
|
||||||
'label' => _('Interpreteur de commande'),
|
'label' => _('Interpreteur de commande'),
|
||||||
'help_info' => _("Permet ou non a l'utilisateur de se connecter à un système POSIX."),
|
'help_info' => _("Permet ou non a l'utilisateur de se connecter à un système POSIX."),
|
||||||
|
@ -250,6 +313,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'true_value' => '/bin/bash',
|
'true_value' => '/bin/bash',
|
||||||
'false_value' => '/bin/false'
|
'false_value' => '/bin/false'
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'sambaSID' => array (
|
'sambaSID' => array (
|
||||||
'label' => _('Identifiant Samba'),
|
'label' => _('Identifiant Samba'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -260,9 +326,12 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'admin' => 'r'
|
'admin' => 'r'
|
||||||
),
|
),
|
||||||
'form' => array (
|
'form' => array (
|
||||||
//'modify' => 0,
|
'modify' => 0
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'homeDirectory' => array (
|
'homeDirectory' => array (
|
||||||
'label' => _('Répertoire personnel'),
|
'label' => _('Répertoire personnel'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -274,6 +343,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
),
|
),
|
||||||
'view' => 1
|
'view' => 1
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'mail' => array (
|
'mail' => array (
|
||||||
'label' => _('Adresse e-mail'),
|
'label' => _('Adresse e-mail'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -302,6 +374,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'create' => 1
|
'create' => 1
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'personalTitle' => array (
|
'personalTitle' => array (
|
||||||
'label' => _('Titre'),
|
'label' => _('Titre'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -324,6 +399,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'Mlle' => 'Mlle'
|
'Mlle' => 'Mlle'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'description' => array (
|
'description' => array (
|
||||||
'label' => _('Description'),
|
'label' => _('Description'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -340,6 +418,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'create' => 1
|
'create' => 1
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'userPassword' => array (
|
'userPassword' => array (
|
||||||
'label' => _('Mot de passe'),
|
'label' => _('Mot de passe'),
|
||||||
'ldap_type' => 'password',
|
'ldap_type' => 'password',
|
||||||
|
@ -390,6 +471,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
),
|
),
|
||||||
'after_modify' => 'valid'
|
'after_modify' => 'valid'
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'lsRecoveryHash' => array (
|
'lsRecoveryHash' => array (
|
||||||
'label' => _('Hash de recouvrement du mot de passe'),
|
'label' => _('Hash de recouvrement du mot de passe'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -403,6 +487,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'admin' => 'w'
|
'admin' => 'w'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'sambaLMPassword' => array (
|
'sambaLMPassword' => array (
|
||||||
'label' => _('Mot de passe Samba (LM)'),
|
'label' => _('Mot de passe Samba (LM)'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -413,6 +500,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'modify' => 0
|
'modify' => 0
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'sambaNTPassword' => array (
|
'sambaNTPassword' => array (
|
||||||
'label' => _('Mot de passe Samba (NT)'),
|
'label' => _('Mot de passe Samba (NT)'),
|
||||||
'ldap_type' => 'ascii',
|
'ldap_type' => 'ascii',
|
||||||
|
@ -423,6 +513,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'modify' => 0
|
'modify' => 0
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
/* ----------- start -----------*/
|
||||||
'jpegPhoto' => array (
|
'jpegPhoto' => array (
|
||||||
'label' => _('Photo'),
|
'label' => _('Photo'),
|
||||||
'ldap_type' => 'image',
|
'ldap_type' => 'image',
|
||||||
|
@ -455,6 +548,8 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'admin' => 'w'
|
'admin' => 'w'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
/* ----------- end -----------*/
|
||||||
|
|
||||||
|
) // Fin args
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -3,13 +3,69 @@
|
||||||
* LSForm
|
* LSForm
|
||||||
******************
|
******************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Layout
|
||||||
|
*/
|
||||||
|
ul.LSform_layout_active {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 1em;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
li.LSform_layout a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #0072B8;
|
||||||
|
}
|
||||||
|
|
||||||
|
li.LSform_layout_active a {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
li.LSform_layout_active {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #52BCE5;
|
||||||
|
-moz-border-radius: 3px 3px 0px 0px;
|
||||||
|
padding: 4px;
|
||||||
|
display: inline;
|
||||||
|
margin-right: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li.LSform_layout_current {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #0072B8;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2.LSform_layout_active {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.LSform_layout {
|
||||||
|
border: 1px solid #0072B8;
|
||||||
|
margin: 1em;
|
||||||
|
padding: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.LSform_layout_active {
|
||||||
|
display: none;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.LSform_layout_current {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Architecture
|
* Architecture
|
||||||
*/
|
*/
|
||||||
|
div.LSform {
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
dl.LSform {
|
dl.LSform {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-left: 2em;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,14 +73,14 @@ dl.LSform {
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 0.2em;
|
left: 0.2em;
|
||||||
top: 1.2em;
|
top: 1.2em;
|
||||||
width: 15em;
|
width: 16em;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
color: #0072b8;
|
color: #0072b8;
|
||||||
}
|
}
|
||||||
|
|
||||||
dd.LSform {
|
dd.LSform {
|
||||||
margin-left: 15em;
|
margin-left: 16em;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,13 @@ h1 {
|
||||||
clear: left;
|
clear: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin: 0.7em;
|
||||||
|
margin-bottom: 1px;
|
||||||
|
color: #0072b8;
|
||||||
|
clear: left;
|
||||||
|
}
|
||||||
|
|
||||||
a img {
|
a img {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,7 @@ class LSform {
|
||||||
function display(){
|
function display(){
|
||||||
if ($this -> idForm == 'view') {
|
if ($this -> idForm == 'view') {
|
||||||
$GLOBALS['LSsession'] -> addJSscript('LSview.js');
|
$GLOBALS['LSsession'] -> addJSscript('LSview.js');
|
||||||
|
$GLOBALS['LSsession'] -> addJSscript('LSform.js');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_field.js');
|
$GLOBALS['LSsession'] -> addJSscript('LSformElement_field.js');
|
||||||
|
@ -93,6 +94,12 @@ class LSform {
|
||||||
'dn' => $this -> ldapObject -> getValue('dn')
|
'dn' => $this -> ldapObject -> getValue('dn')
|
||||||
);
|
);
|
||||||
$GLOBALS['Smarty'] -> assign('LSform_object',$LSform_object);
|
$GLOBALS['Smarty'] -> assign('LSform_object',$LSform_object);
|
||||||
|
|
||||||
|
if (is_array($GLOBALS['LSobjects'][$LSform_object['type']]['LSform']['layout'])) {
|
||||||
|
$GLOBALS['Smarty'] -> assign('LSform_layout',$GLOBALS['LSobjects'][$LSform_object['type']]['LSform']['layout']);
|
||||||
|
$GLOBALS['Smarty'] -> assign('LSform_layout_nofield_label',_('Aucun champ.'));
|
||||||
|
}
|
||||||
|
|
||||||
$fields = array();
|
$fields = array();
|
||||||
foreach($this -> elements as $element) {
|
foreach($this -> elements as $element) {
|
||||||
$field = array();
|
$field = array();
|
||||||
|
@ -100,7 +107,7 @@ class LSform {
|
||||||
if (isset($this -> _elementsErrors[$element -> name])) {
|
if (isset($this -> _elementsErrors[$element -> name])) {
|
||||||
$field['errors']= $this -> _elementsErrors[$element -> name];
|
$field['errors']= $this -> _elementsErrors[$element -> name];
|
||||||
}
|
}
|
||||||
$fields[] = $field;
|
$fields[$element -> name] = $field;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this -> maxFileSize) {
|
if ($this -> maxFileSize) {
|
||||||
|
@ -123,6 +130,7 @@ class LSform {
|
||||||
*/
|
*/
|
||||||
function displayView(){
|
function displayView(){
|
||||||
$GLOBALS['LSsession'] -> addCssFile('LSform.css');
|
$GLOBALS['LSsession'] -> addCssFile('LSform.css');
|
||||||
|
$GLOBALS['LSsession'] -> addJSscript('LSform.js');
|
||||||
$LSform_object = array(
|
$LSform_object = array(
|
||||||
'type' => $this -> ldapObject -> getType(),
|
'type' => $this -> ldapObject -> getType(),
|
||||||
'dn' => $this -> ldapObject -> getDn()
|
'dn' => $this -> ldapObject -> getDn()
|
||||||
|
@ -131,9 +139,14 @@ class LSform {
|
||||||
$fields = array();
|
$fields = array();
|
||||||
foreach($this -> elements as $element) {
|
foreach($this -> elements as $element) {
|
||||||
$field = $element -> getDisplay();
|
$field = $element -> getDisplay();
|
||||||
$fields[] = $field;
|
$fields[$element -> name] = $field;
|
||||||
}
|
}
|
||||||
$GLOBALS['Smarty'] -> assign('LSform_fields',$fields);
|
$GLOBALS['Smarty'] -> assign('LSform_fields',$fields);
|
||||||
|
|
||||||
|
if (is_array($GLOBALS['LSobjects'][$LSform_object['type']]['LSform']['layout'])) {
|
||||||
|
$GLOBALS['Smarty'] -> assign('LSform_layout',$GLOBALS['LSobjects'][$LSform_object['type']]['LSform']['layout']);
|
||||||
|
$GLOBALS['Smarty'] -> assign('LSform_layout_nofield_label',_('Aucun champ.'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,21 +3,67 @@ var LSform = new Class({
|
||||||
this._modules=[];
|
this._modules=[];
|
||||||
this._elements=[];
|
this._elements=[];
|
||||||
|
|
||||||
this.objecttype = $('LSform_objecttype').value,
|
if ($type($('LSform_idform'))) {
|
||||||
this.objectdn = $('LSform_objectdn').value,
|
this.objecttype = $('LSform_objecttype').value;
|
||||||
this.idform = $('LSform_idform').value,
|
this.objectdn = $('LSform_objectdn').value;
|
||||||
|
this.idform = $('LSform_idform').value;
|
||||||
|
}
|
||||||
|
|
||||||
this.initializeLSform();
|
this.initializeLSform();
|
||||||
|
this.initializeLSformLayout();
|
||||||
},
|
},
|
||||||
|
|
||||||
initializeLSform: function(el) {
|
initializeLSform: function(el) {
|
||||||
this.LStips = new Tips('.LStips');
|
this.LStips = new Tips('.LStips');
|
||||||
if (typeof(el) == 'undefined') {
|
if (this.idform) {
|
||||||
el = document;
|
if (typeof(el) == 'undefined') {
|
||||||
|
el = document;
|
||||||
|
}
|
||||||
|
el.getElements('ul.LSform').each(function(ul) {
|
||||||
|
this._elements[ul.id] = new LSformElement(this,ul.id,ul);
|
||||||
|
}, this);
|
||||||
}
|
}
|
||||||
el.getElements('ul.LSform').each(function(ul) {
|
},
|
||||||
this._elements[ul.id] = new LSformElement(this,ul.id,ul);
|
|
||||||
}, this);
|
initializeLSformLayout: function(el) {
|
||||||
|
$$('.LSform_layout').each(function(el) {
|
||||||
|
el.addClass('LSform_layout_active');
|
||||||
|
},this);
|
||||||
|
|
||||||
|
var LIs = $$('li.LSform_layout');
|
||||||
|
LIs.each(function(li) {
|
||||||
|
li.getFirst('a').addEvent('click',this.onTabBtnClick.bindWithEvent(this,li));
|
||||||
|
},this);
|
||||||
|
|
||||||
|
if (LIs.length != 0) {
|
||||||
|
this._currentTab = 'default_value';
|
||||||
|
document.getElement('li.LSform_layout').getFirst('a').fireEvent('click');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onTabBtnClick: function(event,li) {
|
||||||
|
if ($type(event)) {
|
||||||
|
new Event(event).stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._currentTab!='default_value') {
|
||||||
|
var oldLi = $$('li.LSform_layout[title='+this._currentTab+']');
|
||||||
|
if ($type(oldLi)) {
|
||||||
|
oldLi.removeClass('LSform_layout_current');
|
||||||
|
}
|
||||||
|
var oldDiv = $$('div.LSform_layout[title='+this._currentTab+']');
|
||||||
|
if ($type(oldDiv)) {
|
||||||
|
oldDiv.removeClass('LSform_layout_current');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this._currentTab = li.title;
|
||||||
|
li.addClass('LSform_layout_current');
|
||||||
|
var div = $$('div.LSform_layout[title='+this._currentTab+']');
|
||||||
|
if ($type(div)) {
|
||||||
|
div.addClass('LSform_layout_current');
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
addModule: function(name,obj) {
|
addModule: function(name,obj) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ var LSformElement_mail = new Class({
|
||||||
if ((mail!="")) {
|
if ((mail!="")) {
|
||||||
this.LSmail_open = 1;
|
this.LSmail_open = 1;
|
||||||
this.LSmail.setMails([mail]);
|
this.LSmail.setMails([mail]);
|
||||||
this.LSmail.setObject($('LSform_objecttype').value,$('LSform_objectdn').value);
|
this.LSmail.setObject(varLSform.objecttype,varLSform.objectdn);
|
||||||
this.LSmail.open(btn);
|
this.LSmail.open(btn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,9 +97,9 @@ var LSformElement_select_object_field = new Class({
|
||||||
template: 'LSform',
|
template: 'LSform',
|
||||||
action: 'refreshField',
|
action: 'refreshField',
|
||||||
attribute: this.name,
|
attribute: this.name,
|
||||||
objecttype: $('LSform_objecttype').value,
|
objecttype: varLSform.objecttype,
|
||||||
objectdn: $('LSform_objectdn').value,
|
objectdn: varLSform.objectdn,
|
||||||
idform: $('LSform_idform').value
|
idform: varLSform.idform
|
||||||
};
|
};
|
||||||
data.imgload=varLSdefault.loadingImgDisplay(this.addBtn);
|
data.imgload=varLSdefault.loadingImgDisplay(this.addBtn);
|
||||||
new Request({url: 'index_ajax.php', data: data, onSuccess: this.onLSsmoothboxValidComplete.bind(this)}).send();
|
new Request({url: 'index_ajax.php', data: data, onSuccess: this.onLSsmoothboxValidComplete.bind(this)}).send();
|
||||||
|
|
80
trunk/templates/default/LSform.tpl
Normal file
80
trunk/templates/default/LSform.tpl
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
<form action='{$LSform_action}' method='post' enctype="multipart/form-data" class='LSform'>
|
||||||
|
{$LSform_header}
|
||||||
|
{if $LSform_layout}
|
||||||
|
<!-- Tabs - Start Title -->
|
||||||
|
<ul class='LSform_layout'>
|
||||||
|
{foreach from=$LSform_layout item=tab key=tab_key}
|
||||||
|
<li class='LSform_layout' title='{$tab_key}'><a href="#{$tab_key}">{$tab.label}</a></li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
<!-- Tabs - End Title -->
|
||||||
|
|
||||||
|
<!-- Tabs - Start Content -->
|
||||||
|
{foreach from=$LSform_layout item=tab key=tab_key}
|
||||||
|
<a name='{$tab_key}'/>
|
||||||
|
<h2 class='LSform_layout'>{$tab.label}</h2>
|
||||||
|
<div class='LSform LSform_layout' title='{$tab_key}'>
|
||||||
|
{if $LSformElement_image!='' && $tab.img==1}
|
||||||
|
<div class='LSformElement_image{if $LSformElement_image_errors} LSformElement_image_errors{/if}'>
|
||||||
|
{if $LSformElement_image_actions!='' && !$LSformElement_image_errors}
|
||||||
|
<ul class='LSformElement_image_actions'>
|
||||||
|
<li><img src='{$LS_IMAGES_DIR}/zoom.png' class='LSformElement_image_actions LSformElement_image_action_zoom' id='LSformElement_image_action_zoom_{$LSformElement_image.id}' /></li>
|
||||||
|
{foreach from=$LSformElement_image_actions item=item}
|
||||||
|
<li><img src='{$LS_IMAGES_DIR}/{$item}.png' class='LSformElement_image_actions LSformElement_image_action_{$item}' id='LSformElement_image_action_{$item}_{$LSformElement_image.id}' /></li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
{/if}
|
||||||
|
<img src='{$LSformElement_image.img}' class='LSformElement_image LSsmoothbox' id='LSformElement_image_{$LSformElement_image.id}' />
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<dl class='LSform'>
|
||||||
|
{foreach from=$tab.args item=arg}
|
||||||
|
{if $LSform_fields[$arg]}
|
||||||
|
<dt class='LSform{if $LSform_fields[$arg].errors != ''} LSform-errors{/if}'>{$LSform_fields[$arg].label}{if $LSform_fields[$arg].required} *{/if}{if $LSform_fields[$arg].help_info!=""} <img class='LStips' src="{$LS_IMAGES_DIR}/help.png" alt='?' title="{$LSform_fields[$arg].help_info}"/>{/if}</dt>
|
||||||
|
<dd class='LSform'>{$LSform_fields[$arg].html}{if $LSform_fields[$arg].add != ''} <span class='LSform-addfield'>+ Ajouter un champ</span>{/if}</dd>
|
||||||
|
{if $LSform_fields[$arg].errors != ''}
|
||||||
|
{foreach from=$LSform_fields[$arg].errors item=error}
|
||||||
|
<dd class='LSform LSform-errors'>{$error}</dd>
|
||||||
|
{/foreach}
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
|
<dd class='LSform'><input type='submit' value='{$LSform_submittxt}' class='LSform' /></dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{/foreach}
|
||||||
|
<!-- Tabs - End Content -->
|
||||||
|
{else}
|
||||||
|
{if $LSformElement_image!=''}
|
||||||
|
<div class='LSformElement_image{if $LSformElement_image_errors} LSformElement_image_errors{/if}'>
|
||||||
|
{if $LSformElement_image_actions!='' && !$LSformElement_image_errors}
|
||||||
|
<ul class='LSformElement_image_actions'>
|
||||||
|
<li><img src='{$LS_IMAGES_DIR}/zoom.png' class='LSformElement_image_actions LSformElement_image_action_zoom' id='LSformElement_image_action_zoom_{$LSformElement_image.id}' /></li>
|
||||||
|
{foreach from=$LSformElement_image_actions item=item}
|
||||||
|
<li><img src='{$LS_IMAGES_DIR}/{$item}.png' class='LSformElement_image_actions LSformElement_image_action_{$item}' id='LSformElement_image_action_{$item}_{$LSformElement_image.id}' /></li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
{/if}
|
||||||
|
<img src='{$LSformElement_image.img}' class='LSformElement_image LSsmoothbox' id='LSformElement_image_{$LSformElement_image.id}' />
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<div class='LSform'>
|
||||||
|
<dl class='LSform'>
|
||||||
|
{foreach from=$LSform_fields item=field}
|
||||||
|
<dt class='LSform{if $field.errors != ''} LSform-errors{/if}'>{$field.label}{if $field.required} *{/if}{if $field.help_info!=""} <img class='LStips' src="{$LS_IMAGES_DIR}/help.png" alt='?' title="{$field.help_info}"/>{/if}</dt>
|
||||||
|
<dd class='LSform'>{$field.html}{if $field.add != ''} <span class='LSform-addfield'>+ Ajouter un champ</span>{/if}</dd>
|
||||||
|
{if $field.errors != ''}
|
||||||
|
{foreach from=$field.errors item=error}
|
||||||
|
<dd class='LSform LSform-errors'>{$error}</dd>
|
||||||
|
{/foreach}
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
|
<dd class='LSform'><input type='submit' value='{$LSform_submittxt}' class='LSform' /></dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
</form>
|
58
trunk/templates/default/LSform_view.tpl
Normal file
58
trunk/templates/default/LSform_view.tpl
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
<input type='hidden' name='LSform_objecttype' id='LSform_objecttype' value='{$LSform_object.type}'/>
|
||||||
|
<input type='hidden' name='LSform_objectdn' id='LSform_objectdn' value='{$LSform_object.dn}'/>
|
||||||
|
{if $LSform_layout}
|
||||||
|
<!-- Tabs - Start Title -->
|
||||||
|
<ul class='LSform_layout'>
|
||||||
|
{foreach from=$LSform_layout item=tab key=tab_key}
|
||||||
|
<li class='LSform_layout' title='{$tab_key}'><a href="#{$tab_key}">{$tab.label}</a></li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
<!-- Tabs - End Title -->
|
||||||
|
|
||||||
|
<!-- Tabs - Start Content -->
|
||||||
|
{foreach from=$LSform_layout item=tab key=tab_key}
|
||||||
|
<a name='{$tab_key}'/>
|
||||||
|
<h2 class='LSform_layout'>{$tab.label}</h2>
|
||||||
|
<div class='LSform LSform_layout' title='{$tab_key}'>
|
||||||
|
|
||||||
|
{if $LSformElement_image!='' && $tab.img==1}
|
||||||
|
<div class='LSformElement_image'>
|
||||||
|
<a href='{$LSformElement_image.img}.png' rel='rien ici' title='comment' class='mb'><img src='{$LSformElement_image.img}' class='LSformElement_image LSsmoothbox' id='LSformElement_image_{$LSformElement_image.id}' /></a>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<dl class='LSform'>
|
||||||
|
{assign var='field' value='non'}
|
||||||
|
{foreach from=$tab.args item=arg}
|
||||||
|
{if $LSform_fields[$arg]}
|
||||||
|
{assign var='field' value='oui'}
|
||||||
|
<dt class='LSform'>{$LSform_fields[$arg].label}</dt>
|
||||||
|
<dd class='LSform'>{$LSform_fields[$arg].html}</dd>
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
|
{if $field=='non'}
|
||||||
|
<dd class='LSform'>{$LSform_layout_nofield_label}</dd>
|
||||||
|
{/if}
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{/foreach}
|
||||||
|
<!-- Tabs - End Content -->
|
||||||
|
{else}
|
||||||
|
|
||||||
|
{if $LSformElement_image!=''}
|
||||||
|
<div class='LSformElement_image'>
|
||||||
|
<a href='{$LSformElement_image.img}.png' rel='rien ici' title='comment' class='mb'><img src='{$LSformElement_image.img}' class='LSformElement_image LSsmoothbox' id='LSformElement_image_{$LSformElement_image.id}' /></a>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<div class='LSform'>
|
||||||
|
<dl class='LSform'>
|
||||||
|
{foreach from=$LSform_fields item=field}
|
||||||
|
<dt class='LSform'>{$field.label}</dt>
|
||||||
|
<dd class='LSform'>{$field.html}</dd>
|
||||||
|
{/foreach}
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/if}
|
|
@ -1,19 +1,5 @@
|
||||||
{include file='top.tpl'}
|
{include file='top.tpl'}
|
||||||
{if $pagetitle != ''}<h1>{$pagetitle}</h1>{/if}
|
{if $pagetitle != ''}<h1>{$pagetitle}</h1>{/if}
|
||||||
|
|
||||||
<form action='{$LSform_action}' method='post' class='LSform'>
|
{include file='LSform.tpl'}
|
||||||
{$LSform_header}
|
|
||||||
<dl class='LSform'>
|
|
||||||
{foreach from=$LSform_fields item=field}
|
|
||||||
<dt class='LSform{if $field.errors != ''} LSform-errors{/if}'>{$field.label}{if $field.required} *{/if}{if $field.help_info!=""} <img class='LStips' src="{$LS_IMAGES_DIR}/help.png" alt='?' title="{$field.help_info}"/>{/if}</dt>
|
|
||||||
<dd class='LSform'>{$field.html}{if $field.add != ''} <span class='LSform-addfield'>+ Ajouter un champ</span>{/if}</dd>
|
|
||||||
{if $field.errors != ''}
|
|
||||||
{foreach from=$field.errors item=error}
|
|
||||||
<dd class='LSform LSform-errors'>{$error}</dd>
|
|
||||||
{/foreach}
|
|
||||||
{/if}
|
|
||||||
{/foreach}
|
|
||||||
<dd class='LSform'><input type='submit' value='{$LSform_submittxt}' class='LSform' /></dd>
|
|
||||||
</dl>
|
|
||||||
</form>
|
|
||||||
{include file='bottom.tpl'}
|
{include file='bottom.tpl'}
|
||||||
|
|
|
@ -8,33 +8,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $LSformElement_image!=''}
|
{include file='LSform.tpl'}
|
||||||
<div class='LSformElement_image{if $LSformElement_image_errors} LSformElement_image_errors{/if}'>
|
|
||||||
{if $LSformElement_image_actions!='' && !$LSformElement_image_errors}
|
|
||||||
<ul class='LSformElement_image_actions'>
|
|
||||||
<li><img src='{$LS_IMAGES_DIR}/zoom.png' class='LSformElement_image_actions LSformElement_image_action_zoom' id='LSformElement_image_action_zoom_{$LSformElement_image.id}' /></li>
|
|
||||||
{foreach from=$LSformElement_image_actions item=item}
|
|
||||||
<li><img src='{$LS_IMAGES_DIR}/{$item}.png' class='LSformElement_image_actions LSformElement_image_action_{$item}' id='LSformElement_image_action_{$item}_{$LSformElement_image.id}' /></li>
|
|
||||||
{/foreach}
|
|
||||||
</ul>
|
|
||||||
{/if}
|
|
||||||
<img src='{$LSformElement_image.img}' class='LSformElement_image LSsmoothbox' id='LSformElement_image_{$LSformElement_image.id}' />
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<form action='{$LSform_action}' method='post' enctype="multipart/form-data" class='LSform'>
|
|
||||||
{$LSform_header}
|
|
||||||
<dl class='LSform'>
|
|
||||||
{foreach from=$LSform_fields item=field}
|
|
||||||
<dt class='LSform{if $field.errors != ''} LSform-errors{/if}'>{$field.label}{if $field.required} *{/if}{if $field.help_info!=""} <img class='LStips' src="{$LS_IMAGES_DIR}/help.png" alt='?' title="{$field.help_info}"/>{/if}</dt>
|
|
||||||
<dd class='LSform'>{$field.html}{if $field.add != ''} <span class='LSform-addfield'>+ Ajouter un champ</span>{/if}</dd>
|
|
||||||
{if $field.errors != ''}
|
|
||||||
{foreach from=$field.errors item=error}
|
|
||||||
<dd class='LSform LSform-errors'>{$error}</dd>
|
|
||||||
{/foreach}
|
|
||||||
{/if}
|
|
||||||
{/foreach}
|
|
||||||
<dd class='LSform'><input type='submit' value='{$LSform_submittxt}' class='LSform' /></dd>
|
|
||||||
</dl>
|
|
||||||
</form>
|
|
||||||
{include file='bottom.tpl'}
|
{include file='bottom.tpl'}
|
||||||
|
|
|
@ -7,19 +7,8 @@
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
{/if}
|
{/if}
|
||||||
{if $LSformElement_image!=''}
|
|
||||||
<div class='LSformElement_image'>
|
{include file='LSform_view.tpl'}
|
||||||
<a href='{$LSformElement_image.img}.png' rel='rien ici' title='comment' class='mb'><img src='{$LSformElement_image.img}' class='LSformElement_image LSsmoothbox' id='LSformElement_image_{$LSformElement_image.id}' /></a>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
<input type='hidden' name='LSform_objecttype' id='LSform_objecttype' value='{$LSform_object.type}'/>
|
|
||||||
<input type='hidden' name='LSform_objectdn' id='LSform_objectdn' value='{$LSform_object.dn}'/>
|
|
||||||
<dl class='LSform'>
|
|
||||||
{foreach from=$LSform_fields item=field}
|
|
||||||
<dt class='LSform'>{$field.label}</dt>
|
|
||||||
<dd class='LSform'>{$field.html}</dd>
|
|
||||||
{/foreach}
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
{if $LSrelations!=''}
|
{if $LSrelations!=''}
|
||||||
{foreach from=$LSrelations item=item}
|
{foreach from=$LSrelations item=item}
|
||||||
|
|
Loading…
Reference in a new issue