From 0055ea1d7af587916af9431102e51322d863bc71 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 30 Jul 2015 16:37:42 +0200 Subject: [PATCH] Add import feature --- doc/conf/LSobject.docbook | 16 + doc/conf/LSobject/ioFormat.docbook | 141 ++ doc/conf/conf.entities.xml | 1 + lsexample/LSpeople_import_test.csv | 3 + .../LSobjects/config.LSobjects.LSpeople.php | 26 + public_html/css/default/LSimport.css | 28 + public_html/images/default/import.png | Bin 0 -> 585 bytes public_html/import.php | 84 + public_html/includes/class/class.LSimport.php | 333 ++++ .../includes/class/class.LSioFormat.php | 93 + .../includes/class/class.LSioFormatCSV.php | 109 ++ .../includes/class/class.LSioFormatDriver.php | 142 ++ .../includes/class/class.LSldapObject.php | 63 +- .../includes/class/class.LSsession.php | 4 +- public_html/lang/ldapsaisie.pot | 1609 +++++++++-------- public_html/templates/default/import.tpl | 76 + public_html/view.php | 5 + 17 files changed, 1925 insertions(+), 808 deletions(-) create mode 100644 doc/conf/LSobject/ioFormat.docbook create mode 100644 lsexample/LSpeople_import_test.csv create mode 100644 public_html/css/default/LSimport.css create mode 100644 public_html/images/default/import.png create mode 100644 public_html/import.php create mode 100644 public_html/includes/class/class.LSimport.php create mode 100644 public_html/includes/class/class.LSioFormat.php create mode 100644 public_html/includes/class/class.LSioFormatCSV.php create mode 100644 public_html/includes/class/class.LSioFormatDriver.php create mode 100644 public_html/templates/default/import.tpl diff --git a/doc/conf/LSobject.docbook b/doc/conf/LSobject.docbook index 687fef75..de7bc1f7 100644 --- a/doc/conf/LSobject.docbook +++ b/doc/conf/LSobject.docbook @@ -64,6 +64,11 @@ 'LSsearch' => array ( // Configuration des recherches de l'objet ), // fin LSsearch + + // ioFormat + 'ioFormat' => array ( + // Configuration des formats d'import/export de l'objet + ), // Attributs 'attrs' => array ( @@ -237,6 +242,16 @@ + + ioFormat + + Tableau associatif contenant les paramètres de configuration + des formats de fichiers d'import/export de ce type d'&LSobject;. + Voir la section concernée. + + + + filter @@ -264,5 +279,6 @@ &conf-LSobject-LSrelation; &conf-LSobject-LSform; &conf-LSobject-LSsearch; + &config-LSobject-ioFormat; diff --git a/doc/conf/LSobject/ioFormat.docbook b/doc/conf/LSobject/ioFormat.docbook new file mode 100644 index 00000000..2e80dac2 --- /dev/null +++ b/doc/conf/LSobject/ioFormat.docbook @@ -0,0 +1,141 @@ + + ioFormat + Cette section décrit la manière de paramétrer les formats d'import/export + pour un type d'&LSobject; donné. + +La configuration des ioFormats se situe dans la +configuration des &LSobjects;, dans la variable ioFormat +($GLOBALS['LSobjects']['[nom du type d'LSobject]']['ioFormat']). +Cette variable est un tableau associatif dont la clé est l'identifiant du format et +dont la valeur associée est la configuration du format. + +Structure + array ( + 'label' => '[Label du type de fichier]', + 'driver' => '[Pilote d'ioFormat utilisé]', + 'driver_options' => array([Options du pilote d'ioFormat utilisé]), + 'fields => array ( + '[champ 1]' => '[attribut 1]', + '[champ 2]' => '[attribut 2]', + [...] + ), + 'generated_fields' => array ( + '[attribute 3]' => '[LSformat]', + '[attribute 4]' => '[LSformat]', + [...] + ) + ), + [...] +);]]> + + + +Paramètres de configuration + + + label + + Le label du format + + + + + driver + + Le pilote a utilisé pour ce format. Le pilote permet de gérér la lecture + et l'écriture dans un type de fichier d'import/export. Pour plus d'information sur + les pilotes disponibles, Voir la + section concernée. + + + + + driver_options + + Tableau associatif des options du pilote utilisé pour ce format. Pour + plus d'informations, consulter la documentation du pilote utilisé. + + + + + fields + + Tableau associatif permettant d'associer un champ du fichier source (la clé) + avec attribut de l'objet LDAP (la valeur). + + + + + generated_fields + + Tableau associatif permettant de définir des &LSformats; pour générer des valeurs + d'attributs automatiquement. Ce tableau contient en clé, le nom de l'attribut à généré, + et en valeur associée, le &LSformat; à utilisé. Ce &LSformat; est composé à l'aide des + valeurs des autres attributs de l'objet. + + + + + + + + Pilote d'ioFormat + Cette section décrit la manière de configurer les pilotes d'ioFormat utilisés + lors des imports/exports d'&LSobjects;. + + + Pilote de fichiers CSV + Ce pilote permet de gérer l'import/export de &LSobject; à partir d'un fichier + CSV. Ce pilote utilise la classe PEAR + File_CSV_DataSource + . Par défaut, les paramètres de lecture et d'écriture des + fichiers sont : la virgule sert de délimiteur, le caractère " peut + être utilisé pour encadrer les valeurs des champs et la longueur maximale d'une ligne + est 999999. Ces paramètres peuvent être modifiés en configurant les options du pilote. + +Structure + '[délimiteur]', + 'length' => [longueur maximale d'une ligne], + 'escape' => '[caratère d'encadrement]' +);]]> + + + +Paramètres de configuration + + + delimiter + + Le caractère utilisé pour délimiter les champs (Par défault, une virgule). + + + + + length + + La longueur maximale d'une ligne du fichier. Si zéro est spécifié, la longueur d'une + ligne ne sera pas limité, mais la lecture du fichier sera ralenti. (Par défaut : 999999 + ) + + + + + + escape + + Le caractère utilisé pour encadrer les valeurs des champs + (Par défault : "). + + + + + + + + + + + + diff --git a/doc/conf/conf.entities.xml b/doc/conf/conf.entities.xml index 81693fe7..f6cec44d 100644 --- a/doc/conf/conf.entities.xml +++ b/doc/conf/conf.entities.xml @@ -19,6 +19,7 @@ + diff --git a/lsexample/LSpeople_import_test.csv b/lsexample/LSpeople_import_test.csv new file mode 100644 index 00000000..d41550bb --- /dev/null +++ b/lsexample/LSpeople_import_test.csv @@ -0,0 +1,3 @@ +"login";"civility";"firstname";"name";"mail";"password";"gid";"shell" +"lmartin";"Mme";"Ludivine";"MARTIN";"lmartin@gmail.com";"123Yh%uT";"102009";"no" +"rturin";"M.";"Roger";"TURIN";"rturin@gmail.com";"5-8uHtG34";"102013";"yes" diff --git a/public_html/conf/LSobjects/config.LSobjects.LSpeople.php b/public_html/conf/LSobjects/config.LSobjects.LSpeople.php index b7f3f333..14457079 100644 --- a/public_html/conf/LSobjects/config.LSobjects.LSpeople.php +++ b/public_html/conf/LSobjects/config.LSobjects.LSpeople.php @@ -39,6 +39,32 @@ $GLOBALS['LSobjects']['LSpeople'] = array ( 'ou' => 'people' ) ), + + 'ioFormat' => array ( + 'mycsv' => array ( + 'label' => 'Simple CSV', + 'driver' => 'CSV', + 'driver_options' => array ( + 'delimiter' => ';', + 'escape' => '"', + 'eol' => ';', + 'length' => 2 + ), + 'fields' => array ( + 'login' => 'uid', + 'civility' => 'personalTitle', + 'firstname' => 'givenName', + 'name' => 'sn', + 'mail' => 'mail', + 'password' => 'userPassword', + 'gid' => 'gidNumber', + 'shell' => 'loginShell', + ), + 'generated_fields' => array ( + 'cn' => '%{personalTitle} %{givenName} %{sn}' + ) + ) + ), 'before_modify' => 'valid', 'after_modify' => 'valid', diff --git a/public_html/css/default/LSimport.css b/public_html/css/default/LSimport.css new file mode 100644 index 00000000..c9d82aba --- /dev/null +++ b/public_html/css/default/LSimport.css @@ -0,0 +1,28 @@ +h3.LSimport { + margin-left: 1.5em; + border-bottom: 1px solid; +} + +div.LSimport_error { + padding: 0 2em; +} + +ul.LSimport_global_errors { + background-color: #F56A6A; + list-style-type: none; + padding: 1em; + text-align: center; +} + +ul.LSimport_data_errors { + font-style: italic; + font-size: 0.8em; +} + +ul.LSimport_attr_errors { + padding-left: 1.5em; +} + +ul.LSimport_attr_errors li { + color: #f00; +} diff --git a/public_html/images/default/import.png b/public_html/images/default/import.png new file mode 100644 index 0000000000000000000000000000000000000000..c30cf59894473550b70d2ab97e2244af64c2ecd0 GIT binary patch literal 585 zcmV-P0=E5$P);No%bTEi-Lr>D_AI6iV#?A3~B^FfP%5GR1nd|DqtT_3=slpZLAdaE7%DZ zq7q}81xXPN76HNi^JdngC8_mhYI?w^U( z2gw6K?&>VvIx{ig&f_gAfExg@R2*<~)WC4e95q8rugZ<6&Z+ic)U*Onzk&oo-0>i| zIATHwf=EC_k<7^~keAhcD{H`r6aW_ify}`K%$&?2NJcK8;%KOhO|6b#^*;~+_kTbl z;Odxw3lN0NvI;PYFxpfMsWxLE%Z0^vw@I-i#zYz>Ufg_xS!EE)l=cip0Fkc0GbiElsF znK^ijVHt@UnK|0x!SlPMyan7K-~PV!>fW=oV5*oJs*0JRDPew=cw&P?(*;Eu5;d~( zYlq(NDUO%dUjxW~rt#|X#V_sY_PH1n-EQ~u$EWMFd)E6M=kt$dKcrzwpH{xkji3Jo X7}OeR*sz>k00000NkvXXu0mjfdXfo6 literal 0 HcmV?d00001 diff --git a/public_html/import.php b/public_html/import.php new file mode 100644 index 00000000..70615ba3 --- /dev/null +++ b/public_html/import.php @@ -0,0 +1,84 @@ +listValidIOformats(); + if (is_array($ioFormats) && !empty($ioFormats)) { + LStemplate :: assign('ioFormats',$ioFormats); + if (LSimport::isSubmit()) { + $result=LSimport::importFromPostData(); + LSdebug($result,1); + if(is_array($result)) { + LStemplate :: assign('result',$result); + } + } + } + else { + LStemplate :: assign('ioFormats',array()); + LSerror :: addErrorCode('LSsession_16'); + } + + // Define page title + LStemplate :: assign('pagetitle',_('Import').' : '.$object->getLabel()); + LSsession :: addCssFile('LSform.css'); + LSsession :: addCssFile('LSimport.css'); + LSsession :: setTemplate('import.tpl'); + } + else { + LSerror :: addErrorCode('LSsession_05','LSimport'); + } + } + else { + LSerror :: addErrorCode('LSsession_11'); + } + } + else { + LSerror :: addErrorCode('LSldapObject_01'); + } + } + else { + LSerror :: addErrorCode('LSsession_12'); + } + +} +else { + LSsession :: setTemplate('login.tpl'); +} +LSsession :: displayTemplate(); diff --git a/public_html/includes/class/class.LSimport.php b/public_html/includes/class/class.LSimport.php new file mode 100644 index 00000000..ba3aae2b --- /dev/null +++ b/public_html/includes/class/class.LSimport.php @@ -0,0 +1,333 @@ + + */ +class LSimport { + + /** + * Check if the form was posted by check POST data + * + * @author Benjamin Renard + * + * @retval boolean true if the form was posted, false otherwise + */ + function isSubmit() { + if (isset($_POST['validate']) && ($_POST['validate']=='LSimport')) + return true; + return; + } + + + /** + * Retrieve the post file + * + * @retval mixed The path of the temporary file, false on error + */ + function getPostFile() { + if (is_uploaded_file($_FILES['importfile']['tmp_name'])) { + $fp = fopen($_FILES['importfile']['tmp_name'], "r"); + $buf = fread($fp, filesize($_FILES['importfile']['tmp_name'])); + fclose($fp); + $tmp_file = LS_TMP_DIR.'importfile'.'_'.rand().'.tmp'; + if (move_uploaded_file($_FILES['importfile']['tmp_name'],$tmp_file)) { + LSsession :: addTmpFile($buf,$tmp_file); + } + return $tmp_file; + } + return false; + } + + /** + * Retreive POST data + * + * This method retrieve and format POST data. + * + * The POST data are return as an array containing : + * - LSobject : The LSobject type if this import + * - ioFormat : The IOformat name choose by user + * - justTry : Boolean defining wether the user has chosen to enable + * just try mode (no modification) + * - updateIfExists : Boolean defining wether the user has chosen to + * allow update on existing object. + * - importfile : The path of the temporary file to import + * + * @author Benjamin Renard + * + * @retval mixed Array of POST data, false on error + */ + function getPostData() { + if (isset($_REQUEST['LSobject']) && isset($_POST['ioFormat'])) { + $file=self::getPostFile(); + if ($file) { + return array ( + 'LSobject' => $_REQUEST['LSobject'], + 'ioFormat' => $_POST['ioFormat'], + 'justTry' => ($_POST['justTry']=='yes'), + 'updateIfExists' => ($_POST['updateIfExists']=='yes'), + 'importfile' => $file + ); + } + } + return False; + } + + /** + * Import objects form POST data + * + * This method retreive, validate and import POST data. + * + * If import could start, the return value is an array : + * + * + * array ( + * 'imported' => array ( + * '[object1 dn]' => '[object1 display name]', + * '[object2 dn]' => '[object2 display name]', + * [...] + * ), + * 'updated' => array ( + * '[object3 dn]' => '[object3 display name]', + * '[object4 dn]' => '[object4 display name]', + * [...] + * ), + * 'errors' => array ( + * array ( + * 'data' => array ([object data as read from source file]), + * 'errors' => array ( + * 'globals' => array ( + * // Global error of this object importation that not + * // concerning only one attribute) + * ), + * 'attrs' => array ( + * '[attr1]' => array ( + * '[error 1]', + * '[error 2]', + * [...] + * ) + * ) + * ) + * ), + * [...] + * ) + * ) + * + * @author Benjamin Renard + * + * @retval boolean Array of the import result, false on error + */ + function importFromPostData() { + // Get data from $_POST + $data=self::getPostData(); + if (is_array($data)) { + LSdebug($data,1); + // Load LSobject + if (!isset($data['LSobject']) || LSsession::loadLSobject($data['LSobject'])) { + $LSobject=$data['LSobject']; + // Validate ioFormat + $object = new $LSobject(); + if($object -> isValidIOformat($data['ioFormat'])) { + // Create LSioFormat object + $ioFormat = new LSioFormat($LSobject,$data['ioFormat']); + if ($ioFormat -> ready()) { + // Load data in LSioFormat object + if ($ioFormat -> loadFile($data['importfile'])) { + LSdebug('file loaded'); + $return=array( + 'imported' => array(), + 'updated' => array(), + ); + // Retreive object from ioFormat + $objectsData=$ioFormat -> getAll(); + $objectsInError=array(); + LSdebug($objectsData); + // Browse inputed objects + foreach($objectsData as $objData) { + $globalErrors=array(); + // Instanciate an LSobject + $object = new $LSobject(); + // Instanciate a creation LSform + $form = $object -> getForm('create'); + // Set form data from inputed data + if ($form -> setPostData($objData,true)) { + // Validate form + if ($form -> validate()) { + // Validate data (just validate) + if ($object -> updateData('create',True)) { + LSdebug('Data is correct, retreive object DN'); + $dn = $object -> getDn(); + if ($dn) { + // Check if object already exists + $entry=LSldap::getLdapEntry($dn); + if ($entry===False) { + LSdebug('New object, perform creation'); + if ($data['justTry'] || $object -> updateData('create')) { + LSdebug('Object '.$object -> getDn().' imported'); + $return['imported'][$object -> getDn()]=$object -> getDisplayName(); + continue; + } + else { + LSdebug('Failed to updateData on : '.print_r($objData,True)); + $globalErrors[]=_('Error creating object on LDAP server.'); + } + } + // This object already exist, check 'updateIfExists' mode + elseif ($data['updateIfExists']) { + LSdebug('Object exist, perform update'); + + // Restart import in update mode + + // Instanciate a new LSobject and load data from it's DN + $object = new $LSobject(); + if ($object -> loadData($dn)) { + // Instanciate a modify form + $form = $object -> getForm('modify'); + // Set form data from inputed data + if ($form -> setPostData($objData,true)) { + // Validate form + if ($form -> validate()) { + // Update data on LDAP server + if ($data['justTry'] || $object -> updateData('modify')) { + LSdebug('Object '.$object -> getDn().' updated'); + $return['updated'][$object -> getDn()]=$object -> getDisplayName(); + continue; + } + else { + LSdebug('Failed to updateData (modify) on : '.print_r($objData,True)); + $globalErrors[]=_('Error updating object on LDAP server.'); + } + } + else { + LSdebug('Failed to validate update form on : '.print_r($objData,True)); + LSdebug('Form errors : '.print_r($form->getErrors(),True)); + $globalErrors[]=_('Error validating update form.'); + } + } + else { + LSdebug('Failed to setPostData on update form : '.print_r($objData,True)); + $globalErrors[]=_('Failed to set post data on update form.'); + } + } + else { + LSdebug('Failed to load data of '.$dn); + $globalErrors[]=getFData(_("Failed to load existing object %{dn} from LDAP server. Can't update object.")); + } + } + else { + LSdebug('Object '.$dn.' already exist'); + $globalErrors[]=getFData(_('An object already exist on LDAP server with DN %{dn}.'),$dn); + } + } + else { + $globalErrors[]=_('Failed to generate DN for this object.'); + } + } + else { + $globalErrors[]=_('Failed to validate object data.'); + } + } + else { + LSdebug('Failed to validate form on : '.print_r($objData,True)); + LSdebug('Form errors : '.print_r($form->getErrors(),True)); + $globalErrors[]=_('Error validating creation form.'); + } + } + else { + LSdebug('Failed to setPostData on : '.print_r($objData,True)); + $globalErrors[]=_('Failed to set post data on creation form.'); + } + $objectsInError[]=array( + 'data' => $objData, + 'errors' => array ( + 'globals' => $globalErrors, + 'attrs' => $form->getErrors() + ) + ); + } + $return['errors']=$objectsInError; + return $return; + } + } + else { + LSerror :: addErrorCode('LSimport_04'); + } + } + else { + LSerror :: addErrorCode('LSimport_03',$data['ioFormat']); + } + } + else { + LSerror :: addErrorCode('LSimport_02'); + } + } + else { + LSerror :: addErrorCode('LSimport_01'); + } + return False; + } +} + + +/* + * LSimport_implodeValues template function + * + * This function permit to implode field values during + * template processing. This function take as parameters + * (in $params) : + * - $values : the field's values to implode + * + * @param[in] $params The template function parameters + * @param[in] $template Smarty object + * + * @retval void + **/ +function LSimport_implodeValues($params, $template) { + extract($params); + + if (isset($values) && is_array($values)) { + echo implode(',',$values); + } +} +LStemplate :: registerFunction('LSimport_implodeValues','LSimport_implodeValues'); + + +LSerror :: defineError('LSimport_01', +_("LSimport : Post data not found or not completed.") +); +LSerror :: defineError('LSimport_02', +_("LSimport : object type invalid.") +); +LSerror :: defineError('LSimport_03', +_("LSimport : input/output format %{format} invalid.") +); +LSerror :: defineError('LSimport_04', +_("LSimport : Fail to initialize input/output driver") +); + + + +?> diff --git a/public_html/includes/class/class.LSioFormat.php b/public_html/includes/class/class.LSioFormat.php new file mode 100644 index 00000000..e6d4807a --- /dev/null +++ b/public_html/includes/class/class.LSioFormat.php @@ -0,0 +1,93 @@ + + */ +class LSioFormat { + + var $config=False; + var $driver=False; + + /** + * Constructor + * + * @param[in] string $LSobject The LSobject type name + * @param[in] string $ioFormat The ioFormat name + * + * @retval void + **/ + function LSioFormat($LSobject,$ioFormat) { + $conf=LSconfig::get('LSobjects.'.$LSobject.".ioFormat.".$ioFormat); + if(is_array($conf)) { + $this -> config=$conf; + if (isset($this -> config['driver']) && LSsession :: loadLSclass('LSioFormat'.$this -> config['driver'])) { + $driverClass='LSioFormat'.$this -> config['driver']; + $driverOptions=array(); + if (isset($this -> config['driver_options'])) $driverOptions = $this -> config['driver_options']; + $this -> driver = new $driverClass($driverOptions); + } + else { + LSerror :: addErrorCode('LSioFormat_01',$this -> config['driver']); + } + } + } + + /** + * Check if ioFormat driver is ready + * + * @retval boolean True if ioFormat driver is ready, false otherwise + **/ + function ready() { + return (is_array($this -> config) && $this -> driver !== False); + } + + /** + * Load and valid file + * + * @param[in] string $file The file path to load + * + * @retval boolean True if file is loaded and valid, false otherwise + **/ + function loadFile($file) { + if ($this -> driver -> loadFile($file)) { + return $this -> driver -> isValid(); + } + return False; + } + + /** + * Retreive all objects contained by the loaded file + * + * @retval array The objects contained by the loaded file + **/ + function getAll() { + return $this -> driver -> getAllFormated($this -> config['fields'],$this -> config['generated_fields']); + } + +} + +LSerror :: defineError('LSioFormat_01', +_("LSioFormat : IOformat driver %{driver} invalid or unavailable.") +); diff --git a/public_html/includes/class/class.LSioFormatCSV.php b/public_html/includes/class/class.LSioFormatCSV.php new file mode 100644 index 00000000..758a7a5a --- /dev/null +++ b/public_html/includes/class/class.LSioFormatCSV.php @@ -0,0 +1,109 @@ + + */ +class LSioFormatCSV extends LSioFormatDriver { + + // File_CSV_DataSource object + private $csv=false; + + /** + * Load file + * + * @param[in] string $file The file path to load + * + * @retval boolean True if file is loaded, false otherwise + **/ + public function loadFile($path) { + $this->csv=new File_CSV_DataSource; + if (is_array($this -> options)) { + foreach ($this -> options as $opt_key => $opt_val) { + if (isset($this->csv -> settings[$opt_key])) + $this->csv -> settings[$opt_key] = $opt_val; + } + } + if ($this->csv->load($path)) { + return True; + } + return false; + } + + /** + * Check if loaded file data are valid + * + * @retval boolean True if loaded file data are valid, false otherwise + **/ + public function isValid() { + if ($this -> csv && $this -> csv -> isSymmetric()) { + return True; + } + return False; + } + + /** + * Retreive all object data contained by the loaded file + * + * The objects are returned in array : + * + * array ( + * array ( // Object 1 + * '[field1]' => '[value1]', + * '[field2]' => '[value2]', + * [...] + * ), + * array ( // Object 2 + * '[field1]' => '[value1]', + * '[field2]' => '[value2]', + * [...] + * ), + * ) + * + * @retval array The objects contained by the loaded file + **/ + public function getAll() { + return $this -> csv -> connect(); + } + + /** + * Retreive fields names of the loaded file + * + * The fields names are returned in array : + * + * array ( + * '[field1]', + * '[field2]', + * [...] + * ) + * + * @retval array The fields names of the loaded file + **/ + public function getFieldNames() { + return $this -> csv -> getHeaders(); + } +} diff --git a/public_html/includes/class/class.LSioFormatDriver.php b/public_html/includes/class/class.LSioFormatDriver.php new file mode 100644 index 00000000..f90fb02e --- /dev/null +++ b/public_html/includes/class/class.LSioFormatDriver.php @@ -0,0 +1,142 @@ + + */ +class LSioFormatDriver { + + protected $options=array(); + + /** + * Constructor + * + * @param[in] array $options Driver's options + * + * @retval void + **/ + function __construct($options) { + $this -> options = $options; + } + + /** + * Load file + * + * @param[in] string $file The file path to load + * + * @retval boolean True if file is loaded, false otherwise + **/ + function loadFile($path) { + return False; + } + + /** + * Check if loaded file data are valid + * + * @retval boolean True if loaded file data are valid, false otherwise + **/ + function isValid() { + return False; + } + + /** + * Retreive all object data contained by the loaded file + * + * The objects are returned in array : + * + * array ( + * array ( // Object 1 + * '[field1]' => '[value1]', + * '[field2]' => '[value2]', + * [...] + * ), + * array ( // Object 2 + * '[field1]' => '[value1]', + * '[field2]' => '[value2]', + * [...] + * ), + * ) + * + * @retval array The objects contained by the loaded file + **/ + function getAll() { + return array(); + } + + /** + * Retreive fields names of the loaded file + * + * The fields names are returned in array : + * + * array ( + * '[field1]', + * '[field2]', + * [...] + * ) + * + * @retval array The fields names of the loaded file + **/ + function getFieldNames() { + return array(); + } + + /** + * Retreive all objects data of the loaded file formated + * + * This method format objects data using ioFormat configuration + * given as parameters. + * + * @param[in] $fields Array of file's fields name mapping with object attribute + * @param[in] $generated_fields Array of object attribute to generate using other object data + * + * @retval array All objects data of the loaded file formated + **/ + function getAllFormated($fields,$generated_fields) { + if (!is_array($fields)) return False; + if (!is_array($generated_fields)) $generated_fields=array(); + $all=$this -> getAll(); + if (!is_array($all)) return False; + $retall=array(); + foreach($all as $one) { + $retone=array(); + foreach($fields as $key => $attr) { + if (!isset($one[$key])) continue; + if (!isset($retone[$attr])) $retone[$attr]=array(); + $retone[$attr][]=$one[$key]; + } + if (is_array($generated_fields)) { + foreach ($generated_fields as $attr => $format) { + $value=getFData($format,$retone); + if (!empty($value)) { + $retone[$attr]=array($value); + } + } + } + $retall[]=$retone; + } + + return $retall; + } + +} diff --git a/public_html/includes/class/class.LSldapObject.php b/public_html/includes/class/class.LSldapObject.php index 135b92f7..fa1b3427 100644 --- a/public_html/includes/class/class.LSldapObject.php +++ b/public_html/includes/class/class.LSldapObject.php @@ -276,15 +276,21 @@ class LSldapObject { } /** - * Met à jour les données de l'objet à partir d'un retour d'un formulaire. + * Update LDAP object data from one form specify by it's ID. * - * @param[in] $idForm Identifiant du formulaire d'origine + * This method just valid form ID, extract form data and call + * _updateData() private method. + * + * @param[in] $idForm Form ID + * @param[in] $justValidate Boolean to enable just validation mode + * + * @see _updateData() * * @author Benjamin Renard * - * @retval boolean true si la mise à jour a réussi, false sinon + * @retval boolean true if object data was updated, false otherwise */ - public function updateData($idForm=NULL) { + public function updateData($idForm=NULL,$justValidate=False) { if($idForm!=NULL) { if(isset($this -> forms[$idForm])) $LSform = $this -> forms[$idForm][0]; @@ -307,22 +313,28 @@ class LSldapObject { } } $new_data = $LSform -> exportValues(); - return $this -> _updateData($new_data,$idForm); + return $this -> _updateData($new_data,$idForm,$justValidate); } /** - * Met à jour les données de l'objet et de l'entré de l'annuaire + * Update LDAP object data from one form specify by it's ID. + * + * This method implement the continuation and the end of the object data + * udpate. * - * @param[in] $new_data Tableau des données de modification de l'objet + * @param[in] $new_data Array of object data + * @param[in] $idForm Form ID + * @param[in] $justValidate Boolean to enable just validation mode * * @author Benjamin Renard * - * @retval boolean true si la mise à jour a réussi, false sinon + * @retval boolean true if object data was updated, false otherwise * + * @see updateData() * @see validateAttrsData() * @see submitChange() */ - private function _updateData($new_data,$idForm=null) { + private function _updateData($new_data,$idForm=null,$justValidate=False) { if(!is_array($new_data)) { return; } @@ -333,6 +345,10 @@ class LSldapObject { } if($this -> validateAttrsData($idForm)) { LSdebug("les données sont validées"); + if ($justValidate) { + LSdebug('Just validate mode'); + return True; + } if (!$this -> fireEvent('before_modify')) { return; @@ -1819,6 +1835,35 @@ class LSldapObject { return false; } } + + /** + * List IOformats of this object type + * + * @retval mixed Array of valid IOformats of this object type + **/ + function listValidIOformats() { + $ret=array(); + if (isset($this -> config['ioFormat']) && is_array($this -> config['ioFormat'])) { + foreach($this -> config['ioFormat'] as $name => $conf) { + $ret[$name]=_((isset($conf['label'])?$conf['label']:$name)); + } + } + return $ret; + } + + /** + * Check if an IOformat is valid for this object type + * + * @param[in] $f string The IOformat name to check + * + * @retval boolean True if it's a valid IOformat, false otherwise + **/ + function isValidIOformat($f) { + if (isset($this -> config['ioFormat']) && is_array($this -> config['ioFormat']) && isset($this -> config['ioFormat'][$f])) { + return True; + } + return False; + } } diff --git a/public_html/includes/class/class.LSsession.php b/public_html/includes/class/class.LSsession.php index 44f646e1..5e0ad3b8 100644 --- a/public_html/includes/class/class.LSsession.php +++ b/public_html/includes/class/class.LSsession.php @@ -2338,7 +2338,9 @@ class LSsession { LSerror :: defineError('LSsession_15', _("LSsession : Fail to reconnect to LDAP server with user's LDAP credentials.") ); - // 16 : not yet used + LSerror :: defineError('LSsession_16', + _("LSsession : No import/export format define for this object type.") + ); LSerror :: defineError('LSsession_17', _("LSsession : Error during creation of list of levels. Contact administrators. (Code : %{code})") ); diff --git a/public_html/lang/ldapsaisie.pot b/public_html/lang/ldapsaisie.pot index 5eac7199..78b39369 100644 --- a/public_html/lang/ldapsaisie.pot +++ b/public_html/lang/ldapsaisie.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-07-25 18:16+0200\n" +"POT-Creation-Date: 2015-07-28 17:13+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,169 +17,667 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: includes/addons/LSaddons.maildir.php:27 -msgid "MAILDIR Support : Unable to load LSaddon::FTP." +#: import.php:59 view.php:56 +msgid "Import" msgstr "" -#: includes/addons/LSaddons.maildir.php:30 -msgid "MAILDIR Support : The constant %{const} is not defined." +#: includes/class/class.LSioFormat.php:61 +msgid "LSioFormat : IOformat driver %{driver} invalid or unavailable." msgstr "" -#: includes/addons/LSaddons.maildir.php:35 -msgid "MAILDIR : Error creating maildir on the remote server." +#: includes/class/class.LSformElement_mailQuota.php:80 +#: includes/class/class.LSformElement_quota.php:80 +#: includes/class/class.LSformElement_valueWithUnit.php:106 +msgid "Incorrect value" msgstr "" -#: includes/addons/LSaddons.maildir.php:38 -msgid "MAILDIR : Error deleting the maildir on the remote server." +#: includes/class/class.LSformElement_textarea.php:51 +msgid "Clear" msgstr "" -#: includes/addons/LSaddons.maildir.php:41 -msgid "MAILDIR : Error renaming the maildir on the remote server." +#: includes/class/class.LSerror.php:101 +msgid "Errors" msgstr "" -#: includes/addons/LSaddons.maildir.php:44 -msgid "MAILDIR : Error retrieving remote path of the maildir." +#: includes/class/class.LSerror.php:104 +msgid "Stop" msgstr "" -#: includes/addons/LSaddons.samba.php:27 -msgid "SAMBA Support : Unable to load smbHash class." +#: includes/class/class.LSerror.php:224 +msgid "Unknown error : %{error}" msgstr "" -#: includes/addons/LSaddons.samba.php:30 -msgid "SAMBA Support : The constant %{const} is not defined." +#: includes/class/class.LSerror.php:225 +msgid "PHP error : %{error}" msgstr "" -#: includes/addons/LSaddons.samba.php:34 +#: includes/class/class.LSmail.php:61 +msgid "Email" +msgstr "" + +#: includes/class/class.LSmail.php:62 +msgid "Title" +msgstr "" + +#: includes/class/class.LSmail.php:63 +msgid "Message" +msgstr "" + +#: includes/class/class.LSmail.php:75 +msgid "Your message has been sent successfully." +msgstr "" + +#: includes/class/class.LSattribute.php:267 +msgid "The value of field %{label} is invalid." +msgstr "" + +#: includes/class/class.LSattribute.php:731 msgid "" -"SAMBA Support : The constants LS_SAMBA_SID_BASE_USER and " -"LS_SAMBA_SID_BASE_GROUP must'nt have the same parity to keep SambaSID's " -"unicity." +"LSattribute : Attribute %{attr} : LDAP or HTML types unknow (LDAP = %{ldap} " +"& HTML = %{html})." msgstr "" -#: includes/addons/LSaddons.samba.php:39 +#: includes/class/class.LSattribute.php:734 msgid "" -"SAMBA Support : The attribute %{dependency} is missing. Unable to forge the " +"LSattribute : The function %{func} to display the attribute %{attr} is " +"unknow." +msgstr "" + +#: includes/class/class.LSattribute.php:737 +msgid "" +"LSattribute : The rule %{rule} to validate the attribute %{attr} is unknow." +msgstr "" + +#: includes/class/class.LSattribute.php:740 +msgid "" +"LSattribute : Configuration data to verify the attribute %{attr} are " +"incorrect." +msgstr "" + +#: includes/class/class.LSattribute.php:743 +msgid "" +"LSattribute : The function %{func} to save the attribute %{attr} is unknow." +msgstr "" + +#: includes/class/class.LSattribute.php:746 +msgid "LSattribute : The value of the attribute %{attr} can't be generated." +msgstr "" + +#: includes/class/class.LSattribute.php:749 +msgid "LSattribute : Generation of the attribute %{attr} failed." +msgstr "" + +#: includes/class/class.LSattribute.php:752 +msgid "" +"LSattribute : Generation of the attribute %{attr} did not return a correct " +"value." +msgstr "" + +#: includes/class/class.LSattribute.php:755 +msgid "" +"LSattribute : The attr_%{type} of the attribute %{name} is not yet defined." +msgstr "" + +#: includes/class/class.LSformElement_select.php:52 +msgid "Reset selection." +msgstr "" + +#: includes/class/class.LSformElement_select.php:58 +#: includes/class/class.LSformElement_select_object.php:103 +msgid "%{value} (unrecognized value)" +msgstr "" + +#: includes/class/class.LSauthMethod_anonymous.php:68 +msgid "" +"LSauthMethod_anonymous : You must define the LSAUTHMETHOD_ANONYMOUS_USER " +"contant in the configuration file." +msgstr "" + +#: includes/class/class.LSformRule_regex.php:65 +msgid "LSformRule_regex : Regex has not been configured to validate data." +msgstr "" + +#: includes/class/class.LSattr_ldap_password.php:231 +msgid "" +"LSattr_ldap_password : Encoding type %{type} is not supported. This password " +"will be stored in clear text." +msgstr "" + +#: includes/class/class.LSattr_ldap_password.php:234 +msgid "" +"LSattr_ldap_password : Encoding function %{function} is not callable. This " +"password will be stored in clear text." +msgstr "" + +#: includes/class/class.LSattr_html_maildir.php:58 +msgid "The mailbox has been moved." +msgstr "" + +#: includes/class/class.LSattr_html_maildir.php:65 +msgid "The mailbox has been created." +msgstr "" + +#: includes/class/class.LSattr_html_maildir.php:84 +msgid "The mailbox has been archived successfully." +msgstr "" + +#: includes/class/class.LSattr_html_maildir.php:95 +msgid "The mailbox has been deleted." +msgstr "" + +#: includes/class/class.LSldap.php:503 +msgid "LSldap : Error during the LDAP server connection (%{msg})." +msgstr "" + +#: includes/class/class.LSldap.php:506 +msgid "LSldap : Error during the LDAP search (%{msg})." +msgstr "" + +#: includes/class/class.LSldap.php:509 +msgid "LSldap : Object type unknown." +msgstr "" + +#: includes/class/class.LSldap.php:512 +msgid "LSldap : Error while fetching the LDAP entry." +msgstr "" + +#: includes/class/class.LSldap.php:515 +msgid "LSldap : Error while changing the LDAP entry (DN : %{dn})." +msgstr "" + +#: includes/class/class.LSldap.php:518 +msgid "LSldap : Error while deleting empty attributes." +msgstr "" + +#: includes/class/class.LSldap.php:521 +msgid "LSldap : Error while changing the DN of the object." +msgstr "" + +#: includes/class/class.LSformRule_callable.php:56 +msgid "LSformRule_callable : The given callable option is not callable" +msgstr "" + +#: includes/class/class.LSformElement_postaladdress.php:59 +msgid "View on map" +msgstr "" + +#: includes/class/class.LSform.php:68 includes/class/class.LSsmoothbox.php:39 +#: includes/class/class.LSsession.php:1223 +#: includes/class/class.LSconfirmBox.php:37 custom_action.php:83 remove.php:51 +#: custom_search_action.php:73 +msgid "Validate" +msgstr "" + +#: includes/class/class.LSform.php:98 +msgid "Add a field to add another values." +msgstr "" + +#: includes/class/class.LSform.php:99 +msgid "Delete this field." +msgstr "" + +#: includes/class/class.LSform.php:121 includes/class/class.LSform.php:251 +msgid "No field." +msgstr "" + +#: includes/class/class.LSform.php:205 custom_action.php:73 +msgid "" +"Do you really want to execute custom action %{customAction} on " +"%{objectname} ?" +msgstr "" + +#: includes/class/class.LSform.php:216 includes/class/class.LSrelation.php:38 +#: remove.php:49 +msgid "Do you really want to delete" +msgstr "" + +#: includes/class/class.LSform.php:217 +msgid "Caution" +msgstr "" + +#: includes/class/class.LSform.php:218 includes/class/class.LSrelation.php:40 +#: includes/class/class.LSsearchEntry.php:161 +#: includes/class/class.LSformElement_select_object.php:69 +#: includes/class/class.LSformElement_select_object.php:85 modify.php:111 +#: view.php:64 +msgid "Delete" +msgstr "" + +#: includes/class/class.LSform.php:272 +msgid "%{label} attribute data is not valid." +msgstr "" + +#: includes/class/class.LSform.php:350 +msgid "Mandatory field" +msgstr "" + +#: includes/class/class.LSform.php:742 +msgid "LSform : Error during the recovery of the values of the form." +msgstr "" + +#: includes/class/class.LSform.php:745 +msgid "" +"LSform : Error durring the recovery of the value of the field '%{element}'." +msgstr "" + +#: includes/class/class.LSform.php:752 +msgid "LSform : The field %{element} doesn't exist." +msgstr "" + +#: includes/class/class.LSform.php:755 +msgid "LSfom : Field type unknow (%{type})." +msgstr "" + +#: includes/class/class.LSform.php:758 +msgid "LSform : Error during the creation of the element '%{element}'." +msgstr "" + +#: includes/class/class.LSform.php:761 +msgid "LSform : The data entry form %{name} doesn't exist." +msgstr "" + +#: includes/class/class.LSform.php:764 +msgid "LSform : The data entry form %{name} is not correctly configured." +msgstr "" + +#: includes/class/class.LSform.php:767 +msgid "" +"LSform : The element %{name}, listed as displayed in data entry form " +"configuration, doesn't exist." +msgstr "" + +#: includes/class/class.LSformElement_boolean.php:52 +msgid "Reset the choice." +msgstr "" + +#: includes/class/class.LSformElement_boolean.php:60 +msgid "Yes" +msgstr "" + +#: includes/class/class.LSformElement_boolean.php:61 +msgid "No" +msgstr "" + +#: includes/class/class.LSformElement_password.php:134 +msgid "Generate a password." +msgstr "" + +#: includes/class/class.LSformElement_password.php:135 +msgid "Compare with stored password." +msgstr "" + +#: includes/class/class.LSformElement_password.php:136 +msgid "Display password." +msgstr "" + +#: includes/class/class.LSformElement_password.php:137 +msgid "Display hashed password." +msgstr "" + +#: includes/class/class.LSformElement_password.php:138 +msgid "Hide password." +msgstr "" + +#: includes/class/class.LSformElement_password.php:139 +msgid "" +"The password will be sent by mail if changed. Click to disable automatic " +"notification." +msgstr "" + +#: includes/class/class.LSformElement_password.php:140 +msgid "" +"The password will not be sent if changed. Click to enable automatic " +"notification." +msgstr "" + +#: includes/class/class.LSformElement_password.php:141 +msgid "Modify the mail sent to notice the user" +msgstr "" + +#: includes/class/class.LSformElement_password.php:261 +msgid "Notice mail sent." +msgstr "" + +#: includes/class/class.LSformElement_password.php:341 +msgid "LSformElement_password : No contact mail available to send password." +msgstr "" + +#: includes/class/class.LSformElement_password.php:344 +msgid "" +"LSformElement_password : Contact mail invalid (%{mail}). Can't send password." +msgstr "" + +#: includes/class/class.LSformElement_password.php:347 +msgid "" +"LSformElement_password : Fail to exec pwgen. Check it's correctly installed." +msgstr "" + +#: includes/class/class.LSformRule.php:57 +msgid "LSformRule_%{type} : Parameter %{param} is not found." +msgstr "" + +#: includes/class/class.LSauth.php:168 +msgid "LSauth : Login or password incorrect." +msgstr "" + +#: includes/class/class.LSauth.php:171 +msgid "LSauth : Impossible to identify you : Duplication of identities." +msgstr "" + +#: includes/class/class.LSauth.php:174 +msgid "LSauth : Could not load type of identifiable objects." +msgstr "" + +#: includes/class/class.LSauth.php:177 +msgid "LSauth : Can't load authentication method %{method}." +msgstr "" + +#: includes/class/class.LSauth.php:180 +msgid "LSauth : Failed to build the authentication provider %{method}." +msgstr "" + +#: includes/class/class.LSauth.php:183 +msgid "LSauth : Not correctly initialized." +msgstr "" + +#: includes/class/class.LSauth.php:186 +msgid "LSauth : Failed to get authentication informations from provider." +msgstr "" + +#: includes/class/class.LSrelation.php:39 +msgid "Warning" +msgstr "" + +#: includes/class/class.LSrelation.php:67 +#: includes/class/class.LSrelation.php:216 +msgid "No object." +msgstr "" + +#: includes/class/class.LSrelation.php:82 +#: includes/class/class.LSformElement_supannLabeledValue.php:62 +#: includes/class/class.LSsearchEntry.php:145 +#: includes/class/class.LSformElement_supannCompositeAttribute.php:106 +#: includes/class/class.LSformElement_select_object.php:68 modify.php:54 +#: view.php:43 +msgid "Modify" +msgstr "" + +#: includes/class/class.LSrelation.php:328 +msgid "" +"LSrelation : The listing function for the relation %{relation} is unknow." +msgstr "" + +#: includes/class/class.LSrelation.php:331 +msgid "LSrelation : The update function of the relation %{relation} is unknow." +msgstr "" + +#: includes/class/class.LSrelation.php:334 +msgid "LSrelation : Error during relation update of the relation %{relation}." +msgstr "" + +#: includes/class/class.LSrelation.php:337 +msgid "LSrelation : Object type %{LSobject} unknow (Relation : %{relation})." +msgstr "" + +#: includes/class/class.LSformElement_supannLabeledValue.php:63 +#: includes/class/class.LSformElement.php:289 +#: includes/class/class.LSformElement_supannCompositeAttribute.php:107 +#: includes/class/class.LSformElement_select_object.php:75 +msgid "No set value" +msgstr "" + +#: includes/class/class.LSformElement_supannLabeledValue.php:64 +#: includes/class/class.LSformElement_supannCompositeAttribute.php:108 +#: includes/class/class.LSformElement_select_object.php:76 +msgid "No result" +msgstr "" + +#: includes/class/class.LSformElement_image.php:54 +msgid "Click to enlarge." +msgstr "" + +#: includes/class/class.LSformElement_image.php:55 +msgid "Click to delete the picture." +msgstr "" + +#: includes/class/class.LSauthMethod_CAS.php:112 +msgid "LSauthMethod_CAS : Failed to load phpCAS." +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:41 +msgid "Organism" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:47 +msgid "Registration year" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:52 +msgid "Registration year must be an integer" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:61 +msgid "Registration regime" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:67 +msgid "Discipline sector" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:73 +msgid "Diploma type" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:79 +msgid "Cursus & Year" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:91 +#: includes/class/class.LSformElement_supannRoleEntite.php:52 +msgid "Entity" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:96 +msgid "Diploma" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:102 +msgid "Step" +msgstr "" + +#: includes/class/class.LSformElement_supannEtuInscription.php:108 +msgid "Pedagogical element" +msgstr "" + +#: includes/class/class.LSformElement_maildir.php:68 +msgid "" +"Maildir creation/modification on user creation/modification is enabled. " +"Click to disable." +msgstr "" + +#: includes/class/class.LSformElement_maildir.php:69 +msgid "" +"Click to enable maildir creation/modification on user creation/modification." +msgstr "" + +#: includes/class/class.LSformElement_ssh_key.php:57 +msgid "Display the full key." +msgstr "" + +#: includes/class/class.LSformElement_ssh_key.php:79 +msgid "Unknown type" +msgstr "" + +#: includes/class/class.LSattr_html_select_object.php:228 +msgid "" +"LSattr_html_select_object : LSobject type is undefined (attribute : %{attr})." +msgstr "" + +#: includes/class/class.LSattr_html_select_object.php:231 +msgid "" +"LSattr_html_select_object : the value of the parameter value_attribute in " +"the configuration of the attribute %{attrs} is incorrect. This attribute " +"does not exists." +msgstr "" + +#: includes/class/class.LSattr_html_select_object.php:234 +msgid "" +"LSattr_html_select_object : more than one object returned corresponding to " +"value %{val} of attribute %{attr}." +msgstr "" + +#: includes/class/class.LSformElement_rss.php:50 +msgid "Display RSS stack." +msgstr "" + +#: includes/class/class.LSsmoothbox.php:38 +msgid "Are you sure to want to close this window and lose all changes ?" +msgstr "" + +#: includes/class/class.LSformElement_supannRoleEntite.php:40 +msgid "Role" +msgstr "" + +#: includes/class/class.LSformElement_supannRoleEntite.php:46 +msgid "Entity type" +msgstr "" + +#: includes/class/class.LSformRule_inarray.php:56 +msgid "" +"LSformRule_inarray : Possible values has not been configured to validate " +"data." +msgstr "" + +#: includes/class/class.LSimport.php:133 +msgid "Error creating object on LDAP server." +msgstr "" + +#: includes/class/class.LSimport.php:159 +msgid "Error updating object on LDAP server." +msgstr "" + +#: includes/class/class.LSimport.php:165 +msgid "Error validating update form." +msgstr "" + +#: includes/class/class.LSimport.php:170 +msgid "Failed to set post data on update form." +msgstr "" + +#: includes/class/class.LSimport.php:175 +msgid "" +"Failed to load existing object %{dn} from LDAP server. Can't update object." +msgstr "" + +#: includes/class/class.LSimport.php:180 +msgid "An object already exist on LDAP server with DN %{dn}." +msgstr "" + +#: includes/class/class.LSimport.php:184 +msgid "Failed to generate DN for this object." +msgstr "" + +#: includes/class/class.LSimport.php:188 +msgid "Failed to validate object data." +msgstr "" + +#: includes/class/class.LSimport.php:194 +msgid "Error validating creation form." +msgstr "" + +#: includes/class/class.LSimport.php:199 +msgid "Failed to set post data on creation form." +msgstr "" + +#: includes/class/class.LSimport.php:243 +msgid "LSimport : Post data not found or not completed." +msgstr "" + +#: includes/class/class.LSimport.php:246 +msgid "LSimport : object type invalid." +msgstr "" + +#: includes/class/class.LSimport.php:249 +msgid "LSimport : input/output format %{format} invalid." +msgstr "" + +#: includes/class/class.LSimport.php:252 +msgid "LSimport : Fail to initialize input/output driver" +msgstr "" + +#: includes/class/class.LStemplate.php:88 +msgid "LStemplate : compile directory is not writable (dir : " +msgstr "" + +#: includes/class/class.LStemplate.php:107 +msgid "LStemplate : Can't load Smarty 2 support file" +msgstr "" + +#: includes/class/class.LStemplate.php:114 +msgid "LStemplate : Can't load Smarty 3 support file" +msgstr "" + +#: includes/class/class.LStemplate.php:118 +msgid "LStemplate : Smarty version not recognized." +msgstr "" + +#: includes/class/class.LStemplate.php:129 +msgid "LStemplate : Can't load Smarty." +msgstr "" + +#: includes/class/class.LStemplate.php:302 +msgid "LStemplate : Template %{file} not found." +msgstr "" + +#: includes/class/class.LSsearchEntry.php:137 modify.php:104 +msgid "View" +msgstr "" + +#: includes/class/class.LSsearchEntry.php:153 view.php:51 +msgid "Copy" +msgstr "" + +#: includes/class/class.LSformElement.php:194 +msgid "Attribute" +msgstr "" + +#: includes/class/class.LSformElement_xmpp.php:50 +msgid "Chat with this person." +msgstr "" + +#: includes/class/class.LSformElement_text.php:57 +msgid "Generate the value" +msgstr "" + +#: includes/class/class.LSformElement_url.php:51 +msgid "Display this website." +msgstr "" + +#: includes/class/class.LSformElement_url.php:52 +msgid "Add this website to my bookmarks." +msgstr "" + +#: includes/class/class.LSformElement_valueWithUnit.php:190 +msgid "" +"LSformElement_valueWithUnit : Units configuration data are missing for the " "attribute %{attr}." msgstr "" -#: includes/addons/LSaddons.samba.php:42 -msgid "SAMBA Support : Can't get the sambaDomain object." -msgstr "" - -#: includes/addons/LSaddons.samba.php:45 -msgid "SAMBA Support : Error modifying the sambaDomain object." -msgstr "" - -#: includes/addons/LSaddons.samba.php:48 -msgid "SAMBA Support : The %{attr} of the sambaDomain object is incorrect." -msgstr "" - -#: includes/addons/LSaddons.asterisk.php:27 -msgid "Asterisk Support : The constant %{const} is not defined." -msgstr "" - -#: includes/addons/LSaddons.asterisk.php:30 -msgid "Asterisk : The function %{function} only work with %{objectName}." -msgstr "" - -#: includes/addons/LSaddons.asterisk.php:33 +#: includes/class/class.LSformRule_password.php:98 msgid "" -"Asterisk : The attribute %{dependency} is missing. Unable to generate MD5 " -"hashed password." +"LSformRule_password : Invalid regex configured : %{regex}. You must use PCRE " +"(begining by '/' caracter)." msgstr "" -#: includes/addons/LSaddons.asterisk.php:36 +#: includes/class/class.LSattr_html.php:125 msgid "" -"Asterisk : Clear password not availlable. Unable to generate MD5 hashed " -"password." +"LSattr_html : The method addToForm() of the HTML type of the attribute " +"%{attr} is not defined." msgstr "" -#: includes/addons/LSaddons.supann.php:27 -msgid "SUPANN Support : The constant %{const} is not defined." -msgstr "" - -#: includes/addons/LSaddons.supann.php:30 +#: includes/class/class.LSattr_html.php:129 msgid "" -"SUPANN Support : The LSobject type %{type} does not exist. Can't work with " -"entities.." -msgstr "" - -#: includes/addons/LSaddons.supann.php:33 -msgid "SUPANN Support : The global array %{array} is not defined." -msgstr "" - -#: includes/addons/LSaddons.supann.php:38 -msgid "" -"SUPANN Support : The attribute %{dependency} is missing. Unable to forge the " -"attribute %{attr}." -msgstr "" - -#: includes/addons/LSaddons.supann.php:41 -msgid "" -"SUPANN Support : Can't get the basedn of entities. Unable to forge the " -"attribute %{attr}." -msgstr "" - -#: includes/addons/LSaddons.mail.php:27 -msgid "MAIL Support : Pear::MAIL is missing." -msgstr "" - -#: includes/addons/LSaddons.mail.php:32 -msgid "MAIL Error : %{msg}" -msgstr "" - -#: includes/addons/LSaddons.mail.php:36 -msgid "MAIL : Error sending your email" -msgstr "" - -#: includes/addons/LSaddons.ftp.php:27 -msgid "FTP Support : Pear::Net_FTP is missing." -msgstr "" - -#: includes/addons/LSaddons.ftp.php:31 -msgid "FTP Support : The constant %{const} is not defined." -msgstr "" - -#: includes/addons/LSaddons.ftp.php:37 -msgid "Net_FTP Error : %{msg}" -msgstr "" - -#: includes/addons/LSaddons.ftp.php:41 -msgid "FTP Support : Unable to connect to FTP Server (Step : %{step})." -msgstr "" - -#: includes/addons/LSaddons.ftp.php:44 -msgid "FTP Support : Unable to make directory %{dir} on the remote server." -msgstr "" - -#: includes/addons/LSaddons.ftp.php:47 -msgid "FTP Support : Unable to delete directory %{dir} on the remote server." -msgstr "" - -#: includes/addons/LSaddons.ftp.php:50 -msgid "" -"FTP Support : Unable to modify rights on the directory %{dir} on the remote " -"server." -msgstr "" - -#: includes/addons/LSaddons.ftp.php:53 -msgid "" -"FTP Support : Unable to rename folder from %{old} to %{new} on the remote " -"server." -msgstr "" - -#: includes/addons/LSaddons.posix.php:27 -msgid "POSIX Support : The constant %{const} is not defined." -msgstr "" - -#: includes/addons/LSaddons.posix.php:31 -msgid "POSIX Support : Unable to load LSaddon::FTP." -msgstr "" - -#: includes/addons/LSaddons.posix.php:36 -msgid "" -"POSIX : The attribute %{dependency} is missing. Unable to forge the " -"attribute %{attr}." +"LSattr_html_%{type} : Multiple data are not supported for this field type." msgstr "" #: includes/class/class.LSsearch.php:1031 @@ -262,73 +760,210 @@ msgstr "" msgid "LSsearch : Error during execution of the custom action %{customAction}." msgstr "" -#: includes/class/class.LSsearchEntry.php:137 modify.php:104 -msgid "View" +#: includes/class/class.LSformElement_mail.php:51 +msgid "Send a mail from here." msgstr "" -#: includes/class/class.LSsearchEntry.php:145 -#: includes/class/class.LSformElement_supannCompositeAttribute.php:106 -#: includes/class/class.LSrelation.php:82 -#: includes/class/class.LSformElement_select_object.php:68 -#: includes/class/class.LSformElement_supannLabeledValue.php:62 modify.php:54 -#: view.php:43 -msgid "Modify" +#: includes/class/class.LSldapObject.php:458 +msgid "The attribute %{attr} is not valid." msgstr "" -#: includes/class/class.LSsearchEntry.php:153 view.php:51 -msgid "Copy" +#: includes/class/class.LSldapObject.php:1889 +msgid "LSldapObject : Object type unknown." msgstr "" -#: includes/class/class.LSsearchEntry.php:161 -#: includes/class/class.LSform.php:218 includes/class/class.LSrelation.php:40 -#: includes/class/class.LSformElement_select_object.php:69 -#: includes/class/class.LSformElement_select_object.php:85 modify.php:111 -#: view.php:59 -msgid "Delete" +#: includes/class/class.LSldapObject.php:1892 +msgid "LSldapObject : Update form is not defined for the object %{obj}." msgstr "" -#: includes/class/class.LSformElement_postaladdress.php:59 -msgid "View on map" +#: includes/class/class.LSldapObject.php:1895 +msgid "LSldapObject : No form exists for the object %{obj}." msgstr "" -#: includes/class/class.LSformElement_maildir.php:68 +#: includes/class/class.LSldapObject.php:1898 msgid "" -"Maildir creation/modification on user creation/modification is enabled. " -"Click to disable." +"LSldapObject : The function %{func} to validate the attribute %{attr} the " +"object %{obj} is unknow." msgstr "" -#: includes/class/class.LSformElement_maildir.php:69 +#: includes/class/class.LSldapObject.php:1901 msgid "" -"Click to enable maildir creation/modification on user creation/modification." +"LSldapObject : Configuration data are missing to validate the attribute " +"%{attr} of the object %{obj}." msgstr "" -#: includes/class/class.LSformRule.php:57 -msgid "LSformRule_%{type} : Parameter %{param} is not found." +#: includes/class/class.LSldapObject.php:1905 +msgid "" +"LSldapObject : The function %{func} to be executed on the object event " +"%{event} doesn't exist." msgstr "" -#: includes/class/class.LSformElement_supannCompositeAttribute.php:107 -#: includes/class/class.LSformElement_select_object.php:75 -#: includes/class/class.LSformElement_supannLabeledValue.php:63 -#: includes/class/class.LSformElement.php:289 -msgid "No set value" +#: includes/class/class.LSldapObject.php:1908 +msgid "" +"LSldapObject : The %{func} execution on the object event %{event} failed." msgstr "" -#: includes/class/class.LSformElement_supannCompositeAttribute.php:108 -#: includes/class/class.LSformElement_select_object.php:76 -#: includes/class/class.LSformElement_supannLabeledValue.php:64 -msgid "No result" +#: includes/class/class.LSldapObject.php:1912 +msgid "" +"LSldapObject : Class %{class}, which method %{meth} to be executed on the " +"object event %{event}, doesn't exist." msgstr "" -#: includes/class/class.LSformRule_regex.php:65 -msgid "LSformRule_regex : Regex has not been configured to validate data." +#: includes/class/class.LSldapObject.php:1915 +msgid "" +"LSldapObject : Method %{meth} within %{class} class to be executed on object " +"event %{event}, doesn't exist." msgstr "" -#: includes/class/class.LSformElement_rss.php:50 -msgid "Display RSS stack." +#: includes/class/class.LSldapObject.php:1918 +msgid "" +"LSldapObject : Error during execute %{meth} method within %{class} class, to " +"be executed on object event %{event}." msgstr "" -#: includes/class/class.LSformElement_xmpp.php:50 -msgid "Chat with this person." +#: includes/class/class.LSldapObject.php:1922 +msgid "" +"LSldapObject : Some configuration data of the object type %{obj} are missing " +"to generate the DN of the new object." +msgstr "" + +#: includes/class/class.LSldapObject.php:1925 +msgid "" +"LSldapObject : The attibute %{attr} of the object is not yet defined. Can't " +"generate DN." +msgstr "" + +#: includes/class/class.LSldapObject.php:1928 +msgid "LSldapObject : Without DN, the object could not be changed." +msgstr "" + +#: includes/class/class.LSldapObject.php:1931 +msgid "" +"LSldapObject : The attribute %{attr_depend} depending on the attribute " +"%{attr} doesn't exist." +msgstr "" + +#: includes/class/class.LSldapObject.php:1934 +msgid "LSldapObject : Error during deleting the object %{objectname}." +msgstr "" + +#: includes/class/class.LSldapObject.php:1938 +msgid "" +"LSldapObject : Error during actions to be executed before renaming the objet." +msgstr "" + +#: includes/class/class.LSldapObject.php:1941 +msgid "" +"LSldapObject : Error during actions to be executed after renaming the objet." +msgstr "" + +#: includes/class/class.LSldapObject.php:1945 +msgid "" +"LSldapObject : Error during actions to be executed before deleting the objet." +msgstr "" + +#: includes/class/class.LSldapObject.php:1948 +msgid "" +"LSldapObject : Error during actions to be executed after deleting the objet." +msgstr "" + +#: includes/class/class.LSldapObject.php:1952 +msgid "" +"LSldapObject : Error during the actions to be executed before creating the " +"object." +msgstr "" + +#: includes/class/class.LSldapObject.php:1955 +msgid "" +"LSldapObject : Error during the actions to be executed after creating the " +"object. It was created anyway." +msgstr "" + +#: includes/class/class.LSldapObject.php:1959 +msgid "" +"LSldapObject : The function %{func} to be executed before creating the " +"object doesn't exist." +msgstr "" + +#: includes/class/class.LSldapObject.php:1962 +msgid "" +"LSldapObject : Error executing the function %{func} to be execute after " +"deleting the object." +msgstr "" + +#: includes/class/class.LSldapObject.php:1965 +msgid "" +"LSldapObject : The function %{func} to be executed after deleting the object " +"doesn't exist." +msgstr "" + +#: includes/class/class.LSldapObject.php:1968 +msgid "" +"LSldapObject : Error executing the function %{func} to be execute after " +"creating the object." +msgstr "" + +#: includes/class/class.LSldapObject.php:1972 +msgid "" +"LSldapObject : %{func} function, to be executed on object event %{event}, " +"doesn't exist." +msgstr "" + +#: includes/class/class.LSldapObject.php:1975 +msgid "" +"LSldapObject : Error during the execution of %{func} function on object " +"event %{event}." +msgstr "" + +#: includes/class/class.LSldapObject.php:1979 +msgid "" +"LSldapObject : %{meth} method, to be executed on object event %{event}, " +"doesn't exist." +msgstr "" + +#: includes/class/class.LSldapObject.php:1982 +msgid "" +"LSldapObject : Error during execution of %{meth} method on object event " +"%{event}." +msgstr "" + +#: includes/class/class.LSldapObject.php:1985 +msgid "LSldapObject : Error during generate LDAP filter for %{LSobject}." +msgstr "" + +#: includes/class/class.LSldapObject.php:1989 +msgid "" +"LSldapObject : Error during execution of the custom action %{customAction} " +"on %{objectname}." +msgstr "" + +#: includes/class/class.LSldapObject.php:1993 +msgid "LSldapObject : Fail to retrieve container DN." +msgstr "" + +#: includes/class/class.LSldapObject.php:1996 +msgid "" +"LSldapObject : The function %{func} to generate container DN is not callable." +msgstr "" + +#: includes/class/class.LSldapObject.php:1999 +msgid "LSldapObject : Error during generating container DN : %{error}" +msgstr "" + +#: includes/class/class.LSldapObject.php:2004 +msgid "" +"LSrelation : Some parameters are missing in the call of methods to handle " +"standard relations (Method : %{meth})." +msgstr "" + +#: includes/class/class.LSattr_html_select_list.php:63 +msgid "Invalid value" +msgstr "" + +#: includes/class/class.LSattr_html_select_list.php:243 +msgid "" +"LSattr_html_select_list : Configuration data are missing to generate the " +"select list of the attribute %{attr}." msgstr "" #: includes/class/class.LSformElement_date.php:159 @@ -339,628 +974,6 @@ msgstr "" msgid "Today." msgstr "" -#: includes/class/class.LSformRule_inarray.php:56 -msgid "" -"LSformRule_inarray : Possible values has not been configured to validate " -"data." -msgstr "" - -#: includes/class/class.LSattr_html_select_object.php:228 -msgid "" -"LSattr_html_select_object : LSobject type is undefined (attribute : %{attr})." -msgstr "" - -#: includes/class/class.LSattr_html_select_object.php:231 -msgid "" -"LSattr_html_select_object : the value of the parameter value_attribute in " -"the configuration of the attribute %{attrs} is incorrect. This attribute " -"does not exists." -msgstr "" - -#: includes/class/class.LSattr_html_select_object.php:234 -msgid "" -"LSattr_html_select_object : more than one object returned corresponding to " -"value %{val} of attribute %{attr}." -msgstr "" - -#: includes/class/class.LSauth.php:168 -msgid "LSauth : Login or password incorrect." -msgstr "" - -#: includes/class/class.LSauth.php:171 -msgid "LSauth : Impossible to identify you : Duplication of identities." -msgstr "" - -#: includes/class/class.LSauth.php:174 -msgid "LSauth : Could not load type of identifiable objects." -msgstr "" - -#: includes/class/class.LSauth.php:177 -msgid "LSauth : Can't load authentication method %{method}." -msgstr "" - -#: includes/class/class.LSauth.php:180 -msgid "LSauth : Failed to build the authentication provider %{method}." -msgstr "" - -#: includes/class/class.LSauth.php:183 -msgid "LSauth : Not correctly initialized." -msgstr "" - -#: includes/class/class.LSauth.php:186 -msgid "LSauth : Failed to get authentication informations from provider." -msgstr "" - -#: includes/class/class.LSformElement_textarea.php:51 -msgid "Clear" -msgstr "" - -#: includes/class/class.LSformElement_quota.php:80 -#: includes/class/class.LSformElement_mailQuota.php:80 -#: includes/class/class.LSformElement_valueWithUnit.php:106 -msgid "Incorrect value" -msgstr "" - -#: includes/class/class.LSattr_html_maildir.php:58 -msgid "The mailbox has been moved." -msgstr "" - -#: includes/class/class.LSattr_html_maildir.php:65 -msgid "The mailbox has been created." -msgstr "" - -#: includes/class/class.LSattr_html_maildir.php:84 -msgid "The mailbox has been archived successfully." -msgstr "" - -#: includes/class/class.LSattr_html_maildir.php:95 -msgid "The mailbox has been deleted." -msgstr "" - -#: includes/class/class.LSformElement_boolean.php:52 -msgid "Reset the choice." -msgstr "" - -#: includes/class/class.LSformElement_boolean.php:60 -msgid "Yes" -msgstr "" - -#: includes/class/class.LSformElement_boolean.php:61 -msgid "No" -msgstr "" - -#: includes/class/class.LSldapObject.php:454 -msgid "The attribute %{attr} is not valid." -msgstr "" - -#: includes/class/class.LSldapObject.php:1829 -msgid "LSldapObject : Object type unknown." -msgstr "" - -#: includes/class/class.LSldapObject.php:1832 -msgid "LSldapObject : Update form is not defined for the object %{obj}." -msgstr "" - -#: includes/class/class.LSldapObject.php:1835 -msgid "LSldapObject : No form exists for the object %{obj}." -msgstr "" - -#: includes/class/class.LSldapObject.php:1838 -msgid "" -"LSldapObject : The function %{func} to validate the attribute %{attr} the " -"object %{obj} is unknow." -msgstr "" - -#: includes/class/class.LSldapObject.php:1841 -msgid "" -"LSldapObject : Configuration data are missing to validate the attribute " -"%{attr} of the object %{obj}." -msgstr "" - -#: includes/class/class.LSldapObject.php:1845 -msgid "" -"LSldapObject : The function %{func} to be executed on the object event " -"%{event} doesn't exist." -msgstr "" - -#: includes/class/class.LSldapObject.php:1848 -msgid "" -"LSldapObject : The %{func} execution on the object event %{event} failed." -msgstr "" - -#: includes/class/class.LSldapObject.php:1852 -msgid "" -"LSldapObject : Class %{class}, which method %{meth} to be executed on the " -"object event %{event}, doesn't exist." -msgstr "" - -#: includes/class/class.LSldapObject.php:1855 -msgid "" -"LSldapObject : Method %{meth} within %{class} class to be executed on object " -"event %{event}, doesn't exist." -msgstr "" - -#: includes/class/class.LSldapObject.php:1858 -msgid "" -"LSldapObject : Error during execute %{meth} method within %{class} class, to " -"be executed on object event %{event}." -msgstr "" - -#: includes/class/class.LSldapObject.php:1862 -msgid "" -"LSldapObject : Some configuration data of the object type %{obj} are missing " -"to generate the DN of the new object." -msgstr "" - -#: includes/class/class.LSldapObject.php:1865 -msgid "" -"LSldapObject : The attibute %{attr} of the object is not yet defined. Can't " -"generate DN." -msgstr "" - -#: includes/class/class.LSldapObject.php:1868 -msgid "LSldapObject : Without DN, the object could not be changed." -msgstr "" - -#: includes/class/class.LSldapObject.php:1871 -msgid "" -"LSldapObject : The attribute %{attr_depend} depending on the attribute " -"%{attr} doesn't exist." -msgstr "" - -#: includes/class/class.LSldapObject.php:1874 -msgid "LSldapObject : Error during deleting the object %{objectname}." -msgstr "" - -#: includes/class/class.LSldapObject.php:1878 -msgid "" -"LSldapObject : Error during actions to be executed before renaming the objet." -msgstr "" - -#: includes/class/class.LSldapObject.php:1881 -msgid "" -"LSldapObject : Error during actions to be executed after renaming the objet." -msgstr "" - -#: includes/class/class.LSldapObject.php:1885 -msgid "" -"LSldapObject : Error during actions to be executed before deleting the objet." -msgstr "" - -#: includes/class/class.LSldapObject.php:1888 -msgid "" -"LSldapObject : Error during actions to be executed after deleting the objet." -msgstr "" - -#: includes/class/class.LSldapObject.php:1892 -msgid "" -"LSldapObject : Error during the actions to be executed before creating the " -"object." -msgstr "" - -#: includes/class/class.LSldapObject.php:1895 -msgid "" -"LSldapObject : Error during the actions to be executed after creating the " -"object. It was created anyway." -msgstr "" - -#: includes/class/class.LSldapObject.php:1899 -msgid "" -"LSldapObject : The function %{func} to be executed before creating the " -"object doesn't exist." -msgstr "" - -#: includes/class/class.LSldapObject.php:1902 -msgid "" -"LSldapObject : Error executing the function %{func} to be execute after " -"deleting the object." -msgstr "" - -#: includes/class/class.LSldapObject.php:1905 -msgid "" -"LSldapObject : The function %{func} to be executed after deleting the object " -"doesn't exist." -msgstr "" - -#: includes/class/class.LSldapObject.php:1908 -msgid "" -"LSldapObject : Error executing the function %{func} to be execute after " -"creating the object." -msgstr "" - -#: includes/class/class.LSldapObject.php:1912 -msgid "" -"LSldapObject : %{func} function, to be executed on object event %{event}, " -"doesn't exist." -msgstr "" - -#: includes/class/class.LSldapObject.php:1915 -msgid "" -"LSldapObject : Error during the execution of %{func} function on object " -"event %{event}." -msgstr "" - -#: includes/class/class.LSldapObject.php:1919 -msgid "" -"LSldapObject : %{meth} method, to be executed on object event %{event}, " -"doesn't exist." -msgstr "" - -#: includes/class/class.LSldapObject.php:1922 -msgid "" -"LSldapObject : Error during execution of %{meth} method on object event " -"%{event}." -msgstr "" - -#: includes/class/class.LSldapObject.php:1925 -msgid "LSldapObject : Error during generate LDAP filter for %{LSobject}." -msgstr "" - -#: includes/class/class.LSldapObject.php:1929 -msgid "" -"LSldapObject : Error during execution of the custom action %{customAction} " -"on %{objectname}." -msgstr "" - -#: includes/class/class.LSldapObject.php:1934 -msgid "" -"LSrelation : Some parameters are missing in the call of methods to handle " -"standard relations (Method : %{meth})." -msgstr "" - -#: includes/class/class.LSformElement_supannRoleEntite.php:40 -msgid "Role" -msgstr "" - -#: includes/class/class.LSformElement_supannRoleEntite.php:46 -msgid "Entity type" -msgstr "" - -#: includes/class/class.LSformElement_supannRoleEntite.php:52 -#: includes/class/class.LSformElement_supannEtuInscription.php:91 -msgid "Entity" -msgstr "" - -#: includes/class/class.LSauthMethod_anonymous.php:68 -msgid "" -"LSauthMethod_anonymous : You must define the LSAUTHMETHOD_ANONYMOUS_USER " -"contant in the configuration file." -msgstr "" - -#: includes/class/class.LSauthMethod_CAS.php:112 -msgid "LSauthMethod_CAS : Failed to load phpCAS." -msgstr "" - -#: includes/class/class.LSformElement_text.php:57 -msgid "Generate the value" -msgstr "" - -#: includes/class/class.LSform.php:68 includes/class/class.LSsmoothbox.php:39 -#: includes/class/class.LSsession.php:1223 -#: includes/class/class.LSconfirmBox.php:37 remove.php:51 custom_action.php:83 -#: custom_search_action.php:73 -msgid "Validate" -msgstr "" - -#: includes/class/class.LSform.php:98 -msgid "Add a field to add another values." -msgstr "" - -#: includes/class/class.LSform.php:99 -msgid "Delete this field." -msgstr "" - -#: includes/class/class.LSform.php:121 includes/class/class.LSform.php:251 -msgid "No field." -msgstr "" - -#: includes/class/class.LSform.php:205 custom_action.php:73 -msgid "" -"Do you really want to execute custom action %{customAction} on " -"%{objectname} ?" -msgstr "" - -#: includes/class/class.LSform.php:216 includes/class/class.LSrelation.php:38 -#: remove.php:49 -msgid "Do you really want to delete" -msgstr "" - -#: includes/class/class.LSform.php:217 -msgid "Caution" -msgstr "" - -#: includes/class/class.LSform.php:272 -msgid "%{label} attribute data is not valid." -msgstr "" - -#: includes/class/class.LSform.php:350 -msgid "Mandatory field" -msgstr "" - -#: includes/class/class.LSform.php:742 -msgid "LSform : Error during the recovery of the values of the form." -msgstr "" - -#: includes/class/class.LSform.php:745 -msgid "" -"LSform : Error durring the recovery of the value of the field '%{element}'." -msgstr "" - -#: includes/class/class.LSform.php:752 -msgid "LSform : The field %{element} doesn't exist." -msgstr "" - -#: includes/class/class.LSform.php:755 -msgid "LSfom : Field type unknow (%{type})." -msgstr "" - -#: includes/class/class.LSform.php:758 -msgid "LSform : Error during the creation of the element '%{element}'." -msgstr "" - -#: includes/class/class.LSform.php:761 -msgid "LSform : The data entry form %{name} doesn't exist." -msgstr "" - -#: includes/class/class.LSform.php:764 -msgid "LSform : The data entry form %{name} is not correctly configured." -msgstr "" - -#: includes/class/class.LSform.php:767 -msgid "" -"LSform : The element %{name}, listed as displayed in data entry form " -"configuration, doesn't exist." -msgstr "" - -#: includes/class/class.LSrelation.php:39 -msgid "Warning" -msgstr "" - -#: includes/class/class.LSrelation.php:67 -#: includes/class/class.LSrelation.php:216 -msgid "No object." -msgstr "" - -#: includes/class/class.LSrelation.php:328 -msgid "" -"LSrelation : The listing function for the relation %{relation} is unknow." -msgstr "" - -#: includes/class/class.LSrelation.php:331 -msgid "LSrelation : The update function of the relation %{relation} is unknow." -msgstr "" - -#: includes/class/class.LSrelation.php:334 -msgid "LSrelation : Error during relation update of the relation %{relation}." -msgstr "" - -#: includes/class/class.LSrelation.php:337 -msgid "LSrelation : Object type %{LSobject} unknow (Relation : %{relation})." -msgstr "" - -#: includes/class/class.LSsmoothbox.php:38 -msgid "Are you sure to want to close this window and lose all changes ?" -msgstr "" - -#: includes/class/class.LSattribute.php:267 -msgid "The value of field %{label} is invalid." -msgstr "" - -#: includes/class/class.LSattribute.php:731 -msgid "" -"LSattribute : Attribute %{attr} : LDAP or HTML types unknow (LDAP = %{ldap} " -"& HTML = %{html})." -msgstr "" - -#: includes/class/class.LSattribute.php:734 -msgid "" -"LSattribute : The function %{func} to display the attribute %{attr} is " -"unknow." -msgstr "" - -#: includes/class/class.LSattribute.php:737 -msgid "" -"LSattribute : The rule %{rule} to validate the attribute %{attr} is unknow." -msgstr "" - -#: includes/class/class.LSattribute.php:740 -msgid "" -"LSattribute : Configuration data to verify the attribute %{attr} are " -"incorrect." -msgstr "" - -#: includes/class/class.LSattribute.php:743 -msgid "" -"LSattribute : The function %{func} to save the attribute %{attr} is unknow." -msgstr "" - -#: includes/class/class.LSattribute.php:746 -msgid "LSattribute : The value of the attribute %{attr} can't be generated." -msgstr "" - -#: includes/class/class.LSattribute.php:749 -msgid "LSattribute : Generation of the attribute %{attr} failed." -msgstr "" - -#: includes/class/class.LSattribute.php:752 -msgid "" -"LSattribute : Generation of the attribute %{attr} did not return a correct " -"value." -msgstr "" - -#: includes/class/class.LSattribute.php:755 -msgid "" -"LSattribute : The attr_%{type} of the attribute %{name} is not yet defined." -msgstr "" - -#: includes/class/class.LSformElement_password.php:134 -msgid "Generate a password." -msgstr "" - -#: includes/class/class.LSformElement_password.php:135 -msgid "Compare with stored password." -msgstr "" - -#: includes/class/class.LSformElement_password.php:136 -msgid "Display password." -msgstr "" - -#: includes/class/class.LSformElement_password.php:137 -msgid "Display hashed password." -msgstr "" - -#: includes/class/class.LSformElement_password.php:138 -msgid "Hide password." -msgstr "" - -#: includes/class/class.LSformElement_password.php:139 -msgid "" -"The password will be sent by mail if changed. Click to disable automatic " -"notification." -msgstr "" - -#: includes/class/class.LSformElement_password.php:140 -msgid "" -"The password will not be sent if changed. Click to enable automatic " -"notification." -msgstr "" - -#: includes/class/class.LSformElement_password.php:141 -msgid "Modify the mail sent to notice the user" -msgstr "" - -#: includes/class/class.LSformElement_password.php:261 -msgid "Notice mail sent." -msgstr "" - -#: includes/class/class.LSformElement_password.php:341 -msgid "LSformElement_password : No contact mail available to send password." -msgstr "" - -#: includes/class/class.LSformElement_password.php:344 -msgid "" -"LSformElement_password : Contact mail invalid (%{mail}). Can't send password." -msgstr "" - -#: includes/class/class.LSformElement_password.php:347 -msgid "" -"LSformElement_password : Fail to exec pwgen. Check it's correctly installed." -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:41 -msgid "Organism" -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:47 -msgid "Registration year" -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:52 -msgid "Registration year must be an integer" -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:61 -msgid "Registration regime" -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:67 -msgid "Discipline sector" -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:73 -msgid "Diploma type" -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:79 -msgid "Cursus & Year" -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:96 -msgid "Diploma" -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:102 -msgid "Step" -msgstr "" - -#: includes/class/class.LSformElement_supannEtuInscription.php:108 -msgid "Pedagogical element" -msgstr "" - -#: includes/class/class.LSldap.php:503 -msgid "LSldap : Error during the LDAP server connection (%{msg})." -msgstr "" - -#: includes/class/class.LSldap.php:506 -msgid "LSldap : Error during the LDAP search (%{msg})." -msgstr "" - -#: includes/class/class.LSldap.php:509 -msgid "LSldap : Object type unknown." -msgstr "" - -#: includes/class/class.LSldap.php:512 -msgid "LSldap : Error while fetching the LDAP entry." -msgstr "" - -#: includes/class/class.LSldap.php:515 -msgid "LSldap : Error while changing the LDAP entry (DN : %{dn})." -msgstr "" - -#: includes/class/class.LSldap.php:518 -msgid "LSldap : Error while deleting empty attributes." -msgstr "" - -#: includes/class/class.LSldap.php:521 -msgid "LSldap : Error while changing the DN of the object." -msgstr "" - -#: includes/class/class.LStemplate.php:88 -msgid "LStemplate : compile directory is not writable (dir : " -msgstr "" - -#: includes/class/class.LStemplate.php:107 -msgid "LStemplate : Can't load Smarty 2 support file" -msgstr "" - -#: includes/class/class.LStemplate.php:114 -msgid "LStemplate : Can't load Smarty 3 support file" -msgstr "" - -#: includes/class/class.LStemplate.php:118 -msgid "LStemplate : Smarty version not recognized." -msgstr "" - -#: includes/class/class.LStemplate.php:129 -msgid "LStemplate : Can't load Smarty." -msgstr "" - -#: includes/class/class.LStemplate.php:302 -msgid "LStemplate : Template %{file} not found." -msgstr "" - -#: includes/class/class.LSformElement_image.php:54 -msgid "Click to enlarge." -msgstr "" - -#: includes/class/class.LSformElement_image.php:55 -msgid "Click to delete the picture." -msgstr "" - -#: includes/class/class.LSformElement_url.php:51 -msgid "Display this website." -msgstr "" - -#: includes/class/class.LSformElement_url.php:52 -msgid "Add this website to my bookmarks." -msgstr "" - -#: includes/class/class.LSformRule_password.php:98 -msgid "" -"LSformRule_password : Invalid regex configured : %{regex}. You must use PCRE " -"(begining by '/' caracter)." -msgstr "" - #: includes/class/class.LSsession.php:1163 msgid "Connection" msgstr "" @@ -971,7 +984,7 @@ msgid "LDAP server" msgstr "" #: includes/class/class.LSsession.php:1183 -#: includes/class/class.LSsession.php:2169 select.php:70 +#: includes/class/class.LSsession.php:2172 select.php:70 msgid "Level" msgstr "" diff --git a/public_html/templates/default/import.tpl b/public_html/templates/default/import.tpl new file mode 100644 index 00000000..bcf2ee94 --- /dev/null +++ b/public_html/templates/default/import.tpl @@ -0,0 +1,76 @@ +{include file='ls:top.tpl'} + {if $pagetitle != ''}

{$pagetitle}

{/if} + +
+
+ +
+
+
+ +
+
+ +
+
{tr msg='yes'} {tr msg='no'}
+ +
+
{tr msg='yes'} {tr msg='no'}
+ +
+
+
+
+{if is_array($result)} +

{tr msg='Result'}

+{if !empty($result.errors)} +

{tr msg='Errors'}

+{foreach $result.errors as $error} +

Object {$error@iteration}

+
+{if !empty($error.errors.globals)} +
    + {foreach $error.errors.globals as $e} +
  • {$e}
  • + {/foreach} +
+{/if} +
    +{foreach $error.data as $key => $val} +
  • + {$key} : + {if empty($val)}{tr msg='No value'}{else}{LSimport_implodeValues values=$val}{/if} + {if isset($error.errors.attrs[$key])} +
      + {foreach $error.errors.attrs.$key as $e} +
    • {$e}
    • + {/foreach} +
    + {/if} +
  • +{/foreach} +
+
+{/foreach} +{/if} + +

{tr msg='Imported objects'} ({count($result.imported)})

+
    +{foreach $result.imported as $dn => $name} +
  • {$name}
  • +{foreachelse} +
  • {tr msg='No imported object'}
  • +{/foreach} +
+ +{if !empty($result.updated)} +

{tr msg='Updated objects'} ({count($result.updated)})

+
    +{foreach $result.updated as $dn => $name} +
  • {$name}
  • +{/foreach} +
+{/if} + +{/if} +{include file='ls:bottom.tpl'} diff --git a/public_html/view.php b/public_html/view.php index 0b996c4b..79bf1f98 100644 --- a/public_html/view.php +++ b/public_html/view.php @@ -140,6 +140,11 @@ if(LSsession :: startLSsession()) { 'url' => 'create.php?LSobject='.$LSobject, 'action' => 'create' ); + $LSview_actions['import'] = array ( + 'label' => 'Import', + 'url' => 'import.php?LSobject='.$LSobject, + 'action' => 'import' + ); } $LSview_actions['refresh'] = array ( 'label' => 'Refresh',