Changeset 4362
- Timestamp:
- 05/12/11 11:52:50 (13 years ago)
- Location:
- contrib
- Files:
-
- 7 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/Dms/inc/class.uimydms.inc.php
r3526 r4362 13 13 14 14 /* $Id: class.uimydms.inc.php 22794 2006-11-06 05:53:11Z lkneschke $ */ 15 15 define('PHPGW_SERVER_ROOT','/var/www/expresso'); 16 16 require_once(PHPGW_SERVER_ROOT.'/mydms/inc/inc.Settings.php'); 17 17 require_once(PHPGW_SERVER_ROOT.'/mydms/inc/inc.DBAccess.php'); … … 759 759 $this->t->set_var('lang_comment',lang('comment')); 760 760 $this->t->set_var('lang_keywords',lang('keywords')); 761 $this->t->set_var('lang_download',lang(' download'));761 $this->t->set_var('lang_download',lang('Descargar Archivo')); 762 762 $this->t->set_var('lang_last_update',lang('last update')); 763 763 $this->t->set_var('lang_current_version',lang('current version')); … … 776 776 $this->t->set_var('lang_delete',lang('delete')); 777 777 $this->t->set_var('lang_view_online',lang('view online')); 778 $this->t->set_var('lang_confirm_delete',lang(' Do you really want to delete this document?'));778 $this->t->set_var('lang_confirm_delete',lang('Relmente quiere borrar el documento?')); 779 779 $this->t->set_var('lang_update_document',lang('update document')); 780 780 $this->t->set_var('lang_update',lang('update')); … … 865 865 { 866 866 $documentID = ($_documentID === false ? (int)$_GET['documentid'] : $_documentID); 867 867 868 //echo "documento".$documentID; 868 869 if(!$document = getDocument($documentID)) 869 870 { 870 871 print "Access denied!"; exit; 871 872 } 873 874 872 875 $user = getUser($GLOBALS['phpgw_info']['user']['account_id']); 873 876 $accessMode = $document->getAccessMode($user); -
contrib/Dms/inc/inc.ClassDocument.php
r3526 r4362 3 3 function getDocument($id) 4 4 { 5 6 // echo "aggggi".$id; 5 7 if (!is_numeric($id)) 6 8 die ("invalid documentid"); 7 9 8 10 $queryStr = "SELECT * FROM phpgw_mydms_Documents WHERE id = " . $id; 11 12 //echo "<br>documentos".$queryStr."<br>"; 9 13 $resArr = $GLOBALS['mydms']->db->getResultArray($queryStr); 10 14 if (is_bool($resArr) && $resArr == false) … … 15 19 16 20 $resArr = $resArr[0]; 17 $newDocument = new Document($resArr["id"], $resArr["name"], $resArr["comment"], $resArr["date"], $resArr["expires"], $resArr["owner"], $resArr["folder"], $resArr["inheritAccess"], $resArr["defaultAccess"], $resArr["locked"], $resArr["keywords"], $resArr["sequence"]); 18 21 $newDocument = new Document($resArr["id"], $resArr["name"], $resArr["comment"], $resArr["date"], $resArr["expires"], $resArr["owner"], $resArr["folder"], $resArr[7], $resArr[8], $resArr[9], $resArr["keywords"], $resArr["sequence"]); 22 23 19 24 if($newDocument->getAccessMode(getUser($GLOBALS['phpgw_info']['user']['account_id'])) > M_NONE) 20 25 return $newDocument; … … 419 424 return M_NONE; 420 425 } 421 426 return $this->getAccessList2(); 422 427 //Berechtigung erben?? 423 428 // wird ï¿œber GetAccessList() bereits realisiert. … … 431 436 } 432 437 */ 433 $highestPrivileged = M_NONE;438 /* $highestPrivileged = M_NONE; 434 439 435 440 //ACLs durchforsten … … 465 470 466 471 //Standard-Berechtigung verwenden 467 return $this->getDefaultAccess(); 468 } 469 472 return $this->getDefaultAccess();*/ 473 } 474 function getAccessList2() 475 { 476 477 $grupos=read_repository2($GLOBALS['phpgw_info']['user']['account_id']); 478 // echo "".$GLOBALS['phpgw_info']['user']['account_id']; 479 480 if($grupos!=''){ 481 $queryStr = "SELECT * FROM phpgw_mydms_acls WHERE targettype = ".T_FOLDER." AND target in ( select folder from phpgw_mydms_Documents WHERE id=" . $this->_id . ") and (userid=".$GLOBALS['phpgw_info']['user']['account_id']." or groupid in (".$grupos.")) ORDER BY targettype"; 482 }else{ 483 $queryStr = "SELECT * FROM phpgw_mydms_acls WHERE targettype = ".T_FOLDER." AND target in ( select folder from phpgw_mydms_Documents WHERE id=" . $this->_id . ") and (userid=".$GLOBALS['phpgw_info']['user']['account_id']." ) ORDER BY targettype"; 484 485 } 486 //echo "aqui".$queryStr ; 487 $resArr = $GLOBALS['mydms']->db->getResultArray($queryStr); 488 489 490 if (is_bool($resArr) && !$resArr) 491 return false; 492 493 //$this->_accessList = array("groups" => array(), "users" => array()); 494 foreach ($resArr as $row) 495 { 496 497 //echo "el grupo de acceso es".$row[4]." ".$row["groupid"]."<br>"; 498 return $row["mode"]; 499 /*if ($row["userid"] != -1) 500 array_push($this->_accessList["users"], new UserAccess($row["userid"], $row["mode"])); 501 else //if ($row["groupID"] != -1) 502 array_push($this->_accessList["groups"], new GroupAccess($row["groupid"], $row["mode"]));*/ 503 } 504 505 506 return $this->_accessList; 507 } 470 508 function getNotifyList() 471 509 { … … 683 721 ); 684 722 685 if(!$this->db->select('phpgw_mydms_DocumentContent', $cols, $where, __LINE__, __FILE__ )) {723 if(!$this->db->select('phpgw_mydms_DocumentContent', $cols, $where, __LINE__, __FILE__, false, 'ORDER BY version,id desc')) { 686 724 return false; 687 725 } -
contrib/Dms/inc/inc.ClassFolder.php
r3526 r4362 4 4 if (!is_numeric($id)) 5 5 die ("invalid folderid"); 6 7 $queryStr = "SELECT * FROM phpgw_mydms_Folders WHERE id = " . $id; 6 $queryStr = "SELECT id,name,parent,comment,owner,inheritaccess,defaultaccess,sequence FROM phpgw_mydms_folders WHERE id = " . $id; 7 8 //echo "<br>folderrrrr".$queryStr."<br>"; 8 9 $resArr = $GLOBALS['mydms']->db->getResultArray($queryStr); 9 10 … … 15 16 $resArr = $resArr[0]; 16 17 if($id == 1) { 17 $resArr[ "defaultAccess"] = M_READ;18 } 19 $newFolder = new Folder($resArr["id"], $resArr["name"], $resArr["parent"], $resArr["comment"], $resArr["owner"], $resArr["inheritAccess"], $resArr["defaultAccess"], $resArr["sequence"]);18 $resArr[6] = M_READ; 19 } 20 // echo $resArr["id"]." ".$resArr[6]." ".$resArr["parent"]." ".$id." ".$GLOBALS['phpgw_info']['user']['account_id']." dddd ".$resArr[5]." dddd ".$resArr["defaultAccess"]; 20 21 22 $newFolder = new Folder($resArr["id"], $resArr["name"], $resArr["parent"], $resArr["comment"], $resArr["owner"], $resArr["inheritaccess"], $resArr["defaultaccess"], $resArr["sequence"]); 23 //echo "llll".$GLOBALS['phpgw_info']['user']['account_id']." ".$resArr["inheritaccess"]; 21 24 #print $resArr["name"]."<br>"; 22 25 #print $newFolder->getAccessMode(getUser($GLOBALS['phpgw_info']['user']['account_id']))."<br>"; 23 if($newFolder->getAccessMode(getUser($GLOBALS['phpgw_info']['user']['account_id'])) > 1) 24 return $newFolder; 25 else 26 if($newFolder->getAccessMode(getUser($GLOBALS['phpgw_info']['user']['account_id'])) > 1){ 27 //echo "retornoooo"; 28 return $newFolder; 29 } 30 else{ 26 31 return false; 32 } 27 33 } 28 34 … … 45 51 function Folder($id, $name, $parentID, $comment, $ownerID, $inheritAccess, $defaultAccess, $sequence) 46 52 { 53 //echo "aaaaaccccseexxx".$inheritAccess; 54 if($inheritAccess=='f'){ 55 unset($inheritAccess); 56 } 47 57 $this->_id = $id; 48 58 $this->_name = $name; … … 53 63 $this->_defaultAccess = $defaultAccess; 54 64 $this->_sequence = $sequence; 55 56 65 $this->db = clone($GLOBALS['phpgw']->db); 57 66 $this->db->set_app('mydms'); 67 // echo"accc".$defaultAccess."lll{ñ{{ñ".$inheritAccess; 58 68 } 59 69 … … 67 77 $where = array('id' => $this->_id); 68 78 69 if(!$this->db->update('phpgw_mydms_ Folders', $data, $where, __LINE__, __FILE__))79 if(!$this->db->update('phpgw_mydms_folders', $data, $where, __LINE__, __FILE__)) 70 80 return false; 71 81 … … 82 92 $where = array('id' => $this->_id); 83 93 84 if(!$this->db->update('phpgw_mydms_ Folders', $data, $where, __LINE__, __FILE__))94 if(!$this->db->update('phpgw_mydms_folders', $data, $where, __LINE__, __FILE__)) 85 95 return false; 86 96 … … 105 115 $where = array('id' => $this->_id); 106 116 107 if(!$this->db->update('phpgw_mydms_ Folders', $data, $where, __LINE__, __FILE__))117 if(!$this->db->update('phpgw_mydms_folders', $data, $where, __LINE__, __FILE__)) 108 118 return false; 109 119 … … 126 136 $where = array('id' => $this->_id); 127 137 128 if(!$this->db->update('phpgw_mydms_ Folders', $data, $where, __LINE__, __FILE__))138 if(!$this->db->update('phpgw_mydms_folders', $data, $where, __LINE__, __FILE__)) 129 139 return false; 130 140 … … 151 161 $where = array('id' => $this->_id); 152 162 153 if(!$this->db->update('phpgw_mydms_ Folders', $data, $where, __LINE__, __FILE__))163 if(!$this->db->update('phpgw_mydms_folders', $data, $where, __LINE__, __FILE__)) 154 164 return false; 155 165 … … 167 177 $where = array('id' => $this->_id); 168 178 169 if(!$this->db->update('phpgw_mydms_ Folders', $data, $where, __LINE__, __FILE__))179 if(!$this->db->update('phpgw_mydms_folders', $data, $where, __LINE__, __FILE__)) 170 180 return false; 171 181 … … 181 191 $where = array('id' => $this->_id); 182 192 183 if(!$this->db->update('phpgw_mydms_ Folders', $data, $where, __LINE__, __FILE__))193 if(!$this->db->update('phpgw_mydms_folders', $data, $where, __LINE__, __FILE__)) 184 194 return false; 185 195 … … 192 202 if (!isset($this->_subFolders)) 193 203 { 194 $queryStr = "SELECT * FROM phpgw_mydms_ Folders WHERE parent = " . $this->_id . " ORDER BY sequence";204 $queryStr = "SELECT * FROM phpgw_mydms_folders WHERE parent = " . $this->_id . " ORDER BY sequence"; 195 205 196 206 … … 226 236 'sequence' => $sequence, 227 237 ); 228 $res = $this->db->insert('phpgw_mydms_ Folders', $insertData, '', __LINE__, __FILE__, 'mydms');238 $res = $this->db->insert('phpgw_mydms_folders', $insertData, '', __LINE__, __FILE__, 'mydms'); 229 239 230 240 if (!$res) … … 233 243 unset($this->_subFolders); 234 244 235 return getFolder($this->db->get_last_insert_id('phpgw_mydms_ Folders','id'));245 return getFolder($this->db->get_last_insert_id('phpgw_mydms_folders','id')); 236 246 } 237 247 … … 307 317 function getDocuments() 308 318 { 319 320 // echo "aaaaaaaquoooooo"; 309 321 if (!isset($this->_documents)) 310 322 { 311 $queryStr = "SELECT * FROM phpgw_mydms_Documents WHERE folder = " . $this->_id . " ORDER BY sequence"; 323 $queryStr = "SELECT * FROM phpgw_mydms_documents WHERE folder = " . $this->_id . " ORDER BY id desc,sequence"; 324 // echo "eeeeee".$queryStr; 312 325 $resArr = $GLOBALS['mydms']->db->getResultArray($queryStr); 313 326 if (is_bool($resArr) && !$resArr) … … 341 354 'sequence' => $sequence, 342 355 ); 343 $res = $this->db->insert('phpgw_mydms_ Documents', $insertData, '', __LINE__, __FILE__, 'mydms');356 $res = $this->db->insert('phpgw_mydms_documents', $insertData, '', __LINE__, __FILE__, 'mydms'); 344 357 345 358 if (!$res) … … 355 368 # return false; 356 369 357 $document = getDocument($this->db->get_last_insert_id('phpgw_mydms_ Documents','id'));370 $document = getDocument($this->db->get_last_insert_id('phpgw_mydms_documents','id')); 358 371 359 372 $res = $document->addContent($comment, $owner, $tmpFile, $orgFileName, $fileType, $mimeType); 360 373 if (is_bool($res) && !$res) 361 374 { 362 $queryStr = "DELETE FROM phpgw_mydms_ Documents WHERE id = " . $document->getID();375 $queryStr = "DELETE FROM phpgw_mydms_documents WHERE id = " . $document->getID(); 363 376 $GLOBALS['mydms']->db->getResult($queryStr); 364 377 return false; … … 389 402 390 403 //Entfernen der Datenbankeintrï¿œge 391 $queryStr = "DELETE FROM phpgw_mydms_ Folders WHERE id = " . $this->_id;392 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 393 return false; 394 $queryStr = "DELETE FROM phpgw_mydms_ ACLs WHERE target = ". $this->_id. " AND targetType = " . T_FOLDER;395 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 396 return false; 397 $queryStr = "DELETE FROM phpgw_mydms_ Notify WHERE target = ". $this->_id. " AND targetType = " . T_FOLDER;404 $queryStr = "DELETE FROM phpgw_mydms_folders WHERE id = " . $this->_id; 405 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 406 return false; 407 $queryStr = "DELETE FROM phpgw_mydms_acls WHERE target = ". $this->_id. " AND targettype = " . T_FOLDER; 408 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 409 return false; 410 $queryStr = "DELETE FROM phpgw_mydms_notify WHERE target = ". $this->_id. " AND targettype = " . T_FOLDER; 398 411 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 399 412 return false; … … 415 428 if (!isset($this->_accessList)) 416 429 { 417 $queryStr = "SELECT * FROM phpgw_mydms_ ACLs WHERE targetType = ".T_FOLDER." AND target = " . $this->_id . " ORDER BY targetType";418 430 $queryStr = "SELECT * FROM phpgw_mydms_acls WHERE targettype = ".T_FOLDER." AND target = " . $this->_id . " ORDER BY targettype"; 431 //echo "aqui".$queryStr ; 419 432 $resArr = $GLOBALS['mydms']->db->getResultArray($queryStr); 420 433 … … 426 439 foreach ($resArr as $row) 427 440 { 441 //echo "el grupo de acceso es".$row[4]." ".$row["groupid"]."<br>"; 442 428 443 if ($row["userid"] != -1) 429 444 array_push($this->_accessList["users"], new UserAccess($row["userid"], $row["mode"])); … … 435 450 return $this->_accessList; 436 451 } 452 453 454 455 function getAccessList2() 456 { 457 458 $grupos=read_repository2($GLOBALS['phpgw_info']['user']['account_id']); 459 // echo "".$GLOBALS['phpgw_info']['user']['account_id']; 460 461 if($grupos!=''){ 462 $queryStr = "SELECT * FROM phpgw_mydms_acls WHERE targettype = ".T_FOLDER." AND target = " . $this->_id . " and (userid=".$GLOBALS['phpgw_info']['user']['account_id']." or groupid in (".$grupos.")) ORDER BY targettype"; 463 }else{ 464 $queryStr = "SELECT * FROM phpgw_mydms_acls WHERE targettype = ".T_FOLDER." AND target = " . $this->_id . " and (userid=".$GLOBALS['phpgw_info']['user']['account_id']." ) ORDER BY targettype"; 465 466 } 467 //echo "<br>aqui".$queryStr ; 468 $resArr = $GLOBALS['mydms']->db->getResultArray($queryStr); 469 470 471 if (is_bool($resArr) && !$resArr) 472 return false; 473 474 //$this->_accessList = array("groups" => array(), "users" => array()); 475 foreach ($resArr as $row) 476 { 477 //echo "acceso".$row["mode"]; 478 //echo "el grupo de acceso es".$row[4]." ".$row["groupid"]."<br>"; 479 return $row["mode"]; 480 /*if ($row["userid"] != -1) 481 array_push($this->_accessList["users"], new UserAccess($row["userid"], $row["mode"])); 482 else //if ($row["groupID"] != -1) 483 array_push($this->_accessList["groups"], new GroupAccess($row["groupid"], $row["mode"]));*/ 484 } 485 486 return false; 487 } 437 488 438 489 function clearAccessList() 439 490 { 440 $queryStr = "DELETE FROM phpgw_mydms_ ACLs WHERE targetType = " . T_FOLDER . " AND target = " . $this->_id;491 $queryStr = "DELETE FROM phpgw_mydms_acls WHERE targettype = " . T_FOLDER . " AND target = " . $this->_id; 441 492 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 442 493 return false; … … 450 501 $userOrGroup = ($isUser) ? "userid" : "groupid"; 451 502 452 $queryStr = "INSERT INTO phpgw_mydms_ ACLs (target, targetType, ".$userOrGroup.", mode) VALUES503 $queryStr = "INSERT INTO phpgw_mydms_acls (target, targettype, ".$userOrGroup.", mode) VALUES 453 504 (".$this->_id.", ".T_FOLDER.", " . $userOrGroupID . ", " .$mode. ")"; 454 505 if (!$GLOBALS['mydms']->db->getResult($queryStr)) … … 463 514 $userOrGroup = ($isUser) ? "userID" : "groupID"; 464 515 465 $queryStr = "UPDATE phpgw_mydms_ ACLs SET mode = " . $newMode . " WHERE targetType = ".T_FOLDER." AND target = " . $this->_id . " AND " . $userOrGroup . " = " . $userOrGroupID;516 $queryStr = "UPDATE phpgw_mydms_acls SET mode = " . $newMode . " WHERE targettype = ".T_FOLDER." AND target = " . $this->_id . " AND " . $userOrGroup . " = " . $userOrGroupID; 466 517 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 467 518 return false; … … 475 526 $userOrGroup = ($isUser) ? "userID" : "groupID"; 476 527 477 $queryStr = "DELETE FROM phpgw_mydms_ ACLs WHERE targetType = ".T_FOLDER." AND target = ".$this->_id." AND ".$userOrGroup." = " . $userOrGroupID;528 $queryStr = "DELETE FROM phpgw_mydms_acls WHERE targettype = ".T_FOLDER." AND target = ".$this->_id." AND ".$userOrGroup." = " . $userOrGroupID; 478 529 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 479 530 return false; … … 492 543 function getAccessMode($user) 493 544 { 545 494 546 GLOBAL $settings; 495 547 … … 532 584 //ACLs durchforsten 533 585 $foundInACL = false; 534 $accessList = $this->getAccessList(); 586 587 return $this->getAccessList2(); 588 /*$accessList = $this->getAccessList(); 535 589 if (!$accessList) { 536 590 return false; … … 552 606 foreach ($accessList["groups"] as $groupAccess) 553 607 { 608 554 609 if ($user->isMemberOfGroup($groupAccess->getGroup())) 555 610 { 611 612 // echo "entro grupoooo<br>";//.$groupAccess->getGroup()." <br>"; 613 556 614 $foundInACL = true; 557 615 if ($groupAccess->getMode() > $highestPrivileged) … … 562 620 } 563 621 if ($foundInACL) 564 return $highestPrivileged; 622 return $highestPrivileged;*/ 565 623 566 624 //Standard-Berechtigung verwenden 567 return $this->getDefaultAccess();625 //return $this->getDefaultAccess(); 568 626 } 569 627 … … 572 630 if (!isset($this->_notifyList)) 573 631 { 574 $queryStr ="SELECT * FROM phpgw_mydms_ Notify WHERE targetType = " . T_FOLDER . " AND target = " . $this->_id;632 $queryStr ="SELECT * FROM phpgw_mydms_notify WHERE targettype = " . T_FOLDER . " AND target = " . $this->_id; 575 633 $resArr = $GLOBALS['mydms']->db->getResultArray($queryStr); 576 634 if (is_bool($resArr) && $resArr == false) … … 593 651 $userOrGroup = ($isUser) ? "userID" : "groupID"; 594 652 595 $queryStr = "INSERT INTO phpgw_mydms_ Notify (target, targetType, " . $userOrGroup . ") VALUES (" . $this->_id . ", " . T_FOLDER . ", " . $userOrGroupID . ")";653 $queryStr = "INSERT INTO phpgw_mydms_notify (target, targettype, " . $userOrGroup . ") VALUES (" . $this->_id . ", " . T_FOLDER . ", " . $userOrGroupID . ")"; 596 654 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 597 655 return false; … … 605 663 $userOrGroup = ($isUser) ? "userID" : "groupID"; 606 664 607 $queryStr = "DELETE FROM phpgw_mydms_ Notify WHERE target = " . $this->_id . " AND targetType = " . T_FOLDER . " AND " . $userOrGroup . " = " . $userOrGroupID;665 $queryStr = "DELETE FROM phpgw_mydms_notify WHERE target = " . $this->_id . " AND targettype = " . T_FOLDER . " AND " . $userOrGroup . " = " . $userOrGroupID; 608 666 if (!$GLOBALS['mydms']->db->getResult($queryStr)) 609 667 return false; -
contrib/Dms/inc/inc.ClassGroup.php
r3526 r4362 10 10 11 11 $name = $GLOBALS['phpgw']->accounts->id2name($id); 12 12 // echo" el grupo es".$name." ".$id."<br>"; 13 13 return new Group($id, $name, ''); 14 14 } … … 144 144 { 145 145 //Wenn die User bereits abgefragt wurden, geht's so schneller: 146 147 //echo "usuariooooo".$user->getID()."<br>"; 148 146 149 if (isset($this->_users)) 147 150 { … … 154 157 155 158 $members = $GLOBALS['phpgw']->accounts->member((int)$this->_id); 159 156 160 $phpgw_group_member = array(); 157 161 158 162 if (is_array($members)) 159 163 { 160 foreach($members as $member)164 /* foreach($members as $member) 161 165 { 162 166 if(!in_array($member['account_id'],$phpgw_group_member)) 163 167 { 164 168 $phpgw_group_member[] = $member['account_id']; 165 } 166 } 169 //echo "grupomiembro".$member['account_id']." ".$this->_id."<br>"; 170 }//else{ 171 //echo "<br>arrreglo<br>".$member['account_id']." ".$phpgw_group_member->id."<br>"; 172 //} 173 }*/ 167 174 } 168 175 … … 177 184 178 185 } 186 187 188 179 189 180 190 /** -
contrib/Dms/inc/inc.ClassUser.php
r3526 r4362 49 49 } 50 50 51 52 53 54 55 function read_repository2($id) 56 { 57 58 $login=$GLOBALS['phpgw']->accounts->id2name($id); 59 $ds = $GLOBALS['phpgw']->common->ldapConnect(); 60 $user_context = $GLOBALS['phpgw_info']['server']['ldap_context']; 61 $group_context = $GLOBALS['phpgw_info']['server']['ldap_context']; 62 $justthese = array("gidnumber"); 63 $sri = @ldap_search($ds, $group_context, ("(&(memberUid=" . $login.")(phpgwaccounttype=g))"), $justthese); 64 65 if(!$sri) 66 return null; 67 $allValues = ldap_get_entries($ds, $sri); 68 69 70 while (list($null,$allVals) = @each($allValues)) 71 { 72 settype($allVals,'array'); 73 74 if($data!=""){ 75 $data=$data.","; 76 } 77 $data=$data. $allVals['gidnumber'][0]; 78 79 80 81 } 82 83 //echo "<br>".$data; 84 return $data; 85 } 86 87 88 function get_account_name($account_id,$valor) 89 { 90 // $acct_type = $this->get_type($account_id); 91 $acct_type ='u'; 92 /* jakjr: using justthese with ldap_search */ 93 //$justthese = array("cn","uid","givenname","sn","gecos"); 94 95 /* search the dn for the given uid */ 96 $ds = $GLOBALS['phpgw']->common->ldapConnect(); 97 $user_context = $GLOBALS['phpgw_info']['server']['ldap_context']; 98 99 $justthese = array("uidnumber", "cn", "mail","gecos","dn"); 100 // $sri = @ldap_search($this->ds, "ou=usuarios,ou=cnti,dc=gob,dc=ve", ("(&(sn=*)(mail=*@*)(structuralObjectClass=inetOrgPerson)(deliveryMode=virtual))"), $justthese); 101 102 //if(($acct_type == 'g') && $this->group_context) 103 // { 104 // $sri = @ldap_search($this->ds, $this->group_context, '(gidnumber=' . (int)$account_id . ')', $justthese); 105 // } 106 // else 107 // { 108 $sri = @ldap_search($ds, $user_context, '(uidnumber=' . (int)$account_id . ')', $justthese); 109 //} 110 111 //echo $this->ds.",". $this->user_context.",". '(uidnumber=' . (int)$account_id . ')'.",". $justthese; 112 if(!$sri) 113 return False; 114 $allValues = ldap_get_entries($ds, $sri); 115 $retorna=""; 116 if($acct_type =='g') 117 { 118 if($valor=='gecos') { 119 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['gecos'][0],'utf-8'); 120 } 121 if($valor=='uidnumber') { 122 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['uidnumber'][0],'utf-8'); 123 } 124 if($valor=='cn') { 125 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['cn'][0],'utf-8'); 126 } 127 128 if($valor=='mail') { 129 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['mail'][0],'utf-8'); 130 } 131 if($valor=='dn') { 132 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['dn'][0],'utf-8'); 133 } 134 135 } 136 else 137 { 138 if($valor=='gecos') { 139 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['gecos'][0],'utf-8'); 140 } 141 if($valor=='uidnumber') { 142 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['uidnumber'][0],'utf-8'); 143 } 144 if($valor=='cn') { 145 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['cn'][0],'utf-8'); 146 } 147 148 if($valor=='mail') { 149 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['mail'][0],'utf-8'); 150 } 151 if($valor=='dn') { 152 $retorna=$GLOBALS['phpgw']->translation->convert($allValues[0]['dn'][0],'utf-8'); 153 } 154 155 156 157 158 } 159 return $retorna; 160 } 161 51 162 function getUser($id) 52 163 { 164 //echo "llego"; 53 165 $resArr["id"] = $id; 54 $resArr["login"] = phpgw_id2name($id);166 $resArr["login"] = phpgw_id2name($id);//get_account_name($id,'dn'); 55 167 $resArr["fullName"] = phpgw_get_accname($id); 56 168 $resArr["email"] = phpgw_get_accemail($id); … … 59 171 $resArr["pwd"] = ''; 60 172 $resArr["comment"] = ''; 173 // echo "hhh".$resArr["login"]." ".$resArr["fullName"]." ".$resArr["isAdmin"]; 61 174 return new User($resArr["id"], $resArr["login"], $resArr["pwd"], $resArr["fullName"], $resArr["email"], $resArr["comment"], $resArr["isAdmin"]); 62 175 } … … 137 250 $this->_isAdmin = $isAdmin; 138 251 } 252 253 254 function add($id,$login,$fullName,$email,$isAdmin,$pwd,$comment) 255 { 256 $this->User = new User($id, $login, $pwd, $fullName, $email, $comment, $isAdmin); 257 } 258 259 function sortDataSet($s) 260 { 261 //Sort by the given parameter 262 switch($s) 263 { 264 case "fullName": 265 //Note use of array to reference member method of this object in callback 266 uasort($this->User,array($this,"cmpName")); 267 break; 268 269 case "login": 270 uasort($this->User,array($this,"cmpX")); 271 break; 272 273 case "id": 274 uasort($this->User,array($this,"cmpY")); 275 break; 276 277 case "added": 278 default: 279 //Re-sort array by original keys 280 ksort($this->User); 281 } 282 } 283 284 //Callback function for sorting by name 285 //$a and $b are dataItem objects 286 function cmpName($a,$b) 287 { 288 //Use sort() for simple alphabetical comparison 289 //Convert to lowercase to ensure consistent behaviour 290 $sortable = array(strtolower($a->_fullName),strtolower($b->_fullName)); 291 $sorted = $sortable; 292 sort($sorted); 293 294 //If the names have switched position, return -1. Otherwise, return 1. 295 return ($sorted[0] == $sortable[0]) ? -1 : 1; 296 } 297 298 //Callback function for sorting by x 299 //$a and $b are dataItem objects 300 function cmpX($a,$b) 301 { 302 //Use sort() for simple alphabetical comparison 303 //Convert to lowercase to ensure consistent behaviour 304 $sortable = array(strtolower($a->x),strtolower($b->x)); 305 $sorted = $sortable; 306 sort($sorted); 307 308 //If the names have switched position, return -1. Otherwise, return 1. 309 return ($sorted[0] == $sortable[0]) ? -1 : 1; 310 } 311 312 //Callback function for sorting by y 313 //$a and $b are dataItem objects 314 function cmpY($a,$b) 315 { 316 //If $a's y attribute >= $b's y attribute, return 1. Otherwise, return -1. 317 return ($a->y >= $b->y) ? 1 : -1; 318 } 139 319 140 320 function getID() { return $this->_id; } … … 339 519 function isMemberOfGroup($group) 340 520 { 521 //echo "es miembro de".$this."<br>"; 341 522 return $group->isMember($this); 342 523 } -
contrib/Dms/out/out.AddDocument.php
r3526 r4362 15 15 16 16 $folderid = (isset($_GET['folderid'])) ? (int) $_GET['folderid'] : 1; 17 $folder = getFolder($folderid); 17 //$folder = getFolder($folderid); 18 19 //if ($folder->getAccessMode($user) < M_READWRITE) 20 //die("access denied"); 21 22 if(!$folder = getFolder($folderid)) { 23 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 24 25 } 18 26 19 27 if ($folder->getAccessMode($user) < M_READWRITE) 20 die("access denied"); 28 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 29 21 30 22 31 printHTMLHead( getMLText("folder_title", array("foldername" => $folder->getName()) ) ); … … 48 57 printStartBox(getMLText("add_document")); 49 58 ?> 59 60 <font color="red"><b>NOTA:</b> El documento hereda el permiso correspondiente de la carpeta que lo contiene </font><br></br> 61 62 50 63 51 64 <form action="../op/op.AddDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();"> -
contrib/Dms/out/out.AddSubFolder.php
r3526 r4362 18 18 19 19 $folderid = (isset($_GET['folderid'])) ? (int) $_GET['folderid'] : 1; 20 $folder = getFolder($folderid);21 20 21 //echo "<br>folderid".$folderid; 22 //$folder = getFolder($folderid); 23 if(!$folder = getFolder($folderid)) { 24 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 25 26 } 22 27 23 28 if ($folder->getAccessMode($user) < M_READWRITE) 24 die("accesso denegado");29 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 25 30 26 31 -
contrib/Dms/out/out.EditFolder.php
r3526 r4362 15 15 16 16 $folderid = (isset($_GET['folderid'])) ? (int) $_GET['folderid'] : 1; 17 $folder = getFolder($folderid); 17 //$folder = getFolder($folderid); 18 19 20 if(!$folder = getFolder($folderid)) { 21 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 22 23 } 24 25 if ($folder->getAccessMode($user) < M_READWRITE) 26 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 18 27 19 28 $parent = ($folder->getID() == $settings->_rootFolderID) ? false : $folder->getParent(); 20 29 21 if ($folder->getAccessMode($user) < M_READWRITE)22 die ("Access denied");30 //if ($folder->getAccessMode($user) < M_READWRITE) 31 //die ("Access denied"); 23 32 24 33 -
contrib/Dms/out/out.FolderAccess.php
r3526 r4362 13 13 14 14 include("../inc/inc.Authentication.php"); 15 // 15 16 16 17 … … 26 27 27 28 $folderid = (isset($_GET['folderid'])) ? (int) $_GET['folderid'] : NULL; 28 $folder = getFolder($folderid); 29 30 $allUsers = getAllUsers(); 31 32 if ($folder->getAccessMode($user) < M_ALL) 33 die ("Access denied"); 29 //$folder = getFolder($folderid); 30 31 if(!$folder = getFolder($folderid)) { 32 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 33 34 } 35 36 if ($folder->getAccessMode($user) < M_READWRITE) 37 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 38 39 40 //$allUsers = getAllUsers(); 41 //foreach($allUsers as $c=>$v) 42 // echo "<p>El vector con indice $c tiene el valor $v </p>"; 43 //while (list($clave, $valor) = each($allUsers)) { 44 //echo "<p>El vector con indice $clave tiene el valor $valor </p>"; 45 //} 46 //asort($allUsers); 47 //uasort($allUsers,'ordenar'); 48 49 50 51 52 53 $accounts = $GLOBALS['phpgw']->accounts->get_list('accounts'); 54 $allUsers = array(); 55 for ($i = 0; $i < count($accounts); $i++) 56 { 57 $id = $accounts[$i]["account_id"]; 58 $login = $accounts[$i]["account_lid"]; 59 $fullName = $accounts[$i]['account_firstname'].' '.$accounts[$i]['account_lastname']; 60 $email = $accounts[$i]["account_email"]; 61 $isAdmin = phpgw_is_admin($id); 62 $pwd = ''; 63 $comment = ''; 64 //$myCollection->add($id,$login,$fullName,$email,$isAdmin,$pwd,$comment); 65 $allUsers[$i]=new User($id, $login, $pwd, $fullName, $email, $comment, $isAdmin); 66 } 67 //$allUsers->sortDataSet("fullName"); 68 69 70 function cmpNames($a,$b) 71 { 72 //Use sort() for simple alphabetical comparison 73 //Convert to lowercase to ensure consistent behaviour 74 $sortable = array(strtolower($a->_fullName),strtolower($b->_fullName)); 75 $sorted = $sortable; 76 sort($sorted); 77 78 //If the names have switched position, return -1. Otherwise, return 1. 79 return ($sorted[0] == $sortable[0]) ? -1 : 1; 80 } 81 uasort($allUsers, "cmpNames"); 82 83 84 // $allGroups = getAllGroups(); 85 $phpgw_groups = $GLOBALS['phpgw']->accounts->get_list('groups'); 86 87 $allGroups= array(); 88 89 90 for ($i = 0; $i < count($phpgw_groups); $i++) 91 $allGroups[$i] = new Group($phpgw_groups[$i]["account_id"], $phpgw_groups[$i]["account_lid"], ''); 92 93 function cmpNamesg($a,$b) 94 { 95 //Use sort() for simple alphabetical comparison 96 //Convert to lowercase to ensure consistent behaviour 97 $sortable = array(strtolower($a->_name),strtolower($b->_name)); 98 $sorted = $sortable; 99 sort($sorted); 100 101 //If the names have switched position, return -1. Otherwise, return 1. 102 return ($sorted[0] == $sortable[0]) ? -1 : 1; 103 } 104 105 uasort($allGroups, "cmpNamesg"); 106 107 108 //Sort by name: 109 //$myCollection->sortDataSet("fullName"); 110 //print_r($myCollection->dataSet); 111 //$allUsers[]->sortDataSet("fullName"); 112 113 //Sort by x 114 //$myCollection->sortDataSet("login"); 115 //print_r($myCollection->dataSet); 116 117 //Sort by y 118 //$myCollection->sortDataSet("id"); 119 //print_r($myCollection->dataSet); 120 121 //Sort by order added 122 //$myCollection->sortDataSet("added"); 123 //print_r($myCollection->dataSet); 124 125 126 127 //if ($folder->getAccessMode($user) < M_ALL) 128 //die ("Access denied"); 34 129 35 130 … … 58 153 printFolderPageStart($folder); 59 154 printPageHeader(getMLText("edit_folder_access") . ": " . $folder->getName()); 60 61 62 //Nur admin darf Besitzer ändern 155 $owner = $folder->getOwner(); 156 if($user->getID()==1120 ||$owner->getID()==$user->getID()){ 157 158 //Nur admin darf Besitzer ï¿œndern 63 159 if ($user->isAdmin()) 64 160 { … … 112 208 } 113 209 210 if($user->getID()==1120 ){ 114 211 printMLText("does_not_inherit_access_msg", array("inheriturl" => "../op/op.FolderAccess.php?folderid=".$folderid."&action=inherit")); 212 } 115 213 print "</div>"; 116 214 … … 118 216 $accessList = $folder->getAccessList(); 119 217 120 printNextBox(getMLText("default_access")); 121 ?> 122 123 <div class="defaultAccess"> 124 <form action="../op/op.FolderAccess.php"> 125 <input type="Hidden" name="folderid" value="<?php print $folderid;?>"> 126 <input type="Hidden" name="action" value="setdefault"> 127 128 <?php printAccessModeSelection($folder->getDefaultAccess()); ?> 129 <p> 130 <input type="Submit"> 131 </form> 132 </div> 218 //printNextBox(getMLText("default_access")); 219 ?> 220 221 133 222 134 223 <?php … … 227 316 <option value="none">------------------------------- 228 317 <?php 229 $allGroups = getAllGroups();230 318 foreach ($allGroups as $groupObj) 231 319 print "<option value=\"".$groupObj->getID()."\">" . $groupObj->getName() . "\n"; … … 251 339 252 340 printEndBox(); 341 342 253 343 printFolderPageEnd($folder); 344 345 } 254 346 printHTMLFoot(); 255 347 ?> -
contrib/Dms/out/out.FolderNotify.php
r3526 r4362 15 15 16 16 $folderid = (isset($_GET['folderid'])) ? (int) $_GET['folderid'] : 1; 17 $folder = getFolder($folderid); 17 //$folder = getFolder($folderid); 18 19 if(!$folder = getFolder($folderid)) { 20 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 21 22 } 23 24 if ($folder->getAccessMode($user) < M_READWRITE) 25 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 26 18 27 19 28 $notifyList = $folder->getNotifyList(); 20 29 21 if ($folder->getAccessMode($user) < M_READWRITE)22 die ("Access denied");30 //if ($folder->getAccessMode($user) < M_READWRITE) 31 //die ("Access denied"); 23 32 24 33 -
contrib/Dms/out/out.SetExpires.php
r3526 r4362 34 34 <td valign="top" class="inputDescription"><?php printMLText("expires");?>:</td> 35 35 <td class="standardText"> 36 <input type="Radio" name="expires" value="false"<?php if (!$document->expires()) print " checked";?>><?php printMLText("does_not_expire");?><br>37 <input type="radio" name="expires" value="true"<?php if ($document->expires()) print " checked";?>><?php if ($document->expires()) printDateChooser($document->getExpires(), "exp"); else printDateChooser(-1, "exp"); ?>36 <input type="Radio" name="expires" value="false"<?php if (!$document->expires()) print " checked";?>><?php printMLText("does_not_expire");?><br> 37 <input type="radio" name="expires" value="true"<?php if ($document->expires()) print " checked";?>><?php if ($document->expires()) printDateChooser($document->getExpires(), "exp"); else printDateChooser(-1, "exp"); ?> 38 38 </td> 39 39 </tr> -
contrib/Dms/out/out.UpdateDocument.php
r3526 r4362 87 87 <td valign="top" class="inputDescription"><?php printMLText("expires");?>:</td> 88 88 <td class="standardText"> 89 <input type="Radio" name="expires" value="false"<?php if (!$document->expires()) print " checked";?>><?php printMLText("does_not_expire");?><br>90 <input type="radio" name="expires" value="true"<?php if ($document->expires()) print " checked";?>><?php printDateChooser(-1, "exp");?>89 <input type="Radio" name="expires" value="false"<?php if (!$document->expires()) print " checked";?>><?php printMLText("does_not_expire");?><br> 90 <input type="radio" name="expires" value="true"<?php if ($document->expires()) print " checked";?>><?php printDateChooser(-1, "exp");?> 91 91 </td> 92 92 </tr> -
contrib/Dms/out/out.ViewDocument.php
r3526 r4362 19 19 $document = getDocument($documentid); 20 20 $folder = $document->getFolder(); 21 //echo $folder. "folder id<br>"; 22 //echo $document. "doc id<br>"; 23 //echo $documentid. "documentidid<br>"; 24 //echo $user. "user<br>"; 25 26 27 21 28 22 29 if ($document->getAccessMode($user) < M_READ) -
contrib/Dms/out/out.ViewFolder.php
r3526 r4362 1 1 <?php 2 3 4 2 5 include("../inc/inc.Settings.php"); 3 6 include("../inc/inc.AccessUtils.php"); … … 14 17 15 18 include("../inc/inc.Authentication.php"); 19 //include("../../phpgwapi/inc/class.accounts_ldap.inc.php"); 20 21 22 23 //echo"<br>".; 24 //read_repository2($GLOBALS['phpgw_info']['user']['account_id']); 25 26 27 $acceso=0; 16 28 17 29 $folderid = (isset($_GET['folderid'])) ? (int) $_GET['folderid'] : 1; 30 31 //echo "<br>a".$folderid." b ".$_GET['folderid']."<br>"; 32 18 33 if(!$folder = getFolder($folderid)) { 19 34 //die ("Accesso denegado!".$folderid." ".getFolder($folderid)); 20 35 $acceso=0; 21 36 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 22 37 38 }else{ 39 $acceso=1; 23 40 } 41 42 //echo $folder->getAccessMode(); 24 43 25 44 if ($folder->getAccessMode($user) < M_READ) { 26 45 //die ("accesso denegado!"." ".$folder->getAccessMode($user)); 46 $acceso=0; 27 47 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 48 }else{ 49 $acceso=1; 28 50 } 29 51 … … 68 90 </table> 69 91 70 92 <?php 93 //echo "acccceso".$acceso; 94 if (isset($_GET['folderid'])||$_GET['folderid']>1){ 95 ?> 71 96 72 97 … … 93 118 <td colspan="2" height="8" class="textSidebox"> </td> 94 119 </tr> 95 <tr class="divSideboxEntry">120 <!-- <tr class="divSideboxEntry"> 96 121 <td width="20" align="center" valign="middle" class="textSidebox"><img class="sideboxstar" src="<?php echo $GLOBALS['phpgw_info']['server']['webserver_url']?>/phpgwapi/templates/idots/images/orange-ball.png" width="9" height="9" alt="ball"/></td><td class="textSidebox"><a class="textSidebox" href="<?php echo $GLOBALS['phpgw_info']['server']['webserver_url'];?>/mydms/out/out.FolderNotify.php?folderid=<?php echo $folderid;?>">notificaciones</a></td> 97 </tr> 122 </tr> --> 98 123 <tr class="divSideboxEntry"> 99 124 <td width="20" align="center" valign="middle" class="textSidebox"><img class="sideboxstar" src="<?php echo $GLOBALS['phpgw_info']['server']['webserver_url']?>/phpgwapi/templates/idots/images/orange-ball.png" width="9" height="9" alt="ball"/></td><td class="textSidebox"><a class="textSidebox" href="<?php echo $GLOBALS['phpgw_info']['server']['webserver_url'];?>/mydms/out/out.FolderAccess.php?folderid=<?php echo $folderid;?>">derechos de acceso</a></td> 100 125 101 126 </tr> 127 128 <?php }?> 102 129 </table> 103 130 <table cellspacing="5" cellpadding="0" border="0"> 104 131 <?php 132 if($acceso>0){ 105 133 $documents = $folder->getDocuments(); 106 $documents = filterAccess($documents, $user, M_READ); 134 //echo "user".$user; 135 //$documents = filterAccess($documents, $user, M_READ); 107 136 if (count($documents) > 0) 108 137 { … … 149 178 print "<tr><td class=\"filelist\">".getMLText("no_documents")."</td></tr>"; 150 179 } 180 } 151 181 ?> 152 182 </table> -
contrib/Dms/templates/default/viewDocument.tpl
r3526 r4362 16 16 <th width="20%" id="tab1" class="activetab" onclick="javascript:tab.display(1);"><a href="#" tabindex="0" accesskey="1" onfocus="tab.display(1);" onclick="tab.display(1); return(false);" style="font-size:10px;">Información</a></th> 17 17 <th width="20%" id="tab2" class="activetab" onclick="javascript:tab.display(2);"><a href="#" tabindex="0" accesskey="2" onfocus="tab.display(2);" onclick="tab.display(2); return(false);" style="font-size:10px;">Todas las versiones</a></th> 18 < th width="20%" id="tab3" class="activetab" onclick="javascript:tab.display(3);"><a href="#" tabindex="0" accesskey="3" onfocus="tab.display(3);" onclick="tab.display(3); return(false);" style="font-size:10px;">Documentos relacionados</a></th>19 <th width="20%" id="tab4" class="activetab" onclick="javascript:tab.display(4);"><a href="#" tabindex="0" accesskey="4" onfocus="tab.display(4);" onclick="tab.display(4); return(false);" style="font-size:10px;">Notificaciones</a></th> 20 <th width="20%" id="tab5" class="activetab" onclick="javascript:tab.display(5);"><a href="#" tabindex="0" accesskey="5" onfocus="tab.display(5);" onclick="tab.display(5); return(false);" style="font-size:10px;">{lang_acl}</a></th> 18 <!--<th width="20%" id="tab3" class="activetab" onclick="javascript:tab.display(3);"><a href="#" tabindex="0" accesskey="3" onfocus="tab.display(3);" onclick="tab.display(3); return(false);" style="font-size:10px;">Documentos relacionados</a></th> 19 <th width="20%" id="tab4" class="activetab" onclick="javascript:tab.display(4);"><a href="#" tabindex="0" accesskey="4" onfocus="tab.display(4);" onclick="tab.display(4); return(false);" style="font-size:10px;">Notificaciones</a></th> 20 <th width="20%" id="tab5" class="activetab" onclick="javascript:tab.display(5);"><a href="#" tabindex="0" accesskey="5" onfocus="tab.display(5);" onclick="tab.display(5); return(false);" style="font-size:10px;">{lang_acl}</a></th>--> 21 21 </tr> 22 22 </table> … … 187 187 188 188 <!-- BEGIN lock_row --> 189 <tr class="row_on">189 <!-- <tr class="row_on"> 190 190 <td class="description" valign="top">Status de Bloqueo:</td> 191 191 <td class="infos" colspan="3"> … … 202 202 </div> 203 203 </td> 204 </tr> 204 </tr>--> 205 205 <!-- END lock_row --> 206 206 … … 298 298 <input type="hidden" id="targetid" name="targetid" value="unchanged"> 299 299 </td> 300 <td align="center" width="150px">< a href="#" onclick="selectFolder({current_folder_id},'info_form'); return(false);" style="font-size:10px;">Mover Documento</a></td>300 <td align="center" width="150px"></td> 301 301 </tr> 302 302 <tr class="row_on"> -
contrib/Dms/themes/default/DocumentPageEnd.html
r3526 r4362 20 20 </tr> 21 21 <tr> 22 <td width="45" background="<?php echo(printImgPath("line_vert.gif")) ?>">22 <td width="45" background="<?php echo(printImgPath("line_vert.gif")); ?>" > 23 23 24 24 </td> -
contrib/Resources/inc/class.boresources.inc.php
r3524 r4362 267 267 } 268 268 269 /*$this->so = CreateObject('resources.soresources',269 $this->so = CreateObject('calendar.socalendar', 270 270 Array( 271 271 'owner' => $this->owner, … … 274 274 'g_owner' => $this->g_owner 275 275 ) 276 ); */276 ); 277 277 $this->rpt_day = array( // need to be after creation of soresources 278 278 MCAL_M_SUNDAY => 'Sunday', … … 589 589 590 590 $event = $this->so->read_entry($id); 591 echo $event;591 //echo $event; 592 592 593 593 594 594 return False; 595 } 596 597 598 function read_entry2($id,$ignore_acl=False) 599 { 600 601 602 $event = $this->so->read_entry($id); 603 if(!isset($event['participants'][$this->owner]) && $this->user_is_a_member($event,$this->owner)) 604 { 605 $this->so->add_attribute('participants','U',(int)$this->owner); 606 $this->so->add_entry($event); 607 $event = $this->get_cached_event(); 608 } 609 return $this->xmlrpc ? $this->xmlrpc_prepare($event) : $event; 610 595 611 } 596 612 … … 774 790 775 791 792 776 793 $send_to_ui = True; 777 794 //if ((!is_array($l_start) || !is_array($l_end)) && !isset($_GET['readsess'])) // xmlrpc call … … 799 816 foreach($params['participants'] as $user => $data) 800 817 { 818 801 819 $l_participants[] = $user.$data['status']; 802 820 } … … 1204 1222 } 1205 1223 1224 1206 1225 $overlapping_events = $this->overlap( 1207 1226 $this->maketime($event['start']), … … 1471 1490 } 1472 1491 1473 function overlap($starttime,$endtime,$participants,$owner=0,$id=0,$restore_cache=False)1492 function overlap($starttime,$endtime,$participants,$owner=0,$id=0,$restore_cache=False,$location='n/a') 1474 1493 { 1475 1494 // $retval = Array(); … … 1478 1497 /* This needs some attention.. by commenting this chunk of code it will fix bug #444265 */ 1479 1498 1499 // foreach($id as $c=>$v) 1500 // echo "<p>El 565vector con indice $c tiene el valor $v </p>"; 1501 1502 1503 1480 1504 if($restore_cache) 1481 1505 { … … 1488 1512 // $temp_end_time = (int)$GLOBALS['phpgw']->common->show_date($endtime,'Hi'); 1489 1513 $temp_start = (int)(date('Ymd',$starttime)); 1514 1490 1515 $temp_start_time = (int)(date('Hi',$starttime)); 1491 1516 $temp_end = (int)(date('Ymd',$endtime)); 1492 1517 $temp_end_time = (int)(date('Hi',$endtime)); 1518 // echo "<br>inicio".$temp_start_time." <br> fin ".$temp_end_time."<br> ".(int)(date('Hi a',$endtime))."<br>"; 1519 // echo "<br>inicio".$temp_start." <br> fin ".$temp_end."<br> ".(int)(date('Hi a',$endtime))."<br>"; 1520 1493 1521 if($this->debug) 1494 1522 { … … 1509 1537 $users[] = $this->owner; 1510 1538 } 1539 1511 1540 1512 1541 $possible_conflicts = $this->store_to_cache( … … 1518 1547 'eday' => substr(strval($temp_end),6,2), 1519 1548 'eyear' => substr(strval($temp_end),0,4), 1520 'owner' => $users 1549 'owner' => $users, 1550 'location' => $location 1521 1551 ) 1522 1552 ); … … 1527 1557 echo '<!-- Possible Conflicts ('.$temp_start.'): '.count($possible_conflicts[$temp_start]).' '.count($id).' -->'."\n"; 1528 1558 } 1529 1559 //echo "aaa".$possible_conflicts[$temp_start]; 1560 //echo "bbbb".$possible_conflicts[$temp_end]; 1530 1561 if($possible_conflicts[$temp_start] || $possible_conflicts[$temp_end]) 1531 1562 { … … 1569 1600 $temp_event_end = sprintf("%d%02d",$event['end']['hour'],$event['end']['min']); 1570 1601 // if((($temp_start_time <= $temp_event_start) && ($temp_end_time >= $temp_event_start) && ($temp_end_time <= $temp_event_end)) || 1602 1603 1604 /*}*/ 1605 1606 1607 1571 1608 if(($temp_start_time <= $temp_event_start && 1572 $temp_end_time > $temp_event_start && 1573 $temp_end_time <= $temp_event_end || 1574 $temp_start_time >= $temp_event_start && 1575 $temp_start_time < $temp_event_end && 1576 $temp_end_time >= $temp_event_end || 1577 $temp_start_time <= $temp_event_start && 1578 $temp_end_time >= $temp_event_end || 1579 $temp_start_time >= $temp_event_start && 1580 $temp_end_time <= $temp_event_end) && 1581 $this->participants_not_rejected($participants,$event)) 1609 $temp_end_time >= $temp_event_start && 1610 $temp_end_time <= $temp_event_end) || 1611 ($temp_start_time <= $temp_event_start && 1612 $temp_end_time >= $temp_event_start && 1613 $temp_end_time >= $temp_event_end)|| 1614 ($temp_start_time <= $temp_event_start && 1615 $temp_end_time >= $temp_event_end) || 1616 1617 ($temp_start_time >= $temp_event_start && 1618 $temp_start_time <= $temp_event_end && 1619 $temp_end_time >= $temp_event_end) || 1620 1621 ($temp_start_time >= $temp_event_start && 1622 $temp_end_time <= $temp_event_end)) 1582 1623 { 1583 1624 if($this->debug) … … 1585 1626 echo ' Conflicts'; 1586 1627 } 1587 $retval[] = $event ['id'];1628 $retval[] = $event; 1588 1629 } 1589 1630 if($this->debug) … … 1597 1638 else 1598 1639 { 1599 $retval = False; 1640 $retval1 = False; 1641 $retval = Array(); 1600 1642 } 1601 1643 … … 2022 2064 } 2023 2065 $repeated = $this->repeating_events; 2066 2067 //echo $repeated."repeat<br>" ; 2024 2068 $r_events = count($repeated); 2069 //echo $r_events." ".$this->repeating_event[1]. "repeat23<br>" ; 2025 2070 for ($i=0;$i<$r_events;$i++) 2026 2071 { 2027 2072 $rep_events = $this->repeating_events[$i]; 2073 2028 2074 $id = $rep_events['id']; 2075 //echo $id; 2029 2076 $event_beg_day = mktime(0,0,0,$rep_events['start']['month'],$rep_events['start']['mday'],$rep_events['start']['year']); 2030 2077 if($rep_events['recur_enddate']['month'] != 0 && $rep_events['recur_enddate']['mday'] != 0 && $rep_events['recur_enddate']['year'] != 0) … … 2160 2207 return False; 2161 2208 } 2162 if (isset($params['start']) && ($datearr = $GLOBALS['server']->iso86012date($params['start']))) 2209 $location=$params['location']; 2210 2211 //echo "location".$location; 2212 if (isset($params['start']) && ($datearr = $GLOBALS['server']->iso86012date($params['start']))) 2163 2213 { 2164 2214 $syear = $datearr['year']; … … 2219 2269 //Se $emonth nao tem valor, recebe o valor de $smonth (que recebe $params['smonth']) e soma 1. 2220 2270 //O valor $params['emonth'] indica o mes final para a pesquisa de eventos, e passou a ser 2221 //informado na a impressao de eventos mensais. Mudancas feitas em class.ui resources.inc.php,2271 //informado na a impressao de eventos mensais. Mudancas feitas em class.uicalendar.inc.php, 2222 2272 //function display_month_print(); 2223 2273 if(!$emonth) … … 2236 2286 $edate = mktime(23,59,59,$emonth,$eday,$eyear); 2237 2287 } 2238 //echo "<p>bo resources::store_to_cache(".print_r($params,True).") syear=$syear, smonth=$smonth, sday=$sday, eyear=$eyear, emonth=$emonth, eday=$eday, xmlrpc='$param[xmlrpc]'</p>\n";2288 //echo "<p>bocalendar::store_to_cache(".print_r($params,True).") syear=$syear, smonth=$smonth, sday=$sday, eyear=$eyear, emonth=$emonth, eday=$eday, xmlrpc='$param[xmlrpc]'</p>\n"; 2239 2289 if($this->debug) 2240 2290 { … … 2248 2298 if($owner_id) 2249 2299 { 2250 $cached_event_ids = "";//$this->so->list_events($syear,$smonth,$sday,$eyear,$emonth,$eday,$owner_id); 2251 $cached_event_ids_repeating = "";//$this->so->list_repeated_events($syear,$smonth,$sday,$eyear,$emonth,$eday,$owner_id); 2300 2301 $cached_event_ids = $this->so->list_events($syear,$smonth,$sday,$eyear,$emonth,$eday,$owner_id,$location); 2302 $cached_event_ids_repeating = $this->so->list_repeated_events($syear,$smonth,$sday,$eyear,$emonth,$eday,$owner_id,$location); 2252 2303 } 2253 2304 else 2254 2305 { 2255 $cached_event_ids = "";//$this->so->list_events($syear,$smonth,$sday,$eyear,$emonth,$eday); 2256 $cached_event_ids_repeating = "";//$this->so->list_repeated_events($syear,$smonth,$sday,$eyear,$emonth,$eday); 2306 2307 $cached_event_ids = $this->so->list_events($syear,$smonth,$sday,$eyear,$emonth,$eday,0,$location); 2308 $cached_event_ids_repeating = $this->so->list_repeated_events($syear,$smonth,$sday,$eyear,$emonth,$eday,0,$location); 2257 2309 } 2258 2310 2259 2311 $c_cached_ids = count($cached_event_ids); 2260 2312 $c_cached_ids_repeating = count($cached_event_ids_repeating); 2261 2313 //echo "totaless".$c_cached_ids." - ".$c_cached_ids_repeating; 2262 2314 if($this->debug) 2263 2315 { … … 2274 2326 2275 2327 $cache_start = (int)(sprintf("%04d%02d%02d",$syear,$smonth,$sday)); 2328 2276 2329 $cached_event=$this->get_cached_event(); 2330 2277 2331 if($c_cached_ids) 2278 2332 { 2333 2279 2334 for($i=0;$i<$c_cached_ids;$i++) 2280 2335 { 2281 $event = "";//$this->so->read_entry($cached_event_ids[$i]); 2336 $event = $this->so->read_entry($cached_event_ids[$i]); 2337 2338 //echo "<br>antrrrrroooo".$event['start']." a ".$event['end']." b ".$event['id']; 2282 2339 if ($event['recur_type']) 2283 2340 { … … 2287 2344 $enddate = (int)(date('Ymd',$this->maketime($event['end']))); 2288 2345 $this->cached_events[$startdate][] = $event; 2346 //echo "ver".$event['recur_type'].$startdate." ---".$enddate."<br>antrrrrroooo";; 2289 2347 if($startdate != $enddate) 2290 2348 { … … 2294 2352 for($j=$startdate,$k=0;$j<=$enddate;$k++,$j=(int)(date('Ymd',mktime(0,0,0,$start['month'],$start['mday'] + $k,$start['year'])))) 2295 2353 { 2354 2355 2296 2356 $c_evt_day = count($this->cached_events[$j]) - 1; 2357 //echo "<br>aaaa".$c_evt_day."<br>antrrrrroooo"; ; 2297 2358 if($c_evt_day < 0) 2298 2359 { … … 2310 2371 } 2311 2372 $this->cached_events[$j][] = $event; 2373 //echo "<br>llll:".$event."<br>antrrrrroooo";; 2312 2374 } 2313 2375 if ($j >= $cache_start && (@$params['no_doubles'] || @$this->xmlrpc)) … … 2323 2385 if($c_cached_ids_repeating) 2324 2386 { 2387 //echo "repeaiting".$c_cached_ids_repeating; 2388 2325 2389 for($i=0;$i<$c_cached_ids_repeating;$i++) 2326 2390 { 2327 $this->repeating_events[$i] = "";//$this->so->read_entry($cached_event_ids_repeating[$i]); 2391 $this->repeating_events[$i] = $this->so->read_entry($cached_event_ids_repeating[$i]); 2392 //echo "abc".$this->repeating_events[$i]."<br>"; 2328 2393 if($this->debug) 2329 2394 { … … 2339 2404 } 2340 2405 $this->check_repeating_events($date); 2406 2407 2341 2408 if($this->debug) 2342 2409 { … … 2349 2416 } 2350 2417 } 2418 2419 //echo "countt".count($this->cached_events); 2351 2420 $retval = Array(); 2352 2421 for($j=date('Ymd',mktime(0,0,0,$smonth,$sday,$syear)),$k=0;$j<=date('Ymd',mktime(0,0,0,$emonth,$eday,$eyear));$k++,$j=date('Ymd',mktime(0,0,0,$smonth,$sday + $k,$syear))) 2353 2422 { 2423 //echo "vueltaaaa".$j."<br>"; 2354 2424 if(is_array($this->cached_events[$j])) 2355 2425 { … … 2359 2429 { 2360 2430 $retval[] = $this->xmlrpc_prepare($event); 2431 //echo "cachhhhhheeeeeqqq2222".$this->xmlrpc_prepare($event)."<br>"; 2361 2432 } 2362 2433 } … … 2364 2435 { 2365 2436 $retval[$j] = $this->cached_events[$j]; 2366 } 2367 } 2437 //foreach($this->cached_events[$j][0] as $c=>$v) 2438 //echo "<p>El vector con indice $c tiene el valor $v </p>"; 2439 //echo "cachhhhhheeeeeqqq".$this->cached_events[$j][0]['public']."<br>"; 2440 } 2441 } 2442 2443 2368 2444 } 2369 2445 //echo "store_to_cache(".print_r($params,True).")=<pre>".print_r($retval,True)."</pre>\n"; 2370 //$this->so->cal->event = $cached_event;2446 $this->so->cal->event = $cached_event; 2371 2447 return $retval; 2372 2448 } -
contrib/Resources/inc/class.soresources.inc.php
r3524 r4362 49 49 echo '<!-- SO cat_id : '.$this->cat_id.' -->'."\n"; 50 50 } 51 $this->cal = CreateObject('infolog.soinfolog_'); 51 // $this->cal = CreateObject('infolog.soinfolog_'); 52 $this->cal = CreateObject('calendar.socalendar_'); 52 53 //$this->open_box($this->owner); 53 54 } … … 76 77 } 77 78 79 function read_entry2($id) 80 { 81 return $this->cal->fetch_event($id); 82 } 83 78 84 function list_events($startYear,$startMonth,$startDay,$endYear=0,$endMonth=0,$endDay=0,$owner_id=0) 79 85 { … … 427 433 $this->cal->set_recur_yearly($year,$month,$day,$interval); 428 434 } 435 function list_eventsa($startYear,$startMonth,$startDay,$endYear=0,$endMonth=0,$endDay=0,$owner_id=0,$location='n/a') 436 { 437 438 $extra = ''; 439 $extra .= (strpos($this->filter,'private')?'AND phpgw_cal.is_public=0 ':''); 440 //$extra .= ($this->cat_id?"AND phpgw_cal.category like '%".$this->cat_id."%' ":''); 441 if ($this->cat_id) 442 { 443 if (!is_object($GLOBALS['phpgw']->categories)) 444 { 445 $GLOBALS['phpgw']->categories = CreateObject('phpgwapi.categories'); 446 } 447 $cats = $GLOBALS['phpgw']->categories->return_all_children($this->cat_id); 448 $extra .= "AND (phpgw_cal.category".(count($cats) > 1 ? " IN ('".implode("','",$cats)."')" : '=\''.(int)$this->cat_id."'"); 449 foreach($cats as $cat) 450 { 451 $extra .= " OR phpgw_cal.category LIKE '$cat,%' OR phpgw_cal.category LIKE '%,$cat,%' OR phpgw_cal.category LIKE '%,$cat'"; 452 } 453 $extra .= ') '; 454 } 455 if($owner_id) 456 { 457 return $this->cal->list_events($startYear,$startMonth,$startDay,$endYear,$endMonth,$endDay,$extra,$GLOBALS['phpgw']->datetime->tz_offset,$owner_id,$location); 458 } 459 else 460 { 461 return $this->cal->list_events($startYear,$startMonth,$startDay,$endYear,$endMonth,$endDay,$extra,$GLOBALS['phpgw']->datetime->tz_offset); 462 } 463 } 429 464 430 465 /* End mcal equiv functions */ -
contrib/Resources/inc/class.uiresources.inc.php
r3524 r4362 37 37 'footer' => True 38 38 ); 39 40 39 41 40 42 … … 135 137 function uiresources() 136 138 { 137 138 139 $localtime = $GLOBALS['phpgw']->datetime->users_localtime; 140 141 $this->year = date('Y',$localtime); 142 $this->month = date('m',$localtime); 143 $this->day = date('d',$localtime); 144 $this->today = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime); 139 145 140 146 … … 954 960 'accionmodificar' =>'index.php?menuaction=resources.uiresources.edit&id='. $data['id'], 955 961 'accionlistar' =>'index.php?menuaction=resources.uiresources.search2&id='. $data['name'], 962 956 963 'accionborrar' =>'index.php?menuaction=resources.uiresources.delete&id='. $data['id'], 957 964 'accionreservar' =>'index.php?menuaction=calendar.uicalendar.add&location='. $data['name'] … … 985 992 // } 986 993 987 $sql = 'select t1.*,t2.cat_name from phpgw_resources t1 ,phpgw_categories t2 where t1.cat_id=t2.cat_id '994 $sql = "select t1.*,t2.cat_name from phpgw_resources t1 ,phpgw_categories t2 where t1.cat_id=t2.cat_id and t1.name !='n/a'" 988 995 . $from; 989 996 //.$search; … … 1452 1459 1453 1460 //print_r($_REQUEST); 1461 $this->today = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime); 1462 1463 1464 1465 $jscal = CreateObject('phpgwapi.jscalendar'); // before phpgw_header() !!! 1466 1467 unset($GLOBALS['phpgw_info']['flags']['noheader']); 1468 unset($GLOBALS['phpgw_info']['flags']['nonavbar']); 1469 $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['resources']['title'].' - '.lang('Search Results'); 1470 $GLOBALS['phpgw']->common->phpgw_header(); 1471 1472 $error = ''; 1473 1474 1475 1476 $matches = 0; 1477 1478 //echo "aaaaa".$GLOBALS['phpgw']->common->show_date(1288884600); 1479 1480 //echo "aaaaa".$GLOBALS['phpgw']->common->show_date(1288886400); 1481 1482 if (isset($_REQUEST['fecha'])){ 1483 list($dia,$mes,$ano)=split("/",$_REQUEST['fecha']); 1484 if (isset($_REQUEST['fecha2'])){ 1485 list($dia2,$mes2,$ano2)=split("/",$_REQUEST['fecha2']); 1486 }else{ 1487 list($dia2,$mes2,$ano2)=split("/",$_REQUEST['fecha']); 1488 1489 } 1490 if(isset($_REQUEST['hora'])){ 1491 list($horai,$minutoi,$horaf,$minutof)=split(":",$_REQUEST['hora']); 1492 }else{ 1493 $horai=0; 1494 $minutoi=0; 1495 $horaf=23; 1496 $minutof=59; 1497 } 1498 $starttimea = $this->bo->maketime2(0,0,0,$dia,$mes,$ano,'am') - $GLOBALS['phpgw']->datetime->tz_offset; 1499 1500 1501 }else{ 1502 $localtime = $GLOBALS['phpgw']->datetime->users_localtime; 1503 $ano = date('Y',$localtime); 1504 $mes = date('m',$localtime); 1505 $dia = date('d',$localtime); 1506 $ano2 = date('Y',$localtime); 1507 $mes2 = date('m',$localtime); 1508 $dia2 = date('d',$localtime); 1509 $horai=0; 1510 $minutoi=0; 1511 $horaf=23; 1512 $minutof=59; 1513 1514 //$starttime = $this->bo->maketime2(0,0,0,$dia,$mes,$ano,'am') - $GLOBALS['phpgw']->datetime->tz_offset; 1515 ///echo $starttime; 1516 //$starttime2 = $this->bo->maketime2(23,59,59,$dia,$mes,$ano,'pm') - $GLOBALS['phpgw']->datetime->tz_offset; 1517 ///echo $starttime2; 1518 1519 } 1520 1521 1522 1523 $pm='pm'; 1524 if($horaf<12){ 1525 $pm='am'; 1526 }else{ 1527 $horaf=$horaf-12; 1528 } 1529 $am='am'; 1530 if($horai>11){ 1531 $am='pm'; 1532 $horai=$horai-12; 1533 1534 } 1535 1536 1537 //echo $horai." <br> ".$starttimea."<br>".$horaf; 1538 $starttime = $this->bo->maketime2($horai,$minutoi,0,$dia,$mes,$ano,$am) - $GLOBALS['phpgw']->datetime->tz_offset; 1539 //echo "fff".$starttime; 1540 $starttime2 = $this->bo->maketime2($horaf,$minutof,59,$dia2,$mes2,$ano2,$pm) - $GLOBALS['phpgw']->datetime->tz_offset; 1541 ///echo $starttime2; 1542 //$event = $this->bo->read_entry($res_id); 1543 $location=''; 1544 if($_GET['id']!=''){ 1545 $location=$_GET['id'];}else{ 1546 $location='n/a';} 1547 1548 /*$eventtt=$this->bo->store_to_cache( 1549 Array( 1550 'syear' => $ano, 1551 'smonth' => $mes, 1552 'sday' => $dia, 1553 'shour' => $horai, 1554 'smin' => $minutoi, 1555 'eyear' => $ano, 1556 'emonth' => $mes, 1557 'eday' => $dia, 1558 'fhour' => $horaf, 1559 'fmin' => $minutof, 1560 'location' => $location 1561 ) 1562 ); */ 1563 $date_to_eval = sprintf("%04d%02d%02d",$ano,$mes,$dia); 1564 1565 // echo "date _to _eval".$date_to_eval."<br>"; 1566 //$events = $this->bo->cached_events[$date_to_eval];//(5,23,0,22,10,2010) 1567 $events=$this->bo->overlap($starttime,$starttime2,Array(),0,0,'False',$location); 1568 print_debug('Date',$date_to_eval); 1569 print_debug('Count',count($events)); 1570 //echo "llll<br>".'Date'.$date_to_eval; 1571 //echo "llll<br>".'Count'.count($events); 1572 if(count($events)>0){ 1573 foreach($events as $event) 1574 { 1575 if ($this->bo->rejected_no_show($event)) 1576 { 1577 continue; // user does not want to see rejected events 1578 } 1579 if ($event['recur_type']) // calculate start- + end-datetime for recuring events 1580 { 1581 $this->bo->set_recur_date($event,$date_to_eval); 1582 } 1583 //$events_to_show[] = array( 1584 // 'starttime' => $this->bo->maketime($event['start']), 1585 // 'endtime' => $this->bo->maketime($event['end']), 1586 // 'content' => $this->link_to_entry($event,$mes,$dia,$ano) 1587 //); 1588 1589 } 1590 } 1591 //echo "eeeevento".count($event)."<br>"; 1592 $date_to_eval = sprintf("%04d%02d%02d",$ano,$mes,$dia); 1593 1594 //$event = $this->get_event_ids2($_REQUEST['id'],$starttime,$starttime2); 1595 1596 1597 //$event_ids = $this->bo->search_keywords($_POST['keywords']); 1598 1599 1600 $matches = count($event); 1601 1602 //echo "matches" . $matches."<br>"; 1603 1604 if ($matches == 1) 1605 { 1606 $quantity = lang('1 match found').'.'; 1607 } 1608 elseif ($matches > 0) 1609 { 1610 $quantity = lang('%1 matches found',$matches).'.'; 1611 } 1612 else 1613 { 1614 echo lang('no matches found')." para el ".$dia."/".$mes."/".$ano." en la sala:".$location; 1615 1616 //return; 1617 } 1618 1619 if ($matches > 0){ 1620 $p = $GLOBALS['phpgw']->template; 1621 $p->set_file( 1622 Array( 1623 'search_form' => 'search2.tpl' 1624 ) 1625 ); 1626 1627 }else{ 1628 $p = $GLOBALS['phpgw']->template; 1629 $p->set_file( 1630 Array( 1631 'search_form' => 'search3.tpl' 1632 ) 1633 ); 1634 } 1635 $p->set_block('search_form','search','search'); 1636 $p->set_block('search_form','search_list_header','search_list_header'); 1637 $p->set_block('search_form','search_list','search_list'); 1638 $p->set_block('search_form','search_list_footer','search_list_footer'); 1639 1640 $script=''; 1641 1642 1643 1644 if($matches > 0) 1645 { 1646 $p->parse('rows','search_list_header',True); 1647 } 1648 1649 //if($info){ 1650 //echo $matches; 1651 //for($i=0;$i<$matches;$i++) 1652 // { 1653 //echo "i".$i; 1654 if(count($events)>0){ 1655 foreach($events as $id => $data) 1656 { 1657 1658 //echo "<br>dataaaa".$data['title']; 1659 //echo "<br>".$this->get_account_name($data['owner'],'gecos')." ".$data['owner']; 1660 $datetime = $this->bo->maketime($event['start']) - $GLOBALS['phpgw']->datetime->tz_offset; 1661 1662 1663 1664 //echo "ffffffeeecha".$GLOBALS['phpgw']->common->show_date($data[$i]['datetime'])." ".$data[$i]['start']." ".$this->bo->maketime($data[$i]['start']); 1665 //echo $data['location']." .. ".$data['last_status']." .. ".$data['is_public']; 1666 if($data['public']==1){ 1667 $descripcion=$data['description']; 1668 $name=$data['title']; 1669 }else{ 1670 $descripcion='-'; 1671 $name='Privado'; 1672 } 1673 $dueno=$this->get_account_name($data['owner'],'gecos'); 1674 $info = array( 1675 'tr_color' => $GLOBALS['phpgw']->nextmatchs->alternate_row_color(), 1676 'date' => $GLOBALS['phpgw']->common->show_date($datetime), 1677 'id' => $data['id'], 1678 'name' => $name, 1679 'description' => $descripcion, 1680 'location' =>$data['location'], 1681 1682 'owner'=>$this->get_account_name($data['owner'],'gecos'), 1683 'fecha'=> $dia."/".$mes."/".$ano." <br> ".$GLOBALS['phpgw']->common->show_hour($this->bo->maketime($data['start']))."-".$GLOBALS['phpgw']->common->show_hour($this->bo->maketime($data['end'])), 1684 'priority'=>'', 1685 'ispublic'=>$data['is_public'], 1686 1687 'accionmodificar' =>'index.php?menuaction=resources.uiresources.edit&id='. $data['id'], 1688 'accionlistar' =>'index.php?menuaction=resources.uiresources.search2&id='. $data['id'], 1689 'accionborrar' =>$data['id'], 1690 'accionreservar' =>'index.php?menuaction=calendar.uicalendar.add&location='. $data['id'] 1691 ); 1692 1693 1694 1695 //'accionagregar' =>'index.php?menuaction=resources.uiresources.edit&parent='. $data['id'] 1696 $p->set_var($info); 1697 $p->set_var($info); 1698 $p->parse('rows','search_list',True); 1699 } 1700 //} 1701 // } 1702 } 1703 if($matches > 0) 1704 { 1705 $p->parse('rows','search_list_footer',True); 1706 } 1707 1708 $p->pparse('out','search'); 1709 } 1710 1711 1712 1713 1714 1715 1716 function search22() 1717 { 1718 1719 //print_r($_REQUEST); 1454 1720 1455 1721 $jscal = CreateObject('phpgwapi.jscalendar'); // before phpgw_header() !!! … … 1568 1834 } 1569 1835 1570 1571 1572 1836 1573 1837 function get_event_ids2($idd,$starttime,$starttime2) 1574 1838 { 1575 ////echo "tamannn".count($search)." ".$search[0]; 1576 1839 1840 1841 1842 $from =""; 1577 1843 $from =""; 1578 1844 if (isset($idd)){ … … 1582 1848 1583 1849 if (isset($starttime)){ 1850 1851 $from =$from .' and t1.datetime>=\''.$starttime.'\''; 1584 1852 if (isset($starttime2)){ 1585 1853 1586 $from =$from .' and t1.datetime>=\''.$starttime.'\'and t1.datetime<=\''.$starttime2.'\' ';1854 $from =$from .' and t1.datetime<=\''.$starttime2.'\' '; 1587 1855 } 1588 1856 } … … 1601 1869 1602 1870 1871 //echo $sql; 1603 1872 1604 1873 … … 1638 1907 ); 1639 1908 1640 1641 1909 } 1642 1910 … … 1646 1914 return $retval; 1647 1915 } 1916 function link_to_entry($event,$month,$day,$year) 1917 { 1918 $str = ''; 1919 $is_private = !$event['public'] && !$this->bo->check_perms(PHPGW_ACL_READ,$event); 1920 $viewable = !$this->bo->printer_friendly && $this->bo->check_perms(PHPGW_ACL_READ,$event); 1921 1922 $starttime = $this->bo->maketime($event['start']) - $GLOBALS['phpgw']->datetime->tz_offset; 1923 $endtime = $this->bo->maketime($event['end']) - $GLOBALS['phpgw']->datetime->tz_offset; 1924 $rawdate = mktime(0,0,0,$month,$day,$year); 1925 $rawdate_offset = $rawdate - $GLOBALS['phpgw']->datetime->tz_offset; 1926 $nextday = mktime(0,0,0,$month,$day + 1,$year) - $GLOBALS['phpgw']->datetime->tz_offset; 1927 if ((int)$GLOBALS['phpgw']->common->show_date($starttime,'Hi') && $starttime == $endtime) 1928 { 1929 $time = $GLOBALS['phpgw']->common->show_date($starttime,$this->bo->users_timeformat); 1930 } 1931 elseif ($starttime <= $rawdate_offset && $endtime >= $nextday - 60) 1932 { 1933 $time = '[ '.lang('All Day').' ]'; 1934 } 1935 elseif ((int)$GLOBALS['phpgw']->common->show_date($starttime,'Hi') || $starttime != $endtime) 1936 { 1937 if($starttime < $rawdate_offset && $event['recur_type'] == MCAL_RECUR_NONE) 1938 { 1939 $start_time = $GLOBALS['phpgw']->common->show_date($rawdate_offset,$this->bo->users_timeformat); 1940 } 1941 else 1942 { 1943 $start_time = $GLOBALS['phpgw']->common->show_date($starttime,$this->bo->users_timeformat); 1944 } 1945 1946 if($endtime >= ($rawdate_offset + 86400)) 1947 { 1948 $end_time = $GLOBALS['phpgw']->common->show_date(mktime(23,59,59,$month,$day,$year) - $GLOBALS['phpgw']->datetime->tz_offset,$this->bo->users_timeformat); 1949 } 1950 else 1951 { 1952 $end_time = $GLOBALS['phpgw']->common->show_date($endtime,$this->bo->users_timeformat); 1953 } 1954 $time = $start_time.'-'.$end_time; 1955 } 1956 else 1957 { 1958 $time = ''; 1959 } 1960 1961 $texttitle = $texttime = $textdesc = $textlocation = $textstatus = ''; 1962 1963 1964 1965 if(!$is_private) 1966 { 1967 //$text .= $this->bo->display_status($event['users_status']); 1968 1969 // split text for better display by templates, also see $texttime $texttitle $textdesc $textlocation 1970 $textstatus=$this->bo->display_status($event['users_status']); 1971 1972 } 1973 1974 /* 1975 $text = '<nobr> '.$time.' </nobr> '.$this->bo->get_short_field($event,$is_private,'title').$text. 1976 (!$is_private && $event['description'] ? ': <i>'.$this->bo->get_short_field($event,$is_private,'description').'</i>':''). 1977 $GLOBALS['phpgw']->browser->br; 1978 */ 1979 1980 $texttime=$time; 1981 $texttitle=$this->bo->get_short_field($event,$is_private,'title'); 1982 $textdesc=(!$is_private && $event['description'] ? $this->bo->get_short_field($event,$is_private,'description'):''); 1983 // added $textlocation but this must be activated in the actual pict_link.tpl file of the used template set 1984 $textlocation=$this->bo->get_short_field($event,$is_private,'location'); 1985 1986 if ($viewable) 1987 { 1988 $date = sprintf('%04d%02d%02d',$year,$month,$day); 1989 $this->link_tpl->set_var('link_link',$this->page('view','&cal_id='.$event['id'].'&date='.$date)); 1990 $this->link_tpl->set_var('lang_view',lang('View this entry')); 1991 $this->link_tpl->set_var('desc', $textdesc); 1992 $this->link_tpl->set_var('location', $textlocation); 1993 $this->link_tpl->parse('picture','link_open',True); 1994 } 1995 if (!$is_private) 1996 { 1997 if($event['priority'] == 3) 1998 { 1999 $picture[] = Array( 2000 'pict' => $GLOBALS['phpgw']->common->image('calendar','high'), 2001 'width' => 16, 2002 'height'=> 16, 2003 'title' => lang('high priority') 2004 ); 2005 } 2006 if($event['recur_type'] == MCAL_RECUR_NONE) 2007 { 2008 $picture[] = Array( 2009 'pict' => $GLOBALS['phpgw']->common->image('calendar','circle'), 2010 'width' => 9, 2011 'height'=> 9, 2012 'title' => lang('single event') 2013 ); 2014 } 2015 else 2016 { 2017 $picture[] = Array( 2018 'pict' => $GLOBALS['phpgw']->common->image('calendar','recur'), 2019 'width' => 12, 2020 'height'=> 12, 2021 'title' => lang('recurring event') 2022 ); 2023 } 2024 } 2025 2026 if($event['public'] == 0) 2027 { 2028 $picture[] = Array( 2029 'pict' => $GLOBALS['phpgw']->common->image('calendar','private'), 2030 'width' => 13, 2031 'height'=> 13, 2032 'title' => lang('private') 2033 ); 2034 } 2035 /** if(@isset($event['alarm']) && count($event['alarm']) >= 1 && !$is_private) 2036 { 2037 // if the alarm is to go off the day before the event 2038 // the icon does not show up because of 'alarm_today' 2039 // - TOM 2040 if($this->bo->alarm_today($event,$rawdate_offset,$starttime)) 2041 { 2042 $picture[] = Array( 2043 'pict' => $GLOBALS['phpgw']->common->image('calendar','alarm'), 2044 'width' => 13, 2045 'height'=> 13, 2046 'title' => lang('alarm') 2047 ); 2048 } 2049 }*/ 2050 2051 $description = $this->bo->get_short_field($event,$is_private,'description'); 2052 for($i=0;$i<count($picture);$i++) 2053 { 2054 $var = Array( 2055 'pic_image' => $picture[$i]['pict'], 2056 'width' => $picture[$i]['width'], 2057 'height' => $picture[$i]['height'], 2058 'title' => $picture[$i]['title'] 2059 ); 2060 $this->output_template_array($this->link_tpl,'picture','pict',$var); 2061 } 2062 if ($texttitle) 2063 { 2064 $var = Array( 2065 // 'text' => $text, 2066 'time'=> $texttime, 2067 'title'=> $texttitle, 2068 'users_status'=>$textstatus, 2069 'desc'=> $textdesc, 2070 'location'=> "<br><b>Local:</b> ".$textlocation 2071 ); 2072 $this->output_template_array($this->link_tpl,'picture','link_text',$var); 2073 } 2074 2075 if ($viewable) 2076 { 2077 $this->link_tpl->parse('picture','link_close',True); 2078 } 2079 $str = $this->link_tpl->fp('out','link_pict'); 2080 $this->link_tpl->set_var('picture',''); 2081 $this->link_tpl->set_var('out',''); 2082 // unset($p); 2083 return $str; 2084 } 1648 2085 1649 2086 -
contrib/Resources/templates/default/head.tpl
r3524 r4362 17 17 <table id="calendar_head_table" class="calendar_head_table" border="0" width="100%" cols="{cols}" cellpadding="6" cellspacing="0"> 18 18 <tr> 19 <td rowspan=10>19 <td> 20 20 21 <div id="divSubContainer"> 22 <table cellpadding="0" cellspacing="0" width="100%"> 23 <tbody><tr> 24 <!-- Sidebox Column --> 25 <td id="tdSidebox" valign="top"><div id="thesideboxcolumn" style="width: 203px;"><div id="sideresize"></div> 26 <div class="divSidebox"> 27 <div class="divSideboxHeader"><span>Recursos Menú</span></div> 28 29 <div> 30 <table cellpadding="0" cellspacing="0" width="100%"> 31 <tbody><tr class="divSideboxEntry"> 32 <td class="textSidebox" align="center" valign="middle" width="20"><img class="sideboxstar" src="/resources/templates/default/images/orange-ball.png" alt="ball" height="9" width="9"></td><td class="textSidebox"><a class="textSidebox" href="index.php?menuaction=resources.uiresources.search">Lista del registro</a></td> 33 </tr> 34 <tr class="divSideboxEntry"> 35 <td class="textSidebox" align="center" valign="middle" width="20"><img class="sideboxstar" src="/resources/templates/default/images/orange-ball.png" alt="ball" height="9" width="9"></td><td class="textSidebox"><a class="textSidebox" href=""></a><a class="textSidebox" href="index.php?menuaction=resources.uiresources.edit" >Añadir</a></td> 36 </tr> 37 38 </tbody></table> 39 </div> 40 </div> 41 42 <div class="sideboxSpace"></div> 43 44 </td> <td> 21 45 22 46 23 -
contrib/Resources/templates/default/search.tpl
r3524 r4362 56 56 </td> 57 57 58 <td>59 <table>60 58 61 <tr>62 <td class="inactiv_sortcolumn" align="left">Categoría <br>Administrador</td>63 64 </tr>65 66 </table>67 </td>68 59 <td> 69 60 <table> … … 103 94 104 95 105 <td>{category}<br>{administrador}</td> 96 106 97 <td> {location}</td> 107 98 … … 109 100 110 101 111 <td> 112 <a href="{accionmodificar}"><img src=/resources/templates/default/images/edit.png alt="modificar"></a> 113 </td> 102 114 103 <td> 115 104 <a href="{accionlistar}"><img src=/resources/templates/default/images/calendar.png alt="ver recursos asignados"></a> … … 121 110 <a href="{accionreservar}"><img src=/resources/templates/default/images/bookable.png alt="reservar"></a> 122 111 </td> 123 <td>124 112 125 <a href="" onClick="if ( 0 || confirm('eliminar esta entrada?')) return submitit2('{accionborrar}');; "><img src=/infolog/templates/default/images/delete.png alt="borrar"></a><br>126 127 128 <br>129 130 </td>131 113 132 114 -
contrib/Resources/templates/default/search2.tpl
r3524 r4362 31 31 </script> 32 32 <center> 33 34 <table id="calendar_search_table" width="90%"> 33 <table id="calendar_search_table" width="800"> 35 34 36 35 <tr><td align=left> … … 40 39 41 40 <td> 42 <table >41 <table width="150"> 43 42 44 43 <tr> … … 50 49 </td> 51 50 <td> 52 <table >51 <table width="300"> 53 52 54 53 <tr> … … 62 61 63 62 <td> 64 <table >63 <table width="100"> 65 64 66 65 <tr> … … 71 70 </table> 72 71 </td> 72 73 73 <td> 74 <table> 75 76 <tr> 77 <td class="inactiv_sortcolumn" align="left">Grupos</td> 78 79 </tr> 80 81 </table> 82 </td> 83 <td> 84 <table> 85 86 <tr> 87 <td class="inactiv_sortcolumn" align="left">Prioridad</td> 88 89 </tr> 90 91 </table> 92 </td> 93 <td> 94 <table> 95 96 <tr> 97 <td class="inactiv_sortcolumn" align="left">Public</td> 98 99 </tr> 100 101 </table> 102 </td> 103 <td> 104 <table> 74 <table width="150"> 105 75 106 76 <tr> … … 125 95 </td> 126 96 <td> 127 <table >97 <table width="100"> 128 98 129 99 <tr> … … 158 128 <td>{description}</td> 159 129 <td> {location}</td> 160 <td> {groups}</td> 161 <td> {priority}</td> 162 <td> {ispublic}</td> 130 163 131 <td> {fecha}</td> 164 <td>{owner}< /td>132 <td>{owner}<input type=hidden value={id}></td> 165 133 166 134 -
contrib/Resources/todo
r3526 r4362 11 11 add buy and prize functionality 12 12 add location functionality 13 14 15 CREATE TABLE phpgw_resources16 (17 res_id integer NOT NULL DEFAULT nextval('seq_phpgw_resources'::regclass),18 "name" character varying(100),19 short_description character varying(100),20 cat_id integer NOT NULL,21 quantity integer,22 useable integer,23 "location" character varying(100),24 bookable character(1),25 prize character varying(200),26 picture_src character varying(20),27 accessory_of integer,28 storage_info character varying(200),29 inventory_number character varying(20),30 administrador character varying(255),31 email character varying(255),32 "owner" character varying(255),33 CONSTRAINT phpgw_resources_pkey PRIMARY KEY (res_id)34 )35 WITH (OIDS=TRUE);36 ALTER TABLE phpgw_resources OWNER TO postgres;
Note: See TracChangeset
for help on using the changeset viewer.