$ecriture=fwrite($fichier_content_xml,'</office:body>'); $ecriture=fwrite($fichier_content_xml,'</office:document-content>'); //========================================== $fermeture=fclose($fichier_content_xml); set_time_limit(3000); $fichier_liste="options_eleves_gepi_".suppr_accents(preg_replace("/'/","'",preg_replace('/[" ]/','',$projet)))."_".date("Ymd_Hi"); if(file_exists("../lib/ss_zip.class.php")){ //require_once("ss_zip.class.php"); require_once("../lib/ss_zip.class.php"); $zip= new ss_zip('',6); $zip->add_file("../temp/".$user_temp_directory."/content.xml",'content.xml'); $zip->add_file('liste_options_ods/meta.xml','meta.xml'); $zip->add_file('liste_options_ods/mimetype','mimetype'); $zip->add_file('liste_options_ods/settings.xml','settings.xml'); $zip->add_file('liste_options_ods/styles.xml','styles.xml'); $zip->add_file('liste_options_ods/META-INF/manifest.xml','META-INF/manifest.xml'); $zip->save("../temp/".$user_temp_directory."/$fichier_liste.zip"); rename("../temp/".$user_temp_directory."/$fichier_liste.zip","../temp/".$user_temp_directory."/".$fichier_liste.".ods"); } else { $path = path_niveau(); $chemin_temp = $path."temp/".get_user_temp_directory()."/"; if (!defined('PCLZIP_TEMPORARY_DIR') || constant('PCLZIP_TEMPORARY_DIR')!=$chemin_temp) {
$ecriture = fwrite($fichier_tmp_xml, '<table:table-cell table:formula="oooc:=IF([.B' . $i . ']="";"";IF(ISERROR(ROUND(20*SUMPRODUCT([.G' . $i . ':.AZ' . $i . '];[.G$3:.AZ$3])/(SUMPRODUCT([.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="abs";[.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="disp";[.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="-";[.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="";[.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="v";[.G$3:.AZ$3];[.G$4:.AZ$4]));1));"-";ROUND(20*SUMPRODUCT([.G' . $i . ':.AZ' . $i . '];[.G$3:.AZ$3])/(SUMPRODUCT([.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="abs";[.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="disp";[.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="-";[.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="";[.G$3:.AZ$3];[.G$4:.AZ$4])-SUMPRODUCT([.G' . $i . ':.AZ' . $i . ']="v";[.G$3:.AZ$3];[.G$4:.AZ$4]));1)))"><text:p/></table:table-cell>'); $nb_max_dev = 46; $ecriture = fwrite($fichier_tmp_xml, '<table:table-cell table:number-columns-repeated="' . $nb_max_dev . '"/>'); $ecriture = fwrite($fichier_tmp_xml, '</table:table-row>'); } $ecriture = fwrite($fichier_tmp_xml, '</table:table>'); $ecriture = fwrite($fichier_tmp_xml, '<table:table table:name="Infos" table:style-name="ta1" table:print="false"><table:table-column table:style-name="co2" table:number-columns-repeated="6" table:default-cell-style-name="Default"/><table:table-row table:style-name="ro3"><table:table-cell table:number-columns-repeated="6"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell table:style-name="ce14" office:value-type="string"><text:p>Feuille de calcul destinée à:</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. une saisie hors ligne des notes</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. une conservation des résultats dans un tableur,...</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell table:number-columns-repeated="6"/></table:table-row><table:table-row table:style-name="ro4"><table:table-cell/><table:table-cell table:style-name="ce14" office:value-type="string"><text:p>L'import des notes dans GEPI se fait ainsi:</text:p></table:table-cell><table:table-cell table:number-columns-repeated="3"/><table:table-cell office:value-type="string"><text:p><text:s/></text:p></table:table-cell></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. dans le feuillet 'Notes', cliquer sur le menu 'Fichier/Enregistrer sous'</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. choisir 'Fichier CSV' dans 'Type de fichiers' et cocher 'Editer les paramètres du filtre'</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. cliquer sur 'Enregistrer'</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. valider 'Oui' l'avertissement comme quoi seul le feuillet actif va être enregistré</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. dans les paramètres CSV, choisir le point-virgule comme séparateur de champs et supprimer le séparateur de texte</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell table:number-columns-repeated="6"/></table:table-row><table:table-row table:style-name="ro4"><table:table-cell/><table:table-cell table:style-name="ce14" office:value-type="string"><text:p>Quelques conseils et remarques pour permettre un import des notes dans GEPI:</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. Les champs importés sont repérés par le contenu de la colonne A (masquée par défaut) et de la ligne 1 avec un préfixe GEPI_</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. Les colonnes moyennes ne sont pas prises en compte dans GEPI; elles sont recalculées d'après les notes importées.</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. Ne pas fusionner de cellules sans quoi le format CSV sera perturbé.</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. Les formules permettent des calculs jusqu'à la ligne 100 et jusqu'à la colonne AZ.</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>. Ne pas insérer de ligne pour ajouter un élève (à moins de remplir correctement aussi la colonne A (masquée par défaut))</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell table:number-columns-repeated="6"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell table:style-name="ce14" office:value-type="string"><text:p>Astuce:</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>Vous pouvez saisir plusieurs trimestres en insérant un nouveau feuillet (copie du premier) pour saisir tous les trimestres dans un même fichier tableur. </text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro3"><table:table-cell/><table:table-cell office:value-type="string"><text:p>Il est indispensable que les lignes et colonnes masquées soient copiées avec le reste de la page.</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row><table:table-row table:style-name="ro4"><table:table-cell/><table:table-cell office:value-type="string"><text:p>Lors de l'export, la macro Export_CSV prend en compte le feuillet en courant.</text:p></table:table-cell><table:table-cell table:number-columns-repeated="4"/></table:table-row></table:table></office:spreadsheet></office:body></office:document-content>'); $fermeture = fclose($fichier_tmp_xml); //set_time_limit(3000); /** * Création d'un .odc */ if (file_exists("../lib/ss_zip.class.php")) { require_once "../lib/ss_zip.class.php"; $zip = new ss_zip('', 6); $zip->add_file("{$tmp_fich}", 'content.xml'); // On n'ajoute pas les dossiers, ni les fichiers vides... ss_zip ne le supporte pas... // ... et OpenOffice a l'air de supporter l'absence de ces dossiers/fichiers. $zip->add_file($chemin_modele_ods . '/Basic/script-lc.xml', 'Basic/script-lc.xml'); $zip->add_file($chemin_modele_ods . '/Basic/Standard/script-lb.xml', 'Basic/Standard/script-lb.xml'); $zip->add_file($chemin_modele_ods . '/Basic/Standard/Module1.xml', 'Basic/Standard/Module1.xml'); // On ne met pas ce fichier parce que sa longueur vide fait une blague pour ss_zip. $zip->add_file($chemin_modele_ods . '/META-INF/manifest.xml', 'META-INF/manifest.xml'); $zip->add_file($chemin_modele_ods . '/settings.xml', 'settings.xml'); $zip->add_file($chemin_modele_ods . '/meta.xml', 'meta.xml'); $zip->add_file($chemin_modele_ods . '/Thumbnails/thumbnail.png', 'Thumbnails/thumbnail.png'); $zip->add_file($chemin_modele_ods . '/mimetype', 'mimetype'); $zip->add_file($chemin_modele_ods . '/styles.xml', 'styles.xml'); $zip->save("{$tmp_fich}.zip"); if (file_exists("{$chemin_temp}/{$nom_fic}")) { unlink("{$chemin_temp}/{$nom_fic}");