".$msg["caddie_select_collecte"]."" ;
break;
}
}
public static function proceed_module_pointage($moyen, $idcaddie) {
global $msg;
switch ($moyen) {
case 'raz':
static::proceed_raz($idcaddie);
break;
case 'selection':
static::proceed_selection($idcaddie, 'pointage', '', 'selection');
break;
case 'douchette':
static::proceed_barcode($idcaddie, 'pointage', 'pointe');
break;
case 'panier':
static::proceed_by_caddie($idcaddie);
break;
case 'search_history':
// include ("./".$module."/caddie/pointage/search_history.inc.php");
break;
default:
print "
".$msg["caddie_select_pointage"]."" ;
break;
}
}
public static function proceed_module_action($quelle, $idcaddie) {
global $msg;
switch ($quelle) {
case 'transfert':
static::proceed_transfert($idcaddie);
break;
case 'export':
static::proceed_export($idcaddie);
break;
case 'supprpanier':
static::proceed_supprpanier($idcaddie);
break;
case 'supprbase':
static::proceed_supprbase($idcaddie);
break;
case 'edition':
global $mode;
if(empty($mode)) $mode = 'simple';
static::proceed_edition($idcaddie, $mode);
break;
case 'selection':
static::proceed_selection($idcaddie, 'action', 'selection');
break;
case 'expdocnum':
static::proceed_expdocnum($idcaddie);
break;
case 'reindex':
static::proceed_reindex($idcaddie);
break;
case 'access_rights':
static::proceed_access_rights($idcaddie);
break;
default:
print "
".$msg["caddie_select_action"]."" ;
break;
}
}
public static function proceed_module_remplir($callback, $elements) {
global $msg, $charset;
global $PMBuserid;
print '
'.$msg['caddie_creation_in_progress'].'
';
$caddie = new authorities_caddie();
$caddie->type = $_SESSION['session_history'][$_SESSION['CURRENT']]['AUT']['SEARCH_OBJECTS_TYPE'];
$caddie->name = date($msg['1005']." H:i:s - ").html_entity_decode(strip_tags($_SESSION['session_history'][$_SESSION['CURRENT']]['QUERY']['HUMAN_QUERY']), ENT_COMPAT | ENT_HTML401, $charset);
$caddie->autorisations = $PMBuserid;
$caddie->classementGen = $msg['caddie_classement_created_from_search'];
$id_caddie = $caddie->create_cart();
$values = array();
if (!empty($elements)) { // Vérifie si des éléments sont cochés
$elements = explode(",", $elements);
foreach ($elements as $element) {
$values[] = "('$id_caddie', '$element', '')";
}
} else {
if (!empty($_SESSION['session_history'][$_SESSION['CURRENT']]['AUT']["FORM_VALUES"])) {
$sat = new searcher_authorities_tab($_SESSION['session_history'][$_SESSION['CURRENT']]['AUT']["FORM_VALUES"]);
$notice_ids = explode(',',$sat->get_result());
foreach ($notice_ids as $notice_id) {
$values[] = "('$id_caddie', '$notice_id', '')";
}
} else {
foreach ($_SESSION['session_history'][$_SESSION['CURRENT']]['QUERY']['POST'] as $varname => $value) {
global ${$varname};
${$varname} = $value;
}
$sh = new search(false, $search_xml_file);
$table = $sh->make_search();
$requete = "select * from $table";
$result = pmb_mysql_query($requete);
if (pmb_mysql_num_rows($result)) {
while ($row = pmb_mysql_fetch_assoc($result)) {
$values[] = "('$id_caddie', '".$row['id_authority']."', '')";
}
}
}
}
if (!empty($values)) {
pmb_mysql_query("INSERT INTO authorities_caddie_content (caddie_id, object_id, flag) VALUES ".implode(",", $values));
}
print '';
}
public static function get_constructed_link($sub='', $sub_categ='', $action='', $idcaddie=0, $args_others='') {
}
public static function display_cart_objects($idcaddie) {
global $elt_flag, $elt_no_flag;
$myCart = static::get_object_instance($idcaddie);
print pmb_bidi($myCart->aff_cart_titre());
print pmb_bidi($myCart->aff_cart_nb_items());
print $myCart->aff_filters_form_objects(static::get_constructed_link('gestion', 'panier', '', $idcaddie));
$constructed_link = static::get_constructed_link('gestion', 'panier', '', $idcaddie);
if($elt_flag) {
$constructed_link .= "&elt_flag=".$elt_flag;
}
if($elt_no_flag) {
$constructed_link .= "&elt_no_flag=".$elt_no_flag;
}
$myCart->aff_cart_objects($constructed_link);
}
public static function proceed($idcaddie=0, $item='') {
global $action;
global $form_actif;
global $object_type;
$idcaddie += 0;
//$item += 0; item peux etre un cb
switch ($action) {
case 'new_cart':
$myCart = static::get_object_instance();
$form_action = static::get_constructed_link('gestion', 'panier', 'valid_new_cart')."&item=".$item;
$form_cancel = "history.go(-1);";
print $myCart->get_form($form_action, $form_cancel);
break;
case 'edit_cart':
$myCart = static::get_object_instance($idcaddie);
$form_action = static::get_constructed_link('gestion', 'panier', 'save_cart', $idcaddie, "&item=".$item);
$form_cancel = "document.location='".static::get_constructed_link('gestion', 'panier')."&item=".$item."';";
$form_duplicate = static::get_constructed_link('gestion', 'panier', 'duplicate_cart', $idcaddie);
print $myCart->get_form($form_action, $form_cancel, $form_duplicate);
break;
case 'duplicate_cart':
$myCart = static::get_object_instance($idcaddie);
$myCart->set_idcaddie(0);
$form_action = static::get_constructed_link('gestion', 'panier', 'valid_new_cart')."&item=".$item;
$form_cancel = "history.go(-1);";
print $myCart->get_form($form_action, $form_cancel);
break;
case 'del_cart':
$myCart = static::get_object_instance($idcaddie);
$myCart->delete();
print static::get_redirection_editable_paniers();
break;
case 'save_cart':
$myCart = static::get_object_instance($idcaddie);
$myCart->set_properties_from_form();
if($form_actif) $myCart->save_cart();
print static::get_redirection_editable_paniers($idcaddie);
break;
case 'del_item':
$myCart = static::get_object_instance($idcaddie);
if ($object_type=="EXPL_CB") $myCart->del_item_blob($item);
else $myCart->del_item($item);
print static::get_redirection_editable_paniers($idcaddie);
break;
case 'valid_new_cart':
$myCart = static::get_object_instance(0);
$myCart->set_properties_from_form();
if($form_actif) {
$myCart->create_cart();
}
print static::get_redirection_editable_paniers($idcaddie);
break;
case 'list_delete' :
$list_ui_class_name = static::get_list_ui_class_name();
$list_ui_class_name::run_action_list($action);
print static::get_redirection_editable_paniers();
break;
default:
if($idcaddie) {
static::display_cart_objects($idcaddie);
} else {
static::get_aff_editable_paniers($idcaddie);
}
}
}
public static function proceed_classement() {
global $action;
global $baseLink;
$baseLink=static::get_constructed_link("gestion", "classementGen");
$classementGen = new classementGen(static::$model_class_name,0);
$classementGen->proceed($action);
}
public static function proceed_selection($idcaddie=0, $sub='', $quelle='', $moyen='') {
//Enrichi dans les classes enfants
}
public static function proceed_by_caddie($idcaddie=0) {
global $msg;
global $action;
global $idcaddie_selected;
global $elt_flag, $elt_no_flag, $elt_flag_inconnu, $elt_no_flag_inconnu;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
switch ($action) {
case 'choix_quoi':
print $myCart->aff_cart_titre();
print $myCart->aff_cart_nb_items();
print $myCart->get_choix_quoi_form(static::get_constructed_link('pointage', 'panier', 'pointe_item', $idcaddie, "&idcaddie_selected=".$idcaddie_selected),
static::get_constructed_link('pointage', 'panier', '', $idcaddie, "&item=0"),
$msg["caddie_choix_pointe_panier"],
$msg["caddie_item_pointer"],
"",false);
if ($idcaddie_selected) {
$myCart_selected = static::get_object_instance($idcaddie_selected);
print $myCart_selected->aff_cart_titre();
print $myCart_selected->aff_cart_nb_items();
}
break;
case 'pointe_item':
if ($idcaddie_selected) {
$myCart_selected = static::get_object_instance($idcaddie_selected);
print $myCart_selected->aff_cart_titre();
print $myCart_selected->aff_cart_nb_items();
$liste_0=$liste_1= array();
if ($elt_flag) {
$liste_0 = $myCart->get_cart("FLAG", $elt_flag_inconnu) ;
}
if ($elt_no_flag) {
$liste_1= $myCart->get_cart("NOFLAG", $elt_no_flag_inconnu) ;
}
$liste= array_merge($liste_0,$liste_1);
if($liste) {
foreach ($liste as $cle => $object) {
$myCart_selected->pointe_item($object,$myCart->type);
}
}
print "
".$msg["caddie_menu_pointage_apres_pointage"]."
";
print $myCart_selected->aff_cart_nb_items();
}
static::get_aff_paniers("pointage", "", "panier");
break;
default:
print $myCart->aff_cart_titre();
print $myCart->aff_cart_nb_items();
static::get_aff_paniers_from_panier($idcaddie, "pointage");
break;
}
} else {
static::get_aff_paniers("pointage", "", "panier");
}
}
public static function proceed_edition($idcaddie=0, $mode="simple") {
global $action;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
print pmb_bidi($myCart->aff_cart_titre());
switch ($action) {
case 'choix_quoi':
print pmb_bidi($myCart->aff_cart_nb_items()) ;
print $myCart->get_edition_switch_form($mode, static::get_constructed_link('action', 'edition', 'choix_quoi', $idcaddie, '&object_type='.static::$object_type.'&item=0'));
switch ($mode) {
case 'advanced':
print $myCart->get_list_caddie_content_ui()->get_display_list();
break;
case 'simple':
default:
print $myCart->get_edition_form();
break;
}
break;
case 'suite':
print pmb_bidi($myCart->aff_cart_nb_items()) ;
break;
default:
break;
}
} else {
static::get_aff_paniers("action", "edition");
}
}
public static function proceed_edition_tableau($idcaddie=0, $mode="simple") {
global $msg;
global $worksheet ; //Pour les fonctions dans edition_func.inc.php
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
switch ($mode) {
case 'advanced':
$myCart->get_list_caddie_content_ui()->get_display_spreadsheet_list();
break;
case 'simple':
default:
$worksheet = new spreadsheetPMB();
$worksheet->write_string(0,0,$msg["caddie_numero"].$idcaddie);
$worksheet->write_string(0,1,$myCart->type);
$worksheet->write_string(0,2,$myCart->name);
$worksheet->write_string(0,3,$myCart->comment);
$myCart->write_tableau();
$worksheet->download('Caddie_'.$myCart->type.'_'.$idcaddie.'.xls');
break;
}
}
}
public static function proceed_edition_tableauhtml($idcaddie=0, $mode='simple') {
global $charset;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
header("Content-Type: application/download\n");
header("Content-Disposition: atachement; filename=\"tableau.xls\"");
print "";
switch ($mode) {
case 'advanced':
print $myCart->get_list_caddie_content_ui()->get_display_html_list();
break;
case 'simple':
default:
print $myCart->get_display_tableauhtml();
break;
}
}
}
public static function proceed_edition_html($idcaddie=0, $mode="simple") {
global $charset;
global $std_header;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
header ("Content-Type: text/html; charset=$charset");
print $std_header;
switch ($mode) {
case 'advanced':
print $myCart->get_list_caddie_content_ui()->get_display_html_list();
break;
case 'simple':
default:
print $myCart->get_display_tableauhtml();
break;
}
}
}
public static function proceed_export($idcaddie=0) {
global $action;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
print pmb_bidi($myCart->aff_cart_titre());
switch ($action) {
case 'choix_quoi':
print pmb_bidi($myCart->aff_cart_nb_items()) ;
print $myCart->get_export_form(static::get_constructed_link('action', 'export', 'exporter', $idcaddie), static::get_constructed_link('action', 'export', '', 0));
break;
case 'exporter':
print $myCart->get_export_iframe();
break;
default:
break;
}
} else {
static::get_aff_paniers('action', 'export');
}
}
public static function proceed_transfert($idcaddie=0) {
//Enrichi dans les classes enfants
}
public static function proceed_supprbase($idcaddie=0) {
global $msg;
global $action;
global $begin_result_liste;
global $end_result_liste;
global $elt_flag, $elt_no_flag;
global $elt_flag_inconnu;
global $elt_no_flag_inconnu;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
print pmb_bidi($myCart->aff_cart_titre());
switch ($action) {
case 'choix_quoi':
print $myCart->aff_cart_nb_items();
print $myCart->get_choix_quoi_form(static::get_constructed_link('action', 'supprbase', 'del_base', $idcaddie),
static::get_constructed_link('action', 'supprbase', '', 0),
$msg["caddie_choix_supprbase"],
$msg["supprimer"],
"return confirm('$msg[caddie_confirm_supprbase]')");
break;
case 'del_base':
// On déclenche un événement sur la supression
$evt_handler = events_handler::get_instance();
$event = new event_users_group("users_group", "get_autorisation_del_base");
$event->set_id_caddie($idcaddie);
$evt_handler->send($event);
if($event->get_error_message()){
echo $event->get_error_message();
break;
}
print "
";
// inclusion du javascript de gestion des listes dépliables
// début de liste
print $begin_result_liste;
print $res_aff_suppr_base ;
print $end_result_liste;
}
print "
".$msg['caddie_situation_after_suppr']."
";
$myCart->compte_items();
print $myCart->aff_cart_nb_items();
break;
default:
break;
}
} else {
static::get_aff_paniers('action', 'supprbase');
}
}
public static function proceed_supprpanier($idcaddie=0) {
global $msg;
global $action;
global $elt_flag;
global $elt_flag_inconnu;
global $elt_no_flag;
global $elt_no_flag_inconnu;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
print $myCart->aff_cart_titre();
switch ($action) {
case 'choix_quoi':
print $myCart->aff_cart_nb_items() ;
$action_link = static::get_constructed_link('action', 'supprpanier', 'del_cart', $idcaddie);
$action_cancel_link = static::get_constructed_link('action', 'supprpanier', '', 0);
print $myCart->get_choix_quoi_form($action_link, $action_cancel_link, $msg["caddie_choix_supprpanier"], $msg["caddie_act_vider_le_panier"],"return confirm('$msg[caddie_confirm_supprpanier]')");
break;
case 'del_cart':
print "
".$msg['caddie_situation_before_suppr']."
";
print $myCart->aff_cart_nb_items() ;
if ($elt_flag) $myCart->del_item_flag($elt_flag_inconnu);
if ($elt_no_flag) $myCart->del_item_no_flag($elt_no_flag_inconnu);
print "
".$msg['caddie_situation_after_suppr']."
";
print $myCart->aff_cart_nb_items() ;
break;
default:
break;
}
} else {
static::get_aff_paniers('action', 'supprpanier');
}
}
public static function proceed_raz($idcaddie=0) {
$idcaddie += 0;
if ($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
print pmb_bidi($myCart->aff_cart_titre());
$model_class_name = static::get_model_class_name();
if ($model_class_name::check_rights($idcaddie)) $myCart->depointe_items();
print pmb_bidi($myCart->aff_cart_nb_items());
} else {
static::get_aff_paniers('pointage', '', 'raz');
}
}
public static function proceed_import($idcaddie=0, $object_type='') {
global $action;
global $item;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
print pmb_bidi($myCart->aff_cart_titre());
switch ($action) {
case 'add_item':
$myCart->add_item($item,$object_type);
$myCart->compte_items();
print $myCart->aff_cart_nb_items();
break;
default:
print $myCart->aff_cart_nb_items();
break;
}
} else {
static::get_aff_paniers('collecte', '', 'import');
}
}
public static function proceed_expdocnum($idcaddie=0) {
global $msg;
global $action;
global $base_path;
global $elt_flag, $elt_no_flag;
global $elt_flag_inconnu, $elt_no_flag_inconnu;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
print pmb_bidi($myCart->aff_cart_titre());
switch ($action) {
case 'choix_quoi':
print $myCart->aff_cart_nb_items();
print $myCart->get_choix_quoi_form(static::get_constructed_link('action', 'expdocnum', 'export')."&idcaddie=$idcaddie", static::get_constructed_link('action', 'expdocnum')."&idcaddie=0", $msg["caddie_choix_expdocnum"], $msg["caddie_expdocnum_export"], "return confirm('$msg[caddie_confirm_export]')");
break;
case 'export':
print "
".$msg['caddie_situation_exportdocnum']."
";
print $myCart->aff_cart_nb_items();
// vérifier et/ou créer le répertoire $chemin
$chemin_export_doc_num=$base_path."/temp/cart".$idcaddie."/";
$handledir = @opendir($chemin_export_doc_num);
if (!$handledir) {
if (!mkdir($chemin_export_doc_num)) die ("Unsufficient privileges on temp directory");
} else closedir($handledir);
$res_aff_exp_doc_num="";
if ($elt_flag) {
$liste = $myCart->get_cart("FLAG", $elt_flag_inconnu) ;
foreach ($liste as $cle => $object) {
$res_aff_exp_doc_num.=$myCart->export_doc_num ($object,$chemin_export_doc_num) ;
}
}
if ($elt_no_flag) {
$liste = $myCart->get_cart("NOFLAG", $elt_no_flag_inconnu) ;
foreach ($liste as $cle => $object) {
$res_aff_exp_doc_num.=$myCart->export_doc_num ($object,$chemin_export_doc_num) ;
}
}
if ($res_aff_exp_doc_num) {
print "
".$msg['caddie_res_expdocnum']."
";
print $res_aff_exp_doc_num;
} else print "
".$msg['caddie_res_expdocnum_nodocnum']."
";
break;
default:
break;
}
} else {
static::get_aff_paniers('action', 'expdocnum');
}
}
public static function proceed_reindex($idcaddie=0) {
global $msg;
global $action;
global $elt_flag, $elt_no_flag;
global $elt_flag_inconnu, $elt_no_flag_inconnu;
$idcaddie += 0;
if($idcaddie) {
$myCart = static::get_object_instance($idcaddie);
print pmb_bidi($myCart->aff_cart_titre());
switch ($action) {
case 'choix_quoi':
print pmb_bidi($myCart->aff_cart_nb_items());
print $myCart->get_choix_quoi_form(static::get_constructed_link('action', 'reindex', 'suite', $idcaddie), static::get_constructed_link('action', 'reindex', '', 0), $msg["caddie_choix_reindex"], $msg["caddie_bouton_reindex"],"");
break;
case 'suite':
@set_time_limit(0);
$nb_elements_flag=$nb_elements_no_flag=0;
$liste_0=$liste_1= array();
if ($elt_flag) {
$liste_0 = $myCart->get_cart("FLAG", $elt_flag_inconnu) ;
$nb_elements_flag=count($liste_0);
}
if ($elt_no_flag) {
$liste_1= $myCart->get_cart("NOFLAG", $elt_no_flag_inconnu) ;
$nb_elements_no_flag=count($liste_1);
}
$liste= array_merge($liste_0,$liste_1);
$nb_elements_total=count($liste);
if($nb_elements_total){
$myCart->reindex_from_list($liste);
}
print "
";
}
return $display;
}
public static function process_print($idcaddie_new=0) {
global $action;
switch ($action) {
case "print_prepare" :
static::print_prepare($idcaddie_new);
break;
case "print" :
static::set_session();
break;
case "add_item":
default :
if ($_SESSION["PRINT_CART"]) {
static::print_cart();
}
break;
}
}
public static function get_redirection_editable_paniers($idcaddie=0) {
global $page, $nb_per_page;
$href_location = static::get_constructed_link('gestion', 'panier', '', $idcaddie);
if(!empty($page)) $href_location .= "&page=".$page;
if(!empty($nb_per_page)) $href_location .= "&nb_per_page=".$nb_per_page;
return "";
}
} // fin de déclaration de la classe caddie_root_controller