|
|
|
@ -1,30 +1,24 @@ |
|
|
|
|
<?php |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
/** |
|
|
|
|
* This class provides methods for the notebook management. |
|
|
|
|
* Include/require it in your code to use its features. |
|
|
|
|
* @package chamilo.library |
|
|
|
|
*/ |
|
|
|
|
/** |
|
|
|
|
* Code |
|
|
|
|
*/ |
|
|
|
|
require_once 'promotion.lib.php'; |
|
|
|
|
require_once 'fckeditor/fckeditor.php'; |
|
|
|
|
|
|
|
|
|
define ('CAREER_STATUS_ACTIVE', 1); |
|
|
|
|
define ('CAREER_STATUS_INACTIVE',0); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @package chamilo.library |
|
|
|
|
*/ |
|
|
|
|
/** |
|
|
|
|
* Class Career |
|
|
|
|
*/ |
|
|
|
|
class Career extends Model |
|
|
|
|
{ |
|
|
|
|
public $table; |
|
|
|
|
public $columns = array('id', 'name','description','status','created_at','updated_at'); |
|
|
|
|
public $columns = array( |
|
|
|
|
'id', |
|
|
|
|
'name', |
|
|
|
|
'description', |
|
|
|
|
'status', |
|
|
|
|
'created_at', |
|
|
|
|
'updated_at' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Constructor |
|
|
|
|
*/ |
|
|
|
|
public function __construct() |
|
|
|
|
{ |
|
|
|
|
$this->table = Database::get_main_table(TABLE_CAREER); |
|
|
|
@ -32,6 +26,7 @@ class Career extends Model |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Get the count of elements |
|
|
|
|
* @return int |
|
|
|
|
*/ |
|
|
|
|
public function get_count() |
|
|
|
|
{ |
|
|
|
@ -50,8 +45,8 @@ class Career extends Model |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Update all promotion status by career |
|
|
|
|
* @param int career id |
|
|
|
|
* @param int status (1 or 0) |
|
|
|
|
* @param int $career_id |
|
|
|
|
* @param int $status (1 or 0) |
|
|
|
|
*/ |
|
|
|
|
public function update_all_promotion_status_by_career_id($career_id, $status) |
|
|
|
|
{ |
|
|
|
@ -96,13 +91,6 @@ class Career extends Model |
|
|
|
|
*/ |
|
|
|
|
public function return_form($url, $action) |
|
|
|
|
{ |
|
|
|
|
$oFCKeditor = new FCKeditor('description'); |
|
|
|
|
$oFCKeditor->ToolbarSet = 'careers'; |
|
|
|
|
$oFCKeditor->Width = '100%'; |
|
|
|
|
$oFCKeditor->Height = '200'; |
|
|
|
|
$oFCKeditor->Value = ''; |
|
|
|
|
$oFCKeditor->CreateHtml(); |
|
|
|
|
|
|
|
|
|
$form = new FormValidator('career', 'post', $url); |
|
|
|
|
// Setting the form elements |
|
|
|
|
$header = get_lang('Add'); |
|
|
|
@ -115,14 +103,23 @@ class Career extends Model |
|
|
|
|
$form->addElement('hidden', 'id', $id); |
|
|
|
|
|
|
|
|
|
$form->addElement('text', 'name', get_lang('Name'), array('size' => '70')); |
|
|
|
|
$form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'careers','Width' => '100%', 'Height' => '250')); |
|
|
|
|
$form->add_html_editor( |
|
|
|
|
'description', |
|
|
|
|
get_lang('Description'), |
|
|
|
|
false, |
|
|
|
|
false, |
|
|
|
|
array( |
|
|
|
|
'ToolbarSet' => 'careers', |
|
|
|
|
'Width' => '100%', |
|
|
|
|
'Height' => '250' |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
$status_list = $this->get_status_list(); |
|
|
|
|
$form->addElement('select', 'status', get_lang('Status'), $status_list); |
|
|
|
|
if ($action == 'edit') { |
|
|
|
|
$form->addElement('text', 'created_at', get_lang('CreatedAt')); |
|
|
|
|
$form->freeze('created_at'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($action == 'edit') { |
|
|
|
|
$form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"'); |
|
|
|
|
} else { |
|
|
|
@ -142,6 +139,7 @@ class Career extends Model |
|
|
|
|
|
|
|
|
|
// Setting the rules |
|
|
|
|
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
|
|
|
|
|
return $form; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -184,6 +182,7 @@ class Career extends Model |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $cid; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -216,6 +215,7 @@ class Career extends Model |
|
|
|
|
if (!empty($id)) { |
|
|
|
|
event_system(LOG_CAREER_CREATE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $id; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|