00001 <?php
00002 require_once('const.php');
00003 require_once('config.php');
00004
00011
00012 # $_SESSION[] is used in this file, so start the session if necessary
00013
00014 if (session_id() == "") { session_start(); }
00015
00016
00024
00025 $actions_info = array (
00026
00027 'send_reminder' => array (
00028
00029 'button' => 'b_send_reminder',
00030 'button_label' => 'Passwort zusenden',
00031 'confirm' => FALSE,
00032 'input' => array( ),
00033 'eval' => 'send_reminder($smarty,$INPUT,$db);',
00034 "acl" => array( "any" => "any"),
00035
00036 ),
00037
00038 'report' => array (
00039 'button' => 'b_report',
00040 'button_label' => 'Status-Report per E-Mail jetzt senden',
00041 'confirm' => FALSE,
00042 'input' => array( ),
00043 'eval' => 'report($smarty,$INPUT, $db);',
00044
00045 "acl" => array( "any" => "any"),
00046 ),
00047
00048 'opac' => array (
00049 'button' => 'b_opac',
00050 'button_label' => 'Im Katalog anzeigen',
00051 'confirm' => FALSE,
00052 'input' => array( "mode" => "opac" ),
00053 'eval' => 'view_item($smarty,$INPUT, $db);',
00054
00055 'button_visible_if' => array (
00056 "item" => array("book"),
00057 ),
00058
00059 "acl" => array( "book" => "any"),
00060 ),
00061
00062 'view' => array (
00063 'button' => 'b_view',
00064 'button_label' => 'Anzeigen',
00065 'confirm' => FALSE,
00066 'input' => array( ),
00067 'eval' => 'view_item($smarty,$INPUT, $db);',
00068
00069 "acl" => array( "any" => "any"),
00070 ),
00071
00072
00073 'new' => array (
00074 'button' => 'b_new',
00075 'button_label' => 'neu anlegen',
00076 'confirm' => FALSE,
00077 'input' => array( "mode" => "new"),
00078 'eval' => 'edit_item($smarty,$INPUT, $db);',
00079 'acl' => array (
00080 "user" => "any",
00081 "collection" => "role=admin,role=edit",
00082 "article" => "role=admin,role=edit",
00083 "book" => "role=admin,role=edit",
00084 "url" => "role=admin,role=edit",
00085 "file" => "role=admin,role=edit",
00086 ),
00087 ),
00088
00089 'cancel' => array (
00090 'button' => 'b_cancel',
00091 'button_label' => 'Abbrechen',
00092 'confirm' => FALSE,
00093 'input' => array( ),
00094 'acl' => array ( "any" => "any" ),
00095 ),
00096
00097 'cancel_order' => array (
00098 'button' => 'b_cancel_order',
00099 'button_label' => 'Bestellung stornieren',
00100 'confirm' => TRUE,
00101 'input' => array( "state" => "inactive"),
00102 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00103
00104 'button_visible_if' => array(
00105 "state" => array ("new"),
00106 "item" => array("article","book"),
00107 "mode" => array("edit","admin"),
00108 ),
00109
00110 'acl' => array (
00111 "article" => "role=admin,owner",
00112 "book" => "role=admin,owner",
00113 ),
00114
00115 ),
00116 'coll_edit' => array (
00117 'button' => 'b_coll_edit',
00118 'button_label' => 'Bearbeiten',
00119 'confirm' => FALSE,
00120 'input' => array( ),
00121 'url' => 'collection.php?mode=edit&state=&',
00122
00123 'button_visible_if' => array (
00124 "item" => array("collection"),
00125 "state" => array("active"),
00126 ),
00127
00128 'acl' => array (
00129 "collection" => "role=admin,owner",
00130 ),
00131 ),
00132
00133 'coll_release' => array (
00134 'button' => 'b_coll_release',
00135 'button_label' => 'Auflösen',
00136 'confirm' => TRUE,
00137 'input' => array( "state" => "inactive"),
00138 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00139
00140 'button_visible_if' => array(
00141 "state" => array("active"),
00142 "item" => array("collection"),
00143 "mode" => array("edit","admin"),
00144 ),
00145
00146 'acl' => array (
00147 "collection" => "role=admin,owner",
00148 ),
00149
00150 ),
00151
00152 'coll_revive' => array (
00153 'button' => 'b_coll_revive',
00154 'button_label' => 'Aktivieren',
00155 'confirm' => FALSE,
00156 'input' => array( "state" => "active"),
00157 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00158
00159 'button_visible_if' => array(
00160 "state" => array("obsolete","inactive"),
00161 "item" => array("collection"),
00162 "mode" => array("edit","admin"),
00163 ),
00164 'acl' => array (
00165 "collection" => "role=admin,owner",
00166 ),
00167 ),
00168
00169 'accept' => array (
00170 'button' => 'b_accept',
00171 'button_label' => 'Bestellung annehmen',
00172 'confirm' => FALSE,
00173 'input' => array( "state" => "open"),
00174 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00175
00176 'button_visible_if' => array (
00177 "item" => array("article","book"),
00178 "state" => array("new"),
00179 "mode" => array("staff","admin"),
00180 ),
00181 'acl' => array (
00182 "article" => "role=admin,role=staff",
00183 "book" => "role=admin,role=staff",
00184 ),
00185 ),
00186
00187 'activate' => array (
00188 'button' => 'b_activate',
00189 'button_label' => 'Aktivieren',
00190 'confirm' => FALSE,
00191 'input' => array( "state" => "active"),
00192 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00193
00194 'button_visible_if' => array (
00195 "state" => array("inactive"),
00196 "item" => array("file", "url"),
00197 "mode" => array("edit","admin"),
00198 ),
00199
00200 'acl' => array (
00201 "file" => "owner,role=admin",
00202 "url" => "owner,role=admin",
00203 ),
00204 ),
00205
00206 'deactivate' => array (
00207 'button' => 'b_deactivate',
00208 'button_label' => 'Deaktivieren',
00209 'confirm' => FALSE,
00210 'input' => array( "state" => "inactive"),
00211 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00212
00213 'button_visible_if' => array (
00214 "state" => array("active"),
00215 "item" => array("file", "url"),
00216 "mode" => array("edit","admin"),
00217 ),
00218
00219 'acl' => array (
00220 "file" => "owner,role=admin",
00221 "url" => "owner,role=admin",
00222 ),
00223 ),
00224
00225 'finished' => array (
00226 'button' => 'b_finished',
00227 'button_label' => 'Bestellung erledigt',
00228 'confirm' => FALSE,
00229 'input' => array( "state" => "active"),
00230 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00231
00232 'button_visible_if' => array (
00233 "state" => array("open"),
00234 "mode" => array("staff","admin"),
00235 ),
00236
00237 'acl' => array (
00238 "article" => "role=admin,role=staff",
00239 "book" => "role=admin,role=staff",
00240 ),
00241 ),
00242
00243 'reject' => array (
00244 'button' => 'b_reject',
00245 'button_label' => 'Bestellung ablehnen',
00246 'confirm' => TRUE,
00247 'input' => array( "state" => "inactive"),
00248 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00249
00250 'button_visible_if' => array (
00251 "item" => array("article","book"),
00252 "state" => array("new","open"),
00253 "mode" => array("staff","admin"),
00254 ),
00255 'acl' => array (
00256 "article" => "role=admin,role=staff",
00257 "book" => "role=admin,role=staff",
00258 ),
00259 ),
00260
00261 'return' => array (
00262 'button' => 'b_return',
00263 'button_label' => 'Rückgabe erledigt',
00264 'confirm' => FALSE,
00265 'input' => array( "state" => "inactive"),
00266 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00267
00268 'button_visible_if' => array (
00269 "item" => array("article","book"),
00270 "state" => array("obsolete"),
00271 "mode" => array("staff","admin"),
00272 ),
00273
00274 'acl' => array (
00275 "article" => "role=admin,role=staff",
00276 "book" => "role=admin,role=staff",
00277 ),
00278 ),
00279
00280 'cancel_release' => array (
00281 'button' => 'b_cancel_release',
00282 'button_label' => 'Bestellung verlängern',
00283 'confirm' => FALSE,
00284 'input' => array( "state" => "open"),
00285 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00286
00287 'button_visible_if' => array (
00288 "item" => array("article","book"),
00289 "state" => array("obsolete"),
00290 "mode" => array("edit","admin"),
00291 ),
00292 'acl' => array (
00293 "article" => "role=admin,owner",
00294 "book" => "role=admin,owner",
00295 ),
00296 ),
00297
00298 'revive' => array (
00299 'button' => 'b_revive',
00300 'button_label' => 'Bestellung erneuern',
00301 'confirm' => FALSE,
00302 'input' => array( "state" => "new"),
00303 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00304
00305 'button_visible_if' => array (
00306 "item" => array("book", "article"),
00307 "state" => array("inactive"),
00308 "mode" => array("edit","admin"),
00309 ),
00310 'acl' => array (
00311 "article" => "role=admin,owner",
00312 "book" => "role=admin,owner",
00313 ),
00314 ),
00315
00316
00317 'release' => array (
00318 'button' => 'b_release',
00319 'button_label' => 'Rückgabe',
00320 'confirm' => FALSE,
00321 'input' => array( "state" => "obsolete"),
00322 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00323
00324 'button_visible_if' => array (
00325 "item" => array("book", "article"),
00326 "state" => array("active"),
00327 "mode" => array("edit","admin"),
00328 ),
00329 'acl' => array (
00330 "article" => "role=admin,owner",
00331 "book" => "role=admin,owner",
00332 ),
00333 ),
00334
00335 'edit' => array (
00336 'button' => 'b_edit',
00337 'button_label' => 'Bearbeiten',
00338 'confirm' => FALSE,
00339 'input' => array( "mode" => "edit"),
00340 'eval' => 'edit_item($smarty,$INPUT, $db);',
00341
00342 'button_visible_if' => array (
00343 "item" => array("article","book", "file", "url", "user"),
00344 "mode" => array("edit","staff", "admin"),
00345 ),
00346 'acl' => array (
00347 "article" => "role=admin,role=staff,owner",
00348 "book" => "role=admin,role=staff,owner",
00349 "file" => "role=admin,role=staff,owner",
00350 "url" => "role=admin,role=staff,owner",
00351 "collection" => "role=admin,role=staff,owner",
00352 "user" => "role=admin",
00353 ),
00354 ),
00355
00356 'extend_loan' => array (
00357 'button' => 'b_extend_loan',
00358 'button_label' => 'Frist verlängern',
00359 'confirm' => FALSE,
00360 'input' => array( "mode" => "edit"),
00361 'eval' => 'edit_item($smarty,$INPUT, $db);',
00362
00363 'button_visible_if' => array (
00364 "item" => array("collection"),
00365 "state" => array("active"),
00366 "mode" => array("edit", "admin"),
00367 ),
00368 'acl' => array (
00369 "collection" => "role=admin,owner",
00370 ),
00371 ),
00372
00373 'upload' => array(
00374 'button' => 'b_upload',
00375 'button_label' => 'Dateien hochladen',
00376 'confirm' => FALSE,
00377 'eval' => 'upload($smarty,$INPUT, $db);',
00378 'input' => array( ),
00379
00380 'acl' => array (
00381 "article" => "role=admin,role=staff",
00382 "book" => "role=admin,role=staff",
00383 "file" => "role=admin,role=staff,owner",
00384 ),
00385 ),
00386
00387 'delete' => array (
00388 'button' => 'b_delete',
00389 'button_label' => 'Löschen',
00390 'confirm' => TRUE,
00391 'input' => array( ),
00392 'eval' => 'del_item($smarty,$INPUT, $db);',
00393
00394 'button_visible_if' => array (
00395 "state" => array("inactive"),
00396 "mode" => array("edit","admin"),
00397 ),
00398
00399 'acl' => array (
00400 "article" => "role=admin,owner",
00401 "book" => "role=admin,owner",
00402 "file" => "role=admin,owner",
00403 "collection" => "role=admin,owner",
00404 "user" => "role=admin",
00405 ),
00406 ),
00407
00408 'delete_url' => array (
00409 'button' => 'b_delete_url',
00410 'button_label' => 'Löschen',
00411 'confirm' => TRUE,
00412 'input' => array( ),
00413 'eval' => 'del_item($smarty,$INPUT, $db);',
00414
00415 'button_visible_if' => array (
00416 "state" => array("active"),
00417 "item" => array("url", "file"),
00418 "mode" => array("edit","admin"),
00419 ),
00420
00421 'acl' => array (
00422 "url" => "role=admin,owner",
00423 "file" => "role=admin,owner",
00424 ),
00425 ),
00426
00427
00428
00429 'user_disable' => array (
00430 'button' => 'b_user_disable',
00431 'button_label' => 'Benutzer sperren',
00432 'confirm' => TRUE,
00433 'input' => array( "state" => "inactive"),
00434 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00435
00436 'button_visible_if' => array (
00437 "item" => array("user"),
00438 "mode" => array("admin"),
00439 "state" => array("active"),
00440 ),
00441 'acl' => array (
00442 "user" => "role=admin",
00443 ),
00444 ),
00445
00446 'user_enable' => array (
00447 'button' => 'b_user_enable',
00448 'button_label' => 'Benutzer entsperren',
00449 'confirm' => FALSE,
00450 'input' => array( "state" => "active"),
00451 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00452
00453 'button_visible_if' => array (
00454 "item" => array("user"),
00455 "mode" => array("admin"),
00456 "state" => array("inactive"),
00457 ),
00458 'acl' => array (
00459 "user" => "role=admin",
00460 ),
00461 ),
00462
00463 'user_accept' => array (
00464 'button' => 'b_user_accept',
00465 'button_label' => 'Benutzer akzeptieren',
00466 'confirm' => FALSE,
00467 'input' => array( "state" => "open"),
00468 'eval' => 'set_item_state($smarty,$INPUT, $db);',
00469
00470 'button_visible_if' => array (
00471 "item" => array("user"),
00472 "mode" => array("admin"),
00473 "state" => array("new"),
00474 ),
00475 'acl' => array (
00476 "user" => "role=admin",
00477 ),
00478 ),
00479
00480 'user_reject' => array (
00481 'button' => 'b_user_reject',
00482 'button_label' => 'Benutzer ablehnen',
00483 'confirm' => TRUE,
00484 'input' => array( ),
00485 'eval' => 'del_item($smarty,$INPUT, $db);',
00486
00487 'button_visible_if' => array (
00488 "item" => array("user"),
00489 "mode" => array("admin"),
00490 "state" => array("new"),
00491 ),
00492 'acl' => array (
00493 "user" => "role=admin",
00494 ),
00495 ),
00496
00497 'setpw' => array (
00498 'button' => 'b_setpw',
00499 'button_label' => 'Passwort ändern',
00500 'confirm' => FALSE,
00501 'input' => array( ),
00502 'eval' => 'setpw($smarty,$INPUT, $db);',
00503
00504 'acl' => array (
00505 "any" => "role=admin,role=staff,role=edit",
00506 ),
00507 ),
00508
00509 'new_email' => array (
00510 'button' => 'b_new_email',
00511 'button_label' => 'E-Mail senden',
00512 'confirm' => FALSE,
00513 'input' => array( "mode" => "new", "item" => "email" ),
00514 'eval' => 'edit_item($smarty,$INPUT, $db);',
00515
00516
00517 'button_visible_if' => array (
00518 "item" => array("article","book","url","file"),
00519 "mode" => array("staff","admin"),
00520 ),
00521
00522 'acl' => array (
00523 "any" => "role=admin,role=staff",
00524 ),
00525 ),
00526
00527 'view_email' => array (
00528 'button' => 'b_view_email',
00529 'button_label' => 'Anzeigen',
00530 'confirm' => FALSE,
00531 'eval' => 'view_email($smarty,$INPUT, $db);',
00532
00533 'acl' => array ("any" => "role=admin,role=staff,owner"),
00534 ),
00535
00536 );
00537
00538
00546
00547 $item_info = array (
00548
00549 "DEFAULT" => array (
00550 "template" => array (
00551 "new" => "edit_default.tpl",
00552 "edit" => "edit_default.tpl",
00553 "staff" => "edit_default.tpl",
00554 "admin" => "edit_default.tpl",
00555 ),
00556
00557 "validation_info" => array (),
00558
00559 "sql_param" => array(
00560 "table" => "document",
00561 "tables" => "document",
00562 "cond" => "id=@id@",
00563
00564 "data" => array (
00565 "created" => strftime("%Y-%m-%d %H:%M:%S"),
00566 "last_modified" => strftime("%Y-%m-%d %H:%M:%S"),
00567 "last_state_change" => strftime("%Y-%m-%d %H:%M:%S"),
00568
00569 "relevance" => 3,
00570 "state" => "new",
00571 "url" => "",
00572 "url_type_id" => 4,
00573 ),
00574
00575 ),
00576
00577 "sql_input" => array(
00578 "new" => "title,author,url,url_type_id,notes,protected,relevance,doc_type_id,collection_id,order_notes",
00579 "edit" => "title,author,url,url_type_id,notes,relevance,protected,order_notes",
00580 "staff" => "title,author,url,url_type_id,protected,order_notes",
00581 "admin" => "title,author,url,url_type_id,notes,relevance,protected,order_notes",
00582 ),
00583
00584 ),
00585
00586 "article" => array(
00587 "validation_info" => array () ,
00588
00589 "template" => array(
00590 "new" => "edit_article.tpl",
00591 "edit" => "edit_article.tpl",
00592 "staff" => "edit_article.tpl",
00593 "admin" => "edit_article.tpl",
00594 ),
00595
00596 "sql_param" => array(
00597 "table" => "document",
00598 "tables" => "document",
00599 "cond" => "id=@id@",
00600
00601 "data" => array (
00602 "created" => strftime("%Y-%m-%d %H:%M:%S"),
00603 "last_modified" => strftime("%Y-%m-%d %H:%M:%S"),
00604 "last_state_change" => strftime("%Y-%m-%d %H:%M:%S"),
00605 "relevance" => 3,
00606 "state" => "new",
00607 "url_type_id" => 3,
00608 "protected" => TRUE,
00609 ),
00610 ),
00611
00612 "sql_input" => array (
00613 "new" => "title,author,journal,year,volume,pages,notes,order_notes,collection_id,relevance,doc_type_id",
00614 "edit" => "title,author,journal,year,volume,pages,relevance,notes,order_notes",
00615 "staff" => "title,author,journal,year,volume,pages,url,url_type_id,order_notes,protected",
00616 "admin" => "title,author,journal,year,volume,pages,url,url_type_id,relevance,notes,order_notes,protected",
00617 ),
00618
00619 ),
00620
00621 "book" => array(
00622
00623 "template" => array (
00624 "new" => "new_book.tpl",
00625 "edit" => "edit_book.tpl",
00626 "staff" => "edit_book.tpl",
00627 "admin" => "edit_book.tpl",
00628 ),
00629
00630 "validation_info" => array (),
00631
00632 "sql_param" => array(
00633 "table" => "document",
00634 "tables" => "document",
00635 "cond" => "id=@id@",
00636 "data" => array (
00637 "created" => strftime("%Y-%m-%d %H:%M:%S"),
00638 "last_modified" => strftime("%Y-%m-%d %H:%M:%S"),
00639 "last_state_change" => strftime("%Y-%m-%d %H:%M:%S"),
00640 "relevance" => 3,
00641 "state" => "new",
00642 "url_type_id" => 2,
00643 "url" => "",
00644 ),
00645 ),
00646
00647 "validation_info" => array(
00648 # "signature" => "/^.*[a-zA-Z0-9].*$/",
00649 ),
00650
00651 "sql_input" => array (
00652 "new" => "title,volume,author,publisher,year,edition,signature,ppn,notes,order_notes,collection_id,doc_type_id,relevance,url",
00653 "edit" => "relevance,notes,order_notes",
00654 "staff" => "title,volume,author,publisher,year,edition,signature,ppn,order_notes,collection_id,doc_type_id,protected,url,url_type_id",
00655 "admin" => "title,volume,author,publisher,year,edition,signature,ppn,notes,order_notes,collection_id,doc_type_id,relevance,protected,url,url_type_id",
00656 ),
00657 ),
00658
00659 "email" => array(
00660
00661 "template" => array (
00662 "new" => "edit_email.tpl",
00663 "edit" => "edit_email.tpl",
00664 "staff" => "edit_email.tpl",
00665 "admin" => "edit_email.tpl",
00666 ),
00667
00668 "validation_info" => array (
00669 "text" => "//",
00670 ),
00671
00672 "sql_param" => array(
00673 "table" => "email",
00674 "tables" => "email",
00675 "cond" => "id=@id@",
00676
00677 "data" => array (
00678 "created" => strftime("%Y-%m-%d %H:%M:%S"),
00679 "user_id" => (isset($_SESSION['user']))
00680 ? $_SESSION['user']['id'] : "",
00681 ),
00682 ),
00683
00684 "validation_info" => array(
00685 "document_id" => "/^[0-9]+$/",
00686 "text" => "//",
00687 ),
00688
00689 "sql_input" => array (
00690 "new" => "document_id,text",
00691 "edit" => "",
00692 "staff" => "",
00693 "admin" => "",
00694 ),
00695 ),
00696
00697 "collection" => array (
00698
00699
00700 "template" => array (
00701 "new" => "edit_collection.tpl",
00702 "edit" => "edit_collection.tpl",
00703 "staff" => "edit_collection.tpl",
00704 "admin" => "edit_collection.tpl",
00705 ),
00706
00707 "validation_info" => array (
00708 "title" => "/^.+$/",
00709 "collection_no" => "/^[0-9]+$/",
00710 "password" => "/^......*$/",
00711 ),
00712
00713 "sql_param" => array(
00714 "table" => "collection",
00715 "tables" => "collection",
00716 "cond" => "id=@id@",
00717 "data" => array (
00718 "created" => strftime("%Y-%m-%d %H:%M:%S"),
00719 "last_modified" => strftime("%Y-%m-%d %H:%M:%S"),
00720 "last_state_change" => strftime("%Y-%m-%d %H:%M:%S"),
00721
00722 "user_id" => (isset($_SESSION['user']))?
00723 $_SESSION['user']['id'] : "",
00724 "state" => 'active',
00725 "location_id" => $default_location_id,
00726 ),
00727 ),
00728
00729 "sql_input" => array (
00730 "new" => "title,collection_no,password,user_id,expiry_date,notes",
00731 "edit" => "title,collection_no,password,expiry_date,notes",
00732 "staff" => "location_id,expiry_date",
00733 "admin" => "title,collection_no,password,location_id,expiry_date,notes",
00734 ),
00735 ),
00736
00737 "file" => array (
00738
00739 "template" => array (
00740 "new" => "edit_file.tpl",
00741 "edit" => "edit_file.tpl",
00742 "staff" => "edit_file.tpl",
00743 "admin" => "edit_file.tpl",
00744 ),
00745
00746 "validation_info" => array (),
00747
00748 "sql_param" => array(
00749 "table" => "document",
00750 "tables" => "document",
00751 "cond" => "id=@id@",
00752
00753 "data" => array (
00754 "created" => strftime("%Y-%m-%d %H:%M:%S"),
00755 "last_modified" => strftime("%Y-%m-%d %H:%M:%S"),
00756 "last_state_change" => strftime("%Y-%m-%d %H:%M:%S"),
00757
00758 "relevance" => 3,
00759 "state" => "active",
00760 "url" => "",
00761 "url_type_id" => 3,
00762 ),
00763
00764 ),
00765
00766 "sql_input" => array(
00767 "new" => "title,author,url,url_type_id,notes,protected,relevance,doc_type_id,collection_id",
00768 "edit" => "title,author,url,url_type_id,notes,relevance,protected",
00769 "staff" => "title,author,url,url_type_id,protected",
00770 "admin" => "title,author,url,url_type_id,notes,relevance,protected",
00771 ),
00772
00773 ),
00774
00775
00776 "url" => array (
00777
00778 "template" => array (
00779 "new" => "edit_url.tpl",
00780 "edit" => "edit_url.tpl",
00781 "staff" => "edit_url.tpl",
00782 "admin" => "edit_url.tpl",
00783 ),
00784
00785 "validation_info" => array (),
00786
00787 "sql_param" => array(
00788 "table" => "document",
00789 "tables" => "document",
00790 "cond" => "id=@id@",
00791
00792 "data" => array (
00793 "created" => strftime("%Y-%m-%d %H:%M:%S"),
00794 "last_modified" => strftime("%Y-%m-%d %H:%M:%S"),
00795 "last_state_change" => strftime("%Y-%m-%d %H:%M:%S"),
00796
00797 "relevance" => 3,
00798 "state" => "active",
00799 "url" => "http://",
00800 "url_type_id" => 4,
00801 ),
00802
00803 ),
00804
00805 "sql_input" => array(
00806 "new" => "title,author,url,url_type_id,notes,protected,relevance,doc_type_id,collection_id",
00807 "edit" => "title,author,url,url_type_id,notes,relevance,protected",
00808 "staff" => "title,author,url,url_type_id,protected",
00809 "admin" => "title,author,url,url_type_id,notes,relevance,protected",
00810 ),
00811
00812 ),
00813
00814 "user" => array (
00815 "template" => array (
00816 "new" => "edit_user.tpl",
00817 "edit" => "edit_user.tpl",
00818 "staff" => "edit_user.tpl",
00819 "admin" => "edit_user.tpl",
00820 ),
00821
00822 "validation_info" => array (),
00823
00824 "sql_param" => array (
00825 "table" => "user",
00826 "tables" => "user",
00827 "cond" => "id=@id@",
00828 "data" => array (
00829 "created" => strftime("%Y-%m-%d %H:%M:%S"),
00830 "last_modified" => strftime("%Y-%m-%d %H:%M:%S"),
00831 "last_state_change" => strftime("%Y-%m-%d %H:%M:%S"),
00832
00833 "state" => "new",
00834 "role_id" => $default_role_id,
00835
00836 # "email" => "xxx@tu-bs.de",
00837 # "phone" => "0531 391-xxxx"
00838 ),
00839 ),
00840
00841 "sql_input" => array (
00842 "new" => "forename,surname,email,phone,sex,degree_id,use_alias,alias_forename,alias_surname,alias_sex,alias_degree_id,login",
00843 "edit" => "",
00844 "staff" => "",
00845 "admin" => "forename,surname,email,phone,login,password,role_id,sex,degree_id,use_alias,alias_forename,alias_surname,alias_sex,alias_degree_id",
00846 ),
00847 ),
00848 );
00849
00856
00857 $validation_info = array(
00858 "action" => "/^[a-z_]*$/",
00859 "alias_degree_id" => "/^[0-9]*$/",
00860 "alias_surname" => "/^.*$/",
00861 "alias_forename" => "/^.*$/",
00862 "alias_sex" => "/^[mf]?$/",
00863 "author" => "/^.*$/",
00864 "b_cancel" => "/^.*$/",
00865 "b_ok" => "/^.*$/",
00866 "b_ok_x" => "/^.*$/",
00867 "b_ok_y" => "/^.*$/",
00868 "b_prio_down" => "/^.*$/",
00869 "b_prio_down" => "/^.*$/",
00870 "b_prio_up" => "/^.*$/",
00871 "b_report" => "/^.*$/",
00872 'b_accept' => "//",
00873 'b_activate' => "//",
00874 'b_cancel' => "//",
00875 'b_cancel_order' => "//",
00876 'b_cancel_order_2' => "//",
00877 'b_cancel_release' => "//",
00878 'b_coll_edit' => "//",
00879 'b_coll_release' => "//",
00880 'b_coll_revive' => "//",
00881 'b_deactivate' => "//",
00882 'b_delete' => "//",
00883 'b_delete_url' => "//",
00884 'b_directory' => "//",
00885 'b_edit' => "//",
00886 'b_extend_loan' => "//",
00887 'b_finished' => "//",
00888 'b_new' => "//",
00889 'b_new_email' => "//",
00890 'b_opac' => "//",
00891 'b_reject' => "//",
00892 'b_release' => "//",
00893 'b_return' => "//",
00894 'b_revive' => "//",
00895 'b_setpw' => "//",
00896 'b_user_accept' => "//",
00897 'b_user_reject' => "//",
00898 'b_user_disable' => "//",
00899 'b_user_enable' => "//",
00900 'b_view' => "//",
00901 'b_view_email' => "//",
00902 "c_dontask" => "/^.*$/",
00903 "c_order_toc" => "/^.*$/",
00904 "degree_id" => "/^[0-9]*$/",
00905 "document_id" => "/^[0-9]*$/",
00906 "edition" => "/^.*$/",
00907 "expiry_date_Day" => "/^[0-9]*$/",
00908 "expiry_date_Month" => "/^[0-9]*$/",
00909 "expiry_date_Year" => "/^[0-9]*$/",
00910 "email" => "/^.*$/",
00911 "file" => "/^[^\/]*$/",
00912 "forename" => "/^.*$/",
00913 "id" => "/^[0-9]*$/",
00914 "item" => "/^[a-z]*$/",
00915 "journal" => "/^.*$/",
00916 "collection_id" => "/^[0-9]*$/",
00917 "collection_no" => "/^.*$/",
00918 "lecture_no" => "/^.*$/",
00919 "doc_type_id" => "/^[0-9]*$/",
00920 "location_id" => "/^[0-9]*$/",
00921 "login" => "/^.*$/",
00922 "mode" => "/^(new|edit|staff|admin|view|opac|file|print|)$/",
00923 "notes" => "//",
00924 "order_notes" => "//",
00925 "page" => "/^[0-9]*$/",
00926 "pages" => "/^.*$/",
00927 "password" => "/^.*$/",
00928 "pw1" => "/^.*$/",
00929 "pw2" => "/^.*$/",
00930 "userfile1" => "/^.*$/",
00931 "userfile2" => "/^.*$/",
00932 "userfile3" => "/^.*$/",
00933 "phone" => "/^.*$/",
00934 "protected" => "/^.*$/",
00935 "publisher" => "/^.*$/",
00936 "ppn" => "//",
00937 "redirect" => "/^.*$/",
00938 "relevance" => "/^[0-5]?$/",
00939 "role_id" => "/^[0-9]*$/",
00940 "sex" => "/^[mf]?$/",
00941 "signature" => "/^.*$/",
00942 "state" => "/^[a-z]*$/",
00943 "sort_crit" => "/^(author asc|title asc|relevance desc|signature asc|)$/",
00944 "surname" => "/^.*$/",
00945 "text" => "//",
00946 "title" => "/^.*$/",
00947 "type" => "/^[a-z]*$/",
00948 "user_id" => "/^[0-9]*$/",
00949 "url" => "/^.*$/",
00950 "url_type_id" => "/^[0-9]*$/",
00951 "use_alias" => "//",
00952 "volume" => "/^.*$/",
00953 "year" => "/^.*$/",
00954 );
00955
00957
00958 $mime_types = array (
00959 '/^.*\.pdf$/i' => 'application/pdf',
00960 '/^.*\.gif$/i' => 'image/gif',
00961 '/^.*\.jpe?g$/i' => 'image/jpeg',
00962 '/^.*\.png$/i' => 'image/png',
00963 '/^.*\.txt$/i' => 'text/plain',
00964 '/^.*\.html?$/i' => 'text/html'
00965 );
00966
00967 ?>