Merge branch 'master' of github.com:alchemy-fr/Phraseanet

This commit is contained in:
Nicolas Le Goff
2012-01-03 16:17:49 +01:00
42 changed files with 43144 additions and 42186 deletions

View File

@@ -1325,8 +1325,6 @@ class ACL implements cache_cacheableInterface
$rights['manage'] = true; $rights['manage'] = true;
if ($row['modify_struct']) if ($row['modify_struct'])
$rights['modify_struct'] = true; $rights['modify_struct'] = true;
if ($row['bas_manage'])
$rights['bas_manage'] = true;
$this->update_rights_to_base($base_id_dest, $rights); $this->update_rights_to_base($base_id_dest, $rights);

View File

@@ -88,6 +88,12 @@ class Controller_Admin_Users implements ControllerProviderInterface
$request = $app['request']; $request = $app['request'];
$rights = new module_admin_route_users_edit($request); $rights = new module_admin_route_users_edit($request);
$rights->apply_rights(); $rights->apply_rights();
if ($app['request']->get('template'))
{
$rights->apply_template();
}
$rights->apply_infos(); $rights->apply_infos();
$datas = array('error' => false); $datas = array('error' => false);
@@ -198,7 +204,7 @@ class Controller_Admin_Users implements ControllerProviderInterface
{ {
$request = $app['request']; $request = $app['request'];
$users = new module_admin_route_users_edit($request); $users = new module_admin_route_users_edit($request);
$users->apply_template(); $users->apply_template();
return new Symfony\Component\HttpFoundation\RedirectResponse('/admin/users/search/'); return new Symfony\Component\HttpFoundation\RedirectResponse('/admin/users/search/');

View File

@@ -322,6 +322,9 @@ class Session_Handler
*/ */
public function open_phrasea_session() public function open_phrasea_session()
{ {
if (!$this->phrasea_session instanceof Session_Phrasea)
throw new \Exception('No phrasea session available');
$this->phrasea_session->open(); $this->phrasea_session->open();
return $this; return $this;

View File

@@ -222,6 +222,12 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
*/ */
protected $is_admin; protected $is_admin;
/**
*
* @var boolean
*/
protected $ldap_created;
/** /**
* *
* @var boolean * @var boolean
@@ -587,6 +593,23 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
return $this; return $this;
} }
/**
*
* @param boolean $boolean
* @return User_Adapter
*/
public function set_ldap_created($boolean)
{
$value = $boolean ? '1' : '0';
$sql = 'UPDATE usr SET ldap_created = :ldap_created WHERE usr_id = :usr_id';
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute(array(':ldap_created' => $value, ':usr_id' => $this->get_id()));
$stmt->closeCursor();
$this->ldap_created = $boolean;
return $this;
}
/** /**
* *
* @param string $address * @param string $address
@@ -838,7 +861,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
$stmt = $this->appbox->get_connection()->prepare($sql); $stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute(array(':owner_id' => $owner->get_id(), ':usr_id' => $this->get_id())); $stmt->execute(array(':owner_id' => $owner->get_id(), ':usr_id' => $this->get_id()));
$stmt->closeCursor(); $stmt->closeCursor();
$this->set_ftp_address('') $this->set_ftp_address('')
->set_activeftp(false) ->set_activeftp(false)
->set_city('') ->set_city('')
@@ -870,6 +893,11 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
{ {
return $this->is_template; return $this->is_template;
} }
public function is_special()
{
return in_array($this->login, array('invite', 'autoregister'));
}
public function get_template_owner() public function get_template_owner()
{ {
@@ -1025,7 +1053,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
*/ */
public function load($id) public function load($id)
{ {
$sql = 'SELECT usr_id, create_db, usr_login, usr_nom, activite, $sql = 'SELECT usr_id, ldap_created, create_db, usr_login, usr_nom, activite,
usr_prenom, usr_sexe as gender, usr_mail, adresse, usr_creationdate, usr_modificationdate, usr_prenom, usr_sexe as gender, usr_mail, adresse, usr_creationdate, usr_modificationdate,
ville, cpostal, tel, fax, fonction, societe, geonameid, lastModel, invite, ville, cpostal, tel, fax, fonction, societe, geonameid, lastModel, invite,
defaultftpdatasent, mail_notifications, activeftp, addrftp, loginftp, defaultftpdatasent, mail_notifications, activeftp, addrftp, loginftp,
@@ -1041,6 +1069,8 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
$this->id = (int) $row['usr_id']; $this->id = (int) $row['usr_id'];
$this->email = $row['usr_mail']; $this->email = $row['usr_mail'];
$this->login = $row['usr_login']; $this->login = $row['usr_login'];
$this->ldap_created = $row['ldap_created'];
$this->defaultftpdatas = $row['defaultftpdatasent']; $this->defaultftpdatas = $row['defaultftpdatasent'];
$this->mail_notifications = $row['mail_notifications']; $this->mail_notifications = $row['mail_notifications'];
@@ -1120,6 +1150,11 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
return $this->id; return $this->id;
} }
public function get_ldap_created()
{
return $this->ldap_created;
}
public function is_guest() public function is_guest()
{ {
return $this->is_guest; return $this->is_guest;
@@ -1746,7 +1781,6 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
, 'imgtools' => '1' , 'imgtools' => '1'
, 'manage' => '1' , 'manage' => '1'
, 'modify_struct' => '1' , 'modify_struct' => '1'
, 'bas_manage' => '1'
, 'bas_modify_struct' => '1' , 'bas_modify_struct' => '1'
); );

View File

@@ -151,7 +151,9 @@ class basketCollection
$appbox = appbox::get_instance(); $appbox = appbox::get_instance();
$conn = $appbox->get_connection(); $conn = $appbox->get_connection();
$session = $appbox->get_session(); $session = $appbox->get_session();
$sql = 'SELECT ssel_id FROM sselnew WHERE usr_id = :usr_id'; $sql = 'SELECT n.ssel_id FROM sselnew n, ssel s
WHERE s.ssel_id = n.ssel_id AND n.usr_id = :usr_id
AND n.usr_id = s.usr_id';
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
$stmt->execute(array(':usr_id' => $session->get_usr_id())); $stmt->execute(array(':usr_id' => $session->get_usr_id()));
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);

View File

@@ -533,8 +533,7 @@ class collection implements cache_cacheableInterface
"chgstatus" => "1", "chgstatus" => "1",
"imgtools" => "1", "imgtools" => "1",
"manage" => "1", "manage" => "1",
"modify_struct" => "1", "modify_struct" => "1"
"bas_manage" => "1"
); );
$user->ACL()->update_rights_to_base($base_id, $rights); $user->ACL()->update_rights_to_base($base_id, $rights);

View File

@@ -479,6 +479,15 @@ class databox_status
$conn = connection::getPDOConnection(); $conn = connection::getPDOConnection();
$status = '0'; $status = '0';
if(substr($stat1, 0, 2) === '0x')
{
$stat1 = self::hex2bin(substr($stat1, 2));
}
if(substr($stat2, 0, 2) === '0x')
{
$stat2 = self::hex2bin(substr($stat2, 2));
}
$sql = 'select bin(0b' . trim($stat1) . ' & 0b' . trim($stat2) . ') as result'; $sql = 'select bin(0b' . trim($stat1) . ' & 0b' . trim($stat2) . ') as result';
@@ -501,6 +510,15 @@ class databox_status
$status = '0'; $status = '0';
if(substr($stat1, 0, 2) === '0x')
{
$stat1 = self::hex2bin(substr($stat1, 2));
}
if(substr($stat2, 0, 2) === '0x')
{
$stat2 = self::hex2bin(substr($stat2, 2));
}
$sql = 'select bin(0b' . trim($stat1) . ' & ~0b' . trim($stat2) . ') as result'; $sql = 'select bin(0b' . trim($stat1) . ' & ~0b' . trim($stat2) . ') as result';
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
@@ -522,6 +540,15 @@ class databox_status
$status = '0'; $status = '0';
if(substr($stat1, 0, 2) === '0x')
{
$stat1 = self::hex2bin(substr($stat1, 2));
}
if(substr($stat2, 0, 2) === '0x')
{
$stat2 = self::hex2bin(substr($stat2, 2));
}
$sql = 'select bin(0b' . trim($stat1) . ' | 0b' . trim($stat2) . ') as result'; $sql = 'select bin(0b' . trim($stat1) . ' | 0b' . trim($stat2) . ') as result';
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
@@ -539,17 +566,24 @@ class databox_status
public static function dec2bin($status) public static function dec2bin($status)
{ {
$status = (string) $status;
if(!ctype_digit($status))
{
throw new \Exception('Non-decimal value');
}
$conn = connection::getPDOConnection(); $conn = connection::getPDOConnection();
$status = '0'; $sql = 'select bin(' . $status . ') as result';
$sql = 'select bin(' . ((int) $status) . ') as result';
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
$stmt->execute(); $stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC); $row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$status = '0';
if ($row) if ($row)
{ {
$status = $row['result']; $status = $row['result'];
@@ -560,17 +594,28 @@ class databox_status
public static function hex2bin($status) public static function hex2bin($status)
{ {
$status = (string) $status;
if(substr($status, 0, 2) === '0x')
{
$status = substr($status, 2);
}
if(!ctype_xdigit($status))
{
throw new \Exception('Non-hexadecimal value');
}
$conn = connection::getPDOConnection(); $conn = connection::getPDOConnection();
$status = '0'; $sql = 'select BIN( CAST( 0x'.trim($status).' AS UNSIGNED ) ) as result';
$sql = 'select bin(0x' . trim($status) . ') as result';
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
$stmt->execute(); $stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC); $row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$status = '0';
if ($row) if ($row)
{ {
$status = $row['result']; $status = $row['result'];

View File

@@ -161,7 +161,10 @@ class gatekeeper
break; break;
case 'lightbox': case 'lightbox':
$this->token_access(); $this->token_access();
// phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']); if(!$session->is_authenticated())
{
phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']);
}
break; break;
} }
} }

View File

@@ -192,6 +192,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/'; $this->path = $registry->get('GV_RootPath') . 'www/skins/icons/';
$this->file = 'deleted.png'; $this->file = 'deleted.png';
$this->is_physically_present = false; $this->is_physically_present = false;
$this->is_substituted = true;
} }
if (!$row || !file_exists($this->path . $this->file)) if (!$row || !file_exists($this->path . $this->file))
{ {
@@ -204,6 +205,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->path = $registry->get('GV_RootPath') $this->path = $registry->get('GV_RootPath')
. 'www/skins/icons/substitution/'; . 'www/skins/icons/substitution/';
$this->file = 'regroup_thumb.png'; $this->file = 'regroup_thumb.png';
$this->is_substituted = true;
} }
else else
{ {
@@ -217,6 +219,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->path = $registry->get('GV_RootPath') $this->path = $registry->get('GV_RootPath')
. 'www/skins/icons/substitution/'; . 'www/skins/icons/substitution/';
$this->file = str_replace('+', '%20', $mime) . '.png'; $this->file = str_replace('+', '%20', $mime) . '.png';
$this->is_substituted = true;
} }
$this->is_physically_present = false; $this->is_physically_present = false;
if (!file_exists($this->path . $this->file)) if (!file_exists($this->path . $this->file))
@@ -225,6 +228,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->path = $registry->get('GV_RootPath') $this->path = $registry->get('GV_RootPath')
. 'www/skins/icons/'; . 'www/skins/icons/';
$this->file = 'substitution.png'; $this->file = 'substitution.png';
$this->is_substituted = true;
} }
} }

View File

@@ -193,7 +193,8 @@ return call_user_func(
if ($basket->is_valid()) if ($basket->is_valid())
{ {
$basket->get_first_element()->load_users_infos(); if($basket->get_first_element() instanceof basket_element_adapter)
$basket->get_first_element()->load_users_infos();
} }
$twig = new supertwig(); $twig = new supertwig();

View File

@@ -59,8 +59,8 @@ class module_admin_route_users
, 'like_value' => $request->get('like_value') , 'like_value' => $request->get('like_value')
, 'sbas_id' => $request->get('sbas_id') , 'sbas_id' => $request->get('sbas_id')
, 'base_id' => $request->get('base_id') , 'base_id' => $request->get('base_id')
, 'srt' => $request->get("srt") , 'srt' => $request->get("srt", User_Query::SORT_CREATIONDATE)
, 'ord' => $request->get("ord") , 'ord' => $request->get("ord", User_Query::ORD_DESC)
, 'per_page' => $results_quantity , 'per_page' => $results_quantity
, 'offset_start' => $offset_start , 'offset_start' => $offset_start
); );
@@ -68,14 +68,14 @@ class module_admin_route_users
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox); $user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
$query = new User_Query($appbox); $query = new User_Query($appbox);
if (is_array($request->get('base_id'))) if (is_array($this->query_parms['base_id']))
$query->on_base_ids($request->get('base_id')); $query->on_base_ids($this->query_parms['base_id']);
elseif (is_array($request->get('sbas_id'))) elseif (is_array($this->query_parms['sbas_id']))
$query->on_sbas_ids($request->get('sbas_id')); $query->on_sbas_ids($this->query_parms['sbas_id']);
$this->results = $query->sort_by($request->get("srt"), $request->get("ord")) $this->results = $query->sort_by($this->query_parms["srt"], $this->query_parms["ord"])
->like($request->get('like_field'), $request->get('like_value')) ->like($this->query_parms['like_field'], $this->query_parms['like_value'])
->get_inactives($request->get('inactives')) ->get_inactives($this->query_parms['inactives'])
->include_templates(true) ->include_templates(true)
->on_bases_where_i_am($user->ACL(), array('canadmin')) ->on_bases_where_i_am($user->ACL(), array('canadmin'))
->limit($offset_start, $results_quantity) ->limit($offset_start, $results_quantity)

View File

@@ -179,13 +179,19 @@ class module_admin_route_users_edit
} }
} }
$query = new User_Query($appbox);
$templates = $query
->only_templates(true)
->execute()->get_results();
$this->users_datas = $rs; $this->users_datas = $rs;
$out = array( $out = array(
'datas' => $this->users_datas, 'datas' => $this->users_datas,
'users' => $this->users, 'users' => $this->users,
'users_serial' => implode(';', $this->users), 'users_serial' => implode(';', $this->users),
'base_id' => $this->base_id, 'base_id' => $this->base_id,
'main_user' => null 'main_user' => null,
'templates'=>$templates
); );
if (count($this->users) == 1) if (count($this->users) == 1)

View File

@@ -436,7 +436,7 @@ class module_prod_route_records_edit extends module_prod_route_records_abstract
try try
{ {
$reg_record = $this->get_grouping_head(); $reg_record = $this->get_grouping_head();
$reg_sbas_id = $reg_record->get_base_id(); $reg_sbas_id = $reg_record->get_sbas_id();
$newsubdef_reg = new record_adapter($reg_sbas_id, $request->get('newrepresent')); $newsubdef_reg = new record_adapter($reg_sbas_id, $request->get('newrepresent'));
@@ -452,7 +452,7 @@ class module_prod_route_records_edit extends module_prod_route_records_abstract
} }
catch (Exception $e) catch (Exception $e)
{ {
} }
} }

View File

@@ -46,7 +46,7 @@ class module_report_sqlfilter
$coll_filter = array(); $coll_filter = array();
foreach (explode(',', $list_coll_id) as $val) foreach (explode(',', $list_coll_id) as $val)
{ {
$coll_filter [] = " position('," . (int) $val . ",' in concat(',' ,coll_list, ',')) > 0 "; $coll_filter [] = " position('," . phrasea::collFromBas($val) . ",' in concat(',' ,coll_list, ',')) > 0 ";
} }
$ret['sql'] = implode(' OR ', $coll_filter); $ret['sql'] = implode(' OR ', $coll_filter);
@@ -207,7 +207,7 @@ class module_report_sqlfilter
{ {
foreach ($tab as $val) foreach ($tab as $val)
{ {
$coll_filter[] = " position('," . (int) $val . ",' in concat(',' ,coll_list, ',')) > 0 "; $coll_filter[] = " position('," . phrasea::collFromBas($val) . ",' in concat(',' ,coll_list, ',')) > 0 ";
} }
$this->filter['collection'] = array('sql' => implode(' OR ', $coll_filter), 'params' => array()); $this->filter['collection'] = array('sql' => implode(' OR ', $coll_filter), 'params' => array());
} }
@@ -226,7 +226,7 @@ class module_report_sqlfilter
foreach ($tab as $val) foreach ($tab as $val)
{ {
$dl_coll_filter[] = "record.coll_id = :record_fil" . $n; $dl_coll_filter[] = "record.coll_id = :record_fil" . $n;
$params[":record_fil" . $n] = $val; $params[":record_fil" . $n] = phrasea::collFromBas($val);
$n++; $n++;
} }
$this->filter['record'] = array('sql' => implode(' OR ', $dl_coll_filter), 'params' => $params); $this->filter['record'] = array('sql' => implode(' OR ', $dl_coll_filter), 'params' => $params);

View File

@@ -97,8 +97,6 @@ interface record_Interface
public function get_reg_name(); public function get_reg_name();
public function get_bitly_link();
public function get_hd_file(); public function get_hd_file();
public function delete(); public function delete();

View File

@@ -968,6 +968,12 @@ class record_adapter implements record_Interface, cache_cacheableInterface
try try
{ {
$value = $this->get_subdef($name); $value = $this->get_subdef($name);
if ($value->is_substituted())
{
throw new Exception('Cannot replace a substitution');
}
$original_file = p4string::addEndSlash($value->get_path()) . $value->get_file(); $original_file = p4string::addEndSlash($value->get_path()) . $value->get_file();
unlink($original_file); unlink($original_file);
} }
@@ -1288,54 +1294,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
return $regname; return $regname;
} }
/**
*
* @return string
*/
public function get_bitly_link()
{
$registry = registry::get_instance();
if ($this->bitly_link !== null)
return $this->bitly_link;
$this->bitly_link = false;
if (trim($registry->get('GV_bitly_user')) == ''
&& trim($registry->get('GV_bitly_key')) == '')
return $this->bitly_link;
try
{
$short = new PHPShortener();
$bitly = $short->encode($url . 'view/', 'bit.ly', $registry);
if (preg_match('/^(http:\/\/)?(www\.)?([^\/]*)\/(.*)$/', $bitly, $results))
{
if ($results[3] && $results[4])
{
$hash = 'http://bit.ly/' . $results[4];
$sql = 'UPDATE record SET bitly = :hash WHERE record_id = :record_id';
$connbas = connection::getPDOConnection($this->get_sbas_id());
$stmt = $connbas->prepare($sql);
$stmt->execute(array(':hash' => $hash, ':record_id' => $this->get_record_id()));
$stmt->closeCursor();
$this->bitly_link = 'http://bit.ly/' . $hash;
}
}
}
catch (Exception $e)
{
unset($e);
}
$this->delete_data_from_cache();
return $this->bitly_link;
}
/** /**
* *
* @param collection $collection * @param collection $collection

View File

@@ -112,8 +112,7 @@ class record_preview extends record_adapter
break; break;
case "REG": case "REG":
$contId = explode('_', $contId); $contId = explode('_', $contId);
$base_id = $contId[0]; $sbas_id = $contId[0];
$sbas_id = phrasea::sbasFromBas($base_id);
$record_id = $contId[1]; $record_id = $contId[1];
$this->container = new record_adapter($sbas_id, $record_id); $this->container = new record_adapter($sbas_id, $record_id);

View File

@@ -14,6 +14,7 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract
*/ */
protected $object; protected $object;
protected $databox; protected $databox;
protected static $need_records = 1;
public function setUp() public function setUp()
{ {
@@ -119,10 +120,10 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract
*/ */
public function testOperation_and() public function testOperation_and()
{ {
// Remove the following lines when you implement this test. $this->assertEquals('0', databox_status::operation_and('0x001','0x010'));
$this->markTestIncomplete( $this->assertEquals('1', databox_status::operation_and('01','11'));
'This test has not been implemented yet.' $this->assertEquals('0', databox_status::operation_and('01','10'));
); $this->assertEquals('10', databox_status::operation_and('11','10'));
} }
/** /**
@@ -130,10 +131,11 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract
*/ */
public function testOperation_and_not() public function testOperation_and_not()
{ {
// Remove the following lines when you implement this test. $this->assertEquals('0', databox_status::operation_and_not('0x001','0x011'));
$this->markTestIncomplete( $this->assertEquals('0', databox_status::operation_and_not('01','11'));
'This test has not been implemented yet.' $this->assertEquals('1', databox_status::operation_and_not('01','10'));
); $this->assertEquals('1', databox_status::operation_and_not('11','10'));
$this->assertEquals('10', databox_status::operation_and_not('10','01'));
} }
/** /**
@@ -141,10 +143,8 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract
*/ */
public function testOperation_or() public function testOperation_or()
{ {
// Remove the following lines when you implement this test. $this->assertEquals('10001', databox_status::operation_or('0x001','0x011'));
$this->markTestIncomplete( $this->assertEquals('11', databox_status::operation_or('01','11'));
'This test has not been implemented yet.'
);
} }
/** /**
@@ -152,21 +152,31 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract
*/ */
public function testDec2bin() public function testDec2bin()
{ {
// Remove the following lines when you implement this test. $this->assertEquals('1010', databox_status::dec2bin('10'));
$this->markTestIncomplete(
'This test has not been implemented yet.' try
); {
}
catch(Exception $e)
{
}
} }
/**
* @todo Implement testHex2bin().
*/
public function testHex2bin() public function testHex2bin()
{ {
// Remove the following lines when you implement this test. $this->assertEquals('10100001', databox_status::hex2bin('0x0A1'));
$this->markTestIncomplete( $this->assertEquals('10100001', databox_status::hex2bin('0A1'));
'This test has not been implemented yet.'
); try
{
databox_status::hex2bin('G1');
$this->fail('Should raise an exception');
}
catch(Exception $e)
{
}
} }
} }

View File

@@ -15,5 +15,5 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
define('GV_version', '3.5.5.0'); define('GV_version', '3.5.6.0');
define('GV_version_name', 'Baobab'); define('GV_version_name', 'Baobab');

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -106,35 +106,55 @@
</script> </script>
<div> <div>
<div class="tabs PNB10" style="bottom:40px;"> <div class="tabs PNB" style="bottom:40px;">
<ul> <ul>
<li> <li>
<a href="#rights_tab">Droits</a> <a href="#rights_tab">{% trans 'Rights' %}</a>
</li> </li>
{% if main_user is not empty and main_user.is_template is empty %} {% if main_user is not empty and main_user.is_template is empty and main_user.is_special is empty %}
<li> <li>
<a href="#user_infos_tab">Fiche</a> <a href="#user_infos_tab">{% trans 'Infos' %}</a>
</li> </li>
{% endif %} {% endif %}
</ul> </ul>
<div id="rights_tab" class="PNB" style="top:40px;"> <div id="rights_tab" class="PNB" style="top:40px;">
<div class="PNB10" style="height:30px;bottom:auto;">
<h1>
{% if main_user is not empty %}
{% set display_name = main_user.get_display_name() %}
{% trans %}
Edition des droits de {{ display_name }}
{% endtrans %}
{% else %}
{% set number = users|length %}
{% trans %}
Edition des droits de {{ number }} utilisateurs
{% endtrans %}
{% endif %}
</h1>
</div>
<form id="users_rights_form" method="post" action="/admin/users/rights/apply/"> <form id="users_rights_form" method="post" action="/admin/users/rights/apply/">
<input type="hidden" name="users" value="{{users_serial}}"/> <input type="hidden" name="users" value="{{users_serial}}"/>
<table style="width:100%;" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
{% if main_user is not empty %}
{% if main_user.is_special is not empty %}
{% if main_user.get_login() == 'invite' %}
{% trans 'Reglages:: reglages d acces guest' %}
{% elseif main_user.get_login() == 'autoregister' %}
{% trans 'Reglages:: reglages d inscitpition automatisee' %}
{% endif %}
{% else %}
{% set display_name = main_user.get_display_name() %}
{% trans %}
Edition des droits de {{ display_name }}
{% endtrans %}
{% endif %}
{% else %}
{% set number = users|length %}
{% trans %}
Edition des droits de {{ number }} utilisateurs
{% endtrans %}
{% endif %}
</td>
<td style="text-align:right;">
{% trans 'Apply a template' %}
<select name="template">
<option value="">{% trans 'boutton::choisir' %}</option>
{% for template in templates %}
<option value="{{ template.get_id() }}">{{ template.get_display_name() }}</option>
{% endfor %}
</select>
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0" style="table-layout: auto;width:820px;height:67px;bottom:auto;top:50px;" class="PNB10"> <table cellspacing="0" cellpadding="0" border="0" style="table-layout: auto;width:820px;height:67px;bottom:auto;top:50px;" class="PNB10">
<thead> <thead>
<tr> <tr>
@@ -402,7 +422,7 @@
</form> </form>
</div> </div>
{% if main_user is not empty and main_user.is_template is empty %} {% if main_user is not empty and main_user.is_template is empty and main_user.is_special is empty %}
<div id="user_infos_tab" class="PNB" style="top:40px;"> <div id="user_infos_tab" class="PNB" style="top:40px;">
<form id="user_infos_form"> <form id="user_infos_form">
<table> <table>
@@ -521,6 +541,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="PNB10" style="top:auto;height:20px;"> <div class="PNB10" style="top:auto;height:20px;">
<button class="users_rights_valid">{% trans 'boutton::valider' %}</button> <button class="users_rights_valid">{% trans 'boutton::valider' %}</button>
<a href="/admin/users/search/" class="users_rights_cancel">{% trans 'boutton::retour' %}</a>
</div> </div>
</div> </div>

View File

@@ -34,6 +34,13 @@
</span> </span>
</a> </a>
<input type="hidden" value="{{invite_user.get_id()}}" name="invite_user_id"/> <input type="hidden" value="{{invite_user.get_id()}}" name="invite_user_id"/>
<a class="autoregister_modifier" href="#">
<span>
{% trans 'Reglages:: reglages d inscitpition automatisee' %}
</span>
</a>
<input type="hidden" value="{{autoregister_user.get_id()}}" name="autoregister_user_id"/>
</p> </p>
<form id="users_page_search" method="post" action="/admin/users/search/" target="_self"> <form id="users_page_search" method="post" action="/admin/users/search/" target="_self">
<p class="admin_head_opts"> <p class="admin_head_opts">

View File

@@ -9,7 +9,7 @@
{% import 'common/thumbnail.html' as thumbnail %} {% import 'common/thumbnail.html' as thumbnail %}
{% set record = basket_element.get_record() %} {% set record = basket_element.get_record() %}
<div ondblclick="{% if basket_scope == 'groupings' %}openPreview('REG',{{basket_element.get_order()}},'{{basket.get_base_id()}}_{{basket.get_record_id()}}');{% else %}openPreview('BASK',{{basket_element.get_order()}},{{basket.get_ssel_id()}});{% endif %}" <div ondblclick="{% if basket_scope == 'groupings' %}openPreview('REG',{{basket_element.get_order()}},'{{basket.get_sbas_id()}}_{{basket.get_record_id()}}');{% else %}openPreview('BASK',{{basket_element.get_order()}},{{basket.get_ssel_id()}});{% endif %}"
id="CHIM_{{basket_element.get_sselcont_id()}}_{{record.get_serialize_key()}}" id="CHIM_{{basket_element.get_sselcont_id()}}_{{record.get_serialize_key()}}"
sbas="{{basket_record.get_sbas_id()}}" class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;"> sbas="{{basket_record.get_sbas_id()}}" class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;">
{% if user.getPrefs('basket_title_display') == '1' %} {% if user.getPrefs('basket_title_display') == '1' %}

View File

@@ -616,9 +616,7 @@
<button class="default_action"> <button class="default_action">
<img src="/skins/icons/ccoch0.gif"/>&nbsp; <img src="/skins/icons/ccoch0.gif"/>&nbsp;
</button> </button>
<button class="trigger"> <button class="trigger">{% trans 'Select' %}</button>
oui
</button>
</span> </span>
<div class="submenu"> <div class="submenu">
<button class="answer_selector all_selector"> <button class="answer_selector all_selector">
@@ -647,7 +645,7 @@
<button class="default_action TOOL_disktt_btn results_window"> <button class="default_action TOOL_disktt_btn results_window">
<img src="/skins/prod/000000/images/disktt_history.gif"/> {% trans 'action : exporter' %} <img src="/skins/prod/000000/images/disktt_history.gif"/> {% trans 'action : exporter' %}
</button> </button>
<button class="trigger">Select an action</button> <button class="trigger">{% trans 'Select an action' %}</button>
</span> </span>
<div class="submenu"> <div class="submenu">
<button class="TOOL_print_btn results_window"> <button class="TOOL_print_btn results_window">
@@ -688,7 +686,7 @@
</button> </button>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<button class="trigger">Operations</button> <button class="trigger">{% trans 'Select an action' %}</button>
</span> </span>
<div class="submenu" > <div class="submenu" >
{% for action in actions %} {% for action in actions %}
@@ -717,7 +715,7 @@
<img src="/skins/prod/000000/images/pushdoc_history.gif"/> <img src="/skins/prod/000000/images/pushdoc_history.gif"/>
{% trans 'action : push' %} {% trans 'action : push' %}
</button> </button>
<button class="trigger">Select an action</button> <button class="trigger">{% trans 'Select an action' %}</button>
</span> </span>
<div class="submenu"> <div class="submenu">
<button class="TOOL_bridge_btn results_window"> <button class="TOOL_bridge_btn results_window">
@@ -744,7 +742,7 @@
<img src="/skins/icons/door.png"/> <img src="/skins/icons/door.png"/>
{% trans 'action : bridge' %} {% trans 'action : bridge' %}
</button> </button>
<button class="trigger">Select an action</button> <button class="trigger">{% trans 'Select an action' %}</button>
</span> </span>
<div class="submenu"> <div class="submenu">
<button class="TOOL_publish_btn results_window"> <button class="TOOL_publish_btn results_window">

View File

@@ -1,12 +1,4 @@
{% if record.get_bitly_link() and user.ACL().has_right_on_base(record.get_base_id(), 'canreport') %}
<div>
{% trans 'preview::statistiques pour le lien' %}
<a class="bitly_link bitly_link_{{record.get_bitly_link()}}"
href="http://bit.ly/info/{{record.get_bitly_link()}}" target="_blank">
http://bit.ly/{{record.get_bitly_link()}}</a></div>
{% endif %}
{% if record.get_view_popularity() %} {% if record.get_view_popularity() %}
<br> <br>
{% trans 'preview::statistiques de visualisation pour le lien' %} {% trans 'preview::statistiques de visualisation pour le lien' %}

View File

@@ -13,7 +13,7 @@
<div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}" <div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}"
id="{{ prefix|default('IMGT') }}_{{record.get_sbas_id}}_{{record.get_record_id}}" id="{{ prefix|default('IMGT') }}_{{record.get_sbas_id}}_{{record.get_record_id}}"
class="IMGT diapo grouping type-{{record.get_type}}" class="IMGT diapo grouping type-{{record.get_type}}"
onDblClick="openPreview('REG','0','{{record.get_base_id}}_{{record.get_record_id}}');"> onDblClick="openPreview('REG','0','{{record.get_serialize_key()}}');">
{% else %} {% else %}
<div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}" <div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}"
id="{{ prefix|default('IMGT') }}_{{record.get_sbas_id}}_{{record.get_record_id}}" id="{{ prefix|default('IMGT') }}_{{record.get_sbas_id}}_{{record.get_record_id}}"

View File

@@ -78,6 +78,7 @@ function ini_edit_usrs(){
var datas = { var datas = {
users:$('#users_rights_form input[name="users"]').val(), users:$('#users_rights_form input[name="users"]').val(),
values:$('#users_rights_form').serialize(), values:$('#users_rights_form').serialize(),
template:$('#users_rights_form select[name="template"]').val(),
user_infos:$('#user_infos_form').serialize() user_infos:$('#user_infos_form').serialize()
}; };
$.ajax({ $.ajax({
@@ -94,6 +95,17 @@ function ini_edit_usrs(){
}); });
return false; return false;
}); });
$('#right-ajax .users_rights_cancel').bind('click', function(){
var $this = $(this);
$('#right-ajax').empty().addClass('loading').parent().show();
$('#right').hide();
$.get($this.attr('href'), function(data) {
$('#right-ajax').removeClass('loading').html(data);
});
return false;
});
var time_buttons = { var time_buttons = {
'Ok':function(){ 'Ok':function(){

View File

@@ -213,33 +213,6 @@ if ($parm['flush_cache'] && $registry->get('GV_cache_server_type') !== 'nocache'
</div> </div>
<h1><?php echo _('setup:: Reglages generaux') ?></h1> <h1><?php echo _('setup:: Reglages generaux') ?></h1>
<br> <br>
<?php
try
{
$invite = new User_Adapter('invite', $appbox);
}
catch (Exception $e)
{
$invite = User_Adapter::create($appbox, 'invite', 'invite', '', false);
}
?>
<div><a href="editusr.php?ord=asc&p2=<?php echo $invite->get_id() ?>"><?php echo _('Reglages:: reglages d acces guest'); ?></a></div>
<?php
try
{
$autoregister = new User_Adapter('autoregister', $appbox);
}
catch (Exception $e)
{
$invite = User_Adapter::create($appbox, 'autoregister', 'autoregister', '', false);
}
if ($autoregister !== false)
{
?>
<div><a href="editusr.php?ord=asc&p2=<?php echo $autoregister->get_id() ?>"><?php echo _('Reglages:: reglages d inscitpition automatisee'); ?></a></div>
<?php
}
?>
<h2><?php echo _('setup::Votre configuration') ?></h2> <h2><?php echo _('setup::Votre configuration') ?></h2>
<div> <div>
<div style="position:relative;float:left;width:400px;"> <div style="position:relative;float:left;width:400px;">

View File

@@ -362,7 +362,7 @@ $(document).ready(function(){
}); });
return false; return false;
}); });
$('#users_page .invite_modifier').live('click', function(){ $('#users_page .invite_modifier, #users_page .autoregister_modifier').live('click', function(){
var users = $(this).next('input').val(); var users = $(this).next('input').val();
if($.trim(users) === '') if($.trim(users) === '')

View File

@@ -1,15 +1,21 @@
var p4 = p4 || {};
$(document).ready(function(){ $(document).ready(function(){
$('input.input-button').hover( $('input.input-button').hover(
function(){$(this).addClass('hover');}, function(){$(this).addClass('hover');},
function(){$(this).removeClass('hover');} function(){$(this).removeClass('hover');}
); );
var locale = $.cookie('locale'); var locale = $.cookie('locale');
p4.lng = locale !== null ? locale.split('_').reverse().pop() : 'en'; var jq_date = p4.lng = locale !== null ? locale.split('_').reverse().pop() : 'en';
if(jq_date == 'en')
{
jq_date = 'en-GB';
}
$.datepicker.setDefaults({showMonthAfterYear: false}); $.datepicker.setDefaults({showMonthAfterYear: false});
$.datepicker.setDefaults($.datepicker.regional[p4.lng]); $.datepicker.setDefaults($.datepicker.regional[jq_date]);
$('a.infoDialog,div.infoDialog').live('click',function(event){ $('a.infoDialog,div.infoDialog').live('click',function(event){
infoDialog($(this)); infoDialog($(this));

View File

@@ -112,7 +112,7 @@ if ($parm["act"] == "START" || $parm["act"] == "WORK")
$status = databox_status::operation_or($status, $msko[$basrec[0]]); $status = databox_status::operation_or($status, $msko[$basrec[0]]);
$record->set_binary_status($status); $record->set_binary_status($status);
$session->get_logger($databox) $session->get_logger($record->get_databox())
->log($record, Session_Logger::EVENT_STATUS, '', ''); ->log($record, Session_Logger::EVENT_STATUS, '', '');
basket_adapter::revoke_baskets_record($record, $appbox); basket_adapter::revoke_baskets_record($record, $appbox);

View File

@@ -1,6 +1,6 @@
document.getElementById('loader_bar').style.width = '30%'; document.getElementById('loader_bar').style.width = '30%';
var p4 = {}; var p4 = p4 || {};
var baskAjax,baskAjaxrunning; var baskAjax,baskAjaxrunning;
baskAjaxrunning = false; baskAjaxrunning = false;
@@ -1398,24 +1398,21 @@ $(document).ready(function(){
$('#loader_bar').stop().animate({ $('#loader_bar').stop().animate({
width:'70%' width:'70%'
},450); },450);
p4 = { p4.preview = {
preview :{
open:false, open:false,
current:false current:false
}, };
currentViewMode:'classic', p4.currentViewMode = 'classic';
nbNoview:0, p4.nbNoview = 0;
reg_delete:true, p4.reg_delete = true;
lng:'', p4.sel = [];
sel:[], p4.baskSel = [];
baskSel:[], p4.edit = {};
edit:{}, p4.thesau = {
thesau:{
tabs:null tabs:null
}, };
active_zone:false, p4.active_zone = false;
next_bask_scroll: false p4.next_bask_scroll = false;
};
$('#backcolorpickerHolder').ColorPicker({ $('#backcolorpickerHolder').ColorPicker({

View File

@@ -67,7 +67,6 @@ if (!$right)
$sha256 = $record->get_sha256(); $sha256 = $record->get_sha256();
$type = $record->get_type(); $type = $record->get_type();
$bitly = $record->get_bitly_link();
$url = ''; $url = '';
@@ -114,7 +113,7 @@ if ($url != '')
?> ?>
<div class="boxCloser" onclick="parent.hideDwnl();"><?php echo _('boutton::fermer') ?></div> <div class="boxCloser" onclick="parent.hideDwnl();"><?php echo _('boutton::fermer') ?></div>
<div id="tweet"> <div id="tweet">
<div style="margin-left:20px;padding:10px 0 5px;"><a href="http://www.twitter.com/home/?status=<?php echo $bitly ?>" target="_blank"><img src="/skins/icons/twitter.ico" title="share this on twitter" style="vertical-align:middle;padding:0 5px;"/> Send to Twitter</a></div> <div style="margin-left:20px;padding:10px 0 5px;"><a href="http://www.twitter.com/home/?status=<?php echo $url . 'view/' ?>" target="_blank"><img src="/skins/icons/twitter.ico" title="share this on twitter" style="vertical-align:middle;padding:0 5px;"/> Send to Twitter</a></div>
<div style="margin-left:20px;padding:5px 0 10px;"><a href="http://www.facebook.com/sharer.php?u=<?php echo $url . 'view/' ?>" target="_blank"><img src="/skins/icons/facebook.ico" title="share on facebook" style="vertical-align:middle;padding:0 5px;"/> Send to Facebook</a></div> <div style="margin-left:20px;padding:5px 0 10px;"><a href="http://www.facebook.com/sharer.php?u=<?php echo $url . 'view/' ?>" target="_blank"><img src="/skins/icons/facebook.ico" title="share on facebook" style="vertical-align:middle;padding:0 5px;"/> Send to Facebook</a></div>
</div> </div>
<div id="embed" style="text-align:center;padding:10px 0;"> <div id="embed" style="text-align:center;padding:10px 0;">