public function processDefault()
 {
     _classInclude('sysutils|admin');
     if (!Admin::canAdmin()) {
         return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get()));
     }
     echo "Récupération des classeurs de classe sans casier\n";
     echo "----------------------------------------------------------------------\n\n";
     // Récupération des classeurs de classe sans casier
     $sql = 'SELECT DISTINCT module_classeur.id' . ' FROM kernel_mod_enabled, module_classeur' . ' LEFT JOIN module_classeur_dossier ON (module_classeur_dossier.module_classeur_id = module_classeur.id)' . ' WHERE module_classeur.id = kernel_mod_enabled.module_id' . ' AND kernel_mod_enabled.module_type = "MOD_CLASSEUR"' . ' AND kernel_mod_enabled.node_type = "BU_CLASSE"' . ' AND (module_classeur_dossier.id IS NULL' . ' OR module_classeur_dossier.id NOT IN (SELECT id FROM module_classeur_dossier WHERE casier = 1 AND module_classeur_id = module_classeur.id))';
     $results = _doQuery($sql);
     $dossierDAO = _ioDAO('classeur|classeurdossier');
     _classInclude('classeur|classeurService');
     echo count($results) . " casiers à créer.\n";
     foreach ($results as $result) {
         $casier = _record('classeur|classeurdossier');
         $casier->classeur_id = $result->id;
         $casier->parent_id = 0;
         $casier->nom = CopixI18N::get('classeur|classeur.casierNom');
         $casier->nb_dossiers = 0;
         $casier->nb_fichiers = 0;
         $casier->taille = 0;
         $casier->cle = classeurService::createKey();
         $casier->casier = 1;
         $casier->date_creation = date('Y-m-d H:i:s');
         $dossierDAO->insert($casier);
         echo "Casier du classeur {$result->id} créé avec succès !\n";
     }
     echo "\n\nFin de la tâche";
     return _arNone();
 }
 /**
  * Traitement par défaut
  */
 public function processDefault()
 {
     // On charge la classe exportée
     Copix::RequireOnce($this->_exportClassFilename);
     // Définition du serveur Soap
     if (isset($this->_wsname)) {
         $server = new SoapServer(_url('wsserver|default|wsdl', array('wsname' => $this->_wsname)));
     } else {
         $server = new SoapServer(_url('wsserver|default|wsdl'));
     }
     // Assignation de la classe exportée au serveur
     $server->setclass($this->_exportClass);
     // Traitement des appels
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $server->handle();
         return _arNone();
     } else {
         $res = '<strong>' . _i18n('wsserver.handle.title') . '</strong>';
         $res .= '<ul>';
         foreach ($server->getFunctions() as $func) {
             $res .= '<li>' . $func . '</li>';
         }
         $res .= '</ul>';
         $res;
     }
     $tpl = new CopixTpl();
     $tpl->assign('MAIN', $res);
     return new CopixActionReturn(CopixActionReturn::DISPLAY, $tpl);
 }
 /**
  * Retourne les données du chart
  *
  */
 public function processGetChartsDatas()
 {
     $cle = CopixRequest::get('cle');
     echo CopixSession::get("charts|datas|{$cle}");
     CopixSession::set("charts|datas|{$cle}", null);
     return _arNone();
 }
 public function processMigrate()
 {
     $datas = $this->db->query('SELECT * FROM module_groupe_tag')->toArray();
     foreach ($datas as $data) {
         $this->service('tagService')->addTagsToGroup($data['groupe'], array(utf8_encode($data['tag'])));
     }
     echo "si il n'y a rien au dessus, c'est cool ! :)";
     return _arNone();
 }
 public function processGetRssFeedAjax()
 {
     try {
         $feeds = $this->service->getRssFeeds();
         if (empty($feeds)) {
             echo '<p class="mesgInfo">' . $this->i18n('rssmix.noUrl') . '</p>';
         } else {
             echo '<div id="rssmix-cycle" class="widget-rssmix"><ul>';
             foreach ($feeds as $feed) {
                 echo '<li class="content-panel" >
                     <h4 class="rm-title">' . $feed['title'];
                 if (!empty($feed['fluxTitle'])) {
                     echo '<span>(' . $feed['fluxTitle'] . ')</span>';
                 }
                 echo '</h4>';
                 if (!empty($feed['img'])) {
                     echo '<img src="' . $feed['img'] . '" alt="" />';
                 }
                 echo '<a href="' . $feed['link'] . '" class="button button-continue floatright" target="_blank">' . $this->i18n('rssmix.url') . '</a>
                     </li>';
             }
             echo '</ul></div>';
         }
     } catch (Exception $e) {
         echo '<p class="mesgInfo">' . $this->i18n('rssmix.errorConfig') . '</p>';
     }
     return _arNone();
 }
 /**
  * AJAX ONLY ! - Met à jour l'état d'ouverture des classes sur l'écran de gestion des affectations (ouvert / fermé)
  */
 public function processChangeManageAssignmentClassroomState()
 {
     $id = _request('id', null);
     $type = _request('type', null);
     // Paramètres obligatoires
     if (null === $id || null === $type) {
         return new CopixActionReturn(CopixActionReturn::HTTPCODE, array('Content-Type: text/plain; charset=utf-8', 'HTTP/1.1 400 Bad Request'), 'Une erreur est survenue');
     }
     // Changement d'état
     $state = _sessionGet('gestionautonome|assignments_management_classroom_state');
     if (isset($state[$type][$id])) {
         unset($state[$type][$id]);
     } else {
         $state[$type][$id] = 1;
     }
     _sessionSet('gestionautonome|assignments_management_classroom_state', $state);
     return _arNone();
 }
 private function processLocalTest()
 {
     $this->myservice = enic::get('helpers')->service('soapserver|soapserverservice');
     $class = new soapClassModel();
     $class->name = 'Vasi Tavue';
     $class->accountId = 1;
     $class->classId = 6;
     $class->level = 7;
     $class->type = 8;
     $class->year = 2011;
     $date = new DateTime('2012-08-31');
     $class->validityDate = $date->format("Y-m-d H:i:s");
     $directeur = new soapDirectorModel();
     $directeur->name = "jeanClaude";
     $directeur->surname = "leCompte";
     $directeur->mail = "lecompte@caramail.fr";
     $directeur->gender = 1;
     $directeur->password = md5(123456);
     $directeur->phone = '0123456742';
     $adress = new soapAddressModel();
     $adress->address = "4 rue des cochons";
     $adress->additionalAddress = "";
     $adress->city = "Larochelle";
     $adress->postalCode = "76788";
     $school = new soapSchoolModel();
     $school->name = "DesChamps";
     $school->address = $adress;
     $school->director = $directeur;
     $school->rne = 123456789;
     $school->siret = '1234567898';
     $account = new soapAccountModel();
     $account->id = 1;
     $account->school = $school;
     var_dump($this->myservice->accountService->create(1, 2, 3));
     try {
         $j = $this->myservice->createAccount($account);
         $i = $this->myservice->createClass($class);
         $k = $this->myservice->validateClass($class);
     } catch (Exception $e) {
         echo $e;
     }
     return _arNone();
 }
 public function processGetreqlistclasses()
 {
     $id_ecole = (int) $this->request('ecole_id');
     $classes = $this->db->query('SELECT * FROM kernel_bu_ecole_classe AS cl JOIN kernel_bu_annee_scolaire AS an ON cl.annee_scol = an.id_as WHERE an.current = 1 AND cl.is_validee = 1 AND cl.is_supprimee = 0 AND cl.ecole = ' . $id_ecole)->toArray();
     if (empty($classes)) {
         echo json_encode(array('aucune classe'));
         exit;
     }
     $oReturn = array();
     foreach ($classes as $cl) {
         $oReturn[$cl['id']] = utf8_encode($cl['nom']);
     }
     echo json_encode($oReturn);
     return _arNone();
 }
 public function processGetJson()
 {
     echo json_encode($this->service->getItems(5));
     return _arNone();
 }
 /**
  * Cle i18n
  *
  * @author Christophe Beyer <cbeyer@cap-tic.fr>
  * @since 2011/06/17
  * @param string $key Cle demandee
  */
 public function processI18n()
 {
     _currentUser()->assertCredential('group:[current_user]');
     $iKey = CopixRequest::get('key');
     if (CopixI18N::exists($iKey)) {
         echo CopixI18N::get($iKey);
     }
     return _arNone();
 }