Minor - format code, adding getters/setters

pull/2487/head
jmontoyaa 8 years ago
parent fc7aed12d3
commit 30aaa56320
  1. 17
      main/cron/lang/langstats_file_builder.php
  2. 1
      main/cron/user_import/get_data_from_mail.php
  3. 3
      main/inc/lib/search/search_widget.css
  4. 19
      main/mySpace/user_edit.php
  5. 6
      main/webservices/user_import/service.php
  6. 11
      plugin/courselegal/user_list.php
  7. 10
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseSelectForm.php
  8. 18
      src/Chamilo/CourseBundle/Entity/CCourseDescription.php
  9. 18
      src/Chamilo/CourseBundle/Entity/CQuiz.php
  10. 18
      src/Chamilo/CourseBundle/Entity/CQuizQuestionOption.php
  11. 18
      src/Chamilo/CourseBundle/Entity/CStudentPublicationRelDocument.php
  12. 21
      src/Chamilo/CourseBundle/Entity/CThematicAdvance.php
  13. 18
      src/Chamilo/CourseBundle/Entity/CWikiMailcue.php
  14. 3
      src/Chamilo/TicketBundle/Entity/MessageAttachment.php

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script generates a directory based on the English language variables
* but only composed of the 10,000 (can be configured) most frequent words
@ -9,9 +10,7 @@
* When running the language_builder, please make sure this parameter is
* set to 0 in the configuration.php file, otherwise it will take *ages*.
*/
/**
* Requires
*/
require_once '../../inc/global.inc.php';
require_once 'langstats.class.php';
global $_configuration;
@ -33,7 +32,9 @@ $arch_dir = api_get_path(SYS_ARCHIVE_PATH);
* Code run
*/
foreach ($terms as $row) {
if ($words_counter > 10000) { break; }
if ($words_counter > 10000) {
break;
}
$words = str_word_count(get_lang($row['term_name'], null, $orig_lang));
$words_counter += $words;
$terms_in_limit[$row['term_name']] = $i;
@ -59,7 +60,9 @@ $words_found = 0;
$global_var = array(); //keep the combination of all vars
$terms_in_limit = array_flip($terms_in_limit);
foreach ($list_files as $file) {
if (substr($file, 0, 1) == '.') {continue; }
if (substr($file, 0, 1) == '.') {
continue;
}
//echo "'".substr($file,0,-8)."',<br />"; //print in a PHP array format
$vars = file($lang_dir.'/'.$orig_lang.'/'.$file);
$local_var = array();
@ -90,7 +93,9 @@ foreach ($list_files as $file) {
$global_var += $local_var;
};
$terms_diff = count($global_var) - count($terms_in_limit);
echo count($global_var)." terms found in English files (summing up to $words_found words). Some terms ($terms_diff in this case) might have appeared in two different files<br />";
echo count(
$global_var
)." terms found in English files (summing up to $words_found words). Some terms ($terms_diff in this case) might have appeared in two different files<br />";
/**
* Display results
*/

@ -23,7 +23,6 @@ foreach ($list as $mail) {
$mail = trim($mail);
$sql = "SELECT user_id, official_code, firstname, lastname, email FROM $users WHERE email = '$mail'\n";
$res = Database::query($sql);
if ($res === false) { die(mysql_error()); }
if (Database::num_rows($res) == 0) {
$string .= 'No encontrado;'.$row['email'];
} else {

@ -41,9 +41,6 @@
padding-right: 0.9em;
}
.doc_table {
width: 30%;
text-align: left;

@ -76,15 +76,6 @@ $usernameInput->freeze();
// Password
$group = array();
$auth_sources = 0; //make available wider as we need it in case of form reset (see below)
/*if (count($extAuthSource) > 0) {
$group[] =& $form->createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
$auth_sources = array();
foreach ($extAuthSource as $key => $info) {
$auth_sources[$key] = $key;
}
$group[] =& $form->createElement('select', 'auth_source', null, $auth_sources);
$group[] =& $form->createElement('static', '', '', '<br />');
}*/
$group[] = & $form->createElement('radio', 'password_auto', get_lang('Password'), get_lang('AutoGeneratePassword').'<br />', 1);
$group[] = & $form->createElement('radio', 'password_auto', 'id="radio_user_password"', null, 0);
$group[] = & $form->createElement('password', 'password', null, array('onkeydown' => 'javascript: password_switch_radio_button(document.user_add,"password[password_auto]");'));
@ -116,17 +107,7 @@ if ($form->validate()) {
$username = $userInfo['username'];
$send_mail = intval($user['mail']['send_mail']);
$auth_source = PLATFORM_AUTH_SOURCE;
$resetPassword = $user['password']['password_auto'] == '1' ? 0 : 2;
if (count($extAuthSource) > 0 && $user['password']['password_auto'] == '2') {
//$auth_source = $user['password']['auth_source'];
//$password = 'PLACEHOLDER';
} else {
//$auth_source = PLATFORM_AUTH_SOURCE;
//$password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
}
$auth_source = $userInfo['auth_source'];
$password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];

@ -14,8 +14,6 @@ require_once __DIR__.'/../../inc/global.inc.php';
*/
function import_users_from_file($filepath, $security_key)
{
global $_configuration;
$errors_returned = array(
0 => 'success',
1 => 'file import does not exist',
@ -24,8 +22,10 @@ function import_users_from_file($filepath, $security_key)
4 => 'security error'
);
$key = api_get_configuration_value('security_key');
// Check whether this script is launch by server and security key is ok.
if (empty($_SERVER['REMOTE_ADDR']) || $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] || $security_key != $_configuration['security_key']) {
if (empty($_SERVER['REMOTE_ADDR']) || $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] || $security_key != $key) {
return $errors_returned[4];
}

@ -1,5 +1,6 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/config.php';
// Course legal
@ -36,8 +37,6 @@ switch ($action) {
break;
}
$order = " ORDER BY firstname, lastname";
$userList = $legal->getUserAgreementList($courseId, $sessionId, $order);
$table = new HTML_Table(array('class' => 'data_table'));
@ -69,15 +68,7 @@ if (!empty($userList)) {
$table->setCellContents($row, 1, $webDate);
$table->setCellContents($row, 2, $mailDate);
$table->setCellContents($row, 3, $link.' '.$deleteLink);
$row++;
/*
'web_agreement' => string '1' (length=1)
'web_agreement_date' => string '2014-09-30 14:36:30' (length=19)
'mail_agreement' => string '1' (length=1)
'mail_agreement_date' => string '2014-09-30 14:43:16' (length=19)
'mail_agreement_link' => s*/
}
}
$url = $pluginPath.'start.php?'.api_get_cidreq();

@ -553,7 +553,7 @@ class CourseSelectForm
// Mark folders to import which are not selected by the user to import,
// but in which a document was selected.
$documents = isset($_POST['resource'][RESOURCE_DOCUMENT]) ? $_POST['resource'][RESOURCE_DOCUMENT] : null;
if (!empty($resources) && is_array($resources))
if (!empty($resources) && is_array($resources)) {
foreach ($resources as $id => $obj) {
if (isset($obj->file_type) && $obj->file_type == 'folder' &&
!isset($_POST['resource'][RESOURCE_DOCUMENT][$id]) &&
@ -575,6 +575,7 @@ class CourseSelectForm
}
}
}
}
// no break
default:
if (!empty($resources) && is_array($resources)) {
@ -658,14 +659,11 @@ class CourseSelectForm
//get destination course title
if (!empty($hidden_fields['destination_course'])) {
$sessionTitle = null;
if (!empty($hidden_fields['destination_session'])) {
$sessionTitle = ' ('.api_get_session_name($hidden_fields['destination_session']).')';
} else {
$sessionTitle = null;
}
$courseInfo = api_get_course_info(
$hidden_fields['destination_course']
);
$courseInfo = api_get_course_info($hidden_fields['destination_course']);
echo '<h3>';
echo get_lang('DestinationCourse').' : '.$courseInfo['title'].$sessionTitle;
echo '</h3>';

@ -241,4 +241,22 @@ class CCourseDescription
{
return $this->cId;
}
/**
* @return int
*/
public function getIid()
{
return $this->iid;
}
/**
* @param int $iid
* @return CCourseDescription
*/
public function setIid($iid)
{
$this->iid = $iid;
return $this;
}
}

@ -803,7 +803,21 @@ class CQuiz
return $this;
}
/**
* @return int
*/
public function getIid()
{
return $this->iid;
}
/**
* @param int $iid
* @return CQuiz
*/
public function setIid($iid)
{
$this->iid = $iid;
return $this;
}
}

@ -176,4 +176,22 @@ class CQuizQuestionOption
{
return $this->cId;
}
/**
* @return int
*/
public function getIid()
{
return $this->iid;
}
/**
* @param int $iid
* @return CQuizQuestionOption
*/
public function setIid($iid)
{
$this->iid = $iid;
return $this;
}
}

@ -135,4 +135,22 @@ class CStudentPublicationRelDocument
{
return $this->id;
}
/**
* @return int
*/
public function getIid()
{
return $this->iid;
}
/**
* @param int $iid
* @return CStudentPublicationRelDocument
*/
public function setIid($iid)
{
$this->iid = $iid;
return $this;
}
}

@ -4,6 +4,7 @@
namespace Chamilo\CourseBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Chamilo\CoreBundle\Entity\Room;
/**
* CThematicAdvance
@ -289,10 +290,28 @@ class CThematicAdvance
*
* @return $this
*/
public function setRoom($room)
public function setRoom(Room $room)
{
$this->room = $room;
return $this;
}
/**
* @return int
*/
public function getIid()
{
return $this->iid;
}
/**
* @param int $iid
* @return CThematicAdvance
*/
public function setIid($iid)
{
$this->iid = $iid;
return $this;
}
}

@ -208,4 +208,22 @@ class CWikiMailcue
{
return $this->userId;
}
/**
* @return int
*/
public function getIid()
{
return $this->iid;
}
/**
* @param int $iid
* @return CWikiMailcue
*/
public function setIid($iid)
{
$this->iid = $iid;
return $this;
}
}

@ -184,7 +184,4 @@ class MessageAttachment
return $this;
}
}

Loading…
Cancel
Save