diff --git a/VERSIONS_HOTLINE/47691 b/VERSIONS_HOTLINE/47691 new file mode 100644 index 0000000000000000000000000000000000000000..ca3961817d25dca832ab5cfca890feaca8c4e2c0 --- /dev/null +++ b/VERSIONS_HOTLINE/47691 @@ -0,0 +1 @@ + - ticket #47691 : Administration : le rôle rédacteur bibliothèque peut choisir son thème admin \ No newline at end of file diff --git a/VERSIONS_HOTLINE/50010 b/VERSIONS_HOTLINE/50010 new file mode 100644 index 0000000000000000000000000000000000000000..dc2b7f375ad53ba47a8c6e6b7661075e1d296bdc --- /dev/null +++ b/VERSIONS_HOTLINE/50010 @@ -0,0 +1 @@ +- ticket #50010 : Suggestions d'achats avec Koha : remplacement de la colonne PatronReason par Note \ No newline at end of file diff --git a/VERSIONS_WIP/hackfes_add_special_char_ckeditor b/VERSIONS_WIP/hackfes_add_special_char_ckeditor new file mode 100644 index 0000000000000000000000000000000000000000..6bed7b521d534e2fc729bafc90bf942255f605b4 --- /dev/null +++ b/VERSIONS_WIP/hackfes_add_special_char_ckeditor @@ -0,0 +1 @@ + - hackfest : Ckeditor : ajout du bouton caratères spéciaux \ No newline at end of file diff --git a/VERSION_WIP/hackfest_clear_cache_files b/VERSION_WIP/hackfest_clear_cache_files new file mode 100644 index 0000000000000000000000000000000000000000..7a1d22f29a1b4e544fa8d10e2bcf9030cc5f50fa --- /dev/null +++ b/VERSION_WIP/hackfest_clear_cache_files @@ -0,0 +1 @@ + - hackfest : Administration : le bouton vider le cache regénère les fichiers css et js \ No newline at end of file diff --git a/application/modules/admin/controllers/IndexController.php b/application/modules/admin/controllers/IndexController.php index 891d9b25c479e9d6fb5e0af77491f8701be0d0ed..a8014fdfece292da500779b3b0649b3c73540f4f 100644 --- a/application/modules/admin/controllers/IndexController.php +++ b/application/modules/admin/controllers/IndexController.php @@ -111,6 +111,8 @@ class Admin_IndexController extends ZendAfi_Controller_Action { public function clearcacheAction() { (new Storm_Cache())->clean(); + Class_AdminVar::set('CACHE_DATE', (new Class_TimeSource())->dateFormat('Y-m-d H:i:s')); + Class_ScriptLoader::getInstance()->resetCacheHash(); $this->_helper->notify($this->_('Le cache de Bokeh a été vidé')); $this->_redirectToReferer(); } diff --git a/library/Class/AdminVar.php b/library/Class/AdminVar.php index 18832351e6272d52edc3d605f2ad3a8133aea3f8..d47339a06604b897c041d32f2b6cd2f07ab1fc7f 100644 --- a/library/Class/AdminVar.php +++ b/library/Class/AdminVar.php @@ -126,6 +126,7 @@ class Class_AdminVarLoader extends Storm_Model_Loader { 'CACHE_ACTIF' => Class_AdminVar_Meta::newOnOff(implode('<br/>', ['Activer le cache des boîtes (meilleure performance mais mise à jour toutes les ' . CACHE_LIFETIME / 60 . 'mn)', '<a href="' . Class_Url::baseUrl() . '/admin/index/clearcache" >Vider le cache</a>']))->bePrivate(), + 'CACHE_DATE' => Class_AdminVar_Meta::newDefault($this->_('Date du dernier vidage manuel du cache'))->bePrivate(), 'FORMATIONS' => Class_AdminVar_Meta::newOnOff($this->_('Activer ou désactiver le module formation'))->bePrivate(), diff --git a/library/Class/ScriptLoader.php b/library/Class/ScriptLoader.php index aff66e1aa5fe759e3bf747377b47041f103962f0..d3ca72ec45e7681638f9f29a35084b77f82c4ba9 100644 --- a/library/Class/ScriptLoader.php +++ b/library/Class/ScriptLoader.php @@ -731,18 +731,22 @@ class Class_ScriptLoader { * @return string */ protected function _addVersionParam($file) { - return $file . ((false == strpos($file, '?')) ? '?' : '&') . 'v=' . $this->getVersionPergameHash(); + return $file . ((false == strpos($file, '?')) ? '?' : '&') . 'v=' . $this->getCacheHash(); } - - protected function getVersionPergameHash() { + public function getCacheHash() { if (null == $this->_version_pergame_hash) - $this->_version_pergame_hash = md5(BOKEH_MAJOR_VERSION); + $this->_version_pergame_hash = $this->resetCacheHash(); return $this->_version_pergame_hash; } + public function resetCacheHash() { + return $this->_version_pergame_hash = md5(BOKEH_MAJOR_VERSION . Class_AdminVar::get('CACHE_DATE')); + } + + public function loadTreeSelect() { return $this ->loadJQueryUI() diff --git a/library/Class/WebService/SIGB/Koha/BuySuggestForm.php b/library/Class/WebService/SIGB/Koha/BuySuggestForm.php index 696faa8a3479f720c45536375cd5e91187c36650..0925c8593772c7b500366f2472b3a85c57d5528f 100644 --- a/library/Class/WebService/SIGB/Koha/BuySuggestForm.php +++ b/library/Class/WebService/SIGB/Koha/BuySuggestForm.php @@ -58,7 +58,7 @@ class Class_WebService_SIGB_Koha_BuySuggestForm extends ZendAfi_Form_SuggestionA 'placeholder' => '2015', 'validators' => ['Int']]) - ->addElement('textarea', 'PatronReason', ['label' => '', + ->addElement('textarea', 'Note', ['label' => '', 'cols' => 70, 'rows' => 10]) @@ -79,7 +79,7 @@ class Class_WebService_SIGB_Koha_BuySuggestForm extends ZendAfi_Form_SuggestionA 'suggestion', ['legend' => $this->_('Informations sur le document')]) - ->addDisplayGroup(['PatronReason'], + ->addDisplayGroup(['Note'], 'notes_group', ['legend' => $this->_('Notes')]) diff --git a/library/Class/WebService/SIGB/Koha/RestfulService.php b/library/Class/WebService/SIGB/Koha/RestfulService.php index 96e5ed0b061fd1423eda9da3d843a3c49da22119..476d9a0c52466fb62bf155ae5c86c5ebf6775e59 100644 --- a/library/Class/WebService/SIGB/Koha/RestfulService.php +++ b/library/Class/WebService/SIGB/Koha/RestfulService.php @@ -109,7 +109,7 @@ class Class_WebService_SIGB_Koha_RestfulService 'title' => $suggestion->getTitle() . $doctype_label, 'author' => $suggestion->getAuthor(), 'isbn' => $suggestion->getIsbn(), - 'patronreason' => $suggestion->getPatronReason(), + 'note' => $suggestion->getNote(), 'publicationyear' => $suggestion->getPublicationYear(), 'branchcode' => $suggestion->getUser()->getLibraryCode()]; diff --git a/library/Class/WebService/SIGB/Koha/SuggestionsReader.php b/library/Class/WebService/SIGB/Koha/SuggestionsReader.php index 68829492f6fb748af32d29a47286f29b350f14f2..fa8a43cea3a68b3ee37970654764c593709fa576 100644 --- a/library/Class/WebService/SIGB/Koha/SuggestionsReader.php +++ b/library/Class/WebService/SIGB/Koha/SuggestionsReader.php @@ -40,7 +40,6 @@ class Class_WebService_SIGB_Koha_SuggestionsReader { ->setLibrary($library ? $library->getLibelle() : '') ->setDate(trim($data->suggesteddate)) ->setNote(trim($data->note)) - ->setPatronReason(trim($data->patronreason)) ->setStatus($this->_statusLabelFor($data)); return $suggestion; diff --git a/library/Class/WebService/SIGB/Suggestion.php b/library/Class/WebService/SIGB/Suggestion.php index 220427a65ca83ef3b2a7bb5163b36393522036d0..7233eef5377e80481f55b2a42eda1195617b8ee6 100644 --- a/library/Class/WebService/SIGB/Suggestion.php +++ b/library/Class/WebService/SIGB/Suggestion.php @@ -69,7 +69,7 @@ class Class_WebService_SIGB_Suggestion extends Class_Entity { ->visitField($this->_('Date de publication'), $this->getPublicationYear()) ->visitField($this->_('Bibliothèque'), $this->getLibrary()) ->visitField($this->_('Date de suggestion'), $this->getDate()) - ->visitField($this->_('Note'), $this->getPatronReason()) + ->visitField($this->_('Note'), $this->getNote()) ->visitField($this->_('Statut'), $this->getStatus()); return $this; diff --git a/library/ZendAfi/Acl/AdminControllerGroup.php b/library/ZendAfi/Acl/AdminControllerGroup.php index 4894e2b5b617df6a9f4bc4a72824c59303eed0d8..e6c9fadd1dad69ad41bf74ff8d2d67dbff3242aa 100644 --- a/library/ZendAfi/Acl/AdminControllerGroup.php +++ b/library/ZendAfi/Acl/AdminControllerGroup.php @@ -38,7 +38,7 @@ class ZendAfi_Acl_AdminControllerGroup { 'oai' => Class_UserGroup::RIGHT_USER_BIB_NUM, 'frbr-link' => Class_UserGroup::RIGHT_USER_NOTICES_LIEES, 'users' => Class_UserGroup::RIGHT_USER_SIGB_USER_READ, - 'users/change-admin-skins' => null + 'users/change-admin-skin' => null ], $_activated = []; diff --git a/library/ZendAfi/View/Helper/CkEditor.php b/library/ZendAfi/View/Helper/CkEditor.php index 395c7f26b28a3116d2ef0e107519ac0a384188f1..6beb989f124848f4bc8281454ca11d7ca2e3a4d4 100644 --- a/library/ZendAfi/View/Helper/CkEditor.php +++ b/library/ZendAfi/View/Helper/CkEditor.php @@ -50,7 +50,7 @@ class ZendAfi_View_Helper_CkEditor extends ZendAfi_View_Helper_BaseHelper '/', ['HorizontalRule'], ['Link','Unlink','Anchor'], - ['Image','Flash','Table','Iframe','oembed','Slideshow'], + ['Image','Flash','Table','Iframe','oembed','Slideshow', 'SpecialChar'], ]; $config['extraAllowedContent'] = [ @@ -83,11 +83,13 @@ class ZendAfi_View_Helper_CkEditor extends ZendAfi_View_Helper_BaseHelper $config['toolbar'][]=['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField']; } - $config['toolbar']=array_merge($config['toolbar'],['/', - ['Styles','FontSize','TextColor','BGColor'], - ['Bold','Italic','Underline','Strike'], - ['NumberedList','BulletedList','-','Outdent','Indent'], - ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock']]); + $config['toolbar']=array_merge($config['toolbar'], + ['/', + ['Styles','FontSize','TextColor','BGColor'], + ['Bold','Italic','Underline','Strike'], + ['NumberedList','BulletedList','-','Outdent','Indent'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] + ]); $config['extraPlugins'] = 'colordialog'; diff --git a/tests/application/modules/admin/controllers/CmsControllerListModeTest.php b/tests/application/modules/admin/controllers/CmsControllerListModeTest.php index 64d466ab2e6232a901384109c34ca7dffaa65e3c..afd50b7662a219e0885604da5a50a070a69da469 100644 --- a/tests/application/modules/admin/controllers/CmsControllerListModeTest.php +++ b/tests/application/modules/admin/controllers/CmsControllerListModeTest.php @@ -370,7 +370,6 @@ class CmsControllerListModeAdminBibSearchTest extends CmsControllerListModeTestC } - /** @test */ public function newsFromPortailShouldNotBePresent() { $this->assertNotXPathContentContains('//td', 'News from portail', $this->_response->getBody()); @@ -431,4 +430,4 @@ class CmsControllerListModeEditPostTest extends CmsControllerListModeTestCase { $this->assertNotContains('id_cat', $this->getResponseLocation()); } -} \ No newline at end of file +} diff --git a/tests/application/modules/admin/controllers/IndexControllerTest.php b/tests/application/modules/admin/controllers/IndexControllerTest.php index 268b266a49bdb87de7e28cc3fb310f818ddfdc17..89140f340262310cf91dedf10e037f8c696309e7 100644 --- a/tests/application/modules/admin/controllers/IndexControllerTest.php +++ b/tests/application/modules/admin/controllers/IndexControllerTest.php @@ -255,16 +255,25 @@ class Admin_IndexControllerHeartBeatTest extends Admin_IndexControllerTestCase { class Admin_IndexControllerClearCacheActionTest extends Admin_IndexControllerTestCase { + protected $_cache_version; + public function setUp() { parent::setUp(); Storm_Cache::beVolatile(); + $this->_cache_version = Class_ScriptLoader::getInstance()->getCacheHash(); $this->dispatch('/admin/index/clearcache', true); } /** @test */ public function clearCacheShouldRedirectToAdminVar() { - $this->assertRedirectTo('/admin/index/adminvar'); + $this->assertRedirect(); + } + + + /** @test */ + public function cacheVersionShouldHaveChange() { + $this->assertNotEquals($this->_cache_version, Class_ScriptLoader::getInstance()->getCacheHash()); } } diff --git a/tests/application/modules/admin/controllers/UsersControllerTest.php b/tests/application/modules/admin/controllers/UsersControllerTest.php index 974b6f3236b68a186d62ffd0f338d18e4e1033e4..3588242e7d34d7190050ddd6c1bbb255e380a43b 100644 --- a/tests/application/modules/admin/controllers/UsersControllerTest.php +++ b/tests/application/modules/admin/controllers/UsersControllerTest.php @@ -1017,12 +1017,18 @@ class Admin_UsersControllerChangeAdminSkinActionTest extends Admin_AbstractContr public function setUp() { parent::setUp(); + $group_vodeclic = $this->fixture('Class_UserGroup', + ['id' => 20, + 'libelle' => 'Multimedia']) + ->addRight(Class_UserGroup::RIGHT_ACCES_VODECLIC); + $redac = $this->fixture('Class_Users', ['id' => 5, 'login' => 'rédacteur', 'password' => 'msmdp', 'id_site' => '5', 'role_level' => ZendAfi_Acl_AdminControllerRoles::MODO_BIB]); + $redac->setUserGroups([$group_vodeclic])->save(); ZendAfi_Auth::getInstance()->logUser($redac); diff --git a/tests/application/modules/opac/controllers/AbonneControllerSuggestionAchatTest.php b/tests/application/modules/opac/controllers/AbonneControllerSuggestionAchatTest.php index ab79d3e073aa38c59a893f786cc789f245adcda7..b5fde82c602abe6d5e9dd4b8068122a64bf7f235 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerSuggestionAchatTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerSuggestionAchatTest.php @@ -282,8 +282,8 @@ class AbonneControllerSuggestionAchatAddFormMultipleBibsAndKohaRestfulTest exten /** @test */ - public function formShouldContainsTextAreaForPatronReason() { - $this->assertXPath('//form//textarea[@name="PatronReason"]'); + public function formShouldContainsTextAreaForNote() { + $this->assertXPath('//form//textarea[@name="Note"]'); } @@ -355,7 +355,7 @@ class AbonneControllerSuggestionAchatAddFormMultipleBibsAndKohaRestfulPostTest e ['Title' => 'Harry Potter', 'Author' => 'J.K.Rowling', 'Isbn' => '2-07-0541 27_4', - 'PatronReason' => 'Je veux le lire', + 'Note' => 'Je veux le lire', 'PublicationYear' => '2014', 'BranchCode' => 'IST', 'DocType' => '1', @@ -376,7 +376,7 @@ class AbonneControllerSuggestionAchatAddFormMultipleBibsAndKohaRestfulPostTest e $this->assertEquals(['title' => 'Harry Potter [Livres]', 'author' => 'J.K.Rowling', 'isbn' => '2-07-0541 27_4', - 'patronreason' => 'Je veux le lire', + 'note' => 'Je veux le lire', 'publicationyear' => '2014', 'suggestedby' => 'azerty', 'branchcode' => 'IST'], @@ -395,7 +395,7 @@ class AbonneControllerSuggestionAchatAddFormMultipleBibsAndKohaRestfulPostWrongD ['Title' => '', 'Author' => '', 'Isbn' => '', - 'PatronReason' => '', + 'Note' => '', 'PublicationYear' => 'toto', 'submit' => 'Envoyer']); } @@ -885,7 +885,7 @@ class AbonneControllerSuggestionAchatWithOneRestfulSuggestionTest "firstnamemanagedby" : "", "rejectedby" : null, "quantity" : "0", - "note" : "D.L.", + "note" : "Je veux le lire", "patronreason" : "Je veux le lire", "categorydescriptionsuggestedby" : "", "volumedesc" : null, @@ -940,7 +940,7 @@ class AbonneControllerSuggestionAchatWithOneRestfulSuggestionTest /** @test */ - public function patronReasonShouldBePresent() { + public function noteShouldBePresent() { $this->assertXPathContentContains('//td', 'Je veux le lire'); } diff --git a/tests/library/Class/WebService/SIGB/KohaRestfulTest.php b/tests/library/Class/WebService/SIGB/KohaRestfulTest.php index 163fa0c12eb76b40acd7eaafaad1b054cf3fb5d8..2f21a8fb16e89729c8f914d74adf0d87f4428a91 100644 --- a/tests/library/Class/WebService/SIGB/KohaRestfulTest.php +++ b/tests/library/Class/WebService/SIGB/KohaRestfulTest.php @@ -243,7 +243,7 @@ abstract class KohaRestfulSuggestTestCase extends KohaRestfulTestCase { $this->mock_web_client ->whenCalled('postData') ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/rest.pl/suggestions', - ['data' => '{"suggestedby":"32007","title":"CommitStrip - Le Livre","author":"CommitStrip","isbn":"","patronreason":null,"publicationyear":"","branchcode":"IST"}']) + ['data' => '{"suggestedby":"32007","title":"CommitStrip - Le Livre","author":"CommitStrip","isbn":"","note":"","publicationyear":"","branchcode":"IST"}']) ->answers($this->_postAnswer()) ->beStrict();