Example #1
0
 function show_form()
 {
     global $form_do_demande, $dbh, $charset;
     $date = formatdate(today());
     $date_fin = date("Ymd", time());
     //Selecteur des thèmes
     $req = "select * from demandes_theme order by libelle_theme";
     $res = mysql_query($req, $dbh);
     $theme_selector = "<select name='idtheme' >";
     while ($dmde = mysql_fetch_object($res)) {
         $theme_selector .= "<option value='" . $dmde->id_theme . "'>" . htmlentities($dmde->libelle_theme, ENT_QUOTES, $charset) . "</option>";
     }
     $theme_selector .= "</select>";
     //Selecteur des types
     $req = "select * from demandes_type order by libelle_type";
     $res = mysql_query($req, $dbh);
     $type_selector = "<select name='idtype' >";
     while ($dmde = mysql_fetch_object($res)) {
         $type_selector .= "<option value='" . $dmde->id_type . "'>" . htmlentities($dmde->libelle_type, ENT_QUOTES, $charset) . "</option>";
     }
     $type_selector .= "</select>";
     $form_do_demande = str_replace('!!date_fin!!', $date_fin, $form_do_demande);
     $form_do_demande = str_replace('!!date_fin_btn!!', $date, $form_do_demande);
     $form_do_demande = str_replace('!!select_theme!!', $theme_selector, $form_do_demande);
     $form_do_demande = str_replace('!!select_type!!', $type_selector, $form_do_demande);
     print $form_do_demande;
 }
Example #2
0
 function show_form($param = '')
 {
     global $base_path, $dbh, $charset, $msg;
     //paramètres pré-enregistré
     $liste_views = array();
     if ($param['list_view']) {
         foreach ($param['list_view'] as $id_view) {
             $liste_views[$id_view] = $id_view;
         }
     }
     $conso = $param["conso"] ? $param["conso"] : "1";
     $date_deb = $param["date_deb"];
     $date_fin = $param["date_fin"];
     $date_ech = $param["date_ech"];
     $requete = "SELECT id_vue, date_consolidation, nom_vue, comment FROM statopac_vues";
     $res = mysql_query($requete, $dbh);
     $nb_rows = mysql_num_rows($res);
     //taille du selecteur
     if ($nb_rows < 3) {
         $nb = 3;
     } else {
         if ($nb_rows > 10) {
             $nb = 10;
         } else {
             $nb = $nb_rows;
         }
     }
     $select_view = "<select id='list_view' class='saisie-50em' name='list_view[]' size='" . $nb . "' multiple>";
     while ($row = mysql_fetch_object($res)) {
         $select_view .= "<option id='" . $row->id_vue . "' value='" . $row->id_vue . "' " . ($liste_views[$row->id_vue] == $row->id_vue ? "selected" : "") . ">" . htmlentities($row->nom_vue, ENT_QUOTES, $charset) . "</option>";
     }
     $select_view .= "</select>";
     //liste des vues à consolider
     $form_task .= "\n\t\t<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for='stats'>" . $this->msg["planificateur_stats_listView"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne_suite'>" . $select_view . "</div>\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>";
     /*appui sur la fin de la méthode do_form de la classe stat_view*/
     $form_task .= "<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for='stats'>" . $this->msg["planificateur_stats_options"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne_suite'>\n\t\t\t\t<input type='radio' class='radio' id='id_lot' name='conso' value='1' " . ($conso == "1" ? "checked" : "") . "/> \n\t\t\t\t\t<label for='id_lot'>{$msg['stat_last_consolidation']}</label> <br><br>\n\t\t\t\t<input type='radio' class='radio' id='id_interval' name='conso' value='2' " . ($conso == "2" ? "checked" : "") . "/> \n\t\t\t\t\t<label for='id_interval'>{$msg['stat_interval_consolidation']} </label><br><br>\n\t\t\t\t<input type='radio' class='radio' id='id_debut' name='conso' value='3' " . ($conso == "3" ? "checked" : "") . "/> \n\t\t\t\t\t<label for='id_debut'>{$msg['stat_echeance_consolidation']}</label><br>\n\t\t\t</div>\n\t\t</div>";
     $btn_date_deb = "<input type='hidden' name='date_deb' value='!!date_deb!!'/><input type='button' name='date_deb_lib' class='bouton_small' value='!!date_deb_lib!!'   \n\t\t\tonClick=\"openPopUp('./select.php?what=calendrier&caller=planificateur_form&date_caller=!!date_deb!!&param1=date_deb&param2=date_deb_lib&auto_submit=NO&date_anterieure=YES', 'date_deb', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" />";
     $btn_date_fin = "<input type='hidden' name='date_fin' value='!!date_fin!!'/><input type='button' name='date_fin_lib' class='bouton_small'   value='!!date_fin_lib!!'\n\t\t\tonClick=\"openPopUp('./select.php?what=calendrier&caller=planificateur_form&date_caller=!!date_fin!!&param1=date_fin&param2=date_fin_lib&auto_submit=NO&date_anterieure=YES', 'date_fin', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" />";
     $btn_date_echeance = "<input type='hidden' name='date_ech' value='!!date_ech!!'/><input type='button' name='date_ech_lib' class='bouton_small' value='!!date_ech_lib!!'  \n\t\t\tonClick=\"openPopUp('./select.php?what=calendrier&caller=planificateur_form&date_caller=!!date_ech!!&param1=date_ech&param2=date_ech_lib&auto_submit=NO&date_anterieure=YES', 'date_ech', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" />";
     if (!$date_deb) {
         // -- si nouvelle tâche = pas de params pré-enregistrés
         $date_deb = strftime("%Y-%m-%d", mktime(0, 0, 0, date('m'), date('d') - 1, date('y')));
     }
     $btn_date_deb = str_replace("!!date_deb!!", $date_deb, $btn_date_deb);
     $btn_date_deb = str_replace("!!date_deb_lib!!", formatdate($date_deb), $btn_date_deb);
     if (!$date_fin) {
         $date_fin = today();
     }
     $btn_date_fin = str_replace("!!date_fin!!", $date_fin, $btn_date_fin);
     $btn_date_fin = str_replace("!!date_fin_lib!!", formatdate($date_fin), $btn_date_fin);
     if (!$date_ech) {
         $date_ech = today();
     }
     $btn_date_echeance = str_replace("!!date_ech!!", $date_ech, $btn_date_echeance);
     $btn_date_echeance = str_replace("!!date_ech_lib!!", formatdate($date_ech), $btn_date_echeance);
     $form_task = str_replace("!!date_deb_btn!!", $btn_date_deb, $form_task);
     $form_task = str_replace("!!date_fin_btn!!", $btn_date_fin, $form_task);
     $form_task = str_replace("!!echeance_btn!!", $btn_date_echeance, $form_task);
     return $form_task;
 }
Example #3
0
function bodyBottom()
{
    global $TimerStart, $prog_name_full, $prog_ver;
    $today = today();
    $genTime = processTime();
    echo "\n</td>\n        </tr>\n      </table></td>\n  </tr>\n  <tr>\n    <td height=\"32\"><table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n        <tr>\n          <td height=\"1\" bgcolor=\"#7D7D7D\"></td>\n        </tr>\n        <tr>\n          <td><table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#EAEAEA\" class=\"bottomBar\">\n              <tr>\n                <td width=\"30%\" class=\"bottomInfo\">" . _GENERATION_TIME . " {$genTime} " . _SECONDS . "</td>\n                <td class=\"bottomInfo\">\n                <div align=\"center\">Powered by <a href  >{$prog_name_full}</a> {$prog_ver} &copy; 2007</div></td>\n                <td width=\"30%\" class=\"bottomInfo\">\n                <div align=\"right\">" . _NOW . ": {$today}</div></td>\n              </tr>\n            </table></td>\n        </tr>\n        <tr>\n          <td height=\"1\" bgcolor=\"#7D7D7D\"></td>\n        </tr>\n      </table></td>\n  </tr>\n</table>\n\n\n</body>\n</html>";
}
Example #4
0
 public function index()
 {
     $myID = getUserID();
     $title = trim(jsonInput('title'));
     $description = jsonInput('description');
     $location = jsonInput('location');
     $start = strtotime(jsonInput('start'));
     $end = strtotime(jsonInput('end'));
     if (empty($title)) {
         generate_json(array('status' => 0, 'message' => 'Please type event title.'));
     } else {
         if (!$start) {
             generate_json(array('status' => 0, 'message' => 'Start Date is required.'));
         } else {
             if ($end && $start > $end) {
                 generate_json(array('status' => 0, 'message' => 'Dates mismatch.'));
             } else {
                 $start = date("Y-m-d", $start);
                 $end = $end ? date("Y-m-d", $end) : $start;
                 $this->mdb->add_event(array('title' => $title, 'description' => $description, 'location' => $location, 'type' => 'default', 'start' => $start, 'end' => $end, 'date_added' => today(), 'source' => 'local', 'user_id' => $myID));
                 generate_json(array('status' => 1));
             }
         }
     }
 }
Example #5
0
 public function do_login()
 {
     $username = $this->input->post('username');
     $password = ts_hash($this->input->post('password'));
     $status = 1;
     $message = '';
     $query = $this->model->login($username, $password);
     if ($query->num_rows()) {
         $row = $query->row();
         switch ($row->status) {
             case 0:
                 $status = 0;
                 $message = sprintf('Account not yet verified. <br /><a href="%s">Resend Verification?</a>', base_url('signup/resend_verification?token=' . $row->token . '&t=' . strtotime('now')));
                 break;
             case 2:
                 $status = 0;
                 $message = 'This account has been banned.';
                 break;
             default:
                 $uniqueToken = random_string('unique');
                 $this->model->user_update(array('last_active' => today(), 'token' => $uniqueToken), array('id' => $row->id));
                 $sessData = array('user_id' => $row->id, 'username' => $row->username, 'userlevel' => $row->userlevel, 'display_name' => $row->display_name, 'email_address' => $row->email_address, 'token' => $uniqueToken);
                 $this->session->set_userdata($sessData);
                 $message = $uniqueToken;
         }
     } else {
         $status = 0;
         $message = 'Incorrect Username / Password.';
     }
     generate_json(array('status' => $status, 'message' => $message));
 }
Example #6
0
function gl_inquiry_controls()
{
    $dim = get_company_pref('use_dimension');
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    $date = today();
    if (!isset($_POST['TransFromDate'])) {
        $_POST['TransFromDate'] = begin_month($date);
    }
    if (!isset($_POST['TransToDate'])) {
        $_POST['TransToDate'] = end_month($date);
    }
    date_cells(_("From:"), 'TransFromDate');
    date_cells(_("To:"), 'TransToDate');
    if ($dim >= 1) {
        dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
    }
    check_cells(_("No zero values"), 'NoZero', null);
    check_cells(_("Only balances"), 'Balance', null);
    submit_cells('Show', _("Show"), '', '', 'default');
    end_table();
    end_form();
}
Example #7
0
 public function __construct()
 {
     parent::__construct();
     if (empty($this->date)) {
         $this->date = today();
     }
 }
Example #8
0
function error401()
{
    require_once 'russian.php';
    global $mail, $prog_name_full, $prog_ver;
    $today = today();
    $server = $_SERVER['HTTP_HOST'];
    echo "\n<html>\n<head>\n<title>{$prog_name}: " . Authentication_required . "!</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=KOI8-R\" />\n<style type=\"text/css\">\n<!--\nbody { \n    color: #000000; background-color: #FFFFFF; \n    font-family: Arial, Helvetica, sans-serif;\n    font-size: 14px;\n}\na:link { color: #0000CC; }\n-->\n</style>\n</head>\n\n<body>\n<h1><font font size=\"7\">" . Authentication_required . "!</font></h1>\n<HR noshade size=1px>\n<dl>\n<dd>\n\n\n    This server could not verify that you are authorized to access\n    the URL.\n    You either supplied the wrong credentials (e.g., bad password), or your\n    browser doesn't understand how to supply the credentials required.\n\n  </dd></dl><dl><dd>\n\n\n    In case you are allowed to request the document, please\n    check your user-id and password and try again.\n\n</dd></dl><dl><dd>\nIf you think this is a server error, please contact\nthe <a href=\"mailto:{$mail}\">{$mail}</a>\n\n</dd></dl>\n\n<h2><font font size=\"6\">" . _ERROR . " 401</font></h2>\n<HR noshade size=1px>\n<dl>\n<dd>\n<address>\n  <a href=\"/\">{$server}</a>\n  <br />\n\n  <small>{$today}</small>\n  <br />\n  <small>{$prog_name_full} {$prog_ver}</small>\n</address>\n</dd>\n</dl>\n</body>\n</html>\n";
}
Example #9
0
 private function do_signup()
 {
     if ($_POST) {
         $username = $this->input->post('username');
         $fullname = $this->input->post('fullname');
         $email = $this->input->post('email');
         $gender = $this->input->post('gender');
         $password = $this->input->post('password');
         $password2 = $this->input->post('password2');
         $alertMsg = '';
         $this->form_validation->set_rules('username', 'Username', 'required|trim|alpha_numeric|min_length[4]|max_length[20]|is_unique[users.username]');
         $this->form_validation->set_rules('fullname', 'Display name', 'required|alpha_numeric_spaces|max_length[30]');
         $this->form_validation->set_rules('email', 'Email address', 'required|valid_email|is_unique[users.email_address]');
         $this->form_validation->set_rules('password', 'Password', 'required|min_length[4]|max_length[20]');
         $this->form_validation->set_rules('password2', 'Confirm Password', 'matches[password]');
         $this->form_validation->set_message('required', '%s is required.');
         $this->form_validation->set_message('alpha_numeric', '%s must be alpha numeric only.');
         $this->form_validation->set_message('alpha_numeric_spaces', '%s must be letters, numbers and spaces only.');
         $this->form_validation->set_message('valid_email', 'Invalid %s.');
         $this->form_validation->set_message('is_unique', '%s already exists.');
         $this->form_validation->set_message('min_length', '%s must contain atleast %d characters.');
         $this->form_validation->set_message('max_length', '%s too long, allowed up to %d characters only.');
         $this->form_validation->set_message('matches', 'Passwords do not match.');
         $this->form_validation->set_error_delimiters('', '|');
         if ($this->form_validation->run()) {
             $emailVerification = $this->siteinfo->config('signup_verification');
             /* SUCCESS MESSAGE */
             $successMsg = array(sprintf('<div class="alert alert-success">Thank you for joining %s we are happy to have you here. You can now <a href="%s">Login</a>.</div>', ucfirst($this->siteinfo->config('site_name')), base_url()), '<div class="alert alert-danger">Thanks for joining, We have send you an email confirmation to validate your account.</div>');
             $alertMsg .= $emailVerification ? $successMsg[1] : $successMsg[0];
             /* SUCCESS MESSAGE END */
             //Inserts to database
             $mData = array('userlevel' => 0, 'username' => $username, 'email_address' => $email, 'password' => ts_hash($password), 'display_name' => $fullname, 'date_registered' => today(), 'last_active' => NULL, 'status' => $emailVerification ? 0 : 1, 'token' => random_string('unique'));
             $newID = $this->mdb->users_add($mData);
             $genders = $this->config->item('genders');
             if ($newID) {
                 $this->mdb->users_info_add(array('user_id' => $newID, 'firstname' => '', 'middlename' => '', 'lastname' => '', 'gender' => in_array($gender, $genders) ? $gender : $genders[0], 'timezone' => $this->siteinfo->config('timezone'), 'location' => '', 'contact_number' => '', 'company' => '', 'profile_pic' => '', 'email_privacy' => 1));
             }
             //Process Email Notification
             if ($emailVerification) {
             }
             //Clear fields after Success
             $username = '';
             $fullname = '';
             $email = '';
             $password = '';
             $password2 = '';
         } else {
             $errors = validation_errors();
             $errorsArr = explode("|", $errors);
             $alertMsg = '<div class="alert alert-warning">';
             $alertMsg .= isset($errorsArr[0]) ? $errorsArr[0] : 'Unknown error!';
             $alertMsg .= '</div>';
         }
         return array('alert_msg' => $alertMsg, 'username' => htmlentities($username), 'fullname' => htmlentities($fullname), 'email' => htmlentities($email), 'password' => htmlentities($password), 'password2' => htmlentities($password2));
     }
 }
Example #10
0
function date_ago($date)
{
    switch ($date->diff(today())->days) {
        case 0:
            return \Lang::get('pages.updates.today');
            break;
        case 1:
            return \Lang::get('pages.updates.yesterday');
            break;
    }
    return $date->ago();
}
Example #11
0
 public function index()
 {
     $myID = getUserID();
     $date = today();
     $title = trim(jsonInput('title'));
     $content = jsonInput('content');
     $category = trim(jsonInput('category'));
     if (empty($title)) {
         generate_json(array('status' => 0, 'message' => 'Title is required.'));
     } else {
         $insert_id = $this->mdb->insert_note(array('user_id' => $myID, 'title' => $title, 'content' => $content, 'category' => $category, 'date_created' => $date));
         generate_json(array('status' => 1, 'message' => 'Note successfully created.'));
     }
 }
Example #12
0
 public function index()
 {
     $myID = getUserID();
     $query = $this->mdb->get_notif($myID, today());
     $items = array();
     foreach ($query->result() as $row) {
         $tagData = explode("|", $row->tag_data);
         $description = display_notif($row->type, $tagData, $row->counter);
         $description = convert_tag($description, 'span', array('class' => 'tag'));
         $dateNotify = convert_datetime($row->date_notify);
         $items[] = array('id' => $row->id, 'description' => $description, 'actor_id' => $row->actor_id, 'redirect_uri' => $row->redirect, 'timestamp' => relativedate(strtotime($dateNotify), true), 'is_read' => $row->is_read, 'is_new' => $row->is_new);
     }
     $this->mdb->update_notif(array('notify_to' => $myID, 'is_new' => 1), array('is_new' => 0));
     generate_json(array('status' => 1, 'items' => $items));
 }
Example #13
0
function getLast12Months($format = "%b %Y")
{
    $currentDate = today();
    $currentMonth = formatDate($currentDate, "%m");
    $currentYear = formatDate($currentDate, "%Y");
    $startingYear = $currentYear - 1;
    $last_12_months = array();
    for ($i = (int) $currentMonth + 1; $i <= 12; $i++) {
        $last_12_months[] = formatDate($startingYear . "-" . $i . "-01", $format);
    }
    for ($i = 1; $i <= $currentMonth; $i++) {
        $last_12_months[] = formatDate($currentYear . "-" . $i . "-01", $format);
    }
    return $last_12_months;
}
Example #14
0
 public function index()
 {
     $myID = getUserID();
     $name = trim(jsonInput('name'));
     $description = jsonInput('description');
     $membersPost = jsonInput('members');
     $this->np_validations();
     $newProjID = $this->mdb->project_add($myID, $name, $description);
     if ($newProjID) {
         //add yourself in project members
         $this->mdb->project_member_add(array('project_id' => $newProjID, 'user_id' => $myID, 'email_address' => getUserEmail(), 'joined_by' => 0, 'date_joined' => today(), 'last_visit' => today(), 'is_accepted' => 1, 'project_role' => 3));
         $this->mdb->add_project_settings(array('project_id' => $newProjID, 'task_approval' => 0, 'project_approval' => 1));
         //add specified members to project
         if (is_array($membersPost)) {
             foreach ($membersPost as $member) {
                 if (filter_var($member, FILTER_VALIDATE_EMAIL)) {
                     $qChkifAlreadyMember = $this->mdb->checkIfAlreadyMember($newProjID, $member);
                     if (!$qChkifAlreadyMember) {
                         $qChkUser = $this->model->getUserInfo(array('email_address' => $member));
                         if ($qChkUser->num_rows()) {
                             $pmRow = $qChkUser->row();
                             $this->mdb->project_member_add(array('project_id' => $newProjID, 'user_id' => $pmRow->id, 'email_address' => $pmRow->email_address, 'joined_by' => $myID, 'date_joined' => today(), 'last_visit' => NULL, 'is_accepted' => 0, 'project_role' => $this->siteinfo->config('project_roles_default')));
                             //notification
                             notify('project_invite', $pmRow->id, array('project_id' => $newProjID));
                             $qProj = $this->db->get_where('projects', array('id' => $newProjID));
                             if ($qProj->num_rows()) {
                                 $qProjRow = $qProj->row();
                                 $myName = $this->session->userdata('display_name');
                                 $redirectLink = base_url('#/app/projects/' . $newProjID);
                                 do_sendmail($pmRow->id, $qProjRow->project_name, "{$myName} invited you to join <a href='{$redirectLink}'>" . $qProjRow->project_name . "</a>");
                             }
                         } else {
                             $this->mdb->project_member_add(array('project_id' => $newProjID, 'user_id' => 0, 'email_address' => $member, 'joined_by' => $myID, 'date_joined' => today(), 'last_visit' => NULL, 'is_accepted' => 0, 'project_role' => $this->siteinfo->config('project_roles_default')));
                         }
                     }
                 }
             }
         }
         //add project roles
         foreach ($this->siteinfo->config('project_roles') as $roleID => $role) {
             $default = $this->siteinfo->config('project_roles_default') == $roleID ? 1 : 0;
             $this->mdb->project_roles_add($newProjID, $roleID, $default, $role);
         }
     }
     generate_json(array('status' => 1, 'message' => 'New project has been created.'));
 }
Example #15
0
 public function index()
 {
     updateLastActive();
     $myID = getUserID();
     $filepath = 'uploads/files/' . $myID . '/';
     $pid = (int) $this->input->get('pid');
     $tid = (int) $this->input->get('tid');
     if (!file_exists($filepath)) {
         mkdir($filepath, 0777, true);
     }
     if (!validate_access('valid_member', array('project_id' => $pid, 'user_id' => $myID))) {
         $this->output->set_status_header('400');
         echo 'You dont have enough permission to do this.';
     } else {
         $config['upload_path'] = $filepath;
         $config['allowed_types'] = 'jpg|gif|jpeg|bmp|ico|png|zip|rar|gz|mp3|mp4|mkv|avi|txt|apk|ipa|tar|exe|doc|docx|xls|xlsx|ppt|pptx|pdf';
         $config['max_size'] = 30000;
         $config['encrypt_name'] = true;
         $config['max_filename'] = 200;
         $config['remove_spaces'] = false;
         $this->load->library('upload', $config);
         if ($this->upload->do_upload('file')) {
             $data = $this->upload->data();
             $newID = $this->mdb->add_attachment(array('attachment_type' => 'file', 'uploader' => $myID, 'project_id' => $pid, 'task_id' => $tid, 'post_id' => 0, 'filename' => $data['orig_name'], 'filepath' => $data['file_name'], 'filesize' => $data['file_size'] * 1024, 'extension' => $data['file_ext'], 'date_added' => today(), 'date_deleted' => null, 'deleted_by' => 0, 'parent_folder' => 0));
             $imgTypes = array('.gif', '.jpg', '.jpeg', '.png');
             if (in_array(strtolower($data['file_ext']), $imgTypes)) {
                 $this->load->library('image_lib');
                 $thumbpath = $filepath . 'thumbs/';
                 if (!file_exists($thumbpath)) {
                     mkdir($thumbpath, 0777, true);
                 }
                 $config = array('image_library' => 'gd2', 'source_image' => $filepath . $data['file_name'], 'new_image' => $thumbpath . $data['file_name'], 'maintain_ratio' => true, 'height' => 300, 'width' => 300);
                 $this->image_lib->initialize($config);
                 $this->image_lib->resize();
                 $this->image_lib->clear();
             }
             echo $newID;
         } else {
             $errors = $this->upload->display_errors('', '|');
             $errorsArr = explode("|", $errors);
             $this->output->set_status_header('401');
             echo isset($errorsArr[0]) ? $errorsArr[0] : '';
         }
     }
 }
function inquiry_controls()
{
    global $Ajax;
    $dim = get_company_pref('use_dimension');
    start_table(TABLESTYLE_NOBORDER);
    $date = today();
    if (!isset($_POST['TransFromDate'])) {
        $_POST['TransFromDate'] = begin_month($date);
    }
    if (!isset($_POST['TransToDate'])) {
        $_POST['TransToDate'] = end_month($date);
    }
    date_cells(_("From:"), 'TransFromDate');
    date_cells(_("To:"), 'TransToDate');
    type_list_cells(_("Category: "), 'typeId', null, true);
    $r = set();
    account_list_cells(_(""), 'accountId', $r);
    submit_cells('submit_submit', _("Generate Report"), true, '', 'default');
    //submit_cells('RefreshInquiry', _("Search"),'',_('Refresh Inquiry'), 'default');
    end_table();
}
Example #17
0
 function calcul_next_exec($num_planificateur)
 {
     global $dbh;
     $sql = "SELECT id_planificateur, num_type_tache, libelle_tache, perio_heure, perio_minute, perio_jour_mois, perio_jour, perio_mois \n\t\t\t\tFROM planificateur WHERE id_planificateur=" . $num_planificateur;
     $res = mysql_query($sql, $dbh);
     if ($res) {
         while ($obj_sql = mysql_fetch_object($res)) {
             //renseignements Jour J
             $date_du_jour = getdate();
             //utile pour le calcul de l'heure et de la minute
             $date_today = $date_du_jour["year"] . "-" . $date_du_jour["mon"] . "-" . $date_du_jour["mday"];
             //renvoit 1 si année bissextile, 0 sinon
             $annee_bissextile = date('L', today());
             //Valeurs bdd
             $jour_mois_bdd = explode(',', $obj_sql->perio_jour_mois);
             $jour_semaine_bdd = explode(',', $obj_sql->perio_jour);
             $mois_bdd = explode(',', $obj_sql->perio_mois);
             $heure_bdd = $obj_sql->perio_heure;
             $minute_bdd = $obj_sql->perio_minute;
             $this->calcul_date($jour_semaine_bdd, $jour_mois_bdd, $mois_bdd);
             //calcul de la minute
             $this->calcul_minute_exec($minute_bdd, $date_today, $date_du_jour, $jour_semaine_bdd, $mois_bdd, $jour_mois_bdd);
             //calcul de l'heure
             $this->calcul_heure_exec($heure_bdd, $date_today, $date_du_jour, $jour_semaine_bdd, $mois_bdd, $jour_mois_bdd);
             //la date calculée est identique à la date du jour
             if ($date_du_jour["year"] == $this->new_date["ANNEE"] && $date_du_jour["mon"] == $this->new_date["MOIS"] && $date_du_jour["mday"] == $this->new_date["JOUR"]) {
                 //formatage de l'heure calculée
                 $this->new_date["HEURE"] = strlen($this->new_date["HEURE"]) == "1" ? "0" . $this->new_date["HEURE"] : $this->new_date["HEURE"];
                 $this->new_date["MINUTE"] = strlen($this->new_date["MINUTE"]) == "1" ? "0" . $this->new_date["MINUTE"] : $this->new_date["MINUTE"];
                 if ($this->new_date["HEURE"] == $date_du_jour["hours"] && $this->new_date["MINUTE"] == $date_du_jour["minutes"]) {
                     $this->recalcule_date($jour_semaine_bdd, $mois_bdd, $jour_mois_bdd);
                 }
             }
             //formatage de l'heure calculée
             $this->new_date["HEURE"] = strlen($this->new_date["HEURE"]) == "1" ? "0" . $this->new_date["HEURE"] : $this->new_date["HEURE"];
             $this->new_date["MINUTE"] = strlen($this->new_date["MINUTE"]) == "1" ? "0" . $this->new_date["MINUTE"] : $this->new_date["MINUTE"];
         }
     }
 }
Example #18
0
 public function index()
 {
     $myID = getUserID();
     $myEmail = getUserEmail();
     $pID = (int) $this->input->get('id');
     $visitorType = visitor_type($pID, $myID);
     $query = $this->mdb->project_get($pID);
     if ($query->num_rows()) {
         $row = $query->row();
         switch ($visitorType) {
             case 'guest':
                 $is_accepted = 1;
                 $projSett = $this->mdb->projSettings_get($row->id);
                 if ($projSett->num_rows()) {
                     $projSettRow = $projSett->row();
                     $is_accepted = (int) $projSettRow->project_approval ? 0 : 1;
                 }
                 $this->mdb->project_member_add(array('project_id' => $row->id, 'user_id' => $myID, 'email_address' => $myEmail, 'joined_by' => 0, 'date_joined' => today(), 'last_visit' => NULL, 'is_accepted' => $is_accepted, 'project_role' => $this->siteinfo->config('project_roles_default')));
                 generate_json(array('status' => 1));
                 break;
             case 'invited':
                 $this->mdb->project_member_update(array('project_id' => $row->id, 'user_id' => $myID), array('is_accepted' => 1));
                 projectLogs_add('member_new', $pID, array('user_id' => $myID, 'user_name' => $this->session->userdata('display_name')));
                 generate_json(array('status' => 1));
                 break;
             case 'member':
                 generate_json(array('status' => 0, 'message' => 'You are already a member of this project.'));
                 break;
             case 'requesting':
                 generate_json(array('status' => 1));
                 break;
             default:
                 generate_json(array('status' => 1, 'message' => 'Unknown Error.'));
         }
     } else {
         generate_json(array('status' => 0, 'message' => 'Project does not exists.'));
     }
 }
Example #19
0
 function attribuer()
 {
     global $chk, $iduser, $dbh;
     for ($i = 0; $i < count($chk); $i++) {
         $req = "insert into demandes_users set num_user={$iduser}, num_demande={$chk[$i]}, date_creation='" . today() . "', users_statut=1";
         mysql_query($req, $dbh);
     }
 }
function show_form_sug($update_action)
{
    global $dbh, $msg, $charset;
    global $id_bibli, $id_sug;
    global $sug_map;
    global $sug_modif_form;
    global $acquisition_poids_sugg, $lk_url_sug;
    global $acquisition_sugg_categ, $acquisition_sugg_categ_default;
    global $orig_form_mod;
    global $orig_champ_modif;
    global $id_notice;
    global $acquisition_sugg_localises;
    global $deflt_docs_location;
    global $sugg_location_id;
    global $javascript_path;
    $form = $sug_modif_form;
    //Récupération des pondérations de suggestions
    $tab_poids = explode(",", $acquisition_poids_sugg);
    $tab_poids[0] = substr($tab_poids[0], 2);
    //utilisateur
    $tab_poids[1] = substr($tab_poids[1], 2);
    //abonné
    $tab_poids[2] = substr($tab_poids[2], 2);
    //visiteur
    if (!$id_sug) {
        //Création de suggestion
        $titre = htmlentities($msg['acquisition_sug_cre'], ENT_QUOTES, $charset);
        //Récupération de l'utilisateur
        $requete_user = "******" . SESSlogin . "' limit 1 ";
        $res_user = pmb_mysql_query($requete_user, $dbh);
        $row_user = pmb_mysql_fetch_row($res_user);
        $orig = $row_user[0];
        $lib_orig = $row_user[1];
        if ($row_user[2]) {
            $lib_orig .= $row_user[2] . ", " . $row_user[1];
        }
        $form = str_replace('!!lib_orig!!', $orig_form_mod, $form);
        $form = str_replace('!!dat_cre!!', formatdate(today()), $form);
        $form = str_replace('!!orig!!', $orig, $form);
        $form = str_replace('!!lib_orig!!', htmlentities($lib_orig, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!typ!!', '0', $form);
        $form = str_replace('!!poi!!', $tab_poids[0], $form);
        $form = str_replace('!!poi_tot!!', $tab_poids[0], $form);
        $statut = $sug_map->getFirstStateId();
        $form = str_replace('!!statut!!', $statut, $form);
        $form = str_replace('!!lib_statut!!', $sug_map->getHtmlComment($statut), $form);
        $form = str_replace('!!list_user!!', '', $form);
        $form = str_replace('!!creator_ajout!!', '', $form);
        $form = str_replace('!!lien!!', '', $form);
        if ($acquisition_sugg_categ != '1') {
            $sel_categ = "";
        } else {
            if (suggestions_categ::exists($acquisition_sugg_categ_default)) {
                $sugg_categ = new suggestions_categ($acquisition_sugg_categ_default);
            } else {
                $sugg_categ = new suggestions_categ('1');
            }
            $tab_categ = suggestions_categ::getCategList();
            $sel_categ = "<select class='saisie-25em' id='num_categ' name='num_categ'>";
            foreach ($tab_categ as $id_categ => $lib_categ) {
                $sel_categ .= "<option value='" . $id_categ . "' ";
                if ($id_categ == $sugg_categ->id_categ) {
                    $sel_categ .= "selected='selected' ";
                }
                $sel_categ .= ">";
                $sel_categ .= htmlentities($lib_categ, ENT_QUOTES, $charset) . "</option>";
            }
            $sel_categ .= "</select>";
        }
        $form = str_replace('!!nombre_expl!!', '1', $form);
        $list_locs = '';
        if ($acquisition_sugg_localises) {
            $sugg_location_id = (string) $sugg_location_id == "" ? $deflt_docs_location : $sugg_location_id;
            if ($sugg_location_id) {
                $temp_location = $sugg_location_id;
            } else {
                $temp_location = 0;
            }
            $locs = new docs_location();
            $list_locs = $locs->gen_combo_box_sugg($temp_location, 1, "");
        }
        $form = str_replace('<!-- sel_location -->', $list_locs, $form);
        // si suggestion concernant une notice avec 	$id_notice en parametre, on pre-rempli les champs
        if ($id_notice) {
            $notice = new notice($id_notice);
            $tit = htmlentities($notice->tit1, ENT_QUOTES, $charset);
            $edi = htmlentities($notice->ed1, ENT_QUOTES, $charset);
            $prix = $notice->prix;
            $cod = $notice->code;
            $url_sug = $notice->lien;
            $as = array_search("0", $notice->responsabilites["responsabilites"]);
            if ($as !== FALSE && $as !== NULL) {
                $auteur_0 = $notice->responsabilites["auteurs"][$as];
                $auteur = new auteur($auteur_0["id"]);
            }
            $aut = htmlentities($auteur->display, ENT_QUOTES, $charset);
            $form = str_replace('!!id_notice!!', $id_notice, $form);
        } else {
            $form = str_replace('!!id_notice!!', 0, $form);
        }
        $form = str_replace('!!categ!!', $sel_categ, $form);
        $form = str_replace('!!tit!!', $tit, $form);
        $form = str_replace('!!edi!!', $edi, $form);
        $form = str_replace('!!aut!!', $aut, $form);
        $form = str_replace('!!cod!!', $cod, $form);
        $form = str_replace('!!pri!!', $prix, $form);
        $form = str_replace('!!com!!', '', $form);
        $form = str_replace('!!com_gestion!!', '', $form);
        $form = str_replace('!!url_sug!!', $url_sug, $form);
        //Affichage du selecteur de source
        $req = "select * from suggestions_source order by libelle_source";
        $res = pmb_mysql_query($req, $dbh);
        $option = "<option value='0' selected>" . htmlentities($msg['acquisition_sugg_no_src'], ENT_QUOTES, $charset) . "</option>";
        while ($src = pmb_mysql_fetch_object($res)) {
            $option .= "<option value='" . $src->id_source . "' {$selected} >" . htmlentities($src->libelle_source, ENT_QUOTES, $charset) . "</option>";
            $selected = "";
        }
        $selecteur = "<select id='sug_src' name='sug_src'>" . $option . "</select>";
        $form = str_replace('!!liste_source!!', $selecteur, $form);
        $form = str_replace('!!date_publi!!', '', $form);
        $pj = "<div class='row'>\n\t\t\t\t\t<input type='file' id='piece_jointe_sug' name='piece_jointe_sug' class='saisie-80em' size='60' />\n\t\t\t  </div>";
        $form = str_replace('!!div_pj!!', $pj, $form);
    } else {
        //Modification de suggestion
        $titre = htmlentities($msg['acquisition_sug_mod'], ENT_QUOTES, $charset);
        $sug = new suggestions($id_sug);
        $q = suggestions_origine::listOccurences($id_sug);
        $list_orig = pmb_mysql_query($q, $dbh);
        $orig = 0;
        $poids_tot = 0;
        $users = array();
        while ($row_orig = pmb_mysql_fetch_object($list_orig)) {
            if (!$orig) {
                $orig = $row_orig->origine;
                $typ = $row_orig->type_origine;
                $poids = $tab_poids[$row_orig->type_origine];
            }
            array_push($users, $row_orig);
            $poids_tot = $poids_tot + $tab_poids[$row_orig->type_origine];
        }
        //On parcourt tous les créateurs de suggestions
        for ($i = 0; $i < sizeof($users); $i++) {
            $orig = $users[$i]->origine;
            $typ = $users[$i]->type_origine;
            //Récupération du nom du créateur de la suggestion
            switch ($typ) {
                default:
                case '0':
                    $requete_user = "******" . $orig . "'";
                    $res_user = pmb_mysql_query($requete_user, $dbh);
                    $row_user = pmb_mysql_fetch_row($res_user);
                    $lib_orig = $row_user[1];
                    if ($row_user[2]) {
                        $lib_orig .= ", " . $row_user[2];
                    }
                    if (empty($premier_user) || !isset($premier_user)) {
                        $premier_user = $lib_orig;
                    } else {
                        $list_user .= $lib_orig . "<br />";
                    }
                    break;
                case '1':
                    $requete_empr = "SELECT id_empr, empr_nom, empr_prenom FROM empr where id_empr = '" . $orig . "'";
                    $res_empr = pmb_mysql_query($requete_empr, $dbh);
                    $row_empr = pmb_mysql_fetch_row($res_empr);
                    $lib_orig = $row_empr[1];
                    if ($row_empr[2]) {
                        $lib_orig .= ", " . $row_empr[2];
                    }
                    if (empty($premier_user) || !isset($premier_user)) {
                        $premier_user = $lib_orig;
                    } else {
                        $list_user .= $lib_orig . "<br />";
                    }
                    break;
                case '2':
                    if ($orig) {
                        $lib_orig = $orig;
                    } else {
                        $lib_orig = $msg['suggest_anonyme'];
                    }
                    if (empty($premier_user) || !isset($premier_user)) {
                        $premier_user = $lib_orig;
                    } else {
                        $list_user .= $lib_orig . "<br />";
                    }
                    break;
            }
        }
        //Récupération du statut de la suggestion
        $lib_statut = $sug_map->getHtmlComment($sug->statut);
        $form = str_replace('!!dat_cre!!', formatdate($sug->date_creation), $form);
        $form = str_replace('!!orig!!', $orig, $form);
        //Ajout du champ de saisie du nouveau créateur
        $ajout_create = "<input id='creator_orig_id' type='hidden' name='creator_orig_id'>\n\t\t<input type='text' id='creator_lib_orig' name='creator_lib_orig' class='saisie-10emr'/>\n\t\t<input type='button' class='bouton_small' value='...' onclick=\"openPopUp('./select.php?what=origine&caller=sug_modif_form&param1=creator_orig_id&param2=creator_lib_orig&param3=typ&param4=&param5=&param6=&deb_rech=', 'select_creator_orig', 400, 400, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" />";
        if (sizeof($users) > 1) {
            //on ajoute le champ à la liste
            $list_user .= $ajout_create;
            $form = str_replace('!!creator_ajout!!', '', $form);
        } else {
            $form = str_replace('!!creator_ajout!!', "<br />" . $ajout_create, $form);
        }
        //Menu dépliant
        $deroul_user = gen_plus('ori', $msg['suggest_creator'] . " (" . (sizeof($users) - 1) . ")", $list_user, 0);
        if ($lib_orig) {
            $form = str_replace('!!lib_orig!!', htmlentities($premier_user, ENT_QUOTES, $charset), $form);
            if (sizeof($users) > 1) {
                $form = str_replace('!!list_user!!', $deroul_user, $form);
            } else {
                $form = str_replace('!!list_user!!', '', $form);
            }
        } else {
            $form = str_replace('!!lib_orig!!', '&nbsp;', $form);
            $form = str_replace('!!list_user!!', '', $form);
        }
        $form = str_replace('!!typ!!', $typ, $form);
        $form = str_replace('!!poi!!', $poids, $form);
        $form = str_replace('!!poi_tot!!', $poids_tot, $form);
        $form = str_replace('!!statut!!', $sug->statut, $form);
        $form = str_replace('!!lib_statut!!', $lib_statut, $form);
        if ($acquisition_sugg_categ != '1') {
            $sel_categ = "";
        } else {
            $state_name = $sug_map->getStateNameFromId($sug->statut);
            $categ = $sug_map->getState_CATEG($state_name);
            $sugg_categ = new suggestions_categ($sug->num_categ);
            if ($categ == 'YES') {
                $tab_categ = suggestions_categ::getCategList();
                $sel_categ = "<select class='saisie-25em' id='num_categ' name='num_categ'>";
                foreach ($tab_categ as $id_categ => $lib_categ) {
                    $sel_categ .= "<option value='" . $id_categ . "' ";
                    if ($id_categ == $sug->num_categ) {
                        $sel_categ .= "selected='selected' ";
                    }
                    $sel_categ .= ">";
                    $sel_categ .= htmlentities($lib_categ, ENT_QUOTES, $charset) . "</option>";
                }
                $sel_categ .= "</select>";
            } else {
                $sel_categ = htmlentities($sugg_categ->libelle_categ, ENT_QUOTES, $charset);
            }
        }
        //Nombre d'exemplaire
        $form = str_replace('!!nombre_expl!!', $sug->nb, $form);
        //Selecteur de localisation
        $list_locs = '';
        if ($acquisition_sugg_localises) {
            $sugg_location_id = $sug->sugg_location;
            if ($sugg_location_id) {
                $temp_location = $sugg_location_id;
            } else {
                $temp_location = 0;
            }
            $locs = new docs_location();
            $list_locs = $locs->gen_combo_box_sugg($temp_location, 1, "");
        }
        $form = str_replace('<!-- sel_location -->', $list_locs, $form);
        if ($sug->num_notice && $sug->num_notice != 0) {
            $req_ana = "select analysis_bulletin as bull , analysis_notice as noti from analysis where analysis_notice ='" . $sug->num_notice . "'";
            $res_ana = pmb_mysql_query($req_ana, $dbh);
            $num_rows_ana = pmb_mysql_num_rows($res_ana);
            if ($num_rows_ana) {
                $ana = pmb_mysql_fetch_object($res_ana);
                $url_view = "catalog.php?categ=serials&sub=bulletinage&action=view&bul_id={$ana->bull}&art_to_show=" . $ana->noti;
            } else {
                $url_view = "./catalog.php?categ=isbd&id=" . $sug->num_notice;
            }
            $lien = "<a href='{$url_view}'> " . $msg['acquisition_sug_view_not'] . "</a>";
            $form = str_replace('!!lien!!', $lien, $form);
        } else {
            $form = str_replace('!!lien!!', '', $form);
        }
        $form = str_replace('!!categ!!', $sel_categ, $form);
        $form = str_replace('!!tit!!', htmlentities($sug->titre, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!edi!!', htmlentities($sug->editeur, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!aut!!', htmlentities($sug->auteur, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!cod!!', htmlentities($sug->code, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!pri!!', round($sug->prix, 2), $form);
        $form = str_replace('!!com!!', htmlentities($sug->commentaires, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!com_gestion!!', htmlentities($sug->commentaires_gestion, ENT_QUOTES, $charset), $form);
        $req = "select * from suggestions_source order by libelle_source";
        $res = pmb_mysql_query($req, $dbh);
        $selected = "";
        $option = "<option value='0' selected>" . htmlentities($msg['acquisition_sugg_no_src'], ENT_QUOTES, $charset) . "</option>";
        while ($src = pmb_mysql_fetch_object($res)) {
            $src->id_source == $sug->sugg_src ? $selected = " selected " : ($selected = "");
            $option .= "<option value='" . $src->id_source . "' {$selected}>" . htmlentities($src->libelle_source, ENT_QUOTES, $charset) . "</option>";
        }
        $selecteur = "<select id='sug_src' name='sug_src'>" . $option . "</select>";
        $form = str_replace('!!liste_source!!', $selecteur, $form);
        $form = str_replace("!!date_publi!!", htmlentities($sug->date_publi, ENT_QUOTES, $charset), $form);
        if (!$sug->get_explnum('id')) {
            $pj = "<div class='row'>\n\t\t\t\t\t<input type='file' id='piece_jointe_sug' name='piece_jointe_sug' class='saisie-80em' size='60' />\n\t\t\t  </div>";
        } else {
            $pj = "\n\t\t\t<input type='hidden' name='id_pj' id='id_pj' value='" . $sug->get_explnum('id') . "' />\n\t\t\t<div class='row'>" . $sug->get_explnum('nom') . "&nbsp;<input type='submit' class='bouton' name='del_pj' id='del_pj' value='X' onclick='this.form.action=\"./acquisition.php?categ=sug&action=del_pj&id_bibli=" . $id_bibli . "&id_sug=" . $id_sug . "\"' /> \n\t\t\t</div>";
        }
        $form = str_replace('!!div_pj!!', $pj, $form);
        if ($sug->url_suggestion) {
            $form = str_replace('<!-- url_sug -->', $lk_url_sug, $form);
        }
        $form = str_replace('!!url_sug!!', htmlentities($sug->url_suggestion, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!id_notice!!', $sug->num_notice, $form);
        // Affichage du bouton supprimer
        $bt_sup = $sug_map->getButton_DELETED($sug->statut, $id_bibli, $id_sug);
        $form = str_replace('<!-- bouton_sup -->', $bt_sup, $form);
        if ($sug->num_notice) {
            //Eventuellement, lien vers la notice
        } else {
            // Affichage du bouton cataloguer
            $bt_cat = $sug_map->getButton_CATALOG($sug->statut, $id_bibli, $id_sug);
            $button = "<input type='radio' name='catal_type' id='not_type' value='0' checked /><label class='etiquette' for='not_type'>" . htmlentities($msg['acquisition_type_mono'], ENT_QUOTES, $charset) . "</label>\n\t\t\t<input type='radio' name='catal_type' value='1' id='art_type'/><label for='art_type' class='etiquette'>" . htmlentities($msg['acquisition_type_art'], ENT_QUOTES, $charset) . "</label>";
            if ($sug->sugg_noti_unimarc) {
                $bt_cat = str_replace('!!type_catal!!', "&nbsp;<label style='color:red'>Notice externe existante</label>", $bt_cat);
            } else {
                $bt_cat = str_replace('!!type_catal!!', $button, $bt_cat);
            }
            $form = str_replace('<!-- bouton_cat -->', $bt_cat, $form);
        }
    }
    //$action ="./acquisition.php?categ=sug&action=update&id_bibli=".$id_bibli."&id_sug=".$id_sug;
    $form = str_replace('!!action!!', $update_action, $form);
    $form = str_replace('!!form_title!!', $titre, $form);
    print "<script type=\"text/javascript\" src=\"" . $javascript_path . "/tablist.js\"></script>";
    print $form;
}
Example #21
0
 function show_modif_form($reply = false)
 {
     global $form_modif_note, $msg, $charset, $demandes_include_note;
     $act_cancel = "document.location='./demandes.php?categ=action&act=see&idaction={$this->num_action}#fin'";
     $form_modif_note = str_replace('!!cancel_action!!', $act_cancel, $form_modif_note);
     $form_modif_note = str_replace('!!iduser!!', $this->notes_num_user, $form_modif_note);
     $form_modif_note = str_replace('!!typeuser!!', $this->notes_type_user, $form_modif_note);
     if ($this->id_note && !$reply) {
         $title = strlen($this->contenu) > 30 ? substr($this->contenu, 0, 30) . '...' : $this->contenu;
         $form_modif_note = str_replace('!!form_title!!', $msg['demandes_note_modif'] . ' : ' . $title, $form_modif_note);
         $form_modif_note = str_replace('!!contenu!!', htmlentities($this->contenu, ENT_QUOTES, $charset), $form_modif_note);
         if ($this->rapport) {
             $form_modif_note = str_replace('!!ck_rapport!!', 'checked', $form_modif_note);
         } else {
             $form_modif_note = str_replace('!!ck_rapport!!', '', $form_modif_note);
         }
         if ($this->prive) {
             $form_modif_note = str_replace('!!ck_prive!!', 'checked', $form_modif_note);
         } else {
             $form_modif_note = str_replace('!!ck_prive!!', '', $form_modif_note);
         }
         if ($this->notes_read_opac) {
             $form_modif_note = str_replace('!!ck_vue!!', '', $form_modif_note);
         } else {
             $form_modif_note = str_replace('!!ck_vue!!', 'checked', $form_modif_note);
         }
         $form_modif_note = str_replace('!!date_note_btn!!', formatdate($this->date_note), $form_modif_note);
         $form_modif_note = str_replace('!!date_note!!', $this->date_note, $form_modif_note);
         $form_modif_note = str_replace('!!idnote!!', $this->id_note, $form_modif_note);
         $form_modif_note = str_replace('!!idaction!!', $this->num_action, $form_modif_note);
         $btn_suppr = "<input type='submit' class='bouton' value='" . $msg[63] . "' id='suppr_note' name='suppr_note' onclick='this.form.act.value=\"suppr_note\";return confirm_delete();'";
     } elseif ($this->id_note && $reply) {
         $nots = new demandes_notes($this->id_note);
         $title = strlen($nots->contenu) > 30 ? substr($nots->contenu, 0, 30) . '...' : $nots->contenu;
         $form_modif_note = str_replace('!!form_title!!', $msg['demandes_note_reply'] . ' : ' . $title, $form_modif_note);
         $form_modif_note = str_replace('!!contenu!!', '', $form_modif_note);
         if ($demandes_include_note) {
             $form_modif_note = str_replace('!!ck_rapport!!', 'checked', $form_modif_note);
         } else {
             $form_modif_note = str_replace('!!ck_rapport!!', '', $form_modif_note);
         }
         $form_modif_note = str_replace('!!ck_prive!!', '', $form_modif_note);
         $date = formatdate(today());
         $date_note = date("Ymd", time());
         $form_modif_note = str_replace('!!date_note_btn!!', $date, $form_modif_note);
         $form_modif_note = str_replace('!!date_note!!', $date_note, $form_modif_note);
         $form_modif_note = str_replace('!!idnote!!', '', $form_modif_note);
         $form_modif_note = str_replace('!!idaction!!', $this->num_action, $form_modif_note);
     } else {
         $form_modif_note = str_replace('!!form_title!!', $msg['demandes_note_creation'], $form_modif_note);
         $form_modif_note = str_replace('!!ck_prive!!', '', $form_modif_note);
         if ($demandes_include_note) {
             $form_modif_note = str_replace('!!ck_rapport!!', 'checked', $form_modif_note);
         } else {
             $form_modif_note = str_replace('!!ck_rapport!!', '', $form_modif_note);
         }
         $form_modif_note = str_replace('!!contenu!!', '', $form_modif_note);
         $date = formatdate(today());
         $date_note = date("Ymd", time());
         $form_modif_note = str_replace('!!date_note_btn!!', $date, $form_modif_note);
         $form_modif_note = str_replace('!!date_note!!', $date_note, $form_modif_note);
         $form_modif_note = str_replace('!!idnote!!', '', $form_modif_note);
         $form_modif_note = str_replace('!!idaction!!', $this->num_action, $form_modif_note);
         $form_modif_note = str_replace('!!parent_text!!', '', $form_modif_note);
         $form_modif_note = str_replace('!!id_note_parent!!', '', $form_modif_note);
         $form_modif_note = str_replace('!!style!!', '', $form_modif_note);
     }
     $path = "<a href=./demandes.php?categ=gestion&act=see_dmde&iddemande={$this->num_demande}>" . htmlentities($this->libelle_demande, ENT_QUOTES, $charset) . "</a>";
     $path .= " > <a href=./demandes.php?categ=action&act=see&idaction={$this->num_action}>" . htmlentities($this->libelle_action, ENT_QUOTES, $charset) . "</a>";
     $form_modif_note = str_replace('!!path!!', $path, $form_modif_note);
     $form_modif_note = str_replace('!!btn_suppr!!', $btn_suppr, $form_modif_note);
     print $form_modif_note;
 }
Example #22
0
    die;
}
if (isset($_GET["all"])) {
    js();
    exit;
}
if (isset($_GET["tabs"])) {
    tabs();
    exit;
}
if (isset($_GET["hour"])) {
    hour();
    exit;
}
if (isset($_GET["today"])) {
    today();
    exit;
}
if (isset($_GET["week"])) {
    week();
    exit;
}
if (isset($_POST["LoadAvgClean"])) {
    LoadAvgClean();
    exit;
}
function js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body("{computer_load}");
         $expl_cb = $f_ex_cb;
     } else {
         // Verif si expl_id est celui poste
         if ($expl_id == $result[0]) {
             $expl_cb = $org_cb;
         } else {
             //Erreur: code barre deja existant
             error_message_history($msg[301], $msg[303], 1);
             exit;
         }
     }
 } else {
     $expl_cb = $f_ex_cb;
 }
 // on prepare la date de creation ou modification
 $expl_date = today();
 // on recupere les valeurs
 $formlocid = "f_ex_section" . $expl_location;
 $expl_section = ${$formlocid};
 if (!is_numeric($f_ex_nbparts) || !$f_ex_nbparts) {
     $f_ex_nbparts = 1;
 }
 $transfert_origine = "";
 if ($expl_id) {
     $rqt = "SELECT id_transfert FROM transferts, transferts_demande WHERE num_transfert=id_transfert and etat_transfert=0 AND num_expl='" . $expl_id . "' ";
     $res = pmb_mysql_query($rqt);
     if (!pmb_mysql_num_rows($res)) {
         // pas de transfert en cours, on met à jour transfert_location_origine
         $transfert_origine = ", transfert_location_origine='{$expl_location}', transfert_statut_origine='{$expl_statut}', transfert_section_origine='{$expl_section}' ";
     }
 } else {
Example #24
0
 function do_form()
 {
     global $serial_bul_form;
     global $msg;
     global $charset;
     global $pmb_type_audit, $select_categ_prop;
     global $thesaurus_concepts_active;
     global $pmb_notices_show_dates;
     //Notice
     global $ptab, $ptab_bul;
     global $fonction_auteur;
     global $include_path, $class_path;
     global $pmb_type_audit, $select_categ_prop;
     global $value_deflt_fonction;
     global $value_deflt_relation_bulletin;
     global $thesaurus_mode_pmb, $thesaurus_classement_mode_pmb;
     require_once "{$class_path}/author.class.php";
     $fonction = new marc_list('function');
     // mise à jour des flags de niveau hiérarchique
     //if ($this->serial_id) $serial_bul_form = str_replace('!!form_title!!', $msg[4004], $serial_bul_form);
     //	else $serial_bul_form = str_replace('!!form_title!!', $msg[4003], $serial_bul_form);
     $serial_bul_form = str_replace('!!b_level!!', $this->b_biblio_level, $serial_bul_form);
     $serial_bul_form = str_replace('!!h_level!!', $this->b_hierar_level, $serial_bul_form);
     $serial_bul_form = str_replace('!!id!!', $this->bull_num_notice, $serial_bul_form);
     // mise à jour de l'onglet 0
     //$ptab[0] = str_replace('!!tit1!!',	htmlentities($this->tit1,ENT_QUOTES, $charset)	, $ptab[0]);
     $ptab_bul[0] = str_replace('!!tit3!!', htmlentities($this->b_tit3, ENT_QUOTES, $charset), $ptab_bul[0]);
     $ptab_bul[0] = str_replace('!!tit4!!', htmlentities($this->b_tit4, ENT_QUOTES, $charset), $ptab_bul[0]);
     $serial_bul_form = str_replace('!!tab0!!', $ptab_bul[0], $serial_bul_form);
     // initialisation avec les paramètres du user :
     if (!$this->b_langues) {
         global $value_deflt_lang;
         if ($value_deflt_lang) {
             $lang = new marc_list('lang');
             $this->b_langues[] = array('lang_code' => $value_deflt_lang, 'langue' => $lang->table[$value_deflt_lang]);
         }
     }
     if (!$this->b_statut) {
         $this->b_statut = $this->statut;
     }
     if (!$this->b_typdoc) {
         global $xmlta_doctype_bulletin;
         if ($xmlta_doctype_bulletin) {
             $this->b_typdoc = $xmlta_doctype_bulletin;
         } else {
             global $xmlta_doctype_serial;
             $this->b_typdoc = $xmlta_doctype_serial;
         }
     }
     // ajout des selecteurs
     $select_doc = new marc_select('doctype', 'typdoc', $this->b_typdoc, "get_pos(); initIt(); ajax_parse_dom();");
     $serial_bul_form = str_replace('!!doc_type!!', $select_doc->display, $serial_bul_form);
     // Ajout des localisations pour édition
     $select_loc = "";
     global $PMBuserid, $pmb_form_editables;
     if ($PMBuserid == 1 && $pmb_form_editables == 1) {
         $req_loc = "select idlocation,location_libelle from docs_location";
         $res_loc = pmb_mysql_query($req_loc);
         if (pmb_mysql_num_rows($res_loc) > 1) {
             $select_loc = "<select name='grille_location' id='grille_location' style='display:none' onChange=\"get_pos();initIt(); if (inedit) move_parse_dom(relative);\">\n";
             $select_loc .= "<option value='0'>" . $msg['notice_grille_all_location'] . "</option>\n";
             while ($r = pmb_mysql_fetch_object($res_loc)) {
                 $select_loc .= "<option value='" . $r->idlocation . "'>" . $r->location_libelle . "</option>\n";
             }
             $select_loc .= "</select>\n";
         }
     }
     $serial_bul_form = str_replace("!!location!!", $select_loc, $serial_bul_form);
     // mise à jour de l'onglet 1
     // constitution de la mention de responsabilité
     //$this->responsabilites
     $as = array_search("0", $this->b_responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $this->b_responsabilites["auteurs"][$as];
         $auteur = new auteur($auteur_0["id"]);
     }
     if ($value_deflt_fonction && $auteur_0["id"] == 0) {
         $auteur_0["fonction"] = $value_deflt_fonction;
     }
     $ptab[1] = str_replace('!!aut0_id!!', $auteur_0["id"], $ptab[1]);
     $ptab[1] = str_replace('!!aut0!!', htmlentities($auteur->display, ENT_QUOTES, $charset), $ptab[1]);
     $ptab[1] = str_replace('!!f0_code!!', $auteur_0["fonction"], $ptab[1]);
     $ptab[1] = str_replace('!!f0!!', $fonction->table[$auteur_0["fonction"]], $ptab[1]);
     $as = array_keys($this->b_responsabilites["responsabilites"], "1");
     $max_aut1 = count($as);
     if ($max_aut1 == 0) {
         $max_aut1 = 1;
     }
     for ($i = 0; $i < $max_aut1; $i++) {
         $indice = $as[$i];
         $auteur_1 = $this->b_responsabilites["auteurs"][$indice];
         $auteur = new auteur($auteur_1["id"]);
         if ($value_deflt_fonction && $auteur_1["id"] == 0 && $i == 0) {
             $auteur_1["fonction"] = $value_deflt_fonction;
         }
         $ptab_aut_autres = str_replace('!!iaut!!', $i, $ptab[11]);
         $ptab_aut_autres = str_replace('!!aut1_id!!', $auteur_1["id"], $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!aut1!!', htmlentities($auteur->display, ENT_QUOTES, $charset), $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!f1_code!!', $auteur_1["fonction"], $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!f1!!', $fonction->table[$auteur_1["fonction"]], $ptab_aut_autres);
         $autres_auteurs .= $ptab_aut_autres;
     }
     $ptab[1] = str_replace('!!max_aut1!!', $max_aut1, $ptab[1]);
     $as = array_keys($this->b_responsabilites["responsabilites"], "2");
     $max_aut2 = count($as);
     if ($max_aut2 == 0) {
         $max_aut2 = 1;
     }
     for ($i = 0; $i < $max_aut2; $i++) {
         $indice = $as[$i];
         $auteur_2 = $this->b_responsabilites["auteurs"][$indice];
         $auteur = new auteur($auteur_2["id"]);
         if ($value_deflt_fonction && $auteur_2["id"] == 0 && $i == 0) {
             $auteur_2["fonction"] = $value_deflt_fonction;
         }
         $ptab_aut_autres = str_replace('!!iaut!!', $i, $ptab[12]);
         $ptab_aut_autres = str_replace('!!aut2_id!!', $auteur_2["id"], $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!aut2!!', htmlentities($auteur->display, ENT_QUOTES, $charset), $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!f2_code!!', $auteur_2["fonction"], $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!f2!!', $fonction->table[$auteur_2["fonction"]], $ptab_aut_autres);
         $auteurs_secondaires .= $ptab_aut_autres;
     }
     $ptab[1] = str_replace('!!max_aut2!!', $max_aut2, $ptab[1]);
     $ptab[1] = str_replace('!!autres_auteurs!!', $autres_auteurs, $ptab[1]);
     $ptab[1] = str_replace('!!auteurs_secondaires!!', $auteurs_secondaires, $ptab[1]);
     $serial_bul_form = str_replace('!!tab1!!', $ptab[1], $serial_bul_form);
     // mise à jour de l'onglet 2
     /*$ptab[2] = str_replace('!!ed1_id!!',	$this->ed1_id	, $ptab[2]);
     		$ptab[2] = str_replace('!!ed1!!',		htmlentities($this->ed1,ENT_QUOTES, $charset)	, $ptab[2]);
     		$ptab[2] = str_replace('!!ed2_id!!',	$this->ed2_id	, $ptab[2]);
     		$ptab[2] = str_replace('!!ed2!!',		htmlentities($this->ed2,ENT_QUOTES, $charset)	, $ptab[2]);
     		
     		$serial_bul_form = str_replace('!!tab2!!', $ptab[2], $serial_bul_form);*/
     // mise à jour de l'onglet 30 (code)
     $ptab[30] = str_replace('!!cb!!', htmlentities($this->b_code, ENT_QUOTES, $charset), $ptab[30]);
     $serial_bul_form = str_replace('!!tab30!!', $ptab[30], $serial_bul_form);
     // mise à jour de l'onglet 3 (notes)
     $ptab[3] = str_replace('!!n_gen!!', htmlentities($this->b_n_gen, ENT_QUOTES, $charset), $ptab[3]);
     $ptab[3] = str_replace('!!n_contenu!!', htmlentities($this->b_n_contenu, ENT_QUOTES, $charset), $ptab[3]);
     $ptab[3] = str_replace('!!n_resume!!', htmlentities($this->b_n_resume, ENT_QUOTES, $charset), $ptab[3]);
     $serial_bul_form = str_replace('!!tab3!!', $ptab[3], $serial_bul_form);
     // mise à jour de l'onglet 4
     // catégories
     if (sizeof($this->b_categories) == 0) {
         $max_categ = 1;
     } else {
         $max_categ = sizeof($this->b_categories);
     }
     $tab_categ_order = "";
     for ($i = 0; $i < $max_categ; $i++) {
         $categ_id = $this->b_categories[$i]["categ_id"];
         $categ = new category($categ_id);
         if ($i == 0) {
             $ptab_categ = str_replace('!!icateg!!', $i, $ptab[40]);
         } else {
             $ptab_categ = str_replace('!!icateg!!', $i, $ptab[401]);
         }
         if ($thesaurus_mode_pmb && $categ->id) {
             $nom_thesaurus = '[' . $categ->thes->getLibelle() . '] ';
         } else {
             $nom_thesaurus = '';
         }
         $ptab_categ = str_replace('!!categ_id!!', $categ_id, $ptab_categ);
         $ptab_categ = str_replace('!!categ_libelle!!', htmlentities($nom_thesaurus . $categ->catalog_form, ENT_QUOTES, $charset), $ptab_categ);
         $categ_repetables .= $ptab_categ;
         if (sizeof($this->b_categories) > 0) {
             if ($tab_categ_order != "") {
                 $tab_categ_order .= ",";
             }
             $tab_categ_order .= $i;
         }
     }
     $ptab[4] = str_replace('!!max_categ!!', $max_categ, $ptab[4]);
     $ptab[4] = str_replace('!!categories_repetables!!', $categ_repetables, $ptab[4]);
     $ptab[4] = str_replace('!!tab_categ_order!!', $tab_categ_order, $ptab[4]);
     // Concepts
     if ($thesaurus_concepts_active == 1) {
         $index_concept = new index_concept($this->bull_num_notice, TYPE_NOTICE);
         $ptab[4] = str_replace('!!concept_form!!', $index_concept->get_form('notice'), $ptab[4]);
     } else {
         $ptab[4] = str_replace('!!concept_form!!', "", $ptab[4]);
     }
     // indexation interne
     $ptab[4] = str_replace('!!indexint_id!!', $this->b_indexint, $ptab[4]);
     $ptab[4] = str_replace('!!indexint!!', htmlentities($this->b_indexint_lib, ENT_QUOTES, $charset), $ptab[4]);
     if ($this->indexint) {
         $indexint = new indexint($this->indexint);
         if ($indexint->comment) {
             $disp_indexint = $indexint->name . " - " . $indexint->comment;
         } else {
             $disp_indexint = $indexint->name;
         }
         if ($thesaurus_classement_mode_pmb) {
             // plusieurs classements/indexations décimales autorisés en parametrage
             if ($indexint->name_pclass) {
                 $disp_indexint = "[" . $indexint->name_pclass . "] " . $disp_indexint;
             }
         }
         $ptab[4] = str_replace('!!indexint!!', htmlentities($disp_indexint, ENT_QUOTES, $charset), $ptab[4]);
         $ptab[4] = str_replace('!!num_pclass!!', $indexint->id_pclass, $ptab[4]);
     } else {
         $ptab[4] = str_replace('!!indexint!!', '', $ptab[4]);
         $ptab[4] = str_replace('!!num_pclass!!', '', $ptab[4]);
     }
     // indexation libre
     $ptab[4] = str_replace('!!f_indexation!!', htmlentities($this->b_index_l, ENT_QUOTES, $charset), $ptab[4]);
     global $pmb_keyword_sep;
     $sep = "'{$pmb_keyword_sep}'";
     if (!$pmb_keyword_sep) {
         $sep = "' '";
     }
     if (ord($pmb_keyword_sep) == 0xa || ord($pmb_keyword_sep) == 0xd) {
         $sep = $msg['catalogue_saut_de_ligne'];
     }
     $ptab[4] = str_replace("!!sep!!", htmlentities($sep, ENT_QUOTES, $charset), $ptab[4]);
     $serial_bul_form = str_replace('!!tab4!!', $ptab[4], $serial_bul_form);
     // Collation
     $ptab[41] = str_replace("!!npages!!", htmlentities($this->b_npages, ENT_QUOTES, $charset), $ptab[41]);
     $ptab[41] = str_replace("!!ill!!", htmlentities($this->b_ill, ENT_QUOTES, $charset), $ptab[41]);
     $ptab[41] = str_replace("!!size!!", htmlentities($this->b_size, ENT_QUOTES, $charset), $ptab[41]);
     $ptab[41] = str_replace("!!accomp!!", htmlentities($this->b_accomp, ENT_QUOTES, $charset), $ptab[41]);
     $ptab[41] = str_replace("!!prix!!", htmlentities($this->b_prix, ENT_QUOTES, $charset), $ptab[41]);
     $serial_bul_form = str_replace('!!tab41!!', $ptab[41], $serial_bul_form);
     // mise à jour de l'onglet 5 : langues
     // langues répétables
     if (sizeof($this->b_langues) == 0) {
         $max_lang = 1;
     } else {
         $max_lang = sizeof($this->b_langues);
     }
     for ($i = 0; $i < $max_lang; $i++) {
         if ($i) {
             $ptab_lang = str_replace('!!ilang!!', $i, $ptab[501]);
         } else {
             $ptab_lang = str_replace('!!ilang!!', $i, $ptab[50]);
         }
         if (sizeof($this->b_langues) == 0) {
             $ptab_lang = str_replace('!!lang_code!!', '', $ptab_lang);
             $ptab_lang = str_replace('!!lang!!', '', $ptab_lang);
         } else {
             $ptab_lang = str_replace('!!lang_code!!', $this->b_langues[$i]["lang_code"], $ptab_lang);
             $ptab_lang = str_replace('!!lang!!', htmlentities($this->b_langues[$i]["langue"], ENT_QUOTES, $charset), $ptab_lang);
         }
         $lang_repetables .= $ptab_lang;
     }
     $ptab[5] = str_replace('!!max_lang!!', $max_lang, $ptab[5]);
     $ptab[5] = str_replace('!!langues_repetables!!', $lang_repetables, $ptab[5]);
     // langues originales répétables
     if (sizeof($this->b_languesorg) == 0) {
         $max_langorg = 1;
     } else {
         $max_langorg = sizeof($this->b_languesorg);
     }
     for ($i = 0; $i < $max_langorg; $i++) {
         if ($i) {
             $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[511]);
         } else {
             $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[51]);
         }
         if (sizeof($this->b_languesorg) == 0) {
             $ptab_lang = str_replace('!!langorg_code!!', '', $ptab_lang);
             $ptab_lang = str_replace('!!langorg!!', '', $ptab_lang);
         } else {
             $ptab_lang = str_replace('!!langorg_code!!', $this->b_languesorg[$i]["lang_code"], $ptab_lang);
             $ptab_lang = str_replace('!!langorg!!', htmlentities($this->b_languesorg[$i]["langue"], ENT_QUOTES, $charset), $ptab_lang);
         }
         $langorg_repetables .= $ptab_lang;
     }
     $ptab[5] = str_replace('!!max_langorg!!', $max_langorg, $ptab[5]);
     $ptab[5] = str_replace('!!languesorg_repetables!!', $langorg_repetables, $ptab[5]);
     $serial_bul_form = str_replace('!!tab5!!', $ptab[5], $serial_bul_form);
     // mise à jour de l'onglet 6
     global $pmb_curl_timeout;
     $ptab[6] = str_replace('!!lien!!', htmlentities($this->b_lien, ENT_QUOTES, $charset), $ptab[6]);
     $ptab[6] = str_replace('!!eformat!!', htmlentities($this->b_eformat, ENT_QUOTES, $charset), $ptab[6]);
     $ptab[6] = str_replace('!!pmb_curl_timeout!!', $pmb_curl_timeout, $ptab[6]);
     $serial_bul_form = str_replace('!!tab6!!', $ptab[6], $serial_bul_form);
     //Mise à jour de l'onglet 7
     $p_perso = new parametres_perso("notices");
     if (!$p_perso->no_special_fields) {
         $perso_ = $p_perso->show_editable_fields($this->bull_num_notice);
         $perso = "";
         for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
             $p = $perso_["FIELDS"][$i];
             $perso .= "<div id='move_" . $p["NAME"] . "' movable='yes' title=\"" . htmlentities($p["TITRE"], ENT_QUOTES, $charset) . "\">\n\t\t\t\t\t\t<div class='row'><label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . "</label></div>\n\t\t\t\t\t\t<div class='row'>" . $p["AFF"] . "</div>\n\t\t\t\t\t\t</div>";
         }
         $perso .= $perso_["CHECK_SCRIPTS"];
         $ptab[7] = str_replace("!!champs_perso!!", $perso, $ptab[7]);
     } else {
         $ptab[7] = "\n<script>function check_form() { return true; }</script>\n";
     }
     $serial_bul_form = str_replace('!!tab7!!', $ptab[7], $serial_bul_form);
     //Liens vers d'autres notices
     $string_relations = "";
     $n_rel = 0;
     foreach ($this->notice_link as $direction => $relations) {
         foreach ($relations as $relation) {
             //Selection du template
             if ($n_rel == 0) {
                 $pattern_rel = $ptab[130];
             } else {
                 $pattern_rel = $ptab[131];
             }
             //Construction du textbox
             $pattern_rel = str_replace("!!notice_relations_id!!", $relation['id_notice'], $pattern_rel);
             $pattern_rel = str_replace("!!notice_relations_libelle!!", htmlentities($relation['title_notice'], ENT_QUOTES, $charset), $pattern_rel);
             $pattern_rel = str_replace("!!notice_relations_rank!!", $relation['rank'], $pattern_rel);
             $pattern_rel = str_replace("!!n_rel!!", $n_rel, $pattern_rel);
             //Construction du combobox de type de lien
             $pattern_rel = str_replace("!!f_notice_type_relations_name!!", "f_rel_type_{$n_rel}", $pattern_rel);
             //Recuperation des types de relation
             $liste_type_relation_up = new marc_list("relationtypeup");
             $liste_type_relation_down = new marc_list("relationtypedown");
             $liste_type_relation_both = array();
             $corresp_relation_up_down = array();
             foreach ($liste_type_relation_up->table as $key_up => $val_up) {
                 foreach ($liste_type_relation_down->table as $key_down => $val_down) {
                     if ($val_up == $val_down) {
                         $liste_type_relation_both['down'][$key_down] = $val_down;
                         $liste_type_relation_both['up'][$key_up] = $val_up;
                         $corresp_relation_up_down[$key_up] = $key_down;
                         unset($liste_type_relation_down->table[$key_down]);
                         unset($liste_type_relation_up->table[$key_up]);
                     }
                 }
             }
             $opts = '';
             foreach ($liste_type_relation_up->table as $key => $val) {
                 if (preg_match('/^' . $key . '/', $relation['relation_type']) && $direction == 'up') {
                     $opts .= '<option  style="color:#000000" value="' . $key . '-up" selected="selected" >' . $val . '</option>';
                 } else {
                     $opts .= '<option  style="color:#000000" value="' . $key . '-up">' . $val . '</option>';
                 }
             }
             $pattern_rel = str_replace("!!f_notice_type_relations_up!!", $opts, $pattern_rel);
             $opts = '';
             foreach ($liste_type_relation_down->table as $key => $val) {
                 if (preg_match('/^' . $key . '/', $relation['relation_type']) && $direction == 'down') {
                     $opts .= '<option  style="color:#000000" value="' . $key . '-down" selected="selected" >' . $val . '</option>';
                 } else {
                     $opts .= '<option  style="color:#000000" value="' . $key . '-down">' . $val . '</option>';
                 }
             }
             $pattern_rel = str_replace("!!f_notice_type_relations_down!!", $opts, $pattern_rel);
             $opts = '';
             if (array_key_exists($relation['relation_type'], $liste_type_relation_both['up']) || array_key_exists($relation['relation_type'], $liste_type_relation_both['down'])) {
                 $opts .= '<option  style="color:#000000" value="' . $relation['relation_type'] . '-' . $direction . '" selected="selected" >' . $liste_type_relation_both[$direction][$relation['relation_type']] . '</option>';
                 if ($direction == "up") {
                     $notDirection = "down";
                 } else {
                     $notDirection = "up";
                     $corresp_relation_up_down = array_flip($corresp_relation_up_down);
                 }
                 $notRelationType = $corresp_relation_up_down[$relation['relation_type']];
                 unset($liste_type_relation_both[$direction][$relation['relation_type']]);
                 unset($liste_type_relation_both[$notDirection][$notRelationType]);
             }
             foreach ($liste_type_relation_both['down'] as $key => $val) {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down">' . $val . '</option>';
             }
             $pattern_rel = str_replace("!!f_notice_type_relations_both!!", $opts, $pattern_rel);
             $string_relations .= $pattern_rel;
             $n_rel++;
         }
     }
     if (!$n_rel) {
         $pattern_rel = $ptab[130];
         $pattern_rel = str_replace("!!notice_relations_id!!", "", $pattern_rel);
         $pattern_rel = str_replace("!!notice_relations_libelle!!", "", $pattern_rel);
         $pattern_rel = str_replace("!!notice_relations_rank!!", "0", $pattern_rel);
         $pattern_rel = str_replace("!!n_rel!!", $n_rel, $pattern_rel);
         $pattern_rel = str_replace("!!f_notice_type_relations_name!!", "f_rel_type_0", $pattern_rel);
         //Recuperation des types de relation
         $liste_type_relation_up = new marc_list("relationtypeup");
         $liste_type_relation_down = new marc_list("relationtypedown");
         $liste_type_relation_both = array();
         foreach ($liste_type_relation_up->table as $key_up => $val_up) {
             foreach ($liste_type_relation_down->table as $key_down => $val_down) {
                 if ($val_up == $val_down) {
                     $liste_type_relation_both[$key_down] = $val_down;
                     unset($liste_type_relation_down->table[$key_down]);
                     unset($liste_type_relation_up->table[$key_up]);
                 }
             }
         }
         $opts = '';
         foreach ($liste_type_relation_up->table as $key => $val) {
             if ($key . '-up' == $value_deflt_relation_bulletin) {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-up" selected="selected" >' . $val . '</option>';
             } else {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-up">' . $val . '</option>';
             }
         }
         $pattern_rel = str_replace("!!f_notice_type_relations_up!!", $opts, $pattern_rel);
         $opts = '';
         foreach ($liste_type_relation_down->table as $key => $val) {
             if ($key . '-down' == $value_deflt_relation_bulletin) {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down" selected="selected" >' . $val . '</option>';
             } else {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down">' . $val . '</option>';
             }
         }
         $pattern_rel = str_replace("!!f_notice_type_relations_down!!", $opts, $pattern_rel);
         $opts = '';
         foreach ($liste_type_relation_both as $key => $val) {
             if ($key . '-down' == $value_deflt_relation_bulletin) {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down" selected="selected" >' . $val . '</option>';
             } else {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down">' . $val . '</option>';
             }
         }
         $pattern_rel = str_replace("!!f_notice_type_relations_both!!", $opts, $pattern_rel);
         $string_relations .= $pattern_rel;
         $n_rel++;
     }
     //Type de relation par défaut
     $ptab[13] = str_replace("!!value_deflt_relation!!", $value_deflt_relation_bulletin, $ptab[13]);
     //Nombre de relations
     $ptab[13] = str_replace("!!max_rel!!", $n_rel, $ptab[13]);
     //Liens multiples
     $ptab[13] = str_replace("!!notice_relations!!", $string_relations, $ptab[13]);
     $serial_bul_form = str_replace('!!tab13!!', $ptab[13], $serial_bul_form);
     // champs de gestion
     $select_statut = gen_liste_multiple("select id_notice_statut, gestion_libelle from notice_statut order by 2", "id_notice_statut", "gestion_libelle", "id_notice_statut", "form_notice_statut", "", $this->b_statut, "", "", "", "", 0);
     $ptab[8] = str_replace('!!notice_statut!!', $select_statut, $ptab[8]);
     $ptab[8] = str_replace('!!commentaire_gestion!!', htmlentities($this->b_commentaire_gestion, ENT_QUOTES, $charset), $ptab[8]);
     $ptab[8] = str_replace('!!thumbnail_url!!', htmlentities($this->b_thumbnail_url, ENT_QUOTES, $charset), $ptab[8]);
     if ($this->b_is_new) {
         $ptab[8] = str_replace('!!checked_yes!!', "checked", $ptab[8]);
         $ptab[8] = str_replace('!!checked_no!!', "", $ptab[8]);
     } else {
         $ptab[8] = str_replace('!!checked_no!!', "checked", $ptab[8]);
         $ptab[8] = str_replace('!!checked_yes!!', "", $ptab[8]);
     }
     global $pmb_notice_img_folder_id;
     $message_folder = "";
     if ($pmb_notice_img_folder_id) {
         $req = "select repertoire_path from upload_repertoire where repertoire_id ='" . $pmb_notice_img_folder_id . "'";
         $res = pmb_mysql_query($req);
         if (pmb_mysql_num_rows($res)) {
             $rep = pmb_mysql_fetch_object($res);
             if (!is_dir($rep->repertoire_path)) {
                 $notice_img_folder_error = 1;
             }
         } else {
             $notice_img_folder_error = 1;
         }
         if ($notice_img_folder_error) {
             if (SESSrights & ADMINISTRATION_AUTH) {
                 $requete = "select * from parametres where gestion=0 and type_param='pmb' and sstype_param='notice_img_folder_id' ";
                 $res = pmb_mysql_query($requete);
                 $i = 0;
                 if ($param = pmb_mysql_fetch_object($res)) {
                     $message_folder = " <a class='erreur' href='./admin.php?categ=param&action=modif&id_param=" . $param->id_param . "' >" . $msg['notice_img_folder_admin_no_access'] . "</a> ";
                 }
             } else {
                 $message_folder = $msg['notice_img_folder_no_access'];
             }
         }
     }
     $ptab[8] = str_replace('!!message_folder!!', $message_folder, $ptab[8]);
     $display_opac_bulletinage = " style='display:none' ";
     $ptab[8] = str_replace('!!display_bulletinage!!', $display_opac_bulletinage, $ptab[8]);
     //dates de la notice de bulletin
     if ($this->bulletin_id && $this->bull_num_notice && $pmb_notices_show_dates) {
         $create_date = new DateTime($this->b_notice_create_date);
         $update_date = new DateTime($this->b_notice_update_date);
         $dates_notices = "<br>\n\t\t\t\t\t\t<label for='notice_date_crea' class='etiquette'>" . $msg["noti_crea_date"] . "</label>&nbsp;" . $create_date->format('d/m/Y H:i:s') . "\n\t\t\t    \t\t<br>\n\t\t\t    \t\t<label for='notice_date_mod' class='etiquette'>" . $msg["noti_mod_date"] . "</label>&nbsp;" . $update_date->format('d/m/Y H:i:s');
         $ptab[8] = str_replace('!!dates_notice!!', $dates_notices, $ptab[8]);
     } else {
         $ptab[8] = str_replace('!!dates_notice!!', "", $ptab[8]);
     }
     $serial_bul_form = str_replace('!!tab14!!', $ptab[14], $serial_bul_form);
     //affichage des formulaires des droits d'acces
     $rights_form = $this->get_rights_form();
     $ptab[8] = str_replace('<!-- rights_form -->', $rights_form, $ptab[8]);
     global $lang, $xmlta_indexation_lang;
     $user_lang = $this->bull_indexation_lang;
     if (!$user_lang) {
         $user_lang = $xmlta_indexation_lang;
     }
     $langues = new XMLlist("{$include_path}/messages/languages.xml");
     $langues->analyser();
     $clang = $langues->table;
     $combo = "<select name='indexation_lang' id='indexation_lang' class='saisie-20em' >";
     if (!$user_lang) {
         $combo .= "<option value='' selected>--</option>";
     } else {
         $combo .= "<option value='' >--</option>";
     }
     while (list($cle, $value) = each($clang)) {
         // arabe seulement si on est en utf-8
         if ($charset != 'utf-8' and $user_lang != 'ar' or $charset == 'utf-8') {
             if (strcmp($cle, $user_lang) != 0) {
                 $combo .= "<option value='{$cle}'>{$value} ({$cle})</option>";
             } else {
                 $combo .= "<option value='{$cle}' selected>{$value} ({$cle})</option>";
             }
         }
     }
     $combo .= "</select>";
     $ptab[8] = str_replace('!!indexation_lang!!', $combo, $ptab[8]);
     $serial_bul_form = str_replace('!!tab8!!', $ptab[8], $serial_bul_form);
     // autorité personnalisées
     $authperso = new authperso_notice($this->bull_num_notice);
     $authperso_tpl = $authperso->get_form();
     $serial_bul_form = str_replace('!!authperso!!', $authperso_tpl, $serial_bul_form);
     /*if($this->serial_id) {
     			$link_annul = "./catalog.php?categ=serials&sub=view&serial_id=".$this->serial_id;
     			if ($pmb_type_audit) $link_audit =  "<input class='bouton' type='button' onClick=\"window.open('./audit.php?type_obj=1&object_id=$this->serial_id', 'audit_popup', '$select_categ_prop')\" title='$msg[audit_button]' value='$msg[audit_button]' />";
     				else $link_audit = "" ;
     		} else {
     			$link_annul = "./catalog.php?categ=serials";
     			$link_audit = "" ;
     		}*/
     //Bulletin
     if ($this->bulletin_id) {
         $link_annul = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!bul_id!!';
         $serial_bul_form = str_replace('!!form_title!!', $msg[4006], $serial_bul_form);
         $date_date_formatee = formatdate_input($this->date_date);
         if ($pmb_type_audit) {
             $link_audit = "<input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=3&object_id={$this->bulletin_id}', 'audit_popup', 700, 500, -2, -2, '{$select_categ_prop}')\" title='{$msg['audit_button']}' value='{$msg['audit_button']}' />";
         } else {
             $link_audit = "";
         }
         $link_duplicate = "<input type='button' class='bouton' value='{$msg['bulletin_duplicate_bouton']}' onclick='document.location=\"./catalog.php?categ=serials&sub=bulletinage&action=bul_duplicate&bul_id={$this->bulletin_id}\"' />";
     } else {
         $link_annul = './catalog.php?categ=serials&sub=view&serial_id=!!serial_id!!';
         $serial_bul_form = str_replace('!!form_title!!', $msg[4005], $serial_bul_form);
         $this->date_date = today();
         $date_date_formatee = "";
         $link_audit = "";
         $link_duplicate = "";
     }
     $serial_bul_form = str_replace('!!annul!!', $link_annul, $serial_bul_form);
     $serial_bul_form = str_replace('!!serial_id!!', $this->serial_id, $serial_bul_form);
     $serial_bul_form = str_replace('!!bul_id!!', $this->bulletin_id, $serial_bul_form);
     $serial_bul_form = str_replace('!!bul_titre!!', htmlentities($this->bulletin_titre, ENT_QUOTES, $charset), $serial_bul_form);
     $serial_bul_form = str_replace('!!bul_no!!', htmlentities($this->bulletin_numero, ENT_QUOTES, $charset), $serial_bul_form);
     $serial_bul_form = str_replace('!!bul_date!!', htmlentities($this->mention_date, ENT_QUOTES, $charset), $serial_bul_form);
     $serial_bul_form = str_replace('!!bul_cb!!', $this->bulletin_cb, $serial_bul_form);
     $serial_bul_form = str_replace('!!notice_id_no_replace!!', $this->bull_num_notice, $serial_bul_form);
     $date_clic = "onClick=\"openPopUp('./select.php?what=calendrier&caller=notice&date_caller=" . str_replace('-', '', $this->date_date) . "&param1=date_date&param2=date_date_lib&auto_submit=NO&date_anterieure=YES&format_return=IN', 'date_date', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\"  ";
     $date_date = "<input type='hidden' name='date_date' value='" . str_replace('-', '', $this->date_date) . "' />\n\t\t\t\t<input class='saisie-10em' type='text' name='date_date_lib' value='" . $date_date_formatee . "' placeholder='" . $msg["format_date_input_placeholder"] . "' />\n\t\t\t\t<input class='bouton' type='button' name='date_date_lib_bouton' value='" . $msg["bouton_calendrier"] . "' " . $date_clic . " />";
     $serial_bul_form = str_replace('!!date_date!!', $date_date, $serial_bul_form);
     $serial_bul_form = str_replace('!!link_audit!!', $link_audit, $serial_bul_form);
     $serial_bul_form = str_replace('!!link_duplicate!!', $link_duplicate, $serial_bul_form);
     //$serial_bul_form = str_replace('caller=notice',"caller=serial_bul_form",$serial_bul_form);
     //$serial_bul_form = str_replace('document.notice',"document.serial_bul_form",$serial_bul_form);
     return $serial_bul_form;
 }
Example #25
0
function electronic_ticket($id_empr, $cb_doc = "")
{
    global $dbh, $msg, $charset;
    global $PMBusernom;
    global $PMBuserprenom;
    global $PMBuseremail, $PMBuseremailbcc;
    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html; charset=" . $charset . "\n";
    // info site
    global $biblio_name, $biblio_logo, $biblio_adr1, $biblio_adr2, $biblio_cp, $biblio_town, $biblio_state, $biblio_country, $biblio_phone, $biblio_email, $biblio_website, $biblio_commentaire;
    global $empr_electronic_loan_ticket_obj, $empr_electronic_loan_ticket_msg;
    $empr_electronic_loan_ticket_obj = str_replace("!!biblio_name!!", $biblio_name, $empr_electronic_loan_ticket_obj);
    $empr_electronic_loan_ticket_obj = str_replace("!!date!!", formatdate(today()), $empr_electronic_loan_ticket_obj);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_name!!", $biblio_name, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!date!!", formatdate(today()), $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_website!!", $biblio_website, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_phone!!", $biblio_phone, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_adr1!!", $biblio_adr1, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_adr2!!", $biblio_adr2, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_cp!!", $biblio_cp, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_town!!", $biblio_town, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_email!!", $biblio_email, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_commentaire!!", $biblio_commentaire, $empr_electronic_loan_ticket_msg);
    $message_resas = "";
    $message_prets = "";
    if ($cb_doc == "") {
        $rqt = "select expl_cb from pret, exemplaires where pret_idempr='" . $id_empr . "' and pret_idexpl=expl_id order by pret_date ";
        $req = mysql_query($rqt) or die($msg['err_sql'] . '<br />' . $rqt . '<br />' . mysql_error());
        $message_prets = $msg["prets_en_cours"];
        while ($data = mysql_fetch_array($req)) {
            $message_prets .= electronic_loan_ticket_expl_info($data['expl_cb']);
        }
        // Impression des réservations en cours
        $rqt = "select resa_idnotice, resa_idbulletin from resa where resa_idempr='" . $id_empr . "' ";
        $req = mysql_query($rqt) or die($msg['err_sql'] . '<br />' . $rqt . '<br />' . mysql_error());
        if (mysql_num_rows($req) > 0) {
            $message_resas = $msg["documents_reserves"];
            while ($data = mysql_fetch_array($req)) {
                $message_resas .= electronic_loan_ticket_not_bull_info_resa($id_empr, $data['resa_idnotice'], $data['resa_idbulletin']);
            }
        }
        // fin if résas
    } else {
        $message_prets = $msg["prets_en_cours"];
        $message_prets .= electronic_loan_ticket_expl_info($cb_doc);
    }
    $empr_electronic_loan_ticket_msg = str_replace("!!all_reservations!!", $message_resas, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!all_loans!!", $message_prets, $empr_electronic_loan_ticket_msg);
    $requete = "select id_empr, empr_mail, empr_nom, empr_prenom from empr where id_empr='{$id_empr}' ";
    $res = mysql_query($requete, $dbh);
    $empr = mysql_fetch_object($res);
    //remplacement nom et prenom
    $empr_electronic_loan_ticket_msg = str_replace("!!empr_name!!", $empr->empr_nom, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!empr_first_name!!", $empr->empr_prenom, $empr_electronic_loan_ticket_msg);
    if ($empr->empr_mail) {
        // function mailpmb($to_nom="", $to_mail, $obj="", $corps="", $from_name="", $from_mail, $headers, $copie_CC="", $copie_BCC="", $faire_nl2br=0, $pieces_jointes=array()) {
        $res_envoi = @mailpmb($empr->empr_prenom . " " . $empr->empr_nom, $empr->empr_mail, $empr_electronic_loan_ticket_obj, $empr_electronic_loan_ticket_msg, $PMBuserprenom . " " . $PMBusernom, $PMBuseremail, $headers, "", $PMBuseremailbcc, 1, "");
    }
}
Example #26
0
 function construit_liens_HTML()
 {
     global $dbh;
     global $opac_url_base;
     global $msg;
     // $url_base_opac = $opac_url_base."empr.php?lvl=bannette!!empr_info_login!!";
     $url_base_opac = $opac_url_base . "empr.php?lvl=bannette";
     $resultat_aff .= "<style type='text/css'>\n\t\t\tbody { \t\n\t\t\tfont-size: 10pt;\n\t\t\tfont-family: verdana, geneva, helvetica, arial;\n\t\t\tcolor:#000000;\n\t\t\tbackground:#FFFFFF;\n\t\t\t}\n\t\t\ttd {\n\t\t\tfont-size: 10pt;\n\t\t\tfont-family: verdana, geneva, helvetica, arial;\n\t\t\tcolor:#000000;\n\t\t\t}\n\t\t\tth {\n\t\t\tfont-size: 10pt;\n\t\t\tfont-family: verdana, geneva, helvetica, arial;\n\t\t\tfont-weight:bold;\n\t\t\tcolor:#000000;\n\t\t\tbackground:#DDDDDD;\n\t\t\ttext-align:left;\n\t\t\t}\n\t\t\thr {\n\t\t\tborder:none;\n\t\t\tborder-bottom:1px solid #000000;\n\t\t\t}\n\t\t\th3 {\n\t\t\tfont-size: 12pt;\n\t\t\tcolor:#000000;\n\t\t\t}\n\t\t\t</style>";
     $date_today = formatdate(today());
     $public = "<a href='{$url_base_opac}&id_bannette=" . $this->id_bannette . "&code=!!code!!&emprlogin=!!login!!&date_conex=!!date_conex!!'>";
     $public .= $this->comment_public . " : &nbsp;" . sprintf($msg["print_n_notices"], $this->nb_notices);
     $public .= "</a>";
     $entete = str_replace("!!public!!", $public, $this->entete_mail);
     // pour le template de bannette privées
     if ($this->proprio_bannette) {
         $equations = $this->get_equations();
         if ($equations[0]) {
             $equa = new equation($equations[0]);
             $entete = str_replace("!!equation!!", $equa->nom_equation, $entete);
         }
     } else {
         $equations = $this->get_equations();
         $equationTexte = "";
         if ($countEquations = count($equations)) {
             foreach ($equations as $key => $id) {
                 $equa = new equation($id);
                 $equationTexte .= $equa->human_query;
                 if ($key != $countEquations - 1) {
                     $equationTexte .= "<br>";
                 }
             }
         }
         $entete = str_replace("!!equation!!", $equationTexte, $entete);
     }
     $entete = str_replace("!!date!!", $date_today, $entete);
     return $entete;
 }
Example #27
0
 function show_modif_form()
 {
     global $form_modif_action, $msg, $charset;
     if ($this->id_action) {
         $form_modif_action = str_replace('!!form_title!!', htmlentities(sprintf($msg['demandes_action_modif'], ' : ' . $this->sujet_action), ENT_QUOTES, $charset), $form_modif_action);
         $form_modif_action = str_replace('!!sujet!!', htmlentities($this->sujet_action, ENT_QUOTES, $charset), $form_modif_action);
         $form_modif_action = str_replace('!!detail!!', htmlentities($this->detail_action, ENT_QUOTES, $charset), $form_modif_action);
         $form_modif_action = str_replace('!!cout!!', htmlentities($this->cout, ENT_QUOTES, $charset), $form_modif_action);
         $form_modif_action = str_replace('!!time_elapsed!!', htmlentities($this->time_elapsed, ENT_QUOTES, $charset), $form_modif_action);
         $form_modif_action = str_replace('!!progression!!', htmlentities($this->progression_action, ENT_QUOTES, $charset), $form_modif_action);
         $form_modif_action = str_replace('!!select_type!!', $this->workflow->getTypeCommentById($this->type_action), $form_modif_action);
         $type_hide = "<input type='hidden' name='idtype' id='idtype' value='{$this->type_action}' />";
         $form_modif_action = str_replace('!!type_action!!', $type_hide, $form_modif_action);
         $form_modif_action = str_replace('!!select_statut!!', $this->getStatutSelector($this->statut_action), $form_modif_action);
         $form_modif_action = str_replace('!!date_fin_btn!!', formatdate($this->deadline_action), $form_modif_action);
         $form_modif_action = str_replace('!!date_debut_btn!!', formatdate($this->date_action), $form_modif_action);
         $form_modif_action = str_replace('!!date_debut!!', htmlentities($this->date_action, ENT_QUOTES, $charset), $form_modif_action);
         $form_modif_action = str_replace('!!date_fin!!', htmlentities($this->deadline_action, ENT_QUOTES, $charset), $form_modif_action);
         $btn_suppr = "<input type='submit' class='bouton' value='{$msg['63']}' onclick='this.form.act.value=\"suppr_action\"; return confirm_delete();' />";
         $form_modif_action = str_replace('!!btn_suppr!!', $btn_suppr, $form_modif_action);
         $form_modif_action = str_replace('!!idaction!!', $this->id_action, $form_modif_action);
         $form_modif_action = str_replace('!!iddemande!!', $this->num_demande, $form_modif_action);
         if ($this->prive_action) {
             $form_modif_action = str_replace('!!ck_prive!!', 'checked', $form_modif_action);
         } else {
             $form_modif_action = str_replace('!!ck_prive!!', '', $form_modif_action);
         }
         $act_cancel = "document.location='./demandes.php?categ=action&act=see&idaction={$this->id_action}'";
         $act_form = "./demandes.php?categ=action&act=see&idaction={$this->id_action}";
         $form_modif_action = str_replace('!!form_action!!', $act_form, $form_modif_action);
         $form_modif_action = str_replace('!!cancel_action!!', $act_cancel, $form_modif_action);
         $path = "<a href=./demandes.php?categ=gestion&act=see_dmde&iddemande={$this->num_demande}>" . htmlentities($this->libelle_demande, ENT_QUOTES, $charset) . "</a>";
         $path .= " > <a href=./demandes.php?categ=action&act=see&idaction={$this->id_action}>" . htmlentities($this->sujet_action, ENT_QUOTES, $charset) . "</a>";
         $form_modif_action = str_replace('!!path!!', $path, $form_modif_action);
         print $form_modif_action;
     } else {
         $form_modif_action = str_replace('!!form_title!!', htmlentities($msg['demandes_action_creation'], ENT_QUOTES, $charset), $form_modif_action);
         $form_modif_action = str_replace('!!cout!!', '', $form_modif_action);
         $form_modif_action = str_replace('!!progression!!', '', $form_modif_action);
         $form_modif_action = str_replace('!!sujet!!', '', $form_modif_action);
         $form_modif_action = str_replace('!!detail!!', '', $form_modif_action);
         $form_modif_action = str_replace('!!time_elapsed!!', '', $form_modif_action);
         $date = formatdate(today());
         $date_debut = date("Y-m-d", time());
         $form_modif_action = str_replace('!!date_fin_btn!!', $date, $form_modif_action);
         $form_modif_action = str_replace('!!date_debut_btn!!', $date, $form_modif_action);
         $form_modif_action = str_replace('!!date_debut!!', $date_debut, $form_modif_action);
         $form_modif_action = str_replace('!!date_fin!!', $date_debut, $form_modif_action);
         $form_modif_action = str_replace('!!select_type!!', $this->getTypeSelector(), $form_modif_action);
         $form_modif_action = str_replace('!!type_action!!', '', $form_modif_action);
         $form_modif_action = str_replace('!!select_statut!!', $this->getStatutSelector(), $form_modif_action);
         $form_modif_action = str_replace('!!btn_suppr!!', '', $form_modif_action);
         $form_modif_action = str_replace('!!idaction!!', '', $form_modif_action);
         $form_modif_action = str_replace('!!iddemande!!', $this->num_demande, $form_modif_action);
         $act_cancel = "document.location='./demandes.php?categ=gestion&act=see_dmde&iddemande={$this->num_demande}'";
         $form_modif_action = str_replace('!!form_action!!', "", $form_modif_action);
         $form_modif_action = str_replace('!!cancel_action!!', $act_cancel, $form_modif_action);
         $path = "<a href=./demandes.php?categ=gestion&act=see_dmde&iddemande={$this->num_demande}>" . htmlentities($this->libelle_demande, ENT_QUOTES, $charset) . "</a>";
         $form_modif_action = str_replace('!!path!!', $path, $form_modif_action);
         print $form_modif_action;
     }
 }
Example #28
0
 }
 if ($id_notice) {
     $display = new mono_display($id_notice, 6, '', 0, '', '', '', 0, 1, 1, 1);
     print $display->result;
 } else {
     if ($id_bulletin) {
         $bull = new bulletinage($id_bulletin);
         $bull->make_display();
         print $bull->display;
     }
 }
 print "<script type='text/javascript' src='./javascript/tablist.js'></script>\n";
 $form_resa_dates = str_replace('!!resa_date_debut!!', formatdate(today()), $form_resa_dates);
 $form_resa_dates = str_replace('!!resa_date_fin!!', formatdate(today()), $form_resa_dates);
 $form_resa_dates = str_replace('!!resa_deb!!', today(), $form_resa_dates);
 $form_resa_dates = str_replace('!!resa_fin!!', today(), $form_resa_dates);
 $tab_loc_retrait = resa_planning::get_available_locations($id_empr, $id_notice, $id_bulletin);
 if (count($tab_loc_retrait) >= 1) {
     $form_loc_retrait = '<table ><tbody><tr><th>' . $msg['resa_planning_loc_retrait'] . '</th><th>' . $msg['resa_planning_qty_requested'] . '</th></tr>';
     foreach ($tab_loc_retrait as $k => $v) {
         $form_loc_retrait .= '<tr><td width="50%">' . htmlentities($v['location_libelle'], ENT_QUOTES, $charset) . '</td>';
         $form_loc_retrait .= '<td><select name="location[' . $v['location_id'] . ']">';
         for ($i = 0; $i < $v['location_nb'] * 1 + 1; $i++) {
             $form_loc_retrait .= '<option value=' . $i . '>' . $i . '</option>';
         }
         $form_loc_retrait .= '</select></td>';
         $form_loc_retrait .= '</tr>';
     }
     $form_loc_retrait .= '</tbody></table>';
 } else {
     error_message($msg[350], $msg['resa_planning_no_item_available'], 1, "./circ.php?categ=resa_planning&resa_action=search_resa&mode=0&id_empr={$id_empr}&groupID={$groupID}");
Example #29
0
 $ourPDF->Open();
 $ourPDF->SetMargins($marge_gauche, $marge_haut, $marge_droite);
 //On récupère les infos de la facture
 $fac = new actes($id_fac);
 $lignes = actes::getLignes($id_fac);
 $bibli = new entites($fac->num_entite);
 $coord_fac = new coordonnees($fac->num_contact_fact);
 $fou = new entites($fac->num_fournisseur);
 $coord_fou = entites::get_coordonnees($fac->num_fournisseur, '1');
 $coord_fou = mysql_fetch_object($coord_fou);
 $id_cde = liens_actes::getParent($id_fac);
 $cde = new actes($id_cde);
 $ourPDF->addPage();
 $ourPDF->setFont($pmb_pdf_font);
 //Affichage date
 $date = formatdate(today());
 $ourPDF->setFontSize($fs_date);
 $ourPDF->SetXY($x_date, $y_date);
 $ourPDF->Cell($l_date, $h_date, $date, 0, 0, 'L', 0);
 //Affichage raison sociale
 $raison = $bibli->raison_sociale;
 $ourPDF->setFontSize($fs_raison);
 $ourPDF->SetXY($x_raison, $y_raison);
 $ourPDF->Cell($l_raison, $h_raison, $raison, 0, 0, 'L', 0);
 //Affichage coordonnees fournisseur
 if ($fou->raison_sociale != '') {
     $adr_fou = $fou->raison_sociale . "\n";
 }
 if ($coord_fou->libelle != '') {
     $adr_fou .= $coord_fou->libelle;
 }
Example #30
0
function show_from_cde($id_bibli, $id_cde)
{
    global $msg, $charset;
    global $livr_modif_form, $frame_show_from_cde, $form_search, $bt_enr;
    $form = $livr_modif_form;
    $titre = htmlentities($msg['acquisition_liv_cre'], ENT_QUOTES, $charset);
    $date_cre = formatdate(today());
    $cde = new actes($id_cde);
    $num_cde = htmlentities($cde->numero, ENT_QUOTES, $charset);
    $id_fou = $cde->num_fournisseur;
    $fou = new entites($id_fou);
    $lib_fou = htmlentities($fou->raison_sociale, ENT_QUOTES, $charset);
    $bibli = new entites($id_bibli);
    $exer = new exercices($cde->num_exercice);
    $numero = '';
    $comment = '';
    $ref = '';
    $form = str_replace('<!-- frame_show -->', $frame_show_from_cde, $form);
    $form = str_replace('<!-- bouton_enr -->', $bt_enr, $form);
    $form = str_replace('<!-- form_search -->', $form_search, $form);
    $form = str_replace('!!form_title!!', $titre, $form);
    $form = str_replace('!!id_bibli!!', $id_bibli, $form);
    $form = str_replace('!!lib_bibli!!', htmlentities($bibli->raison_sociale, ENT_QUOTES, $charset), $form);
    $form = str_replace('!!lib_exer!!', htmlentities($exer->libelle, ENT_QUOTES, $charset), $form);
    $form = str_replace('!!id_cde!!', $id_cde, $form);
    $lien_cde = "<a href=\"./acquisition.php?categ=ach&sub=cmde&action=modif&id_bibli=" . $id_bibli . "&id_cde=" . $id_cde . "\">" . $num_cde . "</a>";
    $form = str_replace('!!num_cde!!', $lien_cde, $form);
    $form = str_replace('!!date_cre!!', $date_cre, $form);
    $form = str_replace('!!id_liv!!', 0, $form);
    $form = str_replace('!!numero!!', $numero, $form);
    $form = str_replace('!!id_fou!!', $id_fou, $form);
    $form = str_replace('!!lib_fou!!', $lib_fou, $form);
    $form = str_replace('!!comment!!', $comment, $form);
    $form = str_replace('!!ref!!', $ref, $form);
    print $form;
}